123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
-
- Namespace.register("U.MD.N");
- U.MD.N.urlGuide = function () {
- var _hash = U.UF.C.getUrlHash(),
- _type;
-
- if (_hash[0] == "#!") {
- _hash.shift()
- }
-
- else {
- _hash[0] = _hash[0].substr(1);
- }
- _type = _hash[0];
- switch (_type) {
- case "disk":
-
- U.MD.D.I.openApplication(_type, { "userid": _hash[1], "directoryid": _hash[2] });
- break;
- case "file":
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- var _fileinfo = r.value[0];
- _fileinfo = new U.MD.DK.M.entity(_fileinfo.UserFilesID, _fileinfo.UserFilesSize, _fileinfo.UserDirectoryID, _fileinfo.UserFilesName, _fileinfo.UserFilesName,
- _fileinfo.UserFilesExtendName, _fileinfo.UserFilesServerName, _fileinfo.UserFilesAddTime, null, 999, _fileinfo.UserFilesModifyTime, _fileinfo.UserDirectoryEncrypt,
- 1, _fileinfo.UserFilesExtendName, _fileinfo.GroupID, _fileinfo.UsOffice, _fileinfo.UserID, US.userInfo.UserNikeName, _fileinfo.UserName, _fileinfo.UserThumbnailImageHead);
- U.MD.DK.LE.openFileDirectory(_fileinfo);
- });
- break;
- case "excel":
- if (_hash[1] == 'join') {
- U.MD.N.joinGuide(_hash, _type);
- }
- else if (_hash[1].length == 36) {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- if (r.value[0]) {
-
- var _fileinfo = {
- UserDirectoryExtendType: r.value[0].UserFilesExtendName,
- UsOffice: r.value[0].UsOffice ? r.value[0].UsOffice.unEscapeQuotes() : null,
- UserId: r.value[0].UserID,
- UserallDirectoryName: r.value[0].UserFilesName,
- UserDirectoryID: r.value[0].UserFilesID,
- GroupID: r.value[0].UserDirectoryEncrypt
- };
-
- if (r.value && r.value.UsOffice !== undefined && r.value.UsOffice != null) {
- U.MD.D.I.openApplication(_type, _fileinfo);
- }
- }
- });
- }
- break
- case "word":
- if (_hash[1] == 'join') {
- U.MD.N.joinGuide(_hash, _type);
- }
- else if (_hash[1].length == 36) {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- if (r.value[0]) {
- r = r.value[0];
-
- var _fileinfo = {
- UserFilesServerName: r.UserFilesServerName,
- UserDirectoryExtendType: r.UserFilesExtendName,
- UsOffice: r.UsOffice ? r.UsOffice.unEscapeQuotes() : null,
- UserId: r.UserID,
- UserallDirectoryName: r.UserFilesName,
- UserDirectoryID: r.UserFilesID,
- GroupID: r.UserDirectoryEncrypt
- };
-
- if (r && r.UsOffice !== undefined && r.UsOffice != null) {
- U.MD.D.I.openApplication(_type, _fileinfo);
- }
-
- else {
- U.A.Request("http://office.1473.cn/Officetohtml.ashx", ["Open", _fileinfo.UserDirectoryExtendType, _fileinfo.UserFilesServerName], function (r) {
- if (r.value.value != undefined) {
- r = r.value;
- _fileinfo.UsOffice = r.value.getBodyHtml().replace(/src=[\'\"]?([^\'\"]*)[\'\"]?/ig, function (str1, str2) {
- return "src=\"http://office.1473.cn/usoffice/" + str2 + "\"";
- });
- U.MD.D.I.openApplication(_type, _fileinfo);
- } else {
- U.Alert('文档已丢失。。。');
- }
- });
- }
- }
- });
- }
- break;
- case "boomYun": case "txt": case "friend": case "lookupfriend": case "set": case "systemset":
- U.MD.D.I.openApplication(_type, { "directoryid": _hash[1] });
- if (_hash[1] == "template") {
-
- if (_hash[2] != "undefined") {
- U.Boom.I.GetHomeTemp.particulars(_hash[2]);
- U.MD.N.urlWrite("boomYun/template/" + _hash[2], "互联办公");
- }
- }
- break;
- default: break;
- }
- }
- U.MD.N.joinGuide = function (hash, type) {
- var _fileId = hash[2];
- U.MD.U.L.setLoginCallBack(function () {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _fileId]), function (r) {
- var _docinfo = r.value[0];
- if (!_docinfo) {
- return U.Alert('添加协同链接有误,请联系群主获取最新协同链接。。。');
- }
- if (US.friend.group) {
- var _groupId = _docinfo.UserDirectoryEncrypt || _docinfo.UserDirectoryID,
- _groupinfo = U.Json.select(US.friend.group, { "GroupManageID": _groupId })[0],
- _docId = _docinfo.UserFilesID;
- if (!_groupinfo) {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Friends", "GetGroupInfo", _groupId]), function (r) {
- U.MD.F.J.selectUserInfo.NeedUser = [US.userInfo];
- US.friend.group.push(r.value[0]);
- top.U.MD.F.J.determineCreateGroupAndAddGroupUser(r.value[0].GroupManageID, null, null, false, "", "", function (groupid, groupdata) {
- U.Json.del(groupdata[0], { UserId: US.userInfo.userid });
- US.friend.groupusers.push.apply(US.friend.groupusers, groupdata[0]);
-
- U.MD.D.I.openApplication(type, U.Json.select(groupdata[1], { UserDirectoryID: _docId })[0], function (contentwindow) { contentwindow.U.MD.O.W.Panel.addUser(US.userInfo.userid); });
- });
- });
- } else {
- var _docdiskinfo = new U.MD.DK.M.entity(_docinfo.UserFilesID, _docinfo.UserFilesSize, _docinfo.UserDirectoryID, _docinfo.UserFilesName, _docinfo.UserFilesName,
- _docinfo.UserFilesExtendName, _docinfo.UserFilesServerName, _docinfo.UserFilesAddTime, null, 999, _docinfo.UserFilesModifyTime, _docinfo.UserDirectoryEncrypt,
- 0, _docinfo.UserFilesExtendName, _groupId, _docinfo.UsOffice, _docinfo.UserID, US.userInfo.UserNikeName, _docinfo.UserName, _docinfo.UserThumbnailImageHead);
- U.Alert("你已经在该文档的群里了!");
- U.MD.D.I.openApplication(type, _docdiskinfo);
- }
- }
- })
- });
- }
- U.MD.N.urlWrite = function (hash, title) {
- setTimeout(function () {
- U.UF.N.addHash(hash);
- document.title = title;
- }, 0);
- }
|