123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843 |
- //此处放置iframe中的word中的功能面板,包括包括创建邀请协作人员,创建编辑历史,创建生成链接.创建热门模板。
- Namespace.register("U.Word.Panel");
- //#region 初始化区域
- //初始化区域
- //U.Word.Tool = function (UDE) {
- // //初始化页面
- // var _UDSD, _UDGD, _USM, _UW, _UDOD, _UDKD,
- // _UOFD, //邀请好友窗体
- // _UHD, //编辑历史窗体
- // _UDNSD, //生成链接窗体
- // _UHTD, //邀请好友窗体
- // _UDTD = $("#UD_SYQXR_Parent")[0];
- // if ($(_UDTD).Child().length == 0) {
- // _USM = U.M.GetElementInfo(_UDSD);
- // _UW = _USM["OW"] + 50;
- // }
- //}
- /**
- * 加载编辑区域
- *
- * @param {element}
- * @param {element}
- */
- U.Word.Panel.Loadeditor = function () {
- var _worddiv, _UDTD, _UDGD, _wordeditor, _UDKD;
- //$("#UD_SYQXR")[0] 是word的编辑区域,如果不存在,则创建一个。
- if (!$("#UD_SYQXR")[0]) {
- _worddiv = $("#UD_SYQXR_Parent")[0]; //包含word编辑区域的div
- _wordeditor = $$("div", { "id": "UD_SYQXR" }); //创建word编辑器区域
- _pagediv = $$("div", { "className": "U_Boom_CO_Editor_body_main_m" }, _wordeditor); //由于是多页,所以需要另外建立一个div,包含下面的头部,内容,底部
- _header = $$("div", { "className": "U_Boom_CO_Editor_body_main_border" }, _pagediv); //头部信息
- $$("div", { "className": "U_Boom_CO_Editor_body_main_bordero" }, _header); //头部的左上角
- $$("div", { "className": "U_Boom_CO_Editor_body_main_bordert" }, _header); //头部的右上角
- $$("div", { "className": "U_Boom_CO_Editor_body_main_text", contentEditable: "true", spellcheck: "false", "innerHTML": "", "id": "Txt" + Guid.newGuid() }, _pagediv); //编辑器区域
- _footer = $$("div", { "className": "U_Boom_CO_Editor_body_main_border" }, _pagediv);
- $$("div", { "className": "U_Boom_CO_Editor_body_main_borders" }, _footer);
- $$("div", { "className": "U_Boom_CO_Editor_body_main_borderf" }, _footer);
- //把编辑器区域放入窗体。
- U.UI.Form({
- min: false, max: false, close: false, draw: false, className: "UD_SYF_S",
- SO: _worddiv, content: _wordeditor, title: false, hst: false, bst: { "style": { "overflow": "hidden" } },
- style: { "backgroundColor": "transparent", "border": "0", "width": "auto", "top": "15px", "left": "30px" }
- });
- }
- }
- //
- //#endregion
- //#region 团队成员
- /**
- * 创建团队成员的窗体
- *
- * @param {element}
- * @param {element}
- */
- U.Word.Panel.LoadPlayUser = function (fileinfo) {
- var _coopwindow, _frienddiv, _example, _wordsize, _marginleft;
- //如果不存在团队成员窗口,则创建一个团队成员窗口。
- if (!$("#U_Boom_CO_Editor_body_left_invite_user")[0]) {
- _wordsize = U.M.GetElementInfo($("#UD_SYQXR")[0]); //获取编辑器域的父亲。用于获取长度大小,用于定位
- _marginleft = _wordsize["OW"] + 50; //团队窗口的位置间距编辑器50像素
- //创建邀请协助人员窗口
- _coopwindow = $("#U_Boom_CO_Editor_body_left")[0];
- _frienddiv = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user", "id": "U_Boom_CO_Editor_body_left_invite_user" }); //好友内容区域
- _example = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a", "onclick": [[U.Word.Panel.DisplayInsertUser, []]] }, _frienddiv); //默认邀请按钮
- $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_img" }, _example);
- $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_div", "innerHTML": "邀请" }, _example);
- U.UI.Form({
- min: false, max: false, draw: false,
- SO: _coopwindow, content: _frienddiv, title: "<div class='UD_SYF_STI'>邀请协作人员</div>", className: "UD_SYF_S",
- hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
- style: { "border": "1px #d6dff0 solid", "position": "absolute", "width": "300px", "height": "250px", "top": "25px", "left": _marginleft + "px" }
- });
- }
- U.Word.Panel.DisPlayUser(fileinfo); //获取协作人员
- }
- /**
- * 初始化查看团队成员
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.DisPlayUser = function (UDE, UDOD) {
- UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_invite_user")[0];
- var HYD = UDOD.children[0];
- UDOD.innerHTML = ""
- $(UDOD).append(HYD);
- if (UDE) {
- var UGF = _$(US.Friend[3]).Select({ "GroupManageID": UDE.UserDirectoryEncrypt || UDE.GroupID });
- for (i = 0; i < UGF.length; i++) {
- _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a" }, UDOD);
- _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_img", "style": { "background": "" } }, _UDOD);
- $$("img", { "src": U.M.GetImgU(UGF[i].UserThumbnailImageHead) }, _UDTD);
- $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_div", "innerHTML": UGF[i].UserNickName }, _UDOD);
- }
- }
- }
- /**
- * 判断是否是已经新建过 弹出添加成员 异步回调
- *
- * @param {element} Wrod信息数组
- */
- U.Word.Panel.DisplayInsertUser = function () {
- var _UGE = U.Word.TF, //object参数值
- _userid = _UGE["userid"],
- _UFID = _UGE["ID"],
- _UET = _UGE["fileinfo"];
- if (_UET && _UET.UserDirectoryID) { //是否为自己的文档
- //文件实体
- var _UQID = _UET.UserDirectoryEncrypt || _UET.GroupID; //_UQID群id
- if (_UQID == US.userInfo.userid) { _UQID = ""; }
- top.U.F.J.ChanCAD(_UQID)
- top.U.F.J.SelectFriendForm(U.M.apply(this, [[top.U.F.J.CXNEWTJ,
- [_UQID, _UET.UserDirectoryName || _UET.UserFilesName, "由文档" + (_UET.UserDirectoryName || _UET.UserFilesName) + "发起的互联办公群组。", _UFID, U.M.apply(null, [[U.Word.Panel.InsertUser, [_UET]]])]]])
- ); //调用创建群的弹窗函数
- //top.U.F.J.CXNEWTJ, [[U.Word.Panel.InsertUser, ([$("#U_Boom_CO_Editor_body_left_invite_user")[0], _UET], _UET.UserDirectoryName
- }
- else { //不是自己的文档
- U.Word.Save();
- }
- }
- /**
- * 添加团队成员
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.InsertUser = function (UET, GroupID, _FriendUser, groupid, _UGN) {
- //找到硬盘复制粘贴的函数, 先调用复制然后调用粘贴
- //top.U.Dk.RE.WPFZ(UET, "Copy")
- //top.U.Dk.RE.UFStick(GroupID, function () { //粘贴回调
- //}, UET.UserId);
- if (!(UET.UserDirectoryEncrypt && UET.UserId != UET.UserDirectoryEncrypt)) { //如果是新创建的文件,同时文件不在群里 就把文件拷贝到群里进行处理
- /*
-
- //用户id 群id 文件id 群id 判断
- U.A.Request(US.Auth,"UseStudioDisk.CopyAndPasteFiles", [US.userInfo.userid, GroupID.GroupManageID, UET.UserFilesID || UET.UserDirectoryID, GroupID.GroupManageID, 1], function (r) {
- //重新打开
- U.D.Office.Word();
- }, []);
- */
- //用户id 、 目录id(群id) 、 文件id、 群id 、 文件名
- top.U.A.Request(US.Auth, ["CutAndPasteFiles", GroupID.GroupManageID, UET.UserFilesID || UET.UserDirectoryID, "", GroupID.GroupManageID]), top.U.Dk.RE.AsynUFStick, ["", GroupID.GroupManageID, [UET], [UET], U.M.apply(null, [[U.Word.Panel.AsynInsertUser, [UET, _FriendUser, groupid]]]), US.userInfo.userid, GroupID.GroupManageID, "Cut", UET.UserDirectoryParentID];
- }
- //把所有添加进来的好友打印在office窗体里
- // U.Word.Panel.DisPlayUser(UET)
- /*
- if (UET[1].UserDirectoryEncrypt) { //判断文件是否已经是群文件
- }
- else { //如果不是群文件,把当前uw文件复制到群里
- // var _UME = top.U.Dk.RE, _UCE = top.U.Dk.HP.MLWJSY(UET), _UGE = top.U.Dk.DiskOperatingSwitch(US.userInfo.userid);
- // U.A.Request(US.Auth,"UseStudioDisk.CopyFile", [US.userInfo.userid, UGID, UET[1]["UserDirectoryID"], US.userInfo.userid, (_UCE[2].length ? _UME.UEI[0][0].UserDirectoryDeep : "")]), top.U.Dk.RE.AsynUFStick, ["", UGID, [UET[1]], _UCE[1], null, _UGE[1][2], UGID, "Copy", UGID];
- }
- */
- }
- /**
- * 异步添加好友
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.AsynInsertUser = function (UET, _FriendUser, groupid, arr) {
- //弹出窗体
- //console.log(arr);
- //top.U.D.DT.YYDK("Word", [US.userInfo, , arr[0]]);
- //U.Alert("邀请成功");
- U.Word.Panel.DisPlayUser(UET)
- top.U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SentMessageToFriend", US.userInfo.userid, _FriendUser, US.userInfo.UserNickName || US.userInfo.username, '' + groupid + ',' + arr[0].UserDirectoryName + ',' + UET.UserDirectoryModifyTime + ',' + arr[0].UserDirectoryID + ',' + UET.UserDirectoryName + '.UW', 5, false], U.M.apply(), [""]);
- /*
- var i, _UDTD,
- context = r.context,
- _UDOD = context[1],
- _UOE = context[2],
- _UDE = context[3],
- _UDFD = $$("frag");
- r = r.value;
- if (r > -1) {
- for (i = 0; UDE.length; i++) {
- _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a" }, _UDFD);
- $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_img" }, _UDTD);
- $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_div", "innerHTML": "邀请" }, _UDTD);
- }
- $(UDOD).append(_UDFD);
- U.Alert("添加成功");
- }
- */
- }
- //#endregion
- //#region 热门模板
- /**
- * 创建历史记录窗体
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.LoadHotTemplates = function (fileinfo) {
- var _UDTD, _UDOD, _USM, _UW;
- if (!$("#U_Boom_CO_Editor_body_left_template_hot")[0]) {
- _UDTD = $("#U_Boom_CO_Editor_body_left")[0];
- _USM = U.M.GetElementInfo($("#UD_SYQXR")[0]);
- _UW = _USM["OW"] + 50;
- //热门模板提供
- _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user", id: "U_Boom_CO_Editor_body_left_template_hot" });
- U.UI.Form({
- min: false, max: false, draw: false, SO: _UDTD,
- content: _UDOD, title: "<div class='UD_SYF_STI'>热门模板提供</div>", className: "UD_SYF_S",
- hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
- style: { "border": "1px #d6dff0 solid", "width": "300px", "height": "270px", "position": "absolute", "top": "840px", "left": _UW + "px" }
- });
- }
- U.Word.Panel.GetHotTemplates("00000000-0000-0000-0000-000000000000", 1, 10); //热门模板
- }
- /**
- * 初始化加载模板
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.GetHotTemplates = function (UDID, S, E, UDOD) {
- UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_template_hot")[0];
- U.A.Request(US.CD, [US.DB, "UseStudio_Office", "SelectHotTemplate", UDID, S, E], U.Word.Panel.AsynGetHotTemplates, [null, UDOD]);
- }
- /**
- * 获取热门模板
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.AsynGetHotTemplates = function (r) {
- var i, _UDOD,
- _UDFD = $$("frag"),
- context = r.context,
- r = r.value;
- context[1].innerHTML = "";
- for (i = 0; i < r.length; i++) {
- _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user_m", "onclick": [[U.Word.Panel.OpenHotTemplates, [r[i].TemplateId]]] }, _UDFD);
- $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user_m_s", "style": { "background-image": "url(" + (r[i].UseFilesServerThumbnailName || "/Boomyun/img/pc/NImg.png") + ")" } }, _UDOD);
- $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user_m_x", "innerHTML": r[i]["UserFilesName"] }, _UDOD);
- }
- $(context[1]).append(_UDFD);
- }
- /**
- * 点击模板处理
- * @参数:模板分类id
- * @param {element} 换页元素
- */
- U.Word.Panel.OpenHotTemplates = function (ArrTD) {
- top.U.Boom.I.GetHomeTemp.particulars(ArrTD);
- }
- //#endregion
- //#region 链接查看
- /**
- * 查看链接
- *
- * @param {element}
- */
- U.Word.Panel.Loadlink = function (fileinfo) {
- var _rightwindow, _linkdiv, _wordsize, _marginleft;
- //如果不存在添加链接区域,则创建。
- if (!$("#U_Boom_CO_Editor_body_left_href_pay_a")[0]) {
- //右侧功能区域,链接区域要追加到这里
- _rightwindow = $("#U_Boom_CO_Editor_body_left")[0];
- _wordsize = U.M.GetElementInfo($("#UD_SYQXR")[0]);
- _marginleft = _wordsize["OW"] + 50;
- //生成链接
- _linkdiv = $$("div", { "className": "U_Boom_CO_Editor_body_left_href_pay_a", id: "U_Boom_CO_Editor_body_left_href_pay_a", "innerHTML": "将此站点生成链接", "onclick": [[U.Word.Panel.SetDNS]] });
- U.UI.Form({
- min: false, max: false, draw: false, SO: _rightwindow,
- content: _linkdiv, title: "<div class='UD_SYF_STI'>生成链接</div>", className: "UD_SYF_S",
- hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
- style: { "border": "1px #d6dff0 solid", "position": "absolute", "width": "300px", "height": "250px", "top": "570px", "left": _marginleft + "px" }
- });
- }
- // U.Word.Panel.Getlink(fileinfo.UserDirectoryID);
- }
- /**
- * 查看链接
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.Getlink = function (UDID, UDOD) {
- UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_href_pay_a")[0];
- U.A.Request(US.CD, [US.DB, "UseStudio_Office", "SelectHotTemplate", UDID, UOID, US, UE], U.Word.Panel.AsynGetlink, [null, UDOD]);
- }
- /**
- * 查看链接异步
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.AsynGetlink = function (r) {
- var context = r.context;
- r.value;
- if (r) {
- context[1].innerHTML = r;
- }
- }
- U.Word.Panel.SetDNS = function () {
- var _UGE = U.Word.TF, //object参数值
- _UFID = _UGE.ID, //用户ID
- _USID = _UGE.userid, //文件ID
- _UFNM = _UGE.fileinfo.UserDirectoryName, //文件信息
- _USNM = _UGE.fileinfo.UserNickName
- if (_UFID) {
- var _UDOD = $$("div", { "class": "U_Boom_CO_Popup_18" }),
- _UDNA, _UDFX, SFPT, _UDSD = $$("div", { "class": "U_Boom_CO_Popup_18_Set" }, _UDOD),
- _UDQCD, _UDQBD, _UDBG, _UDQD = $$("div", { "class": "U_Boom_CO_Popup_18_Que" }, _UDOD);
- //设置
- $$("div", { "class": "U_Boom_CO_Popup_18_Set_Tag", "innerHTML": "目前默认域名" }, _UDSD), //<span>设置个性域名,让好友同事更快记住链接</span>
- _UDNA = $$("div", { "class": "U_Boom_CO_Popup_18_Set_Name", "innerHTML": "等待域名生成" }, _UDSD),
- //_UDSBD = $$("div", { "class": "U_Boom_CO_Popup_18_Btn" }, _UDSD),
- //设置成功
- //_UDRT = $$("div", { "class": "U_Boom_CO_Popup_18_Que_Right", "style": { "display": "none"} }, _UDQD);
- //$$("div", { "class": "U_Boom_CO_Popup_18_Que_Tag", "innerHTML": "设置成功" }, _UDRT);
- //_UDUR = $$("input", { "type": "text", "class": "U_Boom_CO_Popup_18_Que_Url" }, _UDRT);
- //二维码
- _UDQCD = $$("div", { "class": "U_Boom_CO_Popup_18_Que_Code" }, _UDQD);
- _UDBG = $$("div", { "class": "U_Boom_CO_Popup_18_Que_QR" }, _UDQCD);
- _UDFX = $$("div", { "class": "U_Boom_CO_Popup_18_Que_Con", "innerHTML": "扫一扫 </br> 分享此文档给好友</br></br>第三方平台分享" }, _UDQCD);
- //$$("div", { "class": "U_Boom_CO_Popup_18_Que_Con", "innerHTML": "第三方平台分享", "style": { "line-height": "0px", "margin-left": "10px"} }, _UDQCD);
- //第三方平台
- SFPT = $$("div", { "class": "U_Boom_CO_Popup_18_Sanfang" }, _UDFX);
- $$("div", { "class": "U_Boom_CO_Popup_18_Sanfang_Weibo", "onclick": [[U.Word.Panel.Weibo, [_UDNA, _UFNM, _USNM]]] }, SFPT);
- $$("div", { "class": "U_Boom_CO_Popup_18_Sanfang_Kongjian", "onclick": [[U.Word.Panel.Kongjian, [_UDNA, _UFNM, _USNM]]] }, SFPT)
- //域名管理中心
- //_UDYM = $$("div", { "class": "U_Boom_CO_Popup_18_Set_Yu" }, _UDOD);
- //$$("div", { "class": "U_Boom_CO_Popup_18_Set_Yu_Text", "innerHTML": "对域名不满意?" }, _UDYM),
- //$$("div", { "class": "U_Boom_CO_Popup_18_Set_Yu_Ming", "innerHTML": "域名管理中心", "onclick": [[U.Word.Panel.Yuming]] }, _UDYM),
- _UDQBD = $$("div", { "class": "U_Boom_CO_Popup_18_Btn" }, _UDQD);
- //$$("div", { "innerHTML": "取消", "onclick": [[U.Word.Panel.Close, [_UDOD]]] }, _UDSBD),
- //$$("div", { "innerHTML": "设置", "onclick": [[U.Word.Panel.QDSZ, [_UDRT, _UDSD, _UDUR, _UDNA, _UDQBD]]] }, _UDSBD),
- $$("div", { "innerHTML": "取消", "onclick": [[U.Word.Panel.Close, [_UDOD]]] }, _UDQBD);
- //$$("div", { "innerHTML": "生成二维码", "onclick": [[U.Word.Panel.CodeSet, [_UDUR, _UDBG, _UDQCD]]] }, _UDQBD);
- $$("div", { "innerHTML": "到域名管理中心设置", "onclick": [[U.Word.Panel.Yuming]], "style": { /*"background-color": "#169bd5", "color": "#fff",*/"width": "135px", "cursor": "pointer" } }, _UDQBD);
- top.U.UI.From({ min: false, max: false, id: "U_Boom_CO_Popup_18", style: { "width": "370px", "height": "auto" }, content: _UDOD, title: "提示", hst: {}, bst: {} });
- U.Word.Panel.eaDomain(0, 1, _UFID, _UDNA, _UDSD, _UDNA, _UDQBD, _USID, _UFNM, _UDBG, _UDQCD);
- //U.Word.Panel.Close();
- } else {
- U.Word.Save();
- }
- }
- /*
- * @作用:确定申请域名
- * @参数一:文件ID
- * @参数二:域名生成内容
- * @参数三:设置成功内容
- * @参数四:设置的总体盒子
- * @参数五:域名内容
- * @参数六:域名生成内容
- * @参数七:域名管理中心
- * @参数七:复制二维码按钮
- * @参数八:用户ID
- * @参数九:文件名
- */
- U.Word.Panel.eaDomain = function (i, j, UDID, UDOD, _UDSD, _UDNA, _UDQBD, _USID, _UFNM, _UDBG, _UDQCD) {
- var fid = UDID; //获取文件ID
- var fname = _UFNM; //获取文件名
- var UserID = _USID; //获取用户ID
- var d = new Date(); //获取当前系统时间
- d.setMonth(d.getMonth() + 1); //月数+1
- var yy1 = d.getFullYear(); //获取年份
- var mm1 = d.getMonth() + 1; //因为getMonth()返回值是 0(一月) 到 11(十二月) 之间的一个整数。所以要给其加1
- var dd1 = d.getDate(); //获取哪一天
- if (mm1 < 10) {
- mm1 = '0' + mm1;
- }
- if (dd1 < 10) {
- dd1 = '0' + dd1;
- }
- var ExTime = yy1 + '-' + mm1 + '-' + dd1; //时间组合 年-月-日
- var val; //定义变量
- for (; i < j; i++) {
- val = i.toString(36); //转36进制
- _UDNA.value = "100" + val + ".1473.cn"; //域名生成规则
- //查询数据库,域名表是否有这个域名的存在
- //"1000" + val + '.1473.cn':域名
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_DNS", "DNS_SelectRecommend", "100" + val + '.1473.cn'], function (r) {
- //如果有就重新执行函数,进行+1自增数查询
- if (r.value[0]) {
- for (var i = 0; i < 1; i++) {
- //判断生成的域名是否存在数据库
- if (_UDNA.value == r.value[0].result) {
- var res = (_UDNA.value.split('.')[0].substring(3)).toString(10); //截取最后面的一位数,进行自增
- U.Word.Panel.eaDomain(parseInt(res, 36) + 1, parseInt(res, 36) + 2, UDID, UDOD, _UDSD, _UDNA, _UDQBD, _USID, _UFNM, _UDBG, _UDQCD)//重新执行函数
- }
- }
- } else {
- //fid:文件id
- //查询数据库,域名表是否有这个文件,查看该文件是否存在域名
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_DNS", 'GetDnsInfoByFileId', fid], function (r) {
- if (r.value.length == 0) {
- //fid:文件id fname:文件名 .com:域名类型 ExTime:到期时间 0:类别 _UDUR.value:域名内容 UserID:用户ID 1:是否需要跳转页面展示内容
- //插入域名到数据库
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_DNS", 'DNS_InsertDnsInformation', fid, fname, '.' + 'cn', ExTime, '0', _UDNA.value, UserID, "1"], function (r) {
- //fid:文件ID
- //查询域名是否存在
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_DNS", 'GetDnsInfoByFileId', fid], function (r) {
- _UDNA.innerHTML = r.value[0].Domain; //显示域名至HTML页面
- });
- });
- } else {
- // _UDRT.style.display = "block"; //设置成功的页面显示
- // _UDSD.style.display = "none"; //点击设置页面隐藏
- // _UDQBD.style.display = "block"; //复制生成等按钮显示
- // _UDYM.style.display = "block"; //域名管理中心显示
- // _UDUR.value = r.value[0].Domain; //获取域名生成内容
- _UDNA.innerHTML = r.value[0].Domain;
- }
- //长 - 宽 - 二维码颜色 - 背景颜色 - 输入的文字或者URL - 生成到的地方
- top.U.QR.Code.generate("117", "122", "black", "white", $(_UDNA)[0].innerHTML, $(_UDBG)[0]);
- });
- }
- });
- }
- }
- //域名生成二维码
- //U.Word.Panel.CodeSet = function (_UDUR, _UDBG, _UDQCD) {
- // //长 - 宽 - 二维码颜色 - 背景颜色 - 输入的文字或者URL - 生成到的地方
- // top.U.QR.Code.generate("180", "180", "black", "white", $(_UDUR)[0].value, $(_UDBG)[0]);
- // _UDQCD.style.display = "block"; //二维码显示
- //}
- //域名复制链接分享
- /*U.Word.CopySet = function (_UDUR) {
- // $(_UDUR)[0].select();
- //_UDUR.select();
- top.$(".U_Boom_CO_Popup_18_Que_Url")[0].select();
- return document.execCommand('copy');
- U.Alert("复制成功");
- }*/
- //申请域名异步
- /*U.Word.AsyneaDomain = function (r) {
- var context = r.context, _UDID = context[1], _UDOD = context[2]; r = r.value;
- if (r[0]) {
- $(_UDOD).addAttrArray({ "innerHTML": "http://" + r[0].UserDomain + ".boomyun.com", style: { cursor: "pointer" }, title: "点击跳转", "onclick": U.M.apply(null, "window.open('" + "http://" + r[0].UserDomain + ".boomyun.com" + "')") });
- }
- else { U.Alert("你建站超过指定次数请您重新建立。"); }
- }*/
- /**
- * 确定设置按钮
- *
- * @param {element} 换页元素
- * @参数一:设置成功内容
- * @参数二:设置的总体盒子
- * @参数三:域名内容
- * @参数四:域名生成内容
- * @参数五:复制二维码按钮
- */
- //U.Word.Panel.QDSZ = function (_UDRT, _UDSD, _UDUR, _UDNA, _UDQBD) {
- // _UDRT.style.display = "block";
- // _UDSD.style.display = "none";
- // _UDQBD.style.display = "block";
- // _UDUR.innerHTML = _UDNA.innerHTML; //显示域名内容
- //}
- /**
- * 创建链接分享
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.Createlink = function (UDE, UDOD) {
- //#error 不要
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "UD_I_AddDns", UDE.UserFileId, US.userInfo.userid, 1], U.Word.Panel.AsynCreatelink, [null, UDOD]);
- }
- /**
- * 创建链接分享
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.AsynCreatelink = function (r) {
- var context = r.context;
- r.value;
- if (r) {
- context[1].innerHTML = r.UserDomain + ".1473.cn";
- }
- }
- /**
- * 关闭弹窗
- *
- * @param {element} 换页元素
- */
- //U.Word.Panel.Close = function () {
- // var UserID = U.Word.TF.ID;
- // var iframeID = "UD_Word"+UserID;
- //
- //}
- //点击弹出域名管理系统
- U.Word.Panel.Yuming = function () {
- if (!top.$("#U_Boom_Y_B_Manage_Pop")[0]) {
- top.U.Yuming.MC.StateBox(U.Word.TF["fileinfo"].UserallDirectoryName);
- top.U.D.SetDTop(top.$("#U_Boom_Y_B_Manage_Pop")[0]);
- } else {
- top.$("#U_Boom_Y_B_Manage_Pop")[0].style.display = "block";
- top.U.D.SetDTop(top.$("#U_Boom_Y_B_Manage_Pop")[0]);
- }
- }
- //微博分享
- U.Word.Panel.Weibo = function (_UDNA, _UFNM, _USNM) {
- var WBtitle = "这个文档超赞的,赶快分享给大家吧!【" + _USNM + "——(分享自-互联办公)】";
- var sharesinastring = 'http://v.t.sina.com.cn/share/share.php?title=' + WBtitle + '&url=' + _UDNA.innerHTML + '&content=utf-8&sourceUrl=' + _UDNA.innerHTML;
- window.open(sharesinastring, 'newwindow', 'height=500,width=800,top=300,left=300');
- }
- //QQ空间分享
- U.Word.Panel.Kongjian = function (_UDNA, _UFNM, _USNM) {
- var KJtitle = "分享是种乐趣,所以让我们成为传播乐趣的人吧!【" + _USNM + "——(分享自-互联办公)】";
- var shareqqzonestring = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?summary=' + _UFNM + '&title=' + KJtitle + '&url=' + _UDNA.innerHTML;
- window.open(shareqqzonestring, 'newwindow', 'height=500,width=800,top=300,left=300');
- }
- //#endregion
- //#region 历史记录
- /**
- * 初始化加载模板
- *
- * @param
- */
- U.Word.Panel.LoadOfficeHistory = function (fileinfo) {
- var _UDOD, _UDTD, _USM, _UW;
- if (!$("#U_Boom_CO_Editor_body_left_invite_history")[0]) {
- _UDTD = $("#U_Boom_CO_Editor_body_left")[0];
- _USM = U.M.GetElementInfo($("#UD_SYQXR")[0]);
- _UW = _USM["OW"] + 50;
- //编辑历史
- _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user", "id": "U_Boom_CO_Editor_body_left_invite_history" });
- U.UI.Form({
- min: false, max: false, draw: false, SO: _UDTD,
- content: _UDOD, title: "<div class='UD_SYF_STI'>编辑历史</div>", className: "UD_SYF_S",
- hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
- bst: {},
- style: {
- "width": "300px", "height": "250px", "position": "absolute", "top": "300px", "left": _UW + "px", "border-radius": "0px",
- "border": "1px #d6dff0 solid"
- }
- });
- }
- if (fileinfo) {
- U.Word.Panel.ViewEditHistory(fileinfo.UserDirectoryID, U.Word.TF.historyid, 1, 10); //历史记录
- } else {
- $$("div", { "innerHTML": "暂无历史", "style": { "text-align": "center", "margin-top": "50px" } }, _UDOD);
- }
- }
- /**
- * 插入历史
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.InsertOfficeHistory = function (UFID, userid, UTH) {
- var UHID = Guid.newGuid();
- U.A.Request(US.CD, [US.DB, "UseStudio_Office", "InsertDocumentModifyRecord", UHID, userid, UTH.escapeQuotes(), UFID]), U.M.apply(), [];
- }
- /**
- * 查看编辑历史
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.ViewEditHistory = function (UDID, UOID, S, E, UDOD) {//创始人id 文件id 空的id 选取开始 选取长度 获取编辑历史的框
- // setInterval(function () {
- UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_invite_history")[0];
- U.A.Request(US.CD, [US.DB, "UseStudio_Office", "SelectOfficeHistory", UDID, UOID, S, E], U.Word.Panel.AsynViewEditHistory, [null, UDOD]);
- // }, 1000)
- }
- /**
- * 查看编辑历史异步
- *
- * @param {element} 换页元素
- */
- U.Word.Panel.AsynViewEditHistory = function (r) {
- var _UDOD, _UDTD, _UDSD, _UDFDC,
- context = r.context,
- _UDE = r.value,
- _UDFD = $(context[1]);
- if (_UDE.length == 0 && !$("#U_Boom_CO_Editor_History_N")[0]) {//如果UDE不存在值则显示暂无历史
- $$("div", { "innerHTML": "暂无历史", "id": "U_Boom_CO_Editor_History_N", "style": { "text-align": "center", "margin-top": "50px" } }, _UDFD[0]);
- }
- //大概意思是 将最新一条的historyid设为一个值 ,如果获取最新的一条数据的historyid与一个值不一样则获取这条数据 如果相等则不获取
- else if (U.Word.TF.historyid != _UDE[0].HistoryId && U.Word.TF.historyid != "00000000-0000-0000-0000-000000000000") {
- if (_UDE) { $("#U_Boom_CO_Editor_History_N")[0] && $("#U_Boom_CO_Editor_History_N").remove(); } //第一次保存后 删除"暂无历史"文字
- var _UDOD = document.createElement("div");
- _UDOD.className = "U_Boom_CO_Editor_body_right_user_o";
- _UDOD.id = _UDE[0].FileId;
- $(context[1])[0].insertBefore(_UDOD, $(context[1])[0].childNodes[0]);
- // _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o", "id": _UDE[0].FileId }, _UDFD[0]);
- _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_l" }, _UDOD);
- $$("img", { "src": U.M.GetImgU(_UDE[0].UseFilesServerThumbnailName) }, _UDTD);
- _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r" }, _UDOD);
- _UDSD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s" }, _UDTD);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s_l", "innerHTML": _UDE[0].UserNickName || _UDE[0].UserName }, _UDSD);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s_r", "innerHTML": U.MT.getDateInterval(_UDE[0].CreateTime, "String") + "保存更新" }, _UDSD);
- _UDSD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_x" }, _UDTD);
- (_UDE[0].UserId != US.userInfo.userid) && $$("div", { "innerHTML": "对话", "style": { "margin-right": "10px" }, "onclick": [[]] }, _UDSD);
- $$("div", { "innerHTML": "详情", "onclick": [[U.Word.Panel.EditHistory, [_UDE[0]]]] }, _UDSD);
- U.Word.TF.historyid = _UDE[0].HistoryId; //记录此条历史记录为最新U.Word.TF.historyid
- }
- else {//加载编辑历史数据
- if (_UDE) { $("#U_Boom_CO_Editor_History_N")[0] && $("#U_Boom_CO_Editor_History_N").remove(); } //第一次保存后 删除"暂无历史"文字
- for (a = 0; a < _UDE.length; a++) {//获取历史记录数据的长度
- _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o", "id": _UDE[a].FileId }, _UDFD[0]);
- _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_l" }, _UDOD);
- $$("img", { "src": U.M.GetImgU(_UDE[a].UseFilesServerThumbnailName) }, _UDTD);
- _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r" }, _UDOD);
- _UDSD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s" }, _UDTD);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s_l", "innerHTML": _UDE[a].UserNickName || _UDE[a].UserName }, _UDSD);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s_r", "innerHTML": U.MT.getDateInterval(_UDE[a].CreateTime, "String") + "保存更新" }, _UDSD);
- _UDSD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_x" }, _UDTD);
- (_UDE[a].UserId != US.userInfo.userid) && $$("div", { "innerHTML": "对话", "style": { "margin-right": "10px" }, "onclick": [[]] }, _UDSD);
- $$("div", { "innerHTML": "详情", "onclick": [[U.Word.Panel.EditHistory, [_UDE[a]]]] }, _UDSD);
- U.Word.TF.historyid = _UDE[0].HistoryId;
- }
- _UDSA = _UDFD[0].parentNode.parentNode;
- _UDFD[0].parentNode.style.height = "190px"
- divall = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_all" }, _UDSA);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_all_a", "innerHTML": "显示全部", "onclick": [U.Word.Panel.EditHistoryonc] }, divall);
- if (_UDE.length == 1 && (_UDFDC = _UDFD.Child()).length > 0) { _UDFD.append(_UDFDC[_UDFDC.length - 1], "", _UDSD[0]); }
- //记录最新历史记录的id
- //U.Word.TF.historyid = _UDE[0].HistoryId;
- //U.Word.TF.historyid = _UDE[_UDE.length - 1].HistoryId; //获取历史记录的历史id
- }
- }
- /**
- * 编辑历史弹出全部
- *
- */
- U.Word.Panel.EditHistoryc = function (UDE) {//此参数为历史记录的信息
- var _UDOD = $$("div"),
- _UCT = top.U.UI.Form({
- content: _UDOD, bst: { "style": { "overflow": "auto" } },
- "style": { "width": "950px", "height": "550px", "overflow": "hidden" },
- title: "历史记录", id: "Bjlsall", draw: false, max: false, min: false
- });
- var i, _UDBD, _UDTD, _UDSD;
- for (var a = 0; a < UDE.length; a++) {//循环历史记录的长度 用来显示多个历史记录在"显示按钮"的打开的窗体上
- _UDBD = $$("div", { "className": "U_Boom_Forms_Other_EditHistory_Container_all", "id": UDE[a].HistoryId + "-" + a }, _UDOD);
- _UDTD = $$("div", { "className": "U_Boom_Forms_Other_EditHistory_Container_Head" }, _UDBD);
- _UDBB = $$("div", { "className": "U_Boom_CO_Editor_body_btn", "innerHTML": "展开", "onclick": U.Word.Panel.btn }, _UDBD);
- $$("div", { "className": "U_Boom_CO_Editor_body_btn_img1" }, _UDBB);
- $$("img", { "src": U.M.GetImgU(UDE[a].UserThumbnailImageHead), "onerror": U.M.ImgError, "alt": UDE[a].UserName, "title": UDE[a].UserName }, _UDTD);
- $$("div", { "innerHTML": (UDE[a].UserNickName) + " " + U.MT.getDateInterval(UDE[a].CreateTime) + " 更改了以下内容" }, _UDTD);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_all_nr", "innerHTML": UDE[a].OfficeContent }, _UDTD);
- }
- }
- /**
- * 点击显示全部
- *
- */
- U.Word.Panel.EditHistoryonc = function () {
- var _wordinfo = U.Word.TF; //word全局变量 包含了uw文件的文件信息 等
- var _fileinfo = _wordinfo["fileinfo"]; //uw文件的文件信息
- var _fileid = _fileinfo.UserDirectoryID;
- var UDOD = $("#U_Boom_CO_Editor_body_left_invite_history")[0]; //历史记录框
- U.A.Request(US.CD, [US.DB, "UseStudio_Office", "SelectOfficeHistory", _fileid, "00000000-0000-0000-0000-000000000000", 1, 10]), U.Word.Panel.OnDisplayD, [null, UDOD]; //
- }
- /**
- * 更新历史弹出全部
- *
- */
- U.Word.Panel.OnDisplayD = function (r) {
- if ($(".U_Boom_CO_Editor_body_right_user_o_r_all")) {//如果存在则删除
- $(".U_Boom_CO_Editor_body_right_user_o_r_all").remove();
- }
- divall = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_all" }, r.context[1].parentNode.parentNode);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_all_a", "innerHTML": "显示全部", "onclick": [U.Word.Panel.EditHistoryonc] }, divall);
- U.Word.Panel.EditHistoryc(r.value);
- }
- /**
- * 编辑历史的展开与关闭
- *
- */
- U.Word.Panel.btn = function () {//编辑历史记录底端的显示全部的展开与关闭
- if (this.parentNode.children[0].lastChild.children[0].scrollHeight > 100) {//根据内容的高度来判断
- if (this.innerText == "展开") {
- this.innerHTML = "收起<div class='U_Boom_CO_Editor_body_btn_img2'></div>";
- this.parentNode.style.cssText = "height:100%;min-height:100px;overflow:visible;float:left;width:95%;"
- this.style.cssText = "margin-right:-7px;"
- }
- else if (this.innerText == "收起") {
- this.innerHTML = "展开<div class='U_Boom_CO_Editor_body_btn_img1'></div>";
- this.parentNode.style.cssText = "height:100px;overflow:hidden;float:none;width:none";
- this.style.cssText = "margin-right: 0px; "
- }
- } else {
- if (this.innerText == "展开") {
- this.innerHTML = "收起<div class='U_Boom_CO_Editor_body_btn_img2'></div>";
- this.parentNode.style.cssText = "height:100%;min-height:100px;overflow:visible;float:left;width:95%;"
- this.style.cssText = "margin-right:-7px;"
- }
- else if (this.innerText == "收起") {
- this.innerHTML = "展开<div class='U_Boom_CO_Editor_body_btn_img1'></div>";
- this.parentNode.style.cssText = "height:100px;overflow:hidden;";
- this.style.cssText = "margin-right: 0px;"
- }
- }
- }
- /**
- * 编辑历史弹出
- *
- */
- U.Word.Panel.EditHistory = function (UDE) {//此参数为历史记录的信息
- var _UDOD = $$("div"),
- _UCT = top.U.UI.Form({
- content: _UDOD, bst: { "style": { "overflow": "auto" } },
- "style": { "width": "900px", "height": "550px", "overflow": "hidden" },
- title: "历史记录", id: "Bjls", draw: true, max: true, min: false
- });
- U.A.Request(US.CD, [US.DB, "Usestudio_Office", "SelectHistoryDetails", UDE.HistoryId], U.Word.Panel.AsynEditHistory, [_UDOD, UDE]);
- }
- /**
- * 编辑历史弹出异步
- *
- */
- U.Word.Panel.AsynEditHistory = function (r) {
- var i, _UDOD = r.context[0], _UDBD, _UDTD, _UDSD, _UDATA = r.value, _L = _UDATA.length;
- for (i = 0; i < _L; i++) {
- _UDBD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container" }, _UDOD);
- _UDTD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container_Head" }, _UDBD);
- $$("img", { "src": U.M.GetImgU(_UDATA[i].UserThumbnailImageHead), "onerror": U.M.ImgError, "alt": r.context[1].UserName /*_UDATA[i].UserName*/, "title": r.context[1].UserName/*_UDATA[i].UserName*/ }, _UDTD);
- $$("div", { "innerHTML": (r.context[1].UserNickName/*_UDATA[i].UserNickName || _UDATA[i].UserName*/) + " " + U.MT.getDateInterval(_UDATA[i].CreateTime) + " 更改了以下内容" }, _UDTD);
- $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_nr", "innerHTML": _UDATA[i].OfficeContent }, _UDTD);
- }
- }
- //U.Word.ViewDisplayon = function () {//功能区域关闭
- // var UDAA = $("#U_Boom_CO_Editor_body_left")[0].childNodes; //获取功能区域
- // var UDWD = $("#U_Boom_CO_Editor_body_left .UD_SYF_S"); //获取功能区域
- // var UDOD_yq_colse = $(".UD_SYF_S"); //获取获取功能区域的关闭按钮
- // UDOD_yq_colse[1].childNodes[4].firstChild.onclick = function () {//邀请协作人员关闭
- // U.D.CloseWindow(UDWD[0]);
- // UDWD[1].style.top = UDWD[1].offsetTop - 270 + "px";
- // UDWD[2].style.top = UDWD[2].offsetTop - 270 + "px";
- // UDWD[3].style.top = UDWD[3].offsetTop - 270 + "px";
- // }
- // UDOD_yq_colse[4].childNodes[4].firstChild.onclick = function () {//编辑历史关闭
- // U.D.CloseWindow(UDWD[3]);
- // UDWD[2].style.top = UDWD[2].offsetTop - 270 + "px";
- // UDWD[3].style.top = UDWD[3].offsetTop - 270 + "px";
- // }
- // UDOD_yq_colse[2].childNodes[4].firstChild.onclick = function () {//生成链接关闭
- // U.D.CloseWindow(UDWD[1]);
- // UDWD[3].style.top = UDWD[3].offsetTop - 270 + "px";
- // }
- // UDOD_yq_colse[3].childNodes[4].firstChild.onclick = function () {//热门模板关闭
- // U.D.CloseWindow(UDWD[2]);
- // }
- //}
- /**
- * 打开历史记录
- *
- * @param {element} 换页元素
- */
- //U.Word.Openhistory = function (UDE) {
- // U.UI.Form({ draw: false, max: false, id: "U_Boom_CO_History", content: "", title: "历史记录", hst: { style: { "padding": "0 0 0 10px"} }, bst: { "style": { overflow: "hidden"}} }); //创建窗体
- // U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "SelectHistoryDetails", UDE.HistoryId], U.Word.AsynOpenhistory, []);
- //}
- /**
- * 打开异步
- *
- * @param {element} 换页元素
- */
- //U.Word.AsynOpenhistory = function (r) {
- // var context = r.context,
- // _UDOD = context[0];
- // r = r.value;
- // if (r != -1) {
- // _UDOD.inenrHTML = r.OfficeContent;
- // }
- //}
- //#endregion
|