123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753 |
- Namespace.register("U.Dk.RE");
- U.Dk.RE.CE = [];
- U.Dk.RE.TF = "";
- U.Dk.RE.TSXXML = function () {
- var i, _dirid, _fileinfo, _UKE, _UCE,
- _UTF = 1,
- _userid = US.userInfo.userid,
- _diskinfo = US.Disk.UserDisk;
- if (_diskinfo[1][2] == _userid || _diskinfo[2]) {
- if (_diskinfo[2] || ((_fileinfo = _$(_diskinfo[0]).RecurD(null, { "UserDirectoryID": _diskinfo[1][1] }, "UserDirectoryParentID"), _UCE = _fileinfo[_fileinfo.length - 1], _dirid = _UCE.UserDirectoryID) && _UCE.GroupID || _dirid == US.FG)) {
- _dirid = _diskinfo[1][1];
- _UKE = _$(U.Dk.HP.MLWJSY[_fileinfo[0]], _diskinfo[0][0]).groupBy("UserId");
- _UCE = [];
- for (i in _UKE) {
- (_UKE.hasOwnProperty(i) && i != _userid) && (_UCE.push({ UserId: i, UserThumbnailImageHead: _UKE[i][0].UserThumbnailImageHead }));
- };
- if (_UCE.length) {
- U.F.W.ViewFriend({
- GroupManageID: _dirid,
- GroupManageName: _fileinfo[0].UserDirectoryName + "(" + _UCE.length + ")人",
- GroupManageDescript: "推送消息让所有人都能收到你的通知",
- "UserId": _UCE.pluck("UserId").join(",")
- });
- return ""
- }
- _UTF = 0;
- }
- else { _UTF = 2; }
- }
- (_UTF != null) && (U.Alert["无参与消息的用户", "只能在本人共享内推送消息", "本人目录无法推送消息"][_UTF]);
- }
- U.Dk.RE.QXWJPD = function (userid, UTF, UDID) {
- var _UUID = US.userInfo.userid,
- _diskinfo = U.Dk.DiskOperatingSwitch(userid),
- _UEM = U.Dk.HP.WPCZQXHQ(UDID),
- _UCE = _UEM[2][0],
- _UPID = _UCE[_UCE.length - 1].UserDirectoryID;
- return (_UEM[0] && (UTF == "folder" || (_UPID == US.FG || _UPID == US.DG || _UCE[_UCE.length - 1].GroupID)));
- }
- U.Dk.RE.WPXJWJ = function (UTF, UDOD, userid) {
- if (!U.U.L.isLogin(3)) {
- if (U.Dk.RE.QXWJPD(userid, UTF)) {
- U.Dk.RE.CMB(UTF, null, UDOD || US.Disk.UserDisk.pdiv, userid);
- }
- else { U.Alert("无权限访问此文件夹"); };
- }
- }
- U.Dk.RE.CMB = function (UTP, UAF, UDOD, userid, UTF) {
- var _UDTD, _UDSD, _dirid,
- _UFL = false,
- _UTF = "txt,uw,ue,folder";
- if (_UTF.indexOf(UTP) > -1) {
- _UDTD = $$("div", { "className": "UDL U_UI_dlnoSR" }); _UFL = true;
- _UDSD = $$("div", {}, _UDTD); _dirid = $$("input", { "type": "text", "style": { "cssText": "width: 248px; height: 20px; line-height:20px; border:0; outline:none; background:none;" } }, _UDSD);
- U.Dk.RE.Prompt(UTP == "folder" ? "新建文件夹" : "新建" + UTP + "文件", 140, 350, _UDTD, U.M.apply(_UDTD, [[U.Dk.RE.AF, [UTP, _dirid, UAF, userid, UTF]]]), UDOD);
- }
- return _UFL;
- }
- U.Dk.RE.AF = function (UTF, UFN, UAF, userid, UFT) {
- var i, _fileinfo, _USID, _UOID, _UGID,
- _USC = 9999,
- _ULX = 1,
- _diskinfo = U.Dk.DiskOperatingSwitch(userid) || US.Disk.UserDisk,
- _UPID = _diskinfo[1][1] || US.DG,
- _UTM = U.Dk.HP.WPCZQXHQ(_UPID);
- (typeof UFN != "string") && (UFN = UFN.value || UFN.innerText || "");
- if (_UTM[0] && _UPID && U.Dk.RE.MBC(_UPID, UFN, UTF, "Create") && U.Dk.RE.QXWJPD(userid, UTF)) {
- _fileinfo = [];
- while (_diskinfo[4][_USID || _UPID]) {
- _fileinfo.push(_diskinfo[4][_USID || _UPID]);
- _USID = _diskinfo[4][_USID || _UPID]["UserDirectoryParentID"]
- }
- _UGID = U.Dk.RE.WPHQID(_fileinfo, _diskinfo); ("folderencrypt".indexOf(UTF) > -1) && (_USC = _fileinfo[0].UserDirectoryDeep, _ULX = 0, _diskinfo[1][0].FilesCount += 1); _UOID = _fileinfo[_fileinfo.length - 1].UserDirectoryID;
- _fileinfo = U.Dk.M.RUS(new U.Dk.M.Entity(Guid.newGuid(), 0, _UPID, UFN.addEllipsis(20), UFN, UTF, null, U.MT.toTimeStamp(new Date()), "", _USC, null, _UOID == US.SG ? "true" : "", _ULX, "", (_UOID == US.FG ? userid : (_UGID || "")), null, userid));
- if (_fileinfo.filetype == "1") {
- U.A.Request(US.Auth, ["CreateFile", US.userInfo.userid, _fileinfo["UserDirectoryID"], _fileinfo["UserDirectoryParentID"], UFN.escapeQuotes() + (UTF == "txt" ? ".txt" : ""), UTF, _fileinfo["UserFilesServerName"] || "", _UGID, _fileinfo.filetype == "1" ? (_fileinfo["UserDirectoryEncrypt"] || _UGID) : _fileinfo["UserDirectoryEncrypt"]]), U.Dk.RE.AsynAF, ["", _fileinfo, UAF, _diskinfo, U.D.SY.ET["Disk"]["SY"]["DJ"], userid, UTF, UFT];
- }
- else {
- U.A.Request(US.Auth, ["CreateDirectory", US.userInfo.userid, _fileinfo["UserDirectoryID"], _fileinfo["UserDirectoryParentID"], _USC, UFN.escapeQuotes(), _UGID, _fileinfo.filetype == "1" ? (_fileinfo["UserDirectoryEncrypt"] || _UGID) : _fileinfo["UserDirectoryEncrypt"]]), U.Dk.RE.AsynAF, ["", _fileinfo, UAF, _diskinfo, U.D.SY.ET["Disk"]["SY"]["DJ"], userid, UTF, UFT];
- }
- return _fileinfo;
- }
- else { U.Alert("拒绝访问"); } return false;
- }
- U.Dk.RE.AsynAF = function (r) {
- var context = r.context,
- _fileinfo = context[1],
- _cb = context[2],
- _diskinfo = context[3],
- _UDOD = context[4],
- _userid = context[5],
- _UTP = context[6],
- _UTF = context[7],
- _diskinfo = U.Dk.DiskOperatingSwitch(_userid),
- _dirid = _diskinfo[1][1];
- r = r.value;
- if (r != null) {
- (_diskinfo[2] || _diskinfo[1][2] != US.userInfo.userid) && (U.Ut.AddObj(_fileinfo, { "UserId": US.userInfo.userid, "UserNickName": US.userInfo.UserNickName, "UserName": US.userInfo.username, "UserThumbnailImageHead": US.userInfo.UserThumbnailImageHead, "Parent": _diskinfo[4][_fileinfo.UserDirectoryParentID] }));
- var _diskinfo = U.Dk.DiskOperatingSwitch(_userid);
-
- U.Dk.M.Entity.Add([_fileinfo], _diskinfo);
- if (_dirid == _fileinfo.UserDirectoryParentID) {
- U.Dk.RE.AsynWPXJWJ(_UDOD, _userid, _fileinfo);
- }
- else if (!_dirid) {
- var _UDAD = $(_diskinfo[2] ? "#UD_SYWOC" : "#UD_SYWLTXO", _diskinfo.pdiv).childg(0)[_diskinfo[2] ? 1 : 3];
- _UDAD = $(_UDAD).Child()[0].onclick();
- }
- if (_cb) {
- _cb(context, r, _diskinfo[1][1] == _fileinfo);
- }
- else if (!_UTF && "txt,uw,ue".indexOf(_UTP) > -1) {
- U.Dk.LE.OpenFileDirectory(_fileinfo);
- }
- else if (U.Ut.isFunction(_UTF)) { (_UTF)(); }
- }
- }
- U.Dk.RE.AsynWPXJWJ = function (UDOD, userid, UDE) {
- var _UDAD, _UDTD, _UDSD,
- _diskinfo = U.Dk.DiskOperatingSwitch(userid);
- if (!UDE["filetype"] && UDOD && $(UDOD).Parent().id.indexOf(UDE.UserDirectoryParentID) == 1) {
- _UDTD = $($(UDOD).Parent()).Child()[1];
- (_UDTD) && (U.Dk.LL.XWPDH([UDE], _UDTD, null, null, userid));
- }
- if (UDE["UserDirectoryParentID"] == _diskinfo[1][1] || !_diskinfo[1][1]) {
- _UDSD = $("#" + (_diskinfo[2] ? (U.Dk.LTWPDH(_diskinfo[2], _diskinfo), "UD_SYWOCRC") : (U.Dk.CSHYHWP(_diskinfo), "UD_SYWRZ")), _diskinfo.pdiv)[0];
- (_$(_diskinfo[0]).Select({ "UserDirectoryParentID": _diskinfo[1][1] }).length == 1) && (_UDSD.innerText = "");
- U.Dk.VW.XWPDY([UDE], _UDSD, _UDTD ? [(_UDAD = $(_UDTD).Child())[_UDAD.length - 1]] : null);
- }
- }
- U.Dk.RE.WPSCWJ = function (UDE, userid) {
- var _diskinfo = U.Dk.DiskOperatingSwitch(userid);
- U.Dk.RE.DMB(UDE, null, $("#UD_SYW" + (_diskinfo[2] ? "O" : ""), _diskinfo.pdiv)[0], userid);
- }
- U.Dk.RE.DMB = function (UDE, UAF, UDPD, userid) {
- userid = userid || (UDE.UserId || UDE.GroupID) || (UDE[0] && (UDE[0].UserId || UDE[0].GroupID)) || US.userInfo.userid;
- var i, _UH, _UDOD,
- _userid = US.userInfo.userid;
- UDE = UDE.length ? UDE : [UDE];
- if (U.Dk.HP.WPCZQXHQ()[4] || (UDE = _$(UDE).Select({ "UserId": _userid })).length) {
- if (UDE.length > 1) {
- _UDOD = $$("div", { "style": { "cssText": "float:left;text-align:center;width:100%;padding:5% 0 5% 0;" } });
- $$("span", { "style": { "cssText": "font-weight:bold;" }, "innerHTML": "你确定要删除这" + UDE.length + "项吗?" }, _UDOD);
- }
- else {
- _UDOD = U.Dk.RE.ABYS(null, UDE[0]);
- }
- U.Dk.RE.Prompt("删除文件", _UH, 350, _UDOD, U.M.apply(this, [[U.Dk.RE.DF, [UDE, UAF, userid]]]), UDPD);
- }
- else { U.Alert("拒绝访问"); }
- }
- U.Dk.RE.DF = function (UDE, UCB, userid) {
- UDE = UDE.length == null ? [UDE] : UDE;
- var i,
- _userid = US.userInfo.userid,
- _UAID = _$(UDE).pluck("UserDirectoryID").join(",");
- U.A.Request(US.Auth, ["DeleteDirectoryOrFile", _UAID, UDE[0].GroupID || ""]), U.Dk.RE.AsynDF, ["", UDE, UCB, userid];
- }
- U.Dk.RE.AsynDF = function (r) {
- var i, _dirid, _USE,
- context = r.context,
- _fileinfo = context[1],
- _UCB = context[2],
- _userid = context[3],
- _diskinfo = U.Dk.DiskOperatingSwitch(_userid);
- r = r.value;
- if (r) {
- _USE = U.Dk.RE.DFWJJ(_fileinfo, _userid);
- _diskinfo[1][0].FileSize -= _USE[0];
- _diskinfo[1][0].FilesCount -= _USE[1];
- U.Dk.RE.AsynWPSCWJ(_fileinfo, _userid);
- }
- else {
- U.Alert("操作失败!");
- }
- }
- U.Dk.RE.DFWJJ = function (UDE, userid) {
- var i, j, _UKE,
- _UCE = [0, 0],
- _diskinfo = U.Dk.DiskOperatingSwitch(userid);
- for (i = 0; i < UDE.length; i++) {
- for (j = 0; j < _diskinfo[0].length; j++) {
- if (_diskinfo[0][j].UserDirectoryID == UDE[i].UserDirectoryID || (UDE[i].tf && UDE[i].UserDirectoryParentID == _diskinfo[0][j].UserDirectoryParentID)) {
- _UKE = _diskinfo[0][j];
- (!_UKE.filetype) && (UDE.push({ "UserDirectoryParentID": _UKE.UserDirectoryID, "tf": true }));
- _UCE[0] += _UKE.UserDirectorySize;
- _diskinfo[0].splice(j, 1);
- (!UDE[i].tf) && (_$(_diskinfo[4][_UKE.UserDirectoryParentID].Child).Delete({ UserDirectoryID: _UKE.UserDirectoryID }));
- _UCE[1]++; j--;
- }
- }
- }
- return _UCE;
- }
- U.Dk.RE.AsynWPSCWJ = function (UDE, userid) {
- var i, j, _UDPD,
- _UCE = ["L", "R"],
- _diskinfo = U.Dk.DiskOperatingSwitch(userid);
- for (i = 0; i < UDE.length; i++) {
- if (UDE[i].UserDirectoryID) {
- for (j = 0; j < _UCE.length; j++) {
- ($("#" + _UCE[j] + UDE[i]["UserDirectoryID"])).remove();
- }
- }
- }
- _diskinfo[2] ? (_UDPD = "UD_SYWOCRC", U.Dk.LTWPDH(_diskinfo[2], _diskinfo)) : (_UDPD = "UD_SYWRZ", U.Dk.CSHYHWP(_diskinfo));
- (!(_UDPD = $("#" + _UDPD, _diskinfo.pdiv)).Child()[0]) && (U.Dk.VW.XWPDYXK(_UDPD[0]));
- }
- U.Dk.RE.WPCMM = function (UDOD, UDE) {
- var _dirid, _userid = US.userInfo.userid;
- if (U.Dk.HP.WPCZQXHQ(null, null, UDE)[4]) {
- UDOD.innerText = "";
- (_dirid = $$("input", { "ondblclick": U.M.StopBubble, "onblur": [[U.Dk.RE.TWPCMM, ["this", UDE, UDE.UserId || _userid]]], "onclick": U.M.StopBubble, "className": "UD_SYSXZTST", "value": UDE["UserallDirectoryName"].replace("." + UDE["UserDirectoryExtendType"], "") }, UDOD)).select();
- _dirid.onkeyup = U.M.apply(_dirid, [[U.M.returnkeylogin, [_dirid, [[_dirid.onblur]]]]]);
- }
- else {
- U.Alert("拒绝访问");
- }
- }
- U.Dk.RE.TWPCMM = function (UDOD, UDE, userid) {
- var _UDPD = $(UDOD).Parent(),
- _UTF = U.Dk.RE.MFN(UDE, UDOD.value, null, userid);
- if (_UTF || _UTF == "none") {
- _UDPD.innerText = UDE.UserallDirectoryName;
- _UDPD = $("#L" + UDE["UserDirectoryID"], _diskinfo.pdiv)[0];
- (_UDPD) && ($("div", _UDPD)[3].innerText = UDE.UserallDirectoryName);
- }
- }
- U.Dk.RE.MFN = function (UDE, UST, UCB, userid) {
- userid = userid || US.userInfo.userid;
- var _UEN = UDE.UserDirectoryExtendType,
- _diskinfo = U.Dk.DiskOperatingSwitch(userid),
- _USN = UST.replaceHtmlSign();
- UST = UST.replaceHtmlSign() + (UDE.filetype ? "." + _UEN : "");
- (_UEN == "folderencrypt") && (_UEN = "folder");
- if (UST == UDE.UserallDirectoryName) { _UTF = "none"; }
- else if (U.Dk.RE.MBC((_diskinfo && _diskinfo[1] && _diskinfo[1][1] ? _diskinfo[1][1] : UDE.UserDirectoryParentID), UST, _UEN, "Change")) {
- _UTF = true;
- if (_UEN == "folder") {
- U.A.Request(US.Auth, ["UpdateDirectoryInfo", UDE.UserDirectoryID, UST], U.Dk.RE.AsynMRN, ["", UDE, UST, UCB, userid]);
- }
- else {
- U.A.Request(US.Auth, ["UpdateFileInfo", UDE.UserDirectoryID, UST], U.Dk.RE.AsynMRN, ["", UDE, UST, UCB, userid]);
- }
- }
- (_UTF) && (U.Ut.AddObj(UDE, { "UserallDirectoryName": UST, "UserDirectoryName": UST.addEllipsis(20) })); return _UTF;
- }
- U.Dk.RE.AsynMRN = function (r) {
- var context = r.context,
- _fileinfo = context[1],
- _UST = context[2], _UCB = context[3],
- _userid = context[4],
- _diskinfo = U.Dk.DiskOperatingSwitch(_userid);
- r = r.value;
- if (r) {
- (_UST) && (U.Ut.AddObj(_fileinfo, { "UserallDirectoryName": _UST, "UserDirectoryName": _UST.addEllipsis(20) }));
- U.Dk.RE.AsynWPCMM(_fileinfo);
- (_UCB) && (_UCB(context, r));
- }
- }
- U.Dk.RE.AsynWPCMM = function (UDE) {
- var i,
- _UCE = ["L", "R"],
- _diskinfo = US.Disk.UserDisk;
- for (i = 0; i < _UCE.length; i++) {
- _UDCD = $("#" + _UCE[i] + UDE.UserDirectoryID, _diskinfo.pdiv);
- if (_UDCD[0]) {
- if (i) {
- _UDCD = _UDCD.childg()[0];
- _UDCD = $(_UDCD).childg()[1];
- _UDCD = $(_UDCD).Child()[0] = UDE.UserallDirectoryName;
- }
- else {
- _UDCD = _UDCD.childg()[0];
- _UDCD = $(_UDCD).Child()[2].innerHTML = UDE.UserallDirectoryName;
- }
- }
-
- }
- }
- U.Dk.RE.WPFZ = function (UDE, TF) {
- UDE = UDE.length ? UDE : [UDE];
- U.Dk.RE.CE = UDE;
- U.Dk.RE.TF = TF;
- U.Dk.RE.OR = US.Disk.UserDisk;
- U.Dk.RE.UEI = U.Dk.HP.ZDQXWPHQ(US.Disk.UserDisk[1][1], US.Disk.UserDisk);
- U.Dk.RE.UDID = UDE[0].UserDirectoryID;
- }
- U.Dk.RE.WPJQ = function (userid) {
- if (U.Dk.RE.UDID == US.Disk.UserDisk[1][2] && U.Dk.RE.TF == "Cut") {
- U.Alert("文件粘贴成功");
- }
- else {
- U.Dk.DiskOperatingSwitch(userid);
- U.Dk.RE.UFStick(userid);
- }
- }
- U.Dk.RE.UFStick = function (userid, UCB, UDID) {
- var _UGID, _dirid, _UCE, _UFT,
- _UME = U.Dk.RE,
- _UTP = _UME.TF,
- _fileinfo = _UME.CE,
- _UBE = _UME.UEI[0][_UME.UEI[0].length - 1],
- _USID = _UBE.UserDirectoryID,
- _diskinfo = U.Dk.DiskOperatingSwitch(userid),
- _UTF = U.Dk.HP.WPCZQXHQ(UDID),
- _UKE = _UTF[2][0][_UTF[2][0].length - 1];
- UDID = UDID || _diskinfo[1][1];
- if (_$(_fileinfo).Select({ UserDirectoryID: UDID })[0]) {
- U.Alert("不允许添加到选择目录");
- }
- else if (_UTF[0]) {
- if (_fileinfo.length && (((_dirid = _UKE.UserDirectoryID) == US.FG || _UKE.GroupID != null) || ((_dirid == _USID || _dirid == US.SG) && US.userInfo.userid == userid)) || !UDID) {
- _UGID = U.Dk.RE.WPHQID(_UTF[2][0], _diskinfo); _UCE = U.Dk.HP.MLWJSY(_fileinfo);
- if (_UTP == "Cut" || _diskinfo[1][0].FileSize + _UCE[1] <= U.UP.GetSfileS(_diskinfo[1][0].UserDiskSpace + "M")) {
- if (!UDID) {
- U.Alert("自动整理分配粘贴文件");
- _UTP = _UTP == "Cut";
- U.A.Request(US.Auth, ["CopyOrCutAndPasteFiles", US.userInfo.userid, _$(_fileinfo).pluck("UserDirectoryID").join(","), _UTP, UDID]), U.Dk.RE.AsynTSStick, ["", UDID, _fileinfo, _UCE[1], UCB, _diskinfo[1][2], _UGID, _UTP, _dirid];
- }
- else {
- if (_UTP == "Cut") {
- U.A.Request(US.Auth, ["CutAndPasteFiles", US.userInfo.userid, UDID, _$(_fileinfo).pluck("UserDirectoryID").join(","), _UGID, (_fileinfo[0].GroupID || "")]), U.Dk.RE.AsynUFStick, ["", UDID, _fileinfo, _UCE[1], UCB, _diskinfo[1][2], _UGID, _UTP, _dirid];
- }
- else {
- U.A.Request(US.Auth, ["CopyAndPasteFiles", US.userInfo.userid, UDID, _$(_fileinfo).pluck("UserDirectoryID").join(","), _UGID, (_UCE[2].length ? _UME.UEI[0][0].UserDirectoryDeep : "")]), U.Dk.RE.AsynUFStick, ["", UDID, _fileinfo, _UCE[1], UCB, _diskinfo[1][2], _UGID, _UTP, _dirid];
- }
-
- }
- }
- else {
- U.Alert("网盘已满");
- }
- }
- else {
- U.Alert("请保存目录文件类型相同");
- }
- }
- else {
- U.Alert("拒绝访问");
- }
- }
- U.Dk.RE.AsynTSStick = function (r) {
- var i, _UPID, _dirid, _UCE,
- context = r.context,
- _fileinfo = context[2],
- _diskinfo = r.value;
- for (i = 0; i < _diskinfo.length; i++) {
- _dirid = _diskinfo[i].UserFilesID;
- _UPID = _diskinfo[i].UserDirectoryID;
- _UCE = _$(_fileinfo).Select({ UserDirectoryID: _diskinfo[i].PID })[0];
- U.Ut.AddObj(_diskinfo[i], _UCE); U.Ut.AddObj(_diskinfo[i], { UserDirectoryParentID: _UPID, UserDirectoryID: _dirid, GroupID: null, UserDirectoryEncrypt: null });
- }
- context.push(true);
- U.Dk.RE.AsynUFStick(r);
- }
- U.Dk.RE.AsynUFStick = function (r) {
- var i, j, _UFT, _UAE, _UCE,
- _UIF = US.userInfo,
- context = r.context,
- _dirid = context[1],
- _fileinfo = context[2],
- _USZ = context[3],
- _UCB = context[4],
- _userid = context[5],
- _UGID = context[6],
- _UTF = context[7],
- _UMID = context[8],
- _UPID = _fileinfo[0].UserDirectoryParentID,
- _diskinfo = U.Dk.DiskOperatingSwitch(_userid);
- r = r.value;
- if (r) {
- if (_UTF == "Cut" || _UTF === true) {
- (_UTF !== true) && (_$(_fileinfo).Change({ UserDirectoryParentID: _dirid }), U.Dk.M.RecursionUpdateDirectory(_fileinfo, { GroupID: _UGID }));
- if (_diskinfo[4][_dirid] && _diskinfo[4][_dirid].Child) {
- _diskinfo[4][_dirid].Child = _diskinfo[4][_dirid].Child.concat(_fileinfo)
- }
- if (_diskinfo[4][_UPID] && _diskinfo[4][_UPID].Child) {
- for (i = 0; i < _fileinfo.length; i++) {
- _$(_diskinfo[4][_UPID].Child).Delete({ "UserDirectoryID": _fileinfo[i].UserDirectoryID });
- }
- }
- U.Dk.RE.WPFZ(_fileinfo, "Copy");
- if ((_UAE = U.Dk.RE.OR) !== _diskinfo) {
- for (i = 0; i < _fileinfo.length; i++) {
- _diskinfo[0].push((_fileinfo[i] = _diskinfo[4][_fileinfo[i].UserDirectoryID] = (_$(_UAE[0]).Delete({ "UserDirectoryID": _fileinfo[i].UserDirectoryID })))); _diskinfo[4][_fileinfo[i].UserDirectoryParentID].Child.push(_fileinfo[i]);
- }
- }
- _UFT = true;
- U.Ut.AddObj(_fileinfo, { "UserDirectoryEncrypt": _UMID == US.SG ? "true" : "", "GroupID": _UGID });
- }
- else {
- _UAE = [];
- for (i = 0; i < r.length; i++) {
- _UCE = r[i]; _diskinfo[0].push((_UCE = !_UTF ? _UCE : U.Dk.M.RUS(new U.Dk.M.Entity(_UCE.UserFilesID, _UCE.UserFilesSize, _UCE.UserDirectoryID, _UCE.UserFilesName.addEllipsis(20), _UCE.UserFilesName, _UCE.UserFilesExtendName, _UCE.UserFilesServerName, _UCE.UserFilesAddTime, _UCE.UseFilesServerThumbnailName || "", _UCE.UserDirectoryDeep, U.MT.toTimeStamp(), _UCE.UserDirectoryEncrypt, _UCE.UserFilesExtendName == "folder" ? 0 : 1, "", _UGID))));
- _diskinfo[4][_UCE.UserDirectoryID] = _UCE; for (j = 0; j < _fileinfo.length; j++) { if (_fileinfo[j].UserDirectoryID == r[i].PID || _fileinfo[j].UserFilesID == r[i].PID) { (_diskinfo[4][_UCE.UserDirectoryParentID] && _diskinfo[4][_UCE.UserDirectoryParentID].Child) && (_diskinfo[4][_UCE.UserDirectoryParentID].Child.push(_UCE)); _UAE.push(_UCE); break; } }
- }
- _fileinfo = _UAE;
- }
- if (_UTF == "Copy" || _UTF === false || _UFT) {
- _diskinfo[1][0].FileSize += _USZ;
- _diskinfo[2] ? U.Dk.LTWPDH(_diskinfo[2], _diskinfo) : U.Dk.CSHYHWP(_diskinfo);
- }
- if (_UGID && (_UAE = _$(US.Friend[2]).Select({ GroupManageID: _UGID })[0])) {
- if (!_UAE.DDC) { _UAE.DDC = 0; }
- _UAE.DDC += _fileinfo.length;
- }
- U.Dk.RE.AsynWPJQ(_userid, _fileinfo, _UPID, _UTF); (_UCB) && (_UCB(_fileinfo));
- return _fileinfo[_fileinfo.length - 1];
- }
- else {
- U.Alert("文件错误!");
- }
- }
- U.Dk.RE.AsynWPJQ = function (userid, UDE, UPID, UTF) {
- var i, _UIE, _UDOD, _UAE = [],
- _UKE = [US.DG, US.PG, US.MG, US.VG],
- _diskinfo = U.Dk.DiskOperatingSwitch(userid) || US.Disk.UserDisk,
- _UDTD = $("#" + (_diskinfo[2] ? "UD_SYWOCRC" : "UD_SYWRZ"), _diskinfo.pdiv)[0],
- _dirid = _diskinfo[1][1],
- _UOID = UDE[0].UserDirectoryParentID;
- US.Disk.DiskDaren["SE"] = UDE[UDE.length - 1];
- if (_UDTD && userid == _diskinfo[1][2]) {
- if ((_dirid == _UOID || (_dirid == "" && _UKE.indexOf(_UOID))) && (UTF == "Copy" || UPID != _UOID)) {
- _UDOD = $("#" + (_diskinfo[2] ? "UD_SYWOCRC" : "UD_SYWRZ"), _diskinfo.pdiv)[0]; (_$(_diskinfo[0]).Select({ "UserDirectoryParentID": _diskinfo[1][1] }).length == UDE.length) && (_UDOD.innerText = ""); U.Dk.VW.XWPDY(UDE, _UDOD);
- }
- else if ((UPID && _dirid == UPID)) {
- U.Dk.RE.AsynWPSCWJ(UDE, userid);
- }
- else if (U.Ut.isBoolean(UTF)) {
- _diskinfo[1][1] = _UOID; if (!_diskinfo[2]) { _UDOD = $("#UD_SYWLC", _diskinfo.pdiv)[0].style.display == "none" ? $("#L" + _UOID, _diskinfo.pdiv)[0] : $("#UD_SYWLC", _diskinfo.pdiv).Child()[((_UIE = _UKE.indexOf(_UOID)) > 0 ? _UIE : -4) + 3]; if (_UDOD) { $(_UDOD).Child()[0].onclick(); } }; (!_UDOD) && (U.Dk.LE.OpenFileDirectory(_$(_diskinfo[0]).Select({ "UserDirectoryID": _UOID })[0], userid)); _UDTD.scrollTop = _UDTD.scrollHeight;
- }
- _UDOD = null;
- for (i = 0; i < UDE.length; i++) {
- if (!UDE[i]["filetype"] && (_UDOD = _UDOD || $("#L" + UDE[i].UserDirectoryParentID)[0])) {
- _UAE.push(UDE[i]);
- }
- }
- (_UAE.length && (_UDOD = $(_UDOD).Child()[1])) && (U.Dk.LL.XWPDH(_UAE, _UDOD, null, null, userid));
- _diskinfo[2] ? U.Dk.LTWPDH(_diskinfo[2], _diskinfo) : U.Dk.CSHYHWP(_diskinfo);
- }
- }
- U.Dk.RE.DWJXZ = function (UFID, UV) {
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "UD_I_AddFileEX", US.userInfo.userid, UFID, UV == "true" ? 1 : 0], U.M.apply(null, [[U.Alert, ["成功添加置顶"]]]));
-
- }
- U.Dk.RE.WPXZWJZJ = function (UDN, UFSN, UTF) {
- if (UFSN != "null" || !UFSN) { U.UP.FileDL(UDN, UFSN, UTF); } else { U.Alert("此文件无法下载"); }
- }
- U.Dk.RE.WPXZWJZJO = function (UDID, UTP) {
- if (UDID && !U.U.L.isLogin()) { window.open("/userpages/UD_XZ.htm?id=" + UDID + "&type=" + (UTP || "")); }
- }
- U.Dk.RE.WPCKSX = function (UDOD, UDE, userid) {
- var _diskinfo = U.Dk.DiskOperatingSwitch(userid),
- _UDTD = U.Dk.RE.ABYS(UDE.UserDirectoryID, UDE, true);
- U.Dk.RE.Prompt(UDOD.innerText, $("select", _UDTD)[0] ? 235 : 215, 350, _UDTD, null, $("#UD_SYW" + (_diskinfo[2] ? "O" : ""), _diskinfo.pdiv)[0]);
- }
- U.Dk.RE.ABYS = function (UDID, UDE, UTF) {
- var i, _UCE, _UDOD, _UDTD, _UDSD, _UDMD,
- _userid = US.userInfo.userid,
- _USE = U.UP.FFT(UDE.UserDirectoryExtendType.toLowerCase()),
- _UTF = "文件" + (UDE.filetype ? "" : "夹"),
- _diskinfo = US.Disk.UserDisk; UDE = UDE || _$(_diskinfo[0]).Select({ "UserDirectoryID": UDID }, null, 1)[0];
- _UCE;
- _UDOD = $$("div", { "className": "UDK_SX" });
- _UDTD = $$("div", { "className": "UDK_SXC" }, _UDOD); _UDSD = $$("div", { "className": "UDK_SXCO" }, _UDTD);
- if (U.UP.IsImg(UDE.UserDirectoryExtendType)) {
- $$("img", { "onerror": [[U.M.ImgError, [1]]], "src": U.M.GetImgU(UDE.UserDirectoryUrl), "className": "UDK_RT_UDD_DV" }, _UDSD);
- }
- else {
- $$("div", { "className": "UDK_L_DiskGE UDK_SXCOI", "style": { "cssText": _USE[1] } }, _UDSD);
- }
- _UDSD = $$("div", { "className": "UDK_SXCT" }, _UDTD); $$("div", { "className": "UDK_SXCTO", "style": { "marginTop": "4px" }, "innerHTML": "名称:" + UDE.UserallDirectoryName }, _UDSD);
- if (UDE.filetype) {
- $$("div", { "className": "UDK_SXCTT UC_TF", "onselectstart": U.M.StopBubble, "spellcheck": "false", "innerHTML": "链接:" + (_USE[0] == "图片文件" ? U.M.GetImgU(UDE["UserFilesServerName"]) : "http://disk.1473.cn/" + UDE["UserDirectoryID"]) }, _UDSD);
- }
- else if (UDID != US.FG && UDE.GroupID == _userid && _userid == _diskinfo[1][2] && UTF) {
- _UDMD = $$("div", { "className": "UDK_SXCTO" }, _UDSD); $$("div", { "innerHTML": "权限选择: ", "className": "UDK_SXCTOQ" }, _UDMD); _UDMD = $$("div", { "className": "UDK_SXCTOS" }, _UDMD);
- _UDMD = $$("select", { "onchange": [[U.Dk.RE.GXSZQX, ["this", UDE]]] }, _UDMD); _UDMD.options.length = 3; _UCE = ["无限制", "只允许上传", "只允许下载"]; for (i = 0; i < 3; i++) { _UDMD.options[i].text = _UCE[i]; }
- _UCE = UDE.UserDirectoryEncrypt; (_UCE == "1" || _UCE == "2") && (_UDMD.selectedIndex = parseInt(_UCE));
- }
- $$("div", { "className": "UDK_SXCTO", "innerHTML": "类型:" + _UTF }, _UDSD);
- $$("div", { "className": "UDK_SXCTO", "innerHTML": "创建日期:" + U.MT.formatDateToArray(UDE.UserDirectoryAddTime) }, _UDSD);
- $$("div", { "className": "UDK_SXCTO", "innerHTML": "文件大小:" + U.UP.FileSize(UDE.UserDirectorySize) }, _UDSD);
- return _UDOD;
- }
- U.Dk.RE.GXSZQX = function (UDOD, UDE) {
- var _UDV = UDOD.selectedIndex;
- U.Dk.RE.SQX(UDE.UserDirectoryID, _UDV ? _UDV : "");
- }
- U.Dk.RE.SQX = function (UDID, UV) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "SetFtpPriviledge", UDID, UV], U.Dk.RE.AsynETUE, ["", "SZ", UDID, UV]);
- U.Alert("和服务器同步中...");
-
- }
- U.Dk.RE.WPWJJM = function (UDE) {
- var _UKE = U.Dk.HP.WPCZQXHQ(null, null, UDE), _diskinfo = US.Disk.UserDisk;
- if (_UKE[2][_UKE[2].length - 1].GroupID == null && _UKE[4]) {
- U.Dk.RE.SHEW(UDE.UserDirectoryEncrypt ? false : true, UDE.UserDirectoryID, $("#UD_SYW" + (_diskinfo[2] ? "O" : ""), _diskinfo.pdiv)[0]);
- }
- }
- U.Dk.RE.SHEW = function (UTF, UDID, UDPD) {
- var _UDOD, _UDTD, _UW = 280, _UH = 180;
- if (UTF) { _UDOD = $$("div", { "className": "UDK_JM" }); _UDTD = $$("div", { "className": "UDK_JMO" }, _UDOD); } else { _UDTD = $$("div", { "className": "UDK_JMA" }); _UH = 125; }
- $$("span", { "className": "UDK_JMOS", "innerHTML": "输入密码:" }, _UDTD); $$("input", { "className": "UDK_JMOI", "type": "password" }, _UDTD);
- if (UTF) { _UDSD = $$("div", { "className": "UDK_JMOT" }, _UDOD); $$("span", { "className": "UDK_JMOS", "innerHTML": "确认密码:" }, _UDSD); $$("input", { "type": "password", "className": "UDK_JMOI" }, _UDSD); }
- U.Dk.RE.Prompt("文件夹" + (UTF ? "加密" : "解密"), _UH, _UW, _UDOD || _UDTD, U.M.apply(_UDOD || _UDTD, [[U.Dk.RE.ETUE, [UTF, UDID]]]), UDPD || US.Disk.UserDisk[1][3]);
- }
- U.Dk.RE.ETUE = function (UTF, UDID) {
- var _dirid = $("input", this), _UM = _dirid[0].value, _UTM = UTF ? _dirid[1].value : _UM;
- if (_UM.isStrNull() && _UM == _UTM) {
- U.A.Request(US.Auth, [(UTF ? "DirectoryEncrypt" : "DirectoryDecrypt"), UDID, _UM]), U.Dk.RE.AsynETUE, ["", UTF, UDID];
- }
- else { U.Alert("输入的内容有误"); }
- }
- U.Dk.RE.AsynETUE = function (r) {
- var context = r.context, _UTF = context[1], _dirid = context[2], _UV = context[3], _diskinfo = US.Disk.UserDisk, _fileinfo = _$(_diskinfo[0]).Select({ "UserDirectoryID": _dirid })[0]; r = r.value;
- if (r) { (_fileinfo) && (U.Ut.AddObj(_fileinfo, { "UserDirectoryEncrypt": _UV == null ? r : _UV, "UserDirectoryExtendType": _UTF === true ? "folderencrypt" : "folder" })); U.Dk.RE.AsynWPWJJM(_fileinfo, _UV); }
- else { U.Alert("设置失败"); }
- }
- U.Dk.RE.AsynWPWJJM = function (UDE, UTF) {
- var i, _UCE = ["R", "L"], _dirid = UDE.UserDirectoryID; UTF = UTF ? ["UD_SYWRZOM", "UD_SYWLCJ"] : ["UD_SYWRZOW", "UD_SYWLCW"], _diskinfo = US.Disk.UserDisk;
- for (i = 0; i < _UCE.length; i++) { (_UDCD = $("#" + _UCE[i] + _dirid, _diskinfo.pdiv)[0]); (_UDCD) && ($("div", _UDCD)[i + 1].className = (i ? "UD_SYWLCOI UD_SYWLTXOST UD_SYID " : "UD_SYWRZOS UD_SYID ") + UTF[i]); }
- }
- U.Dk.RE.GXWPCKXS = function (userid, fileinfo, loading, cb) {
-
- if (!fileinfo.Child) {
- U.A.Request(US.Auth, ["GetChildsByDirectoryId", userid, fileinfo.UserDirectoryID], U.Dk.RE.AsynGXWPCKXS, [loading, userid, fileinfo, cb]);
- }
-
- else { cb ? cb() : U.Dk.RE.WPCKXS(userid, fileinfo); }
- }
- U.Dk.RE.AsynGXWPCKXS = function (r) {
- var context = r.context,
- _userid = context[1],
- _fileinfo = context[2],
- _cb = context[3],
- _dirid = _fileinfo.UserDirectoryID,
- _diskinfo = U.Dk.DiskOperatingSwitch(_userid);
- r = r.value;
-
- _$(_diskinfo[0]).Delete({ "UserDirectoryParentID": _dirid });
- _$(_diskinfo[4]).Delete({ "UserDirectoryParentID": _dirid });
- _fileinfo.Child = r;
-
- U.Dk.M.Entity.Add(r, _diskinfo);
- U.Dk.RE.GXWPCKXS(_userid, _fileinfo, null, _cb);
- }
- U.Dk.RE.WPCKXS = function (userid, fileinfo) {
- var _diskinfo = U.Dk.DiskOperatingSwitch(userid),
- _dirid = _diskinfo[1][1],
- _contentel = $("#UD_SYWRZ", _diskinfo.pdiv)[0],
- _leftel = $("#L" + _dirid, _diskinfo.pdiv)[0];
-
- if (fileinfo.UserDirectoryID == _dirid) {
-
- if (_leftel) {
- _leftel.onclick();
- }
-
- else {
- U.Dk.LE.OpenFileDirectory(fileinfo, userid);
- }
- }
- }
- U.Dk.RE.WPCKPL = function (UDE) {
- U.D.Img.Img(UDE, UDE);
-
- }
- U.Dk.RE.MBC = function (UDID, UST, UTF, UTP) {
- var _UAL,
- _UFT = false,
- _userid = US.userInfo.userid,
- _diskinfo = US.Disk.UserDisk,
- _fileinfo = _diskinfo[4][UDID].Child || _$(_diskinfo[0]).Select({ "UserDirectoryParentID": UDID }),
- _UAE = _$(_fileinfo).Select({ "UserDirectoryExtendType": "folder" });
- if (!UST.isStrNull()) { _UAL = "名字不能空"; }
- else if (!UST.count() > 40) { _UAL = "文件名过长"; }
- else if (UTP == "Create" && (UTF == "folder" && _fileinfo.length >= 500) || (UTF != "folder" && _fileinfo.length - _UAE.length >= 5000)) {
- _UAL = "无法创建,超过最大个数";
- }
- else { _UFT = !_UFT; };
- (_UAL) && (U.Alert(_UAL));
- return _UFT;
- }
- U.Dk.RE.WPHQID = function (UDE, UGE) {
- var _UCE = UDE[UDE.length - 1] || "";
- return (UGE[2] || _UCE.UserDirectoryID == US.FG) ? UGE[1][2] : (_UCE.GroupID || "");
- }
- U.Dk.RE.Prompt = function (UTS, UH, UW, UC, UCY, UDOD) {
- return U.UI.Confirm(UTS, { "width": UW ? UW + "px" : "", "height": UH ? (UH + "px") : "" }, "", UCY, UC, UDOD);
- }
|