123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863 |
- Namespace.register("U.MD.DK.RE");
- U.MD.DK.RE.attribute = function (fileordir, userid) {
- var _diskinfo = U.MD.DK.M.diskOperatingSwitch(userid),
- _attributeel = U.MD.DK.RE.attributeStyle(fileordir, true);
- U.UF.UI.confirm(_attributeel);
-
- }
- U.MD.DK.RE.attributeStyle = function (fileordir, issetpermissions) {
- var _ael,
- _aelo,
- _aelt,
- _aels,
- _aelf,
- _aelfo,
- _aelfos,
- _icon = U.MD.DK.C.getIcon(fileordir.UserDirectoryExtendType.toLowerCase())
- ;
- _ael = $$("div", { "className": "U_MD_DK_SX" });
- _aelo = $$("div", { "className": "U_MD_DK_SX" }, _ael);
- _aelt = $$("div", { "className": "U_MD_DK_SXCO" }, _aelo);
-
- if (U.UF.UP.isImg(fileordir.UserDirectoryExtendType)) {
- $$("img", {
- "onerror": function () {
- U.MD.C.imgError(1);
- },
- "src": U.MD.C.getHeadImage(fileordir.UserDirectoryUrl),
- "className": "U_MD_DK_RT_UDD_DV"
- }, _aelt);
- }
-
- else {
- $$("div", { "className": "U_MD_DK_L_DiskGE U_MD_DK_SXCOI", "style": { "cssText": _icon[1] } }, _aelt);
- }
- _aels = $$("div", { "className": "U_MD_DK_SXCT" }, _aelo);
- $$("div", { "className": "U_MD_DK_SXCTO", "style": { "marginTop": "4px" }, "innerHTML": "名称:" + fileordir.UserallDirectoryName }, _aels);
-
- if (fileordir.filetype) {
- $$("div", {
- "className": "U_MD_DK_SXCTT U_MD_D_YesText",
- "onselectstart": U.UF.EV.stopBubble, "spellcheck": "false",
- "innerHTML": "路径:" + "http://disk.1473.cn/" + fileordir["UserDirectoryID"]
- }, _aels);
- }
-
- else if (issetpermissions) {
- _aelf = $$("div", { "className": "U_MD_DK_SXCTO" }, _aels);
- $$("div", { "innerHTML": "权限选择: ", "className": "U_MD_DK_SXCTOQ" }, _aelf);
- _aelfo = $$("div", { "className": "U_MD_DK_SXCTOS" }, _aelf);
-
- _aelfos = $$("select", {
- "onchange": function () {
- U.MD.DK.RE.setpermissions(this, fileordir);
- }
- }, _aelfo);
- _aelfos.options.length = 3;
-
- _aelfos.options[0].text = "无限制";
-
- _aelfos.options[1].text = "只允许上传";
-
- _aelfos.options[2].text = "只允许下载";
-
- _aelfos.selectedIndex = parseInt(fileordir.UserDirectoryEncrypt)
- }
- $$("div", { "className": "U_MD_DK_SXCTO", "innerHTML": "类型:" + (fileordir.filetype ? "文件" : "文件夹") }, _aels);
- $$("div", { "className": "U_MD_DK_SXCTO", "innerHTML": "创建日期:" + U.UF.D.getYearMonthDay(fileordir.UserDirectoryAddTime) }, _aels);
- $$("div", { "className": "U_MD_DK_SXCTO", "innerHTML": "文件大小:" + U.UF.UP.minUnitToMaxUnit(fileordir.UserDirectorySize) }, _aels);
- return _ael;
- }
- U.MD.DK.RE.setpermissions = function (selectel, dirinfo) {
- var _value = selectel.selectedIndex;
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "SetFtpPriviledge", dirinfo.UserDirectoryID, _value], U.MD.DK.RE.asynSetPermissions, ["", dirinfo, _value]);
- U.alert("和服务器同步中...");
- }
- U.MD.DK.RE.asynSetPermissions = function (r) {
- var _context = r.context,
- _dirinfo = _context[1],
- _value = _context[2];
- r = r.value;
-
- if (r) {
- _dirinfo.UserDirectoryEncrypt = _value;
- }
-
- else {
- U.alert("设置失败");
- }
- }
- U.MD.DK.RE.addFileOrFolder = function (fileordirinfo, diskinfo, dirinfo) {
- var _nowdiskinfo = US.disk.UserDisk,
- _leftel = $("#L" + dirinfo["UserDirectoryID"], diskinfo.formel)[0],
- _el = $("#U_MD_DK_RZ", diskinfo.formel)[0];
-
- U.MD.DK.M.entity.add(fileordirinfo, diskinfo);
- U.MD.DK.M.entity.addChild(fileordirinfo, dirinfo);
-
- if (fileordirinfo[0].UserDirectoryParentID == _nowdiskinfo.directoryid && diskinfo == _nowdiskinfo && _nowdiskinfo.directoryid == diskinfo.directoryid) {
-
- if ($(_el).Child()[0].className == "U_MD_DK_RZF") {
- _el.innerText = "";
- }
- U.MD.DK.VW.printContent(fileordirinfo, _el);
-
- if (_leftel) {
- U.MD.DK.LL.printLeftTreeDirectory(fileordirinfo, _leftel, diskinfo.userInfo.UserId);
- }
- }
- }
- U.MD.DK.RE.newFolder = function (diskinfo) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- U.MD.DK.RE.newFolder.confirm(diskinfo, _directoryid);
- }
- else { U.alert("无权限访问此文件夹"); };
- }
- }
- U.MD.DK.RE.newFolder.confirm = function (diskinfo, directoryid) {
- var _ancestors,
- _groupid,
- _newguid = Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入文件夹名字", "style": { "width": "180px", "height": "25px" } })
-
- U.MD.DK.RE.newconfirm(
- _input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.AUTH, ["CreateDirectory", _userid, _newguid, _dirinfo.UserDirectoryDeep + 1, _input.value, directoryid, "", _groupid, ""],
- function (r) {
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "folder", "", U.UF.D.toTimeStamp(), "", _dirinfo.UserDirectoryDeep + 1,
- null, "", 0, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
- }, []);
- }
- else {
- U.alert("文件名过长或者为空");
- return false;
- }
- },
- function () { },
- "新建文件夹"
- );
- }
- U.MD.DK.RE.newText = function (diskinfo, fun) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- U.MD.DK.RE.newText.confirm(diskinfo, _directoryid, fun);
- }
- else { U.alert("无权限访问此文件"); };
- }
- }
- U.MD.DK.RE.newText.confirm = function (diskinfo, directoryid, fun) {
- var _ancestors,
- _groupid,
- _newguid = Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入新文本文档的命名", "style": { "width": "180px", "height": "25px", "padding-left": "7px" } });
-
- U.MD.DK.RE.newconfirm(_input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.AUTH, ["CreateFile", _userid, _newguid, directoryid, _input.value, "", "", "", "txt", _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "txt", "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
-
- if (fun) {
- fun(_fileinfo);
- }
- }, []);
- }
- else {
- U.alert("文件名过长或者为空");
- return false;
- }
- },
- function () { }, "新建文本文件");
- }
- U.MD.DK.RE.newDocument = function (diskinfo, fun, fileid) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- return U.MD.DK.RE.newDocument.confirm(diskinfo, _directoryid, fun, fileid);
- }
- else { U.alert("无权限访问此文档"); };
- }
- }
- U.MD.DK.RE.newDocument.confirm = function (diskinfo, directoryid, fun, fileid) {
- var _ancestors,
- _groupid,
- _newguid = fileid || Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入文档名字", "style": { "width": "180px", "height": "25px" } });
- return U.MD.DK.RE.newconfirm(_input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[0].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[0].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.AUTH, ["CreateFile", _userid, _newguid, directoryid, _input.value, "", "", "", "uw", _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "uw", "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
-
- if (fun) {
- fun(_fileinfo);
- }
- }, []);
- }
- else {
- U.alert("文件名过长或者为空");
- return false;
- }
- }, function () { }, "新建文档");
- }
- U.MD.DK.RE.newExcel = function (diskinfo) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- U.MD.DK.RE.newExcel.confirm(diskinfo, _directoryid);
- }
- else { U.alert("无权限访问此工作表"); };
- }
- }
- U.MD.DK.RE.newExcel.confirm = function (diskinfo, directoryid) {
- var _ancestors,
- _groupid,
- _newguid = Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入表格名字", "style": { "width": "180px", "height": "25px" } });
- U.MD.DK.RE.newconfirm(_input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.AUTH, ["CreateFile", _userid, _newguid, directoryid, _input.value, "", "", "", "ue", _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "ue", "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
- }, []);
- }
- else {
- U.alert("文件名过长或者为空");
- return false;
- }
- }, function () { }, "新建工作表");
- }
- U.MD.DK.RE.newconfirm = function (content, determineFun, cancelFun, str) {
-
- var _confirm = $$("div", { "style": { "cssText": "width: 100%; background: rgb(255,255,255); overflow:hidden; " }, id: "123133456" });
- var _string = str || "提示框";
-
- var _content = $$("div", { "style": { "cssText": "text-align: center; margin: 30px 20px 30px 20px; " } }, _confirm);
-
- if (U.UF.C.isElement(content)) {
-
- $(_content).append(content);
- } else {
-
- _content.innerHTML = content || '内容';
- }
-
- var _footer = $$("div", { "style": { "cssText": " height:45px;" } }, _confirm);
-
- var _form = new U.UF.UI.form(
- _string,
- _confirm,
- {
- "style": {
- "cssText": "font-size: 16px; background: rgb(255,255,255); width: 300px; position: fixed; box-shadow: 0 0 10px 3px rgb(0,0,0); border-radius: 5px;"
- }
- },
- {
- "istop": true,
- "isenlarge": false,
- "isstretching": false,
- "isnarrow": false
- },
- {
- "style": {
- "cssText": " background: rgb(59,88,120); padding: 10px;padding-left: 20px; color: rgb(255,255,255); "
- }
- });
-
- $$("div", {
- "style": {
- "cssText": "text-align: center; color: rgb(255,255,255); width: 30%; padding: 5px; background: rgb(48,126,208); border-radius: 5px;float: right; margin-right:35px;"
- },
- innerHTML: "确定",
- onclick: function () {
- var _bool = true;
- if (U.UF.C.isFunction(determineFun)) {
- _bool = determineFun();
- }
- if (_bool !== false) {
- U.UF.F.closeWindow(_form.form);
- }
- }
- }, _footer);
-
- $$("div", {
- "style": {
- "cssText": "text-align: center; color: rgb(255,255,255); width: 30%; padding: 5px; background: rgb(48,126,208); border-radius: 5px;background: rgb(170,170,170); float: left; margin-left:35px;"
- },
- "innerHTML": "取消",
- "onclick": function () {
- U.UF.C.isFunction(cancelFun) && cancelFun();
- U.UF.F.closeWindow(_form.form);
- }
- }, _footer);
- return _form;
- }
- U.MD.DK.RE.newDocConfirm = function (diskinfo/*determineFun cancelFun*/) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- var _confirm = $$('div'),
- _pickarea = $$("div", { "style": { "cssText": "display:table; width: 100%; height: auto; " } }, _confirm),
- _picklocal = $$("div", { "id": "U_MD_DK_RE_localDoc", "style": { "cssText": "display:table-cell; width:235px; height:170px; background-color:#f5f5f5;text-align:center; vertical-align: middle;cursor: pointer;" } }, _pickarea),
- _pickline = $$("div", { "style": { "cssText": "display:table-cell; width:1px; height: 100%; background-color:#cecece;" } }, _pickarea),
- _pickoa = $$("div", { "style": { "cssText": "display:table-cell; width:234px; height:100%; background-color:#f5f5f5;text-align:center; vertical-align: middle;cursor: pointer;" } }, _pickarea);
- $$("img", { src: "/img/officefileicon.png", style: { "vertical-align": "middle" } }, _picklocal);
- $$("img", { src: "/img/oaofficeicon.png", style: { "vertical-align": "middle" } }, _pickoa);
- $$('span', { innerText: '互联文档', style: { "margin-left": "10px" } }, _pickoa);
- $$('span', { innerText: '本地文档', style: { "margin-left": "10px" } }, _picklocal);
-
- var _enter = $$("div", { "style": { "cssText": "width: 100%; background: rgb(255,255,255); overflow:hidden; display:none" }, id: "123133456" }, _confirm);
- var _string = "新建文档";
-
- var _content = $$("div", { "style": { "cssText": "text-align: center; margin: 30px 20px 30px 20px;" } }, _enter)
-
- var _footer = $$("div", { "style": { "cssText": " height:45px;" } }, _enter);
-
- var _form = new U.UF.UI.form(
- _string,
- _confirm,
- {
- "style": {
- "cssText": "font-size: 16px; background: rgb(255,255,255); width: 470px; position: fixed; box-shadow: rgb(0, 0, 0) 2px 1px 5px; "
- }
- },
- {
- "istop": true,
- "isenlarge": false,
- "isstretching": false,
- "isnarrow": false
- },
- {
- "style": {
- "cssText": " background: #3c475b;padding:4px 0 ; color: rgb(255,255,255); "
- }
- });
- $(_picklocal).bind({
- "mouseover": function () { _picklocal.style.backgroundColor = "#dcdcdc"; }, "mouseout": function () { _picklocal.style.backgroundColor = "#f5f5f5"; }, "click": function () {
- U.MD.DK.RE.newDocument(diskinfo);
- U.UF.F.closeWindow(_form.form, "remove");
- }
- })
- $(_pickoa).bind({
- "mouseover": function () { _pickoa.style.backgroundColor = "#dcdcdc"; }, "mouseout": function () { _pickoa.style.backgroundColor = "#f5f5f5"; }, "click": function () {
-
- var _docId = Guid.newGuid();
- U.MD.O.word(US.userInfo, { 'UserDirectoryID': _docId }, function () {
- var _iframe = $('#UD_Word' + _docId).find('iframe')[0].contentWindow;
- _iframe.document.getElementById('U_MD_O_H_body_left_invite_user').children[0].click();
- U.UF.F.closeWindow(_form.form, "remove");
- });
- }
- })
- return _form;
- }
- else { U.alert("无权限访问此工作表"); };
- }
- }
- U.MD.DK.RE.deleteFileOrDir = function (fileordirs, userid) {
- var _contentel;
-
- if (fileordirs.length > 1) {
- _contentel = $$("div", { "style": { "cssText": "float:left;text-align:center;width:100%;padding:5% 0 5% 0;" } });
- $$("span", { "style": { "cssText": "font-weight:bold;" }, "innerHTML": "你确定要删除这" + fileordirs.length + "项吗?" }, _contentel);
- }
-
- else {
- _contentel = U.MD.DK.RE.attributeStyle(fileordirs, null);
- fileordirs = [fileordirs];
- }
-
- U.UF.UI.confirm(_contentel, function () {
- U.MD.DK.RE.deleteDirectoryOrFile(fileordirs, userid);
- });
- $(".U_MD_DK_SX")[$(".U_MD_DK_SX").length - 2].parentNode.style.margin = "0";
- }
- U.MD.DK.RE.deleteDirectoryOrFile = function (fileordirs, userid) {
- var _allfileordirid = U.Json.toKeyArray(fileordirs, "UserDirectoryID").join(",");
- U.A.Request(US.AUTH, ["DeleteDirectoryOrFile", _allfileordirid, fileordirs[0].GroupID || ""], U.MD.DK.RE.asynDeleteDirectoryOrFile, ["", fileordirs, userid]);
- }
- U.MD.DK.RE.asynDeleteDirectoryOrFile = function (r) {
- var i,
- _dirid,
- _context = r.context,
- _fileordirs = _context[1],
- _userid = _context[2],
- _diskinfo = U.MD.DK.M.diskOperatingSwitch(_userid)
- ;
- r = r.value;
-
- if (r) {
- U.MD.DK.M.entity.del(_fileordirs, _diskinfo);
- U.MD.DK.RE.delPageFileOrDir(_fileordirs, _diskinfo);
- }
- else {
- U.alert("操作失败!");
- }
- }
- U.MD.DK.RE.delPageFileOrDir = function (fileordirs, diskinfo) {
- var i,
- _parentdirinfo,
- _contentel = $("#U_MD_DK_RZ", diskinfo.formel);
-
- for (i = 0; i < fileordirs.length; i++) {
- $("#L" + fileordirs[i].UserDirectoryID, diskinfo.formel).remove();
- $("#R" + fileordirs[i].UserDirectoryID, diskinfo.formel).remove();
-
- if (fileordirs[i].UserDirectoryID == diskinfo.directoryid) {
- _parentdirinfo = fileordirs[i].Parent;
- }
- }
-
- if (_parentdirinfo) {
-
- U.MD.DK.LE.openFileDirectory(_parentdirinfo, diskinfo.userInfo.UserId);
- }
-
- else if (_contentel.Child() == 0) {
- U.MD.DK.VW.printNullView(_contentel[0]);
- }
- }
- U.MD.DK.RE.rename = function (el, fileordir, diskinfo) {
- var _el;
- if (el.firstChild.children[1]) {
- _el = el.firstChild.children[1].children[0];
- _el.innerText = ""
- } else {
- _el = el.lastElementChild;
- _el.innerText = ""
- }
- $$("input", {
- "ondblclick": U.UF.EV.stopBubble,
- "onblur": function () {
- U.MD.DK.RE.detemineReName(this, fileordir, diskinfo);
- },
-
- "onkeyup": function () {
- if (event.keyCode == 13 || event.keyCode == 10) {
- this.onblur();
- }
- },
- "onclick": U.UF.EV.stopBubble,
- "className": "U_MD_U_P_C_P_N_I",
- "value": fileordir.UserallDirectoryName.replace("." + fileordir.UserDirectoryExtendType, "")
- }, _el);
- $(".U_MD_U_P_C_P_N_I")[$(".U_MD_U_P_C_P_N_I").length - 1].focus();
- }
- U.MD.DK.RE.detemineReName = function (inputel, fileordir, diskinfo) {
- var _leftel,
- _rightel,
- _extendtype = fileordir.UserDirectoryExtendType,
- _name = inputel.value.replaceHtmlSign() + (fileordir.filetype ? "." + _extendtype : "");
-
- if (_name != fileordir.UserallDirectoryName) {
-
- if (U.UF.S.FileName.test(_name)) {
-
- if (_extendtype == "folder") {
- U.A.Request(US.AUTH, ["UpdateDirectoryInfo", fileordir.UserDirectoryID, _name], U.MD.DK.RE.asynDetemineReName, ["", fileordir, _name, diskinfo]);
- }
-
- else {
- U.A.Request(US.AUTH, ["UpdateFileInfo", fileordir.UserDirectoryID, _name], U.MD.DK.RE.asynDetemineReName, ["", fileordir, _name, diskinfo]);
- }
- _leftel = $("#L" + fileordir.UserDirectoryID, diskinfo.formel)[0];
- _rightel = $("#R" + fileordir.UserDirectoryID, diskinfo.formel)[0];
-
- if (_leftel) {
- $("div", _leftel)[3].innerText = _name;
- }
-
- if (_rightel) {
- $("div", _rightel)[3].innerText = _name;
- }
- }
- }
-
-
-
-
- }
- U.MD.DK.RE.asynDetemineReName = function (r) {
- var _context = r.context,
- _fileordir = _context[1],
- _name = _context[2]
- ;
- r = r.value;
-
- if (r) {
- _fileordir.UserallDirectoryName = _name;
- _fileordir.UserDirectoryName = _name.addEllipsis(20);
- }
- }
- U.MD.DK.RE.copyorshear = function (dirorfile, type, diskinfo) {
- var _userid = US.disk.UserDisk.userInfo.UserId,
- _dirid = dirorfile.UserDirectoryParentID
- ;
-
- US.disk.Disks[_userid].pasteDirOrFile = {
- "type": type,
- "UserDirectoryID": _dirid,
- "dirorfile": dirorfile,
- "userid": _userid
- };
- }
- U.MD.DK.RE.paste = function (diskinfo) {
- var _ancestors,
- _groupid,
- _fileordirids,
- _dirid = diskinfo.directoryid,
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": _dirid }, 1)[0],
- _userid = US.disk.UserDisk.userInfo.UserId,
- _pastecontent = US.disk.Disks[_userid].pasteDirOrFile,
- _type = _pastecontent.type,
- _pastedirid = _pastecontent.UserDirectoryID,
- _dirorfile = _pastecontent.dirorfile,
- _pasteuserid = _pastecontent.userid
- ;
-
- if (_pastecontent && (_type == "copy" || _dirid != _pastedirid || _pasteuserid != _userid)) {
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
- _fileordirids = U.Json.toKeyArray([_pastecontent.dirorfile], "UserDirectoryID").join(",");
-
-
- if (_type == "shear") {
-
- U.A.Request(US.AUTH, ["CutAndPasteFiles", US.userInfo.userid, _dirid, _fileordirids, _groupid, _pastecontent.dirorfile.GroupID], U.MD.DK.RE.asynPaste, ["", _dirinfo, _groupid, _pastecontent, diskinfo]);
- _pastecontent.type = "copy";
- }
-
- else {
-
- U.A.Request(US.AUTH, ["CopyAndPasteFiles", US.userInfo.userid, _dirid, _fileordirids, _groupid], U.MD.DK.RE.asynPaste, ["", _dirinfo, _groupid, _pastecontent, diskinfo]);
- }
- }
- }
- U.MD.DK.RE.asynPaste = function (r) {
- var i,
- _context = r.context,
- _dirinfo = _context[1],
- _groupid = _context[2],
- _pastecontent = _context[3],
- _diskinfo = _context[4],
- _copyorshearinfo = US.disk.Disks[_pastecontent.userid],
- _pasteinfo = r.value
- ;
-
- if (_pastecontent.type == "shear") {
- U.MD.DK.M.entity.del(_pastecontent.dirorfile, _copyorshearinfo);
- U.MD.DK.RE.delPageFileOrDir(_pastecontent.dirorfile, _copyorshearinfo);
- }
-
- for (i = 0; i < _pasteinfo.length; i++) {
- _pasteinfo[i] = new U.MD.DK.M.entity(_pasteinfo[i].UserDirectoryID, _pasteinfo[i].UserDirectorySize, _pasteinfo[i].UserDirectoryParentID, _pasteinfo[i].UserDirectoryName, _pasteinfo[i].UserDirectoryName, _pasteinfo[i].UserDirectoryExtendType, _pasteinfo[i].UserDirectoryUrl, _pasteinfo[i].UserDirectoryAddTime, _pasteinfo[i].UserDirectoryUrl, "9999", null, _pasteinfo[i].UserDirectoryEncrypt, 1, "", _pasteinfo[i].UserDirectoryEncrypt, "", US.userInfo.userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- }
-
- U.MD.DK.RE.addFileOrFolder(_pasteinfo, _diskinfo, _dirinfo);
- }
- U.MD.DK.RE.downloadFile = function (dirorfileid, isdir) {
- window.open("/Pages/Downlaod.htm?id=" + dirorfileid + "&type=" + (isdir || ""));
- }
- U.MD.DK.RE.replay = function (fileinfo) {
-
-
- }
- U.MD.DK.RE.refresh = function (userid, fileinfo, diskinfo) {
- U.MD.DK.LE.getChildsByDirectoryId(userid, fileinfo, $("#U_MD_DK_RZ", diskinfo.formel)[0])
- }
|