123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215 |
-
- Namespace.register("U.Word");
- U.Word.TF = { "ID": null, "PID": "", "fileinfo": "", "userid": "", historyid: US.NU };
- US = parent.US;
- window.onload = function () {
- U.D.TopForm();
- U.M.ShieldedRightAndSelect();
- var _fileid = U.M.QueryString("ID");
- if (_fileid) {
- parent.U.A.Request(US.Auth, ["GetFileContent", _fileid], U.Word.AsynGOF, [[$("body")[0], true]]);
- };
- }
- U.Word.AsynGOF = function (r, UDOD) {
- var _result = r.value.UsOffice || "";
-
-
- U.M.loadHtml(document.body, _result);
- return true;
- }
- U.Word.Load = function (fileid, fileinfo, uid, iframe) {
-
- U.Word.Variable(fileid, fileinfo, uid, iframe);
- U.Word.Panel.Loadeditor(fileinfo);
- U.Word.Panel.LoadPlayUser(fileinfo);
- U.Word.Panel.Loadlink(fileinfo);
- U.Word.Panel.LoadHotTemplates();
- U.Word.Panel.LoadOfficeHistory(fileinfo);
- U.Word.LoadContent(fileid, fileinfo);
- U.Word.timelyUpdate();
- }
- U.Word.LoadContent = function (fileid, fileinfo) {
-
- var hascontent;
- if (fileinfo) {
- hascontent = U.Ut.isString(fileinfo.UsOffice);
- }
-
- if (fileid && !hascontent) {
- parent.U.A.Request(US.Auth, ["GetFileContent", fileid], U.Word.AsynLoad, ["", fileid, fileinfo]);
- return;
- }
-
- U.Word.OLWord(fileinfo);
- }
- U.Word.AsynLoad = function (r) {
- var context = r.context,
- _fileid = context[1],
- _fileinfo = context[2],
- _uid = context[3],
- r = r.value;
- _fileinfo.UsOffice = r.UsOffice || "";
- U.Word.LoadContent(_fileid, _fileinfo);
- }
- U.Word.Variable = function (fileid, fileinfo, uid, iframe) {
-
- var _UTE = U.Word.TF;
- _UTE.ID = fileid;
- _UTE.userid = uid;
- _UTE.fileinfo = fileinfo;
- _UTE.UDED = iframe;
- }
- U.Word.OLWord = function (fileinfo) {
- var i,
- _content,
- _cursor;
-
- var _child = $("#UD_SYQXR").Child();
- var _editarea = $(_child[_child.length - 1]).Child()[1];
-
-
-
-
- if (!fileinfo) {
- _content = _editarea.innerHTML;
- }
- else {
- _content = fileinfo["UsOffice"];
- }
-
-
- $(_editarea).addAttrArray({
- "innerHTML": "",
- "contentEditable": "true"
- });
-
- _content = U.Word.lastContent(_editarea, _content);
-
-
-
-
- _cursor = U.OU.WordFocus(_editarea, _content, U.Word.Keyboard);
-
-
- _editarea = $(_editarea).Child();
-
- _cursor.QX(1, 1, _editarea[_editarea.length - 1]);
-
- _cursor.CreateR();
- }
- U.Word.lastContent = function (_editarea, content) {
- var _tmp;
- var _content = content;
-
- if (_content) {
- _tmp = $($$("div", { "innerHTML": _content })).Child();
- for (i = 0; i < _tmp.length; i++) {
- if (_tmp[i].className == "U_Boom_CO_Editor_body_main_m") {
- _content = "";
- if (!i) {
- _editarea.innerHTML = $(_tmp[i]).Child()[1].innerHTML;
- }
- else {
-
- U.Word.Page($(_editarea).Parent(), null, $(_tmp[i]).Child()[1].innerHTML);
- }
- }
- }
- }
- else {
- _content = "<div><br /></div>";
- }
- return _content;
- }
- U.Word.CSave = function (cb) {
- if (U.Word.BCWJ()) {
- parent.U.UI.Confirm("是否保存文件", [U.Word.Save, [cb]], UFN);
- }
- else {
- U.M.apply(this, [cb])();
- }
- }
- U.Word.Save = function (cb) {
-
- if (!top.U.U.L.isLogin()) {
-
- var _diskdiv,
- _isdisplay,
- _isopen,
- _isftp,
- _isgroupuser;
- var _wordinfo = U.Word.TF;
- var _fileinfo = _wordinfo["fileinfo"];
- var _uid = _wordinfo.userid;
- var _iframe = _wordinfo.UDED;
- var _worddiv = $(_iframe).Parent({ usform: "true" });
-
- var _editor = $("#UD_SYQXR")[0];
- var _html = _editor.innerHTML.escapeQuotes();
- if (_uid == _wordinfo["userid"] || (_fileinfo && _fileinfo.GroupID == _uid)) {
- _isftp = true;
- }
- if (_fileinfo) {
- _isgroupuser = _$(US.Friend[3]).Select({ "GroupManageID": _fileinfo.UserDirectoryEncrypt, "UserId": US.userInfo.userid })[0];
- }
- var _userdisk = top.U.Dk.DiskOperatingSwitch(US.userInfo.userid);
- if (_fileinfo && (_isftp || _isgroupuser)) {
- top.U.Dk.LE.USOS(_fileinfo, _html, null, cb);
- U.Word.Panel.InsertOfficeHistory(_fileinfo.UserDirectoryID, US.userInfo.userid, _html);
- }
-
-
-
- else {
- _isdisplay = !_userdisk.pdiv || $(_userdisk.pdiv).Parent({ usform: "true" }).style.display == "none";
- _diskdiv = top.U.D.DT.YYDK("Disk", { "userid": _uid, "directoryid": _userdisk ? _userdisk[1][1] : US.DG });
-
- top.U.Dk.RE.CMB("uw", U.M.apply(this, [
- [top.U.Dk.LE.NUSOS, [_html, "uw", _wordinfo]],
- [U.Word.YBKWJ, [U.M.apply(this, [[U.Word.BCAWJMXG, [_worddiv]]])]],
- _isdisplay ? [U.D.CloseWindow, [_diskdiv]] : [U.D.SetDTop, [_worddiv]],
- cb
- ]), _diskdiv, _uid);
- }
- }
- }
- U.Word.BCAWJMXG = function (editordiv, fileinfo) {
- editordiv.id = "UD_Word" + fileinfo.UserDirectoryID;
- $("input", editordiv)[0].value = fileinfo.UserallDirectoryName;
- }
- U.Word.BCWJ = function () {
- var _wordinfo = U.Word.TF,
- _uid = US.userInfo.userid,
- _fileinfo = _wordinfo["fileinfo"],
- _contentdiv = $$("div", { "innerHTML": _fileinfo.UsOffice }),
- _editor = $("#UD_SYQXR")[0];
- if (_fileinfo.UsOffice == null) {
- return 1;
- }
- else if (_wordinfo["ID"] && _fileinfo.UsOffice && _editor.innerHTML != _contentdiv.innerHTML) {
- return 3;
- }
- return 0;
- }
- U.Word.YBKWJ = function (cb, filesinfo) {
- var _fileinfo = filesinfo[1];
- _fileinfo["UsOffice"] = $("#UD_SYQXR")[0].innerHTML;
- U.Word.TF.fileinfo = _fileinfo;
- U.Word.TF.PID = _fileinfo.UserDirectoryParentID;
- U.Word.TF.ID = _fileinfo.UserDirectoryID;
- U.Word.TF.userid = _fileinfo.UserId || top.US.userInfo.userid;
- if (U.Ut.isFunction(cb)) { cb(_fileinfo); }
- }
- U.Word.Backup = function () {
- var _isuser,
- _isgroup;
- var _wordinfo = U.Word.TF;
- var _fileinfo = _wordinfo.fileinfo;
- if (_fileinfo) {
- _isuser = _fileinfo.UserId == US.userInfo.userid;
- _isgroup = _fileinfo.UserDirectoryEncrypt && _$(US.Friend[3]).Select({ "GroupManageID": _fileinfo.UserDirectoryEncrypt, "UserId": US.userInfo.userid })[0];
- if (_isuser || _isgroup) {
- U.Dk.DiskOperatingSwitch(US.userInfo.userid);
-
- U.Dk.VW.CCWPXZK(UDE.UserDirectoryParentID, {
- De: U.Word.BackupDe,
- onclick: U.M.apply(null, [
- [U.Word.OpenBF, [UW]]
- ]),
- Bo: {
- ok: U.M.apply(null, [
- [U.Word.OBackup, [UDE]]
- ])
- }
- }, "Other", UDE.UserDirectoryID, U.Dk.VW.APWPTP);
- }
- else {
- U.Alert("无法备份他人文件");
- }
- }
- else {
- U.Word.WBH("", "Save", true);
- }
- }
- U.Word.BackupDe = function (backupdiv, fileinfo) {
- U.UI.Confirm("是否删除该备份", [U.M.apply(null, [[U.Word.NBackupDe, [fileinfo, backupdiv]]])]);
- }
- U.Word.NBackupDe = function (backupdiv, fileinfo) {
-
- }
- U.Word.OBackup = function (fileinfo, dirid) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "AddBackupFile", fileinfo.UserDirectoryID], U.Word.AsynOBackup, [null, fileinfo, dirid]);
- }
- U.Word.AsynOBackup = function (r) {
- r = r.value;
- var context = r.context;
- if (r) {
- U.Alert("备份成功");
- }
- }
- U.Word.OpenBF = function (fileinfo) {
- U.UI.Confirm("是否选中该备份", [U.Word.OpenNBF, [fileinfo]]);
- }
- U.Word.OpenNBF = function (fileinfo) {
- U.Alert("文件正在加载中");
- U.A.Request(US.Auth, ["GetFileContent", fileinfo.UserDirectoryID], U.Word.AsynOpenBF, ["", fileinfo]);
- }
- U.Word.AsynOpenBF = function (r) {
- var _editor = $("#UD_SYQXR")[0],
- context = r.context,
- _fileinfo = context[1];
- _fileinfo.UsOffice = r.value;
- U.Word.OLWord(_fileinfo);
- }
- U.Word.InsertTable = function () {
- var _UDTD, _UDSD, _UDKD, _UDMB
- _UDOD = $$("div", { "class": "U_Boom_CO_Popup_16" });
- _UDMB = $$("div", { "class": "U_Boom_CO_Popup_16_main" }, _UDOD);
- for (var i = 0; i < 7; i++) {
- for (var j = 0; j < 8; j++) {
- var a = $$("div", { "class": "U_Boom_CO_Popup_16_block", "style": { "top": i * 25 + 'px', "left": j * 26 + 'px'} }, _UDMB);
- a.x = j;
- a.y = i;
- a.onmouseover = function () {
- U.Word.SelectTable(this.x, this.y)
- }
- a.onmousedown = function () {
- U.Word.AsynInsertTable(this.x + 1, this.y + 1)
- }
- }
- }
- $$("div", { "innerHTML": "直接插入", "style": { "position": "absolute", "top": "180px"} }, _UDMB).onclick = function () {
- $(".U_Boom_CO_Popup_16_main")[0].style.display = 'none';
- $(".U_Boom_CO_Popup_16_main")[1].style.display = 'block';
- };
- _UDMB = $$("div", { "class": "U_Boom_CO_Popup_16_main", "style": { "display": "none"} }, _UDOD);
- $$("div", { "class": "U_Boom_CO_Popup_16_title", "innerHTML": "表格尺寸" }, _UDMB);
- _UDTD = $$("div", { "class": "U_Boom_CO_Popup_16_OneLine" }, _UDMB);
- _UDKD = $$("div", { "class": "U_Boom_CO_Popup_16_OneLine" }, _UDMB);
- $$("span", { "innerHTML": "列数:" }, _UDTD);
- var _h = $$("input", { "id": "U_w_table_line" }, _UDTD);
- $$("span", { "innerHTML": "行数:" }, _UDKD);
- var _l = $$("input", { "id": "U_w_table_column" }, _UDKD);
- $$("div", { "innerHTML": "表格宽度", "class": "U_Boom_CO_Popup_16_title" }, _UDMB);
- _UDTD = $$("div", { "class": "U_Boom_CO_Popup_16_OneLine" }, _UDMB);
- _UDSD = $$("span", { "innerHTML": "宽度" }, _UDTD);
- $$("span", { "innerHTML": "mm", "style": { "float": "right", "text-indent": "5px"} }, _UDTD);
- $$("input", { "id": "U_w_table_width", "value": "1", "style": { "width": "50px"} }, _UDTD);
- U.UI.Confirm("插入表格", { "width": "230px", "height": "auto" }, null, [U.Word.AsynInsertTable, [_h, _l]], _UDOD);
- }
- U.Word.SelectTable = function (x, y) {
- var xx = (x % 7) + 1;
- var yy = (y % 9) + 1;
- var a = $(".U_Boom_CO_Popup_16_block");
- for (var i = 0; i < a.length; i++) {
- a[i].style.borderColor = '#9e9e9e';
- }
- for (var i = 0; i < yy; i++) {
- for (var j = 0; j < xx; j++) {
- a[j + 8 * i].style.borderColor = '#38f';
- }
- }
- }
- U.Word.KeyFlage = null;
- U.Word.MouseMenu = $("#UD_SYQER")[0];
- U.Word.AsynInsertTable = function (x, y, node) {
- var container;
- if (!x && !y) {
- U.Alert('请输入数据')
- } else {
- if (typeof x == 'object' || typeof y == 'object') {
- x = x.value;
- y = y.value;
- }
- }
- if (!node) {
- node = $(".U_Boom_CO_Editor_body_main_text")[0]
- container = $$("table", { "border": "0", "class": "U_Boom_Table", "cellpadding": "0", "cellspacing": "0" }, node);
- } else {
- container = node;
- }
- container = $$("tbody", {}, container);
- container.onkeydown = function (e) {
- if (e.ctrlKey) {
- U.Word.KeyFlage = true;
- }
- };
- container.onkeyup = function () {
- U.Word.KeyFlage = null;
- };
- for (var i = 0; i < y; i++) {
- var a = $$("tr", { "class": "U_Boom_Table_Line" }, container);
- for (var j = 0; j < x; j++) {
- var b = $$("td", { "class": "U_Boom_Table_Column" }, a);
- b.onmousedown = function (e) {
- if (e.button == 2) {
- U.M.RLocate(U.Word.MouseMenu);
- } else {
- U.Word.MouseMenu.removeAttribute('style');
- }
- U.Word.EditTable(this, e);
- };
- b.h = j;
- b.l = i;
- }
- }
- if ($("#U_COF")[0]) {
- $("#U_COF")[0].style.display = 'none';
- }
- };
- U.Word.ResizeTable = function (control, e) {
- e.stopPropagation();
- e.preventDefault();
- var startX, container = control.parentNode;
- var ThisTable = container.parentNode.parentNode.parentNode, count,
- offsetX = container.offsetLeft - ThisTable.getBoundingClientRect().left;
- offsetY = container.offsetHeight - ThisTable.getBoundingClientRect().top;
- startX = e.pageX - ThisTable.getBoundingClientRect().left;
- document.onmousemove = function (e) {
- var ThisLine = container.parentNode;
- var TabelLine = ThisTable.getElementsByClassName("U_Boom_Table_Content");
- var TablePreparColumn = [],
- TableElseColumn = [];
- for (var i = 0; i < ThisLine.childNodes.length; i++) {
- if (ThisLine.childNodes[i] == container) {
- count = i;
- }
- }
- for (var i = 0; i < TabelLine.length; i++) {
- for (var k = 0; k < TabelLine[i].childNodes.length; k++) {
- if (k == count) {
- TablePreparColumn.push(TabelLine[i].childNodes[k]);
- }
- if (k > count) {
- TableElseColumn.push(TabelLine[i].childNodes[k]);
- }
- }
- }
- var endX = e.pageX - ThisTable.getBoundingClientRect().left - offsetX;
- var cutX = (endX - startX) / (TableElseColumn.length / TabelLine.length);
- for (var j = 0; j < TablePreparColumn.length; j++) {
- TablePreparColumn[j].style.width = endX + 'px';
- }
- for (var l = 0; l < TableElseColumn.length; l++) {
- if (cutX > 0) {
- TableElseColumn[l].style.width = TableElseColumn[l].offsetWidth - cutX + 'px';
- } else {
- TableElseColumn[l].style.width = TableElseColumn[l].offsetWidth + Math.abs(cutX) + 'px';
- }
- TableElseColumn[l].style.background = "yellow";
- }
- startX = e.pageX - ThisTable.getBoundingClientRect().left;
- TablePreparColumn = [];
- TableElseColumn = [];
- };
- document.onmouseup = function () {
- document.onmousemove = null;
- document.onmouseup = null;
- }
- };
- U.Word.EditTable = function (this_column, e) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- };
- U.Word.ColumnControl = function (fx) {
- var column = $(".U_Boom_Table_Column");
- var selectColumn = [];
- var OperateColumn = [];
- for (var i = 0; i < column.length; i++) {
- if (column[i].state) {
- selectColumn.push(column[i])
- }
- }
- if (fx == 'split') {
- if (selectColumn.length > 1) {
- U.Alert('请选择一个单元格');
-
- for (var i = 0; i < elm.length; i++) {
- elm[i].removeAttribute('style');
- }
- } else {
- var _UDMB = $$("div", { "class": "U_Boom_CO_Popup_16", "style": { "height": "110px"} });
- var UDHD = $$("div", { "class": "U_Boom_CO_Popup_16_main" }, _UDMB);
- $$("div", { "class": "U_Boom_CO_Popup_16_title", "innerHTML": "拆分大小" }, UDHD);
- var _UDTD = $$("div", { "class": "U_Boom_CO_Popup_16_OneLine" }, _UDMB);
- var _UDKD = $$("div", { "class": "U_Boom_CO_Popup_16_OneLine" }, _UDMB);
- $$("span", { "innerHTML": "列数:" }, _UDTD);
- var _l = $$("input", { "id": "U_w_table_line", "value": "2" }, _UDTD);
- $$("span", { "innerHTML": "行数:" }, _UDKD);
- var _h = $$("input", { "id": "U_w_table_column", "value": "2" }, _UDKD);
- var _CUM = new U.UI.Confirm("拆分单元格", { "width": "350px", "text-align": "center" }, null, U.M.apply(null, [[U.Word.AsynInsertTable, [_h, _l, selectColumn[0]]]]), _UDMB);
- }
- } else {
- U.Alert('暂无法使用');
- U.Word.KeyFlage = null;
- U.Word.MouseMenu.removeAttribute('style');
- return false;
-
- var x = selectColumn[0].h, y = selectColumn[0].l;
- var width = 0, content = '';
- for (var i = 0; i < selectColumn.length; i++) {
- if (selectColumn[i].h == y) {
- OperateColumn.push(selectColumn[i]);
- x = selectColumn[i].l, y = selectColumn[i].h;
- }
- }
- for (var j = 1; j < OperateColumn.length; j++) {
- width = OperateColumn[j].parentNode.offsetWidth + width;
- content = OperateColumn[j].innerHTML + content;
- OperateColumn[j].parentNode.remove();
- }
- OperateColumn[0].parentNode.style.width = OperateColumn[0].offsetWidth + width + 'px';
- OperateColumn[0].innerHTML += content;
- }
- U.Word.KeyFlage = null;
- U.Word.MouseMenu.removeAttribute('style');
- };
- U.Word.InserDirectory = function () {
-
-
-
-
-
-
-
-
-
- }
- U.Word.AsynInserDirectory = function () {
- }
- U.Word.PaperSize = function (UDOD) {
- var i, _UDPD,
- _ClassName = [],
- _UDTD = $("#UD_SYQXR"),
- _UDOD = $$("div", { "class": "U_Boom_CO_Popup_14" }),
- _PaperSize = [
- { "name": "A3", "class": "U_Boom_CO_PaperA3", "size": "29.7厘米 × 42厘米" },
- { "name": "A4", "class": "U_Boom_CO_PaperA4", "size": "21厘米 × 29.7厘米" },
- { "name": "A5", "class": "U_Boom_CO_PaperA5", "size": "14.8厘米 × 21厘米" },
- { "name": "Web", "class": "U_Boom_CO_PaperWeb", "size": "占满屏幕" }
- ];
- $$("div", { "innerHTML": "选择纸张大小", "class": "U_Boom_CO_Popup_14_Title" }, _UDOD);
- for (i = 0; i < _PaperSize.length; i++) {
- _UDPD = $$("div", { "class": "U_Boom_CO_Popup_14_Main", "onclick": [[U.Word.AsynPaperSize, [_PaperSize[i]["class"]]]] }, _UDOD);
- $$("div", { "innerHTML": _PaperSize[i].name, "class": "U_Boom_CO_Popup_14_Main_Name" }, _UDPD);
- $$("div", { "innerHTML": _PaperSize[i].size }, _UDPD)
- }
- for (i = 0; i < 1; i++) {
- _ClassName.push(_UDTD[0].className);
- _UDTD = _UDTD.childg(0)[0];
- }
- top.U.UI.Confirm("纸张大小", { "width": "330px", "height": "auto" }, [U.Word.AsynPaperSize, [_UDOD]], [U.Word.CancelPaperSize, [_ClassName]], _UDOD);
- }
- U.Word.SetPaperSize = function (ClassName) {
- var i, _UDTD = $("#UD_SYQXR");
- var _user = $("#U_Boom_CO_Editor_body_left")[0].childNodes[1];
- var _history = $("#U_Boom_CO_Editor_body_left")[0].childNodes[2];
- var _pay = $("#U_Boom_CO_Editor_body_left")[0].childNodes[3];
- var _hot = $("#U_Boom_CO_Editor_body_left")[0].childNodes[4];
- $("#UD_SYQXR")[0].style.cssText = "min-width:148mm"
- _UDTD[0].className = ClassName[0];
- _UDTD[0].children[0].children[1].className = ClassName[1];
- _UDTD[0].children[0].className = ClassName[2];
- _user.style.left = _history.style.left = _pay.style.left = _hot.style.left = _UDTD[0].clientWidth + 88 + "px";
- _UDTD = _UDTD.childg(0)[0];
- }
- U.Word.AsynPaperSize = function (className) {
- U.Word.SetPaperSize["U_Boom_CO_Editor_body_main " + className, "U_Boom_CO_Editor_body_main_text " + className + "C", "U_Boom_CO_Editor_body_main_m " + className];
- $[$("#U_Boom_CO_Editor_body_left")[0], $("#U_Boom_CO_Editor_body_right")[0]].css("display", className == "U_Boom_CO_PaperWeb" ? "none" : "block");
- }
- U.Word.Keyboard = function (UTF, UDE, UTE, UT, UWE) {
- var i, _UTH, _UWH, _UDTD, _UDAD, _UDPD, _UDND, _UDFD;
- if (UTF == "UP") {
-
-
-
-
-
-
-
- }
- else if (UTF == "Cut") {
- }
- else if (UTF == "Copy") {
- }
- else if (UTF == "Paste") {
-
-
-
-
-
-
-
-
-
-
- }
-
- else {
- switch (UTF) {
- case "Backspace":
- _UDTD = UTE.PSO;
- _UDAD = $(_UDTD).Child();
- if ((_UDAD.length < 1 || (_UDAD.length == 1 && _UDAD[0].innerText.replace(/\u200b/g, "").length < 2)) || UTE.GetSelectedText() == _UDTD.innerText) {
- U.M.StopDefault();
- this.CreateR();
- _UDPD = UTE.Parent(null, true);
- if (!U.Word.delPage(_UDTD, UTE)) {
- UTE.moveRange();
- UTE.Replace("<br />");
- UTE.QX(1, 1, _UDPD);
- }
- }
- break;
- case "Delete":
- break;
- case "save":
- U.M.StopDefault();
- U.Word.Save();
- break;
- case "replace":
- alert();
- break;
- case "copy":
- break;
- case "paste":
- break;
- case "selectAll":
- break;
- case "redo":
- break;
- case "undo":
- break;
- default:
- if (!(UT[1] || UT[2]) && !(UT[0] == 8 || UT[0] == 3 || UT[0] == 46 || (UT[0] > 63231 && UT[0] < 63236) || (UT[0] > 63272 && UT[0] < 63278 && UT[0] != 63274))) {
- this.CreateR();
- _UDPD = $(UTE.Parent(null, true)).Parent({ "tagName": "DIV" });
- _UTH = UTE.getBoundingClientRect();
-
- if ((_UDPD.offsetTop + (_UDPD.offsetHeight * 2) - UTE.PSO.offsetTop) > UTE.PSO.offsetHeight && ((UTF == "Down" || UTF == "Enter" || (UTF == "Right" && UTE.GetGBWZ() >= _UDPD.innerText.length)) || (_UTH.right - _UDPD.offsetLeft - 20 >= UTE.PSO.offsetWidth))) {
- U.M.StopDefault();
- U.Word.Page($(UTE.PSO).Parent());
- }
- else if ((_UDPD.offsetTop + (_UDPD.offsetHeight * 2) - UTE.PSO.offsetTop) > UTE.PSO.offsetHeight && UTF == "Delete") {
- }
-
- else if (_UDPD.offsetTop - UTE.PSO.offsetTop < 50 && (UTF == "Up" || (UTF == "Left" && _UTH.right < 70))) {
- U.M.StopDefault();
- U.Word.Page($(UTE.PSO).Parent(), UTF);
- }
-
- else if ((_UTH.right - _UDPD.offsetLeft - 20) >= UTE.PSO.offsetWidth || UTF == "Enter") {
-
-
-
-
-
- U.Word.PageData(UTE.PSO, _UDPD);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- break;
- }
- }
-
-
- }
- U.Word.PageData = function (UDPD, UDSD) {
-
- var i, j, k, _UWH, _UDMD, _UDCD,
- _str = "",
- _ptop = UDPD.offsetTop,
- _pheight = UDPD.offsetHeight,
- _height = UDSD.offsetHeight,
- _UDAD = $(UDPD).Child();
-
- for (i = 0; i < _UDAD.length; i++) {
- _UWH = U.M.GetElementInfo(_UDAD[i]);
- if ((_UWH["OH"] + _UWH["OT"]) - UDPD.offsetTop + _height > UDPD.offsetHeight) {
- _UDMD = U.Word.Page($(UDPD).Parent(), null, null, true);
- _UDMD.appendChild(_UDAD[i], _UDMD.firstChild);
-
- }
- }
-
- }
- U.Word.Page = function (currentpage, pagedown, str, b) {
-
- var _pagediv;
- var _header;
- var _editor;
- var _cursor;
- var _footer;
- _wordeditor = $(currentpage).Parent();
-
- if (pagedown) {
- _pagediv = $(currentpage).prev()[0];
- if (_pagediv) {
- _editor = $(_pagediv).Child()[1];
- }
- }
-
- else {
- _pagediv = $(currentpage).next()[0];
-
- if (!_pagediv) {
-
- _pagediv = $$("div", { "className": "U_Boom_CO_Editor_body_main_m" }, _wordeditor);
- _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);
- _editor = $$("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);
-
- if (b !== true) {
- _cursor = U.OU.WordFocus(_editor, str || "<div><br /></div>", U.Word.Keyboard);
- }
- else {
- _editor.innerHTML = str || "<div><br /></div>";
- }
- }
- else {
- _editor = $(_pagediv).Child()[1];
- }
- }
- if (_editor) {
-
- _editor = $(_editor).Child();
- var _line = pagedown ? _editor.length - 1 : 0;
- _editor = _editor[_line];
- if (b !== true) {
- _cursor = U.OU.WordFocus(_editor, false, U.Word.Keyboard);
- _cursor.QX(1, 1, _editor);
- }
- }
- return _editor;
- }
- U.Word.delPage = function (UDOD, UTE) {
- var _UDPD = $(UDOD).Parent();
- _UDSD = $(_UDPD).prev()[0];
- if (_UDSD) {
- $(_UDPD).remove();
- _UDMD = $(_UDSD).Child()[1];
- _UDMD = $(_UDMD).Child() || $(_UDMD);
- _UDMD = _UDMD[_UDMD.length - 1];
- _UDMD.focus();
- if (UTE != null) {
- UTE.QX(1, 1, _UDMD);
- UTE.CreateR(false);
- }
- return true;
- }
- return false;
- }
- document.oncontextmenu = U.M.StopDefault;
- U.Word.NWWJ = function () {
- top.U.D.DT.YYDK("Word", US.userInfo);
- }
- U.Word.XZZDGS = function () {
- top.U.D.Office.ZDGSXZ(U.Word.TF["ID"], "html", U.Word);
- }
- U.Word.GetTemp = function (UTF) {
- var _UDOD = $("#UD_SYQXR")[0];
- if (!_UDOD.innerText.length || _UDOD.innerText == $$("div", { "innerHTML": "​" }).innerText) {
- U.Word.GSTemp(UTF);
- }
- else {
-
- U.Word.GSTemp(UTF);
- }
- }
- U.Word.GSTemp = function (UTF) {
- U.Alert("模板在加载中");
- var _UIS = "";
- if (UTF == "Word" || UTF == "Web") {
- _UIS = UTF; UTF = UTF == "Word" ? "US_O_Meeting" : "US_O_Website";
- }
- U.MD.IframeLoad($$("iframe", { "width": 0, "height": 0, top: true, "style": { "display": "none" }, "src": "/usercontrols/US_Office/Word_Model/html/" + UTF + ".htm?domain=" + document.domain + "&isEmpty=" + _UIS }, document.body), U.Word.AsynGetTemp);
- }
- U.Word.AsynGetTemp = function (UTH) {
- var i,
- _USE,
- _UDOD = $("#UD_SYQXR")[0],
- _child = $(_UDOD).Child(),
- _editarea = $(_child[0]).Child()[1];
- UTH = U.Ut.isString(UTH) ? UTH : this.contentWindow ? this.contentWindow.document.body.innerHTML : null;
- window.isPrint = false;
- U.D.Office.Editable = true;
- U.M.loadHtml(_editarea, UTH);
-
- }
- U.Word.timelyUpdate = function () {
- U.Word.TimeColse();
- U.Word.TimesetInterval = setInterval(function () {
-
- var _wordinfo = U.Word.TF;
- var _fileinfo = _wordinfo["fileinfo"];
- if (_fileinfo) {
- 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, _wordinfo.historyid, 1, 10], U.Word.AsyntimelyUpdate, [null, UDOD]);
-
- U.MD.uploading(UDOD)
- }
- }, 5000)
- }
- U.Word.AsyntimelyUpdate = function (r) {
- var _wordinfo = U.Word.TF;
- var _fileinfo = _wordinfo["fileinfo"];
- var _fileid = _fileinfo.UserDirectoryID;
- if (r.value.length) {
- parent.U.A.Request(US.Auth, ["GetFileContent", _fileid], U.Word.AsynLoad, ["", _fileid, _fileinfo]);
- U.Word.Panel.AsynViewEditHistory(r);
- }
- }
- U.Word.TimeColse = function () {
- clearInterval(U.Word.TimesetInterval)
- }
|