123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580 |
-
- Namespace.register("U.D.Office");
- U.D.Office.Word = function (userinfo, fileinfo, cb) {
-
-
-
-
-
-
- var _UDOD,
- _UDAD,
- _UTF,
- _UDTD,
- _UAE,
- _UDID = (fileinfo && (fileinfo.UserDirectoryID) || fileinfo) || Guid.newGuid();
-
-
-
- if (fileinfo && fileinfo.UserFilesID) {
-
- fileinfo = new U.Dk.M.Entity(fileinfo.UserFilesID, fileinfo.UserFilesSize, fileinfo.UserDirectoryID, fileinfo.UserFilesName, fileinfo.UserFilesName, fileinfo.UserFilesExtendName,
- fileinfo.UserFilesServerName, fileinfo.UserFilesModifyTime, fileinfo.UseFilesServerThumbnailName, 0, fileinfo.UserFilesModifyTime, fileinfo.UserDirectoryEncrypt, 1, "", fileinfo.UserDirectoryEncrypt,
- fileinfo.UsOffice, fileinfo.UserId, "", "", "");
- }
- U.D.SY.ET["UL"].AD = []
-
- if (!(_UDOD = $("#UD_Word" + _UDID)[0]) || $("#UD_Word" + _UDID)[0].id == "UD_Word" + _UDID) {
-
- _UDOD = $("#UD_Word").clone(true);
-
- _UDOD[0].id = "";
-
- _UAE = U.UI.Form({
-
- resize: U.M.apply(null, [
- [U.Word.Tools.WETZ, [_UDOD[0], "Word"]]
- ]),
-
- id: "UD_Word" + _UDID,
-
- style: {
- width: "90%",
- height: "90%"
- },
-
- htask: {
- style: {
- "top": "10px"
- }
- },
- close: {
-
- onclick: U.D.Office.Colse
- }
-
- });
-
- U.Word.Tools.Wordtools(userinfo, "Word", fileinfo, _UDOD[0]);
-
- $(_UAE.body)[0].innerHTML = '';
- $(_UAE.head)[0].innerHTML = '';
-
-
- $(_UAE.head).addAttrArray({
- "className": ""
- }).append(_UDOD.Child()[0]);
-
- $(_UAE.body).append(_UDOD[0]);
-
- U.D.Office.Office(_UDOD[0], userinfo, fileinfo, "Word", U.M.apply(null, [[U.D.Office.AsynWord], [cb]]));
- _UDOD = _UAE.be;
- }
-
- else {
- U.D.PopupWindow(_UDOD);
- }
- return _UDOD;
- }
- U.D.Office.Colse = function () {
-
-
- }
- U.D.Office.AsynWord = function (userinfo, fileinfo, loading, iframe) {
-
-
-
-
-
-
-
-
-
- var _UW = iframe.contentWindow;
- U.MD.uploading(loading);
- U.Word.Tools.WETZ($(loading).Parent(), "Word");
-
-
-
-
- _UW.U.Word.Load(fileinfo ? fileinfo.UserDirectoryID : "", fileinfo, fileinfo ? fileinfo.UserId : userInfo.userid, iframe);
-
-
-
-
-
-
-
- }
- U.D.Office.AsynWordO = function (r) {
- var context = r.context,
- _UCB = context[1];
- r = r.value;
- if (r && (r = r[0])) {
- r = new U.Dk.M.Entity(r.UserFilesID, r.UserFilesSize, r.UserDirectoryID, r.UserFilesName, r.UserFilesName, r.UserFilesExtendName, r.UserFilesServerName, r.UserFilesAddTime, r.UseFilesServerThumbnailName, 9999, r.UserFilesModifyTime, null, 1, null, r.UserDirectoryEncrypt, null, r.UserID, r.UserName, r.UserName, r.UserThumbnailImageHead);
- }
- context.length >= 5 ? _UCB(context[2], r, context[3], context[4]) : _UCB(r, context[2]);
- }
- U.D.Office.Excel = function (UIF, UDE) {
-
-
-
-
-
-
- var _UDOD,
- _UDAD,
- _UTF,
- _UDTD,
- _UAE,
- _UDID = (UDE && (UDE.UserDirectoryID) || UDE) || Guid.newGuid();
-
-
-
- if (UDE && UDE.UserFilesID) {
-
- UDE = new U.Dk.M.Entity(UDE.UserFilesID, UDE.UserFilesSize, UDE.UserDirectoryID, UDE.UserFilesName, UDE.UserFilesName, UDE.UserFilesExtendName,
- UDE.UserFilesServerName, UDE.UserFilesModifyTime, UDE.UseFilesServerThumbnailName, 0, UDE.UserFilesModifyTime, UDE.UserDirectoryEncrypt, 1, "", UDE.UserDirectoryEncrypt,
- UDE.UsOffice, UDE.UserId, "", "", "");
- }
-
- if (!(_UDOD = $("#UD_Excel" + _UDID)[0])) {
-
- _UDOD = $("#UD_Excel").clone(true);
- _UDOD[0].id = "";
-
- U.D.Office.Exceltools(UIF, "Excel", UDE, _UDOD[0]);
-
- _UAE = U.UI.Form({
-
- resize: U.M.apply(null, [
- [U.D.Office.WETZ, [_UDOD[0], "Excel"]]
- ]),
-
- id: "UD_Word" + _UDID,
-
- style: {
- width: "90%",
- height: "90%"
- },
-
- htask: {
- style: {
- "top": "10px"
- }
- }
-
- });
-
- $(_UAE.head).addAttrArray({
- "className": ""
- }).append(_UDOD.Child()[0]);
-
- $(_UAE.body).append(_UDOD[0]);
- U.D.Office.Office(_UDOD[0], UIF, UDE || _UDID, "Excel", U.D.Office.AsynExcel);
- _UDOD = _UAE.be;
- }
- else {
- U.D.PopupWindow(_UDOD);
- }
- return _UDOD;
- }
- U.D.Office.AsynExcel = function (userinfo, fileinfo, loading, iframe) {
-
- var _win = iframe.contentWindow;
- U.MD.uploading(loading);
- U.Word.Tools.WETZ($(loading).Parent(), "Excel");
- var _UDE = {
- "UFN": {
- CoEd: U.D.Office.CoEd,
- Backup: U.M.apply(this, [
- [U.D.Office.Backup, [fileinfo, _win]]
- ]),
- "Onload": U.M.apply(this, [
- [U.D.Office.OLExcel, [US.userInfo, fileinfo, loading, iframe]]
- ]),
- "Save": U.M.apply(this, [
- [U.D.Office.WBCWJ, [fileinfo, "Excel", loading]]
- ])
- }
- };
-
-
-
-
- _win.U.Excel.OPBE(fileinfo ? fileinfo.UserDirectoryID : "", fileinfo, fileinfo ? fileinfo.UserId : userInfo.userid, _UDE);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- U.D.Office.OLExcel = function (UIF, UDE, UDOD, UDFD) {
- var _UW = UDFD.contentWindow,
- _UDPD = $(UDOD).Parent();
- U.MD.uploading(UDOD);
- U.D.Office.WETZ(_UDPD, (_UW.U.OU.TF["TF"] = "Excel"));
- _UW.U.Excel.SetWH();
- _UW.U.Excel.CNO();
- }
- U.D.Office.Office = function (el, userinfo, fileinfo, type, cb) {
-
-
-
-
-
-
- var _file;
- var _iframe = $("iframe", el)[0];
- var _sel = $(el);
- var _child = _sel.Child()[1];
- _sel.css("display", "block");
-
- switch (type) {
- case "Word": _file = "Word.htm"; break;
- case "Excel": _file = "Excel.htm"; break;
- case "PPT": _file = "PPT.htm"; break;
- default: break;
- }
-
-
- if (!_iframe) {
-
- _iframe = $$("iframe", {
- "frameBorder": "0",
- "style": {
- "border": "0"
- },
- "src": "/usercontrols/" + _file,
- "width": "100%",
- "height": "100%"
- }, _child);
- U.MD.loading(_child, true);
-
-
- U.MD.IframeLoad(_iframe, U.M.apply(_iframe, [[cb, [userinfo, fileinfo, _child, _iframe]]]));
- }
- }
- U.D.Office.WUIF = function (UIF, UDOD, UDE) {
- var _UDKD,
- _UDAD = $("div", UDOD),
- _UDTD = $(".U_Boom_CO_Editor_head_navigation_two_r", _UDAD);
- $("input", UDOD)[0].value = (UDE && (UDE["UserallDirectoryName"] || UDE["UserFilesName"])) || "未命名文档(点击编辑)...";
- _UDKD = $$("div", {
- "className": "U_Boom_CO_Editor_head_navigation_two_img"
- });
- $$("img", {
- "onerror": U.M.ImgError,
- "src": U.M.GetImgU(UIF.UserThumbnailImageHead),
- "onclick": [
- [U.M.StopBubble],
- [U.U.I.ViewOtherUserInfo, [UIF.UserId]]
- ]
- }, _UDKD);
- $$("div", {
- "className": "U_Boom_CO_Editor_head_navigation_username",
- "innerHTML": UIF.UserNickName || ""
- });
- $(_UDTD).append(_UDKD);
- }
- U.D.Office.WI = function (el) {
-
- el = el || event.srcElement;
- return $("iframe", $(el).Parent({ usform: "true" }) || el)[0].contentWindow;
- }
- U.D.Office.Local = function (a) {
- a.click();
- U.D.Office.File = a;
- }
- U.D.Office.WBH = function (type, fun, params) {
-
- var _win = U.D.Office.WI();
-
- _win.U[type][fun].apply(this, params);
- }
- U.D.Office.Other = function (UDE, UFN) {
- var _UDOD = U.D.Office.WI();
- U.Word.O.O[UFN].apply(this, UDE);
- }
- U.D.Office.WBYSXG = function (UDOD, TF) {
- var _UDFD = U.D.Office.WI(UDOD),
- _UDTD = event.srcElement,
- _UCE = {};
- _UCE[TF ? "color" : "backgroundColor"] = "";
- if (_UDTD != UDOD && _UDFD) {
- _UDFD.U.OU.ColorLiOnClick(_UDTD, [UDOD.parentNode, _UCE]);
- }
- UDOD.style.display = 'none';
- }
- U.D.Office.WJMXG = function (UDOD) {
- var _UCE,
- _UDE = U.D.Office.WI(UDOD).U;
- _UDE = (_UDE.Word || _UDE.Excel);
- _UCE = (_UDE["SY"] || _UDE["TF"])["ET"];
- if (!U.U.L.isLogin(3) && (_UCE || _UDE.Save(U.M.apply(this, [
- [U.D.Office.BCAWJMXG, ([$(UDOD).Parent({
- usform: "true"
- }), _UCE])]
- ])))) {
- U.MR.InputTip(this, ["未命名文档(点击编辑)...", ""]);
- $(UDOD).addAttrArray({
- "onblur": [
- [U.MR.InputTip, [UDOD, ["", "未命名文档(点击编辑)..."]]],
- [U.D.Office.AWJMXG, [UDOD]]
- ]
- });
- }
- }
- U.D.Office.BCAWJMXG = function (UDOD, UDE) {
- UDOD.id = "UD_Word" + UDE.UserDirectoryID;
- $("input", UDOD)[0].value = UDE.UserallDirectoryName;
- }
- U.D.Office.AWJMXG = function (UDOD) {
- var _UTH = UDOD.value,
- _UDH = UDOD.defaultValue;
- if (!_UTH && _UTH != _UDH) {
- parent.U.Dk.RE.MFN(_UET, _UTH);
- }
- $(UDOD).addAttrArray({
- "value": _UTH || _UDH,
- "onblur": null
- });
- }
- U.D.Office.ZDGSXZ = function (UFID, UTP, UFE) {
- UFE.Save(U.M.apply(null, [
- [U.UI.Confirm, ["是否下载该文件", [U.UP.FileGS, [UFID, UTP]]]]
- ]));
- }
- U.D.Office.QCDJ = function () {
- U.D.Office.se = window.parent.document.getElementsByClassName("U_Boom_CO_Editor_head_features_ul_d_s");
- U.D.Office.cr = $("#U_Boom_O_N_Navg_Ib");
- for (var i = 0; i < U.D.Office.se.length; i++) {
- U.D.Office.se[i].style.display = 'none';
- }
- for (var i = 0; i < U.D.Office.cr.length; i++) {
- U.D.Office.cr[i].style.display = 'none';
- }
- }
|