MWF.xDesktop.requireApp("process.Xform", "Office", null, false); MWF.xApplication.cms.Xform.Office = MWF.CMSOffice = new Class({ Extends: MWF.APPOffice, getFormId: function(){ var id = this.form.businessData.document.id; return "form"+this.json.id+id; }, getFileName: function(){ var ename = "docx"; switch (this.json.officeType){ case "word": ename = "docx"; break; case "excel": ename = "xlsx"; break; case "ppt": ename = "pptx"; } var id = this.form.businessData.document.id; return "file"+this.json.id+id+"."+ename; }, getOfficeObjectId: function(){ var id = this.form.businessData.document.id; return "NTKOOCX"+this.json.id+id; }, getFileInputName: function(){ var id = this.form.businessData.document.id; return "fileInput"+this.json.id+id; }, getFile: function(site){ var file = null; atts = this.form.businessData.attachmentList || []; for (var i=0; i300) str = str.substr(0,300)+"……"; } var text = new Element("div", { "text": str }).inject(this.node); } var text = MWF.xApplication.process.Xform.LP.openOfficeInfor; text = text.replace("{type}", this.json.officeType); var icon = new Element("div", { "styles": { "width": "200px", "height": "24px", "margin": "auto", "margin-top": "18px", "padding-left": "30px", "font-size": "16px", "font-weight": "bold", "color": "#2b5797", "font-family": "Gadugi", "cursor": "pointer", "background": "url("+this.form.path+""+this.form.options.style+"/icon/"+this.json.officeType+".png"+") no-repeat left center" }, "text": text }).inject(this.node); var url = this.getOfficeFileUrl(); if (!url){ this.node.setStyle("display", "none"); } icon.addEvent("click", function(){ var url = this.getOfficeFileUrl(); if (url){ if (window.o2android){ window.o2android.openDocument(url); }else if(window.webkit){ window.webkit.messageHandlers.openDocument.postMessage(url); }else{ window.open(o2.filterUrl(url)); } } }.bind(this)); } });