<meta http-equiv="Refresh" content="0;url=public/noscript.jsp" /> "+p+"" }}else{ p=this._stripHtmlComments(p); if(this._objectManager){ if(A<=z){ r=new AjxCallback(this,this._processHtmlDoc) }else{ this._makeHighlightObjectsDiv() }}} var w; this._isMsgTruncated=false; if(O){ this._isMsgTruncated=true; var y=document.getElementById(this._msgTruncatedId); if(!y){ var o=document.getElementById(this._infoBarId); if(o){ var j={ id:this._msgTruncatedId,text:ZmMsg.messageTooLarge,link:ZmMsg.viewEntireMessage}; var u=AjxTemplate.expand("mail.Message#InformationBar",j); w=Dwt.parseHtmlFragment(u); o.appendChild(w) }}} var m=AjxEnv.isIE?".MsgBody-text, .MsgBody-text * { font: 10pt monospace; }":""; var T={ parent:this,className:"MsgBody",id:ZmId.getViewId(this._viewId,ZmId.MV_MSG_BODY,this._mode),hidden:true,html:p,styles:m,noscroll:!this._scrollWithIframe,posStyle:DwtControl.STATIC_STYLE,processHtmlCallback:r,useKbMgmt:true}; var l=this._ifw=new DwtIframe(T); this._iframeId=l.getIframe().id; var v=l.getDocument(); if(AjxEnv.isGeckoBased){ var g=AjxCallback.simpleClosure(ZmMailMsgView.__localLinkClicked,null,this); var t=v.getElementsByTagName("a"); for(var x=t.length; --x>=0; ){ var d=t[x]; if(!d.target){ d.onclick=g }}} v.body.className=k?"MsgBody MsgBody-text":"MsgBody MsgBody-html"; v.body.style.height="auto"; l.getIframe().onload=AjxCallback.simpleClosure(this._onloadIframe,this,l); var s=v.getElementsByTagName("head")[0]; if(!s){ s=v.createElement("head"); v.body.parentNode.insertBefore(s,v.body) } var d=v.createElement("link"); d.rel="stylesheet"; d.href=appContextPath+"/css/msgview.css?v="+cacheKillerVersion; s.appendChild(d); l.getIframe().style.visibility=""; if(!k){ this._htmlBody=v.body.innerHTML; var f=this._fixMultipartRelatedImages(this._msg,v); if(f){ if(e){ e.style.display="none" }}else{ var n=this._createDisplayImageClickClosure(this._msg,v,this._displayImagesId,l.getIframe()); if(e){ Dwt.setHandler(e,DwtEvent.ONCLICK,n) }else{ if(appCtxt.get(ZmSetting.DISPLAY_EXTERNAL_IMAGES)||(this._msg&&this._msg.showImages)){ n.call() }}}} if(w){ Dwt.setHandler(w,DwtEvent.ONCLICK,AjxCallback.simpleClosure(this._handleMsgTruncated,this)) } this._resetIframeHeightOnTimer(l.getIframe()) }; ZmMailMsgView.prototype._addTrustedAddrCallback=function(i){ this.getTrustedSendersList().add(i,null,true); appCtxt.set(ZmSetting.TRUSTED_ADDR_LIST,this.getTrustedSendersList().getArray()); var e=appCtxt.getApp(ZmApp.PREFERENCES); var t=e&&e.refresh; if(t&&(typeof(t)=="function")){ t.apply(e,[null,i]) }}; ZmMailMsgView.prototype._addTrustedAddrErrorCallback=function(e){ this.getTrustedSendersList().remove(e) }; ZmMailMsgView.prototype._isTrustedSender=function(t){ var e=this.getTrustedSendersList(); if(e.contains(t.sentByAddr)||e.contains(t.sentByDomain)){ return true } return false }; ZmMailMsgView.prototype.getTrustedSendersList=function(){ return this._controller.getApp().getTrustedSendersList() }; ZmMailMsgView.showMore=function(e,i){ var o=document.getElementById(this._getShowMoreId(e,i)); var t=document.getElementById(this._getMoreId(e,i)); o.style.display="none"; t.style.display="inline" }; ZmMailMsgView._getShowMoreId=function(e,t){ return e+"showmore_"+t }; ZmMailMsgView._getMoreId=function(e,t){ return e+"more_addrs_"+t }; ZmMailMsgView.getAddressesFieldHtmlHelper=function(r,m,c,l,u){ var d=0; var n=[]; var o=false; for(var s=0; s0){ n[d++]=m.addrBubbles?" ":AjxStringUtil.htmlEncode(AjxEmailAddress.SEPARATOR) } if(s==ZmMailMsgView.MAX_ADDRESSES_IN_FIELD){ o=true; var t=ZmMailMsgView._getShowMoreId(u,c); var e=ZmMailMsgView._getMoreId(u,c); n[d++]=" "; n[d++]=ZmMsg.showMore; n[d++]="" } return n.join("") }; ZmMailMsgView.prototype.getAddressesFieldHtml=function(i,e,t){ return ZmMailMsgView.getAddressesFieldHtmlHelper(i,e,t,this._objectManager,this._htmlElId) }; ZmMailMsgView.prototype._renderMessage=function(U,R,E){ var p=appCtxt.getActiveAccount().id; var D; if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&appCtxt.getApp(ZmApp.CONTACTS).contactsLoaded[p]){ D=AjxDispatcher.run("GetContacts") } var h=U.subject||ZmMsg.noSubject; var W=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG,AjxDateFormat.SHORT); var l=U.sentDate?W.format(new Date(U.sentDate)):W.format(new Date(U.date)); var k=U.getAddress(AjxEmailAddress.FROM)||ZmMsg.unknown; var r=U.getAddress(AjxEmailAddress.SENDER); var M=(r&&r.address)?r:k; var e=M&&M!=ZmMsg.unknown?M.getAddress():null; if(e){ U.sentByAddr=e; U.sentByDomain=e.substr(e.indexOf("@")+1); U.showImages=this._isTrustedSender(U) } var _t=D?(D.getContactByEmail((M&&M.address)?M.address:e)?"Contact":"NewContact"):null; var _c=r?k:null; var N=_c&&_c!=ZmMsg.unknown?_c.getAddress():null; var x=[]; var z=U.invite; var S=AjxUtil.isDate(U.autoSendTime)?AjxDateFormat.getDateTimeInstance(AjxDateFormat.FULL,AjxDateFormat.MEDIUM).format(U.autoSendTime):null; if(U.attrs){ for(var V in ZmMailMsgView.displayAdditionalHdrsInMsgView){ if(U.attrs[V]){ x.push({ hdrName:ZmMailMsgView.displayAdditionalHdrsInMsgView[V],hdrVal:U.attrs[V]} ) }}} var J=appCtxt.getApp(ZmApp.CONTACTS); if(J){ var u=[]; if(M){ u.push(M) } if(_c){ u.push(_c) } for(var _o=1; _o1){ J.setAddrLookupGroup(u) }} var O={}; O.addrBubbles=appCtxt.get(ZmSetting.USE_ADDR_BUBBLES); O.shortAddress=appCtxt.get(ZmSetting.SHORT_ADDRESS); if(this._objectManager){ this._lazyCreateObjectManager(); appCtxt.notifyZimlets("onFindMsgObjects",[U,this._objectManager,this]); this._objectManager.setHandlerAttr(ZmObjectManager.DATE,ZmObjectManager.ATTR_CURRENT_DATE,this._dateObjectHandlerDate); h=this._objectManager.findObjects(h,true); M=this._objectManager.findObjects(M,true,ZmObjectManager.EMAIL,false,O); l=this._objectManager.findObjects(l,true,ZmObjectManager.DATE); if(_c){ _c=this._objectManager.findObjects(k,true,ZmObjectManager.EMAIL,false,O) }}else{ M=AjxStringUtil.htmlEncode(M.toString()); if(_c){ _c=AjxStringUtil.htmlEncode(_c.toString()) }} var Z=[]; for(var _o=1; _o0){ var Y=AjxStringUtil.htmlEncode(ZmMsg[AjxEmailAddress.TYPE_STRING[_d]]); var o=this.getAddressesFieldHtml(A,O,_d); Z.push({ prefix:Y,partStr:o} ) }} var P=!appCtxt.get(ZmSetting.VIEW_AS_HTML); var _u=U.getAttachmentLinks(true,P,true).length; var q=(this._mode==ZmId.VIEW_MSG&&!appCtxt.isChildWindow); var _e=appCtxt.getById(U.folderId); var B=(_e&&_e.nId==ZmOrganizer.ID_SYNC_FAILURES); if(!U.showImages){ U.showImages=_e&&_e.isFeed() } this._hdrTableId=ZmId.getViewId(this._viewId,ZmId.MV_HDR_TABLE,this._mode); var f=q?ZmId.getViewId(this._viewId,ZmId.MV_CLOSE_BTN_CELL,this._mode):null; var _r=ZmId.getViewId(this._viewId,ZmId.MV_REPORT_BTN_CELL,this._mode); this._expandRowId=ZmId.getViewId(this._viewId,ZmId.MV_EXPAND_ROW,this._mode); var _i=ZmId.getViewId(this._viewId,ZmId.MV_EXPAND_HDR,this._mode); var T={ id:this._htmlElId,hdrTableId:this._hdrTableId,hdrTableTopRowId:ZmId.getViewId(this._viewId,ZmId.MV_HDR_TABLE_TOP_ROW,this._mode),closeBtnCellId:f,expandRowId:this._expandRowId,expandHeaderId:_i,attachId:this._attLinksId,infoBarId:this._infoBarId,subject:h,dateString:l,hasAttachments:(_u!=0),attachmentsCount:_u}; if(z&&!z.isEmpty()&&this._inviteMsgView){ this._inviteMsgView.addSubs(T,M,e,r?k:null) }else{ T.sentBy=M; T.sentByNormal=e; T.sentByIcon=_t; T.sentByAddr=e; T.obo=_c; T.oboAddr=N; T.participants=Z; T.reportBtnCellId=_r; T.isSyncFailureMsg=B; T.autoSendTime=S; T.additionalHdrs=x; T.isOutDated=z&&z.isEmpty() } var s=(z&&!z.isEmpty()&&this._inviteMsgView)?"mail.Message#InviteHeader":"mail.Message#MessageHeader"; var C=AjxTemplate.expand(s,T); var _n=R||this.getHtmlElement(); _n.appendChild(Dwt.parseHtmlFragment(C)); this._headerElement=Dwt.byId(this._htmlElId+"_headerElement"); var n=document.getElementById(_i); if(n){ var H=ZmId.getButtonId(this._mode,ZmId.OP_EXPAND,ZmId.MSG_VIEW); if(this._expandButton){ this._expandButton.dispose() } this._expandButton=new DwtToolBarButton({ parent:this,id:H,parentElement:_i} ); this._expandButton.addSelectionListener(new AjxListener(this,this._expandButtonListener)); this._expandButton.setImage(this._expandHeader?"HeaderExpanded":"HeaderCollapsed"); this._expandButton.setVisible(Dwt.DISPLAY_BLOCK) } if(q){ var H=ZmId.getButtonId(this._mode,ZmOperation.CLOSE,ZmId.MSG_VIEW); var t=new DwtButton({ parent:this,id:H,parentElement:f} ); t.setImage("Close"); t.setText(ZmMsg.close); t.addSelectionListener(new AjxListener(this,this._closeButtonListener)) } var m=document.getElementById(_r); if(m){ var H=ZmId.getButtonId(this._mode,ZmId.REPORT,ZmId.MSG_VIEW); var Q=new DwtButton({ parent:this,id:H,parentElement:m} ); Q.setText(ZmMsg.reportSyncFailure); Q.addSelectionListener(new AjxListener(this,this._reportButtonListener,U)) } var v; var K=U.getBodyParts(); var w=K.length; if(w>1){ var C=[]; var b=U.hasHtmlPart(); for(var _o=0; _o"].join(""):[""].join(""); C.push(G) }else{ var d=(X.ct!=ZmMimeTable.TEXT_HTML)?AjxStringUtil.convertToHtml(X.content):X.content; if(X.ct==ZmMimeTable.TEXT_PLAIN){ C.push(b?"
":"");
C.push(d);
C.push(b?"
":""); v=X.content }else{ if(appCtxt.get(ZmSetting.VIEW_AS_HTML)){ C.push(d) }else{ var _s=document.createElement("div"); _s.innerHTML=d; var L=AjxStringUtil.convertHtml2Text(_s); C.push(b?"
":"");
C.push(AjxStringUtil.htmlEncode(L));
C.push(b?"
":"") }}}} this._makeIframeProxy(_n,C.join(""),!b,false,v) }else{ var F=U.getBodyPart(); if(F){ var _h=F.content; if(F.ct==ZmMimeTable.TEXT_HTML&&appCtxt.get(ZmSetting.VIEW_AS_HTML)){ if(z&&!z.isEmpty()&&this._inviteMsgView){ _h=this._inviteMsgView.truncateBodyContent(_h,true) } if(U._attachments&&ZmMailMsgView.IMG_FIX_RE.test(_h)){ var _l={}; for(var _o=0; _o"].join(""); this._makeIframeProxy(_n,C,false) }else{ if(F.ct!=ZmMimeTable.TEXT_PLAIN){ var d=U.getTextPart(); if(d===-1){ var y=new AjxCallback(this,this._handleResponseRenderMessage,[_n,F,E]); U.fetchTextPart(y); return } if(d!=null){ d=(F.ct!=ZmMimeTable.TEXT_HTML)?AjxStringUtil.convertToHtml(d):d; this._makeIframeProxy(_n,d,true) } if(E){ E.run() } return }else{ if(z&&!z.isEmpty()&&this._inviteMsgView){ _h=this._inviteMsgView.truncateBodyContent(_h) } var g=true; if(!_h){ _h=AjxTemplate.expand("mail.Message#EmptyMessage"); g=false } _h=g?AjxStringUtil.convertToHtml(_h):_h; this._makeIframeProxy(_n,_h,g,F.truncated,F.content) }}}}} this._setAttachmentLinks(); this._expandRows(this._expandHeader); Dwt.setLoadedTime("ZmMailItem",new Date()); if(E){ E.run() }}; ZmMailMsgView.prototype._handleResponseRenderMessage=function(t,o,u,p,d){ var c=p?p.getResponse():null; if(c==null){ if(o.ct==ZmMimeTable.TEXT_CAL){ var f=o.content.split(/\r\n/); var l=[]; for(var r=0; r0){ c=l.join(""); c=c.replace(/\\t/g,"\t"); c=c.replace(/\\n/g,"\n"); c=c.replace(/\\(.)/g,"$1") }}else{ if(o.ct==ZmMimeTable.TEXT_HTML){ var e=document.createElement("div"); e.innerHTML=o.content; c=AjxStringUtil.convertHtml2Text(e) }}} var h=(o.ct!=ZmMimeTable.TEXT_HTML)?AjxStringUtil.convertToHtml(c):c; var n=(o.ct!=ZmMimeTable.TEXT_HTML)?c:null; this._makeIframeProxy(t,(c||""),true,d,n); this._setAttachmentLinks(); this._expandRows(this._expandHeader); if(u){ u.run() }}; ZmMailMsgView.prototype._setTags=function(o){ if(!appCtxt.get(ZmSetting.TAGGING_ENABLED)||o==null||!this._tagList){ return } var c=o.tags.length; var u=document.getElementById(this._hdrTableId); var n=document.getElementById(this._tagRowId); var f=null; if(n!=null&&u.rows[u.rows.length-1]==n){ if(c>0){ f=n.cells[1] }else{ u.deleteRow(-1); return }}else{ if(c>0){ n=u.insertRow(-1); n.id=this._tagRowId; var e=n.insertCell(-1); e.className="LabelColName"; e.innerHTML=ZmMsg.tags+":"; e.style.verticalAlign="middle"; f=n.insertCell(-1) }else{ return }} var h=[]; for(var r=0; r":"'>"; if(AjxEnv.isGeckoBased){ l[r++]="" } for(var s=0; s"; if(AjxEnv.isIE||AjxEnv.isSafari){ l[r++]="
"; l[r++]=AjxImg.getImageHtml(m.getIconWithColor(),null,["id='",t,"'"].join("")); l[r++]="
" } l[r++]=AjxStringUtil.htmlEncodeSpace(m.name); l[r++]=""; if(AjxEnv.isGeckoBased){ l[r++]="" }} if(AjxEnv.isGeckoBased){ l[r++]="" } l[r++]=""; f.innerHTML=l.join("") }; ZmMailMsgView.prototype._setAttachmentLinks=function(){ this._attachmentLinkIdToFileNameMap=null; var r=!appCtxt.get(ZmSetting.VIEW_AS_HTML); var u=this._msg.getAttachmentLinks(true,r,true); var e=document.getElementById(this._attLinksId+"_container"); if(e){ e.style.display=u.length==0?"none":"" } if(u.length==0){ return } var p=document.getElementById(this._attLinksId+"_table"); if(p){ return } var y=[]; var m=0; var q=0; var n=false; var f=(this._controller.isReadingPaneOn()&&this._controller.isReadingPaneOnRight())?1:ZmMailMsgView.ATTC_COLUMNS; var o=m; y[m++]=""; var l=0; for(var v=0; v":""; d[w++]=x; d[w++]=AjxStringUtil.htmlEncode(b); d[w++]=g.isHit?"":""; var h=d.join(""); if(g.objectify&&this._objectManager){ this._lazyCreateObjectManager(); var c=this._objectManager.getImageAttachmentHandler(); m=this._objectManager.generateSpan(c,y,m,h,{ url:g.url} ) }else{ y[m++]=h }} if(g.size||g.htmlLink||g.vcardLink||g.download||g.briefcaseLink||g.importICSLink){ y[m++]=" ("; if(g.size){ y[m++]=g.size; y[m++]=") " } if(g.htmlLink&&!appCtxt.get(ZmSetting.ATTACHMENTS_BLOCKED)){ y[m++]=g.htmlLink; y[m++]=ZmMsg.preview; y[m++]="" }else{ if(g.vcardLink){ y[m++]=g.vcardLink; y[m++]=ZmMsg.addressBook; y[m++]="" }} if(g.download&&!appCtxt.get(ZmSetting.ATTACHMENTS_BLOCKED)){ if(g.htmlLink||g.vcardLink){ y[m++]=" | " } y[m++]=g.download; y[m++]=ZmMsg.download; y[m++]="" } if(g.briefcaseLink&&!appCtxt.get(ZmSetting.ATTACHMENTS_BLOCKED)){ if(g.htmlLink||g.vcardLink||g.download){ y[m++]=" | " } y[m++]=g.briefcaseLink; y[m++]=ZmMsg.addToBriefcase; y[m++]="" } if(g.importICSLink){ if(g.briefcaseLink||g.htmlLink||g.vcardLink||g.download){ y[m++]=" | " } y[m++]=g.importICSLink; y[m++]=ZmMsg.addToCalendar; y[m++]="" } if(g.removeLink){ if(g.briefcaseLink||g.htmlLink||g.vcardLink||g.download||g.importICSLink){ y[m++]=" | " } y[m++]=g.removeLink; y[m++]=ZmMsg.remove; y[m++]="" } if(ZmMailMsgView._attachmentHandlers){ var k=ZmMailMsgView._attachmentHandlers[g.ct]; var s; if(k){ for(handlerId in k){ s=k[handlerId]; if(s){ y[m++]=" | "+s.call(this,g) }}}}} y[m++]="
"; y[m++]=""; if(g.ct.indexOf("image")!=-1){ ++q }} if(this._limitAttachments!=0&&l>ZmMailMsgView._limitAttachments){ y[o]="
" } y[m++]=""; if(!n&&u.length>1){ q=q>1; y[m++]=ZmMailMsgView._buildZipUrl(this._msg.id,u,q,this._msg.subject) } var t=document.getElementById(this._attLinksId); t.innerHTML=y.join("") }; ZmMailMsgView.prototype.getToolTipContent=function(e){ if(!this._attachmentLinkIdToFileNameMap){ return null } var o=DwtUiEvent.getTarget(e,false); if(o&&o.nodeName.toLowerCase()=="a"){ var i=o.getAttribute("id"); if(i){ var t=this._attachmentLinkIdToFileNameMap[i]; if(t){ return AjxStringUtil.htmlEncode(t) }}} return null }; ZmMailMsgView.prototype.addAttachmentLinkHandler=function(i,t,e){ if(!ZmMailMsgView._attachmentHandlers){ ZmMailMsgView._attachmentHandlers={} } if(!ZmMailMsgView._attachmentHandlers[i]){ ZmMailMsgView._attachmentHandlers[i]={} } ZmMailMsgView._attachmentHandlers[i][t]=e }; ZmMailMsgView.prototype._controlEventListener=function(t){ var e=document.getElementById(this._iframeId); if(e){ this._resetIframeHeightOnTimer(e) } if(this._inviteMsgView&&this._inviteMsgView.isActive()){ this._inviteMsgView.resize() }}; ZmMailMsgView.prototype._shareToolBarListener=function(e){ e._buttonId=e.item.getData(ZmOperation.KEY_ID); e._share=this._msg.share; this.notifyListeners(ZmMailMsgView.SHARE_EVENT,e) }; ZmMailMsgView.prototype._msgChangeListener=function(e){ if(e.type!=ZmEvent.S_MSG){ return } if(e.event==ZmEvent.E_DELETE||e.event==ZmEvent.E_MOVE){ if(e.source==this._msg&&(appCtxt.getCurrentViewId()==this._viewId)){ this._controller._app.popView() }}else{ if(e.event==ZmEvent.E_TAGS||e.event==ZmEvent.E_REMOVE_ALL){ this._setTags(this._msg) }else{ if(e.event==ZmEvent.E_MODIFY){ if(e.source==this._msg){ this.set(e.source,true) }}}}}; ZmMailMsgView.prototype._selectStartListener=function(e){ e._stopPropagation=false; e._returnValue=true }; ZmMailMsgView.prototype._tagChangeListener=function(o){ if(o.type!=ZmEvent.S_TAG){ return } var t=o.getDetail("fields"); if(o.event==ZmEvent.E_MODIFY&&(t&&t[ZmOrganizer.F_COLOR])){ var e=o.getDetail("organizers")[0]; var i=document.getElementById(this._tagCellId+ZmDoublePaneView._TAG_IMG+e.id); if(i){ AjxImg.setImage(i,e.getIconWithColor()) }} if(o.event==ZmEvent.E_DELETE||o.event==ZmEvent.MODIFY){ this._setTags(this._msg) }}; ZmMailMsgView.prototype._expandButtonListener=function(e){ this._expandRows(!this._expandHeader) }; ZmMailMsgView.prototype._expandRows=function(s){ var e=document.getElementById(this._expandRowId); if(!e){ return } this._expandHeader=s; if(this._expandButton){ this._expandButton.setImage(s?"HeaderExpanded":"HeaderCollapsed") } var r=e.parentNode; if(!s){ this._addressRows=[]; while(e.nextSibling){ var h=e.nextSibling; this._addressRows.push(h); r.removeChild(h) }}else{ if(this._addressRows){ for(var o=0; o30000){ u.setScrollWithIframe(true); return } var o=e.offsetWidth; var r=l.body.scrollWidth; if(r>o){ e.style.width=r+"px"; l.body.style.overflow="visible"; if(o>20){ l.body.style.width=o-20+"px" }} i=Math.max(l.documentElement.scrollHeight,d); e.style.height=i+"px"; if(AjxEnv.isWebKitBased){ var c=Math.max(l.body.scrollHeight,l.documentElement.scrollHeight); if(c>i){ e.style.height=c+"px" }}}}; ZmMailMsgView.prototype.setScrollWithIframe=function(t){ this._scrollWithIframe=t; this._limitAttachments=this._scrollWithIframe?3:0; this._attcMaxSize=this._limitAttachments*16+8; this.setScrollStyle(t?DwtControl.CLIP:DwtControl.SCROLL); var e=document.getElementById(this._iframeId); if(e){ e.style.width="100%"; e.scrolling=t; ZmMailMsgView._resetIframeHeight(this,e) }}; ZmMailMsgView._tagClick=function(e,t){ var i=DwtControl.fromElementId(e); i.notifyListeners(ZmMailMsgView._TAG_CLICK,t) }; ZmMailMsgView._detachCallback=function(t,r,e){ var i=window.parentAppCtxt||window.appCtxt; var s=e.getResponse().GetMsgResponse; var o=i.getApp(ZmApp.MAIL).getMailListController().getList(); var n=new ZmMailMsg(s.m[0].id,o,true); n._loadFromDom(s.m[0]); n._loaded=true; n.readReceiptRequested=false; n._part=s.m[0].part; ZmMailMsgView.detachMsgInNewWindow(n,t,r) }; ZmMailMsgView.detachMsgInNewWindow=function(n,t,o){ var i=window.parentAppCtxt||window.appCtxt; var e=i.getNewWindow(true); if(e){ e.command="msgViewDetach"; e.params={ msg:n,isRfc822:t,mode:o} }}; ZmMailMsgView.rfc822Callback=function(o,t,s){ var e=Boolean((t!=null)); var i=window.parentAppCtxt||window.appCtxt; var n={ sender:i.getAppController(),msgId:o,partId:t,getHtml:i.get(ZmSetting.VIEW_AS_HTML),markRead:true,callback:(new AjxCallback(null,ZmMailMsgView._detachCallback,[e,s]))}; ZmMailMsg.fetchMsg(n) }; ZmMailMsgView.contactIconCallback=function(n,i){ if(i=="Contact"){ var o={ action:ZmOperation.NEW_MESSAGE,toOverride:(n+AjxEmailAddress.SEPARATOR)}; AjxDispatcher.run("Compose",o) }else{ AjxDispatcher.require(["ContactsCore","Contacts"],false); var e=new ZmContact(null); var t=AjxEmailAddress.parse(n); e.initFromEmail(t); AjxDispatcher.run("GetContactController").show(e,true) }}; ZmMailMsgView.vcardCallback=function(i,t){ ZmZimbraMail.unloadHackCallback(); var e=window.parentAppCtxt||window.appCtxt; e.getApp(ZmApp.CONTACTS).createFromVCard(i,t) }; ZmMailMsgView.removeAttachmentCallback=function(t,e){ ZmZimbraMail.unloadHackCallback(); if(!(e instanceof Array)){ e=e.split(",") } var o=(e.length>1)?ZmMsg.attachmentConfirmRemoveAll:ZmMsg.attachmentConfirmRemove; var i=appCtxt.getYesNoMsgDialog(); i.registerCallback(DwtDialog.YES_BUTTON,ZmMailMsgView._removeAttachmentCallback,null,[t,e]); i.setMessage(o,DwtMessageDialog.WARNING_STYLE); i.popup() }; ZmMailMsgView._removeAttachmentCallback=function(i,t){ appCtxt.getYesNoMsgDialog().popdown(); var n={ RemoveAttachmentsRequest:{ _jsns:"urn:zimbraMail"}}; var e=n.RemoveAttachmentsRequest; e.m={ id:i,part:t.join(",")}; var o={ jsonObj:n,asyncMode:true,callback:(new AjxCallback(null,ZmMailMsgView._handleRemoveAttachment,[i])),noBusyOverlay:true}; return appCtxt.getAppController().sendRequest(o) }; ZmMailMsgView._handleRemoveAttachment=function(o,u){ var d=window.parentAppCtxt||window.appCtxt; var e=u.getResponse().RemoveAttachmentsResponse.m[0]; var s=d.getApp(ZmApp.MAIL).getMailListController(); s.actionedMsgId=e.id; var n=s.getList(); var i=appCtxt.getAppViewMgr(); var l=i._views; var t=new ZmMailMsg(e.id,n,true); t._loadFromDom(e); for(var h in l){ var c=l[h]; var r=c&&(c[ZmAppViewMgr.C_APP_CONTENT]||c[ZmAppViewMgr.C_APP_CONTENT_FULL]); if(r){ if(AjxUtil.isFunction(r.handleRemoveAttachment)){ r.handleRemoveAttachment(o,t) }}}}; ZmMailMsgView.prototype.handleRemoveAttachment=function(t,e){ if(!this._msg||this._msg.id==t){ this._msg=null; this.set(e) }}; ZmMailMsgView._buildZipUrl=function(h,n,l,e){ if(AjxUtil.isString(e)){ e=e.replace(ZmMailMsgView.FILENAME_INV_CHARS_RE,"") }else{ e=null } e=AjxStringUtil.urlComponentEncode(e||ZmMsg.downloadAllDefaultFileName); var t=[appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI),"&id=",h,"&filename=",e,"&charset=",appCtxt.getCharset(),"&part="].join(""); var s=[]; for(var r=0; r1&&r>0){ y[g++]=AjxStringUtil.LIST_SEP }} y[g++]=""; y[g++]=AjxStringUtil.htmlEncode(h[r].name); y[g++]="" }}else{ y[g++]=" " }}else{ var o=n.getAddress(AjxEmailAddress.FROM); if(o){ if(this._mode==ZmId.VIEW_CONVLIST&&this._isMultiColumn){ y[g++]=ZmMailMsgListView.INDENT } y[g++]=""; var e=o.getName()||o.getDispName()||o.getAddress(); y[g++]=AjxStringUtil.htmlEncode(e); y[g++]="" }}}else{ if(f==ZmItem.F_SUBJECT){ if(this._mode==ZmId.VIEW_CONV||this._mode==ZmId.VIEW_CONVLIST){ if(this._mode==ZmId.VIEW_CONVLIST&&this._isMultiColumn){ y[g++]=ZmMailMsgListView.INDENT } if(!this._isMultiColumn){ y[g++]="" } y[g++]=AjxStringUtil.htmlEncode(n.fragment,true); if(!this._isMultiColumn){ y[g++]="" }}else{ var u=n.subject||ZmMsg.noSubject; y[g++]=AjxStringUtil.htmlEncode(u); if(appCtxt.get(ZmSetting.SHOW_FRAGMENTS)&&n.fragment){ y[g++]=this._getFragmentSpan(n) }}}else{ if(f==ZmItem.F_FOLDER){ y[g++]=""; var i=appCtxt.getById(n.folderId); if(i){ y[g++]=i.getName() } y[g++]="" }else{ if(f==ZmItem.F_SIZE){ y[g++]=""; y[g++]=AjxUtil.formatSize(n.size); y[g++]="" }else{ if(f==ZmItem.F_SORTED_BY){ y[g++]=this._getAbridgedContent(n,l) }else{ g=ZmMailListView.prototype._getCellContents.apply(this,arguments) }}}}}} return g }; ZmMailMsgListView.prototype._getAbridgedContent=function(o,n){ var t=[]; var e=0; var i=(AjxEnv.isIE||AjxEnv.isSafari)?"22":"16"; t[e++]=""; t[e++]=(o.isUnread)?"2){ i.push(ZmItem.F_ACCOUNT) } i.push(ZmItem.F_DATE) }else{ i=[ZmItem.F_SELECTION,ZmItem.F_SORTED_BY] } return this._getHeaders(this.view,i) }; ZmMailMsgListView.prototype._initHeaders=function(){ ZmMailListView.prototype._initHeaders.apply(this,arguments); if(this._mode==ZmId.VIEW_CONV){ this._headerInit[ZmItem.F_SUBJECT]={ text:ZmMsg.fragment,noRemove:true,resizeable:true} }}; ZmMailMsgListView.prototype._getHeaderToolTip=function(t,e){ if(t==ZmItem.F_SUBJECT&&this._mode==ZmId.VIEW_CONV){ return ZmMsg.fragment }else{ return ZmMailListView.prototype._getHeaderToolTip.apply(this,arguments) }}; ZmMailMsgListView.prototype._getSingleColumnSortFields=function(){ return(this._mode==ZmId.VIEW_CONV)?ZmMailMsgListView.SINGLE_COLUMN_SORT_CV:ZmMailListView.SINGLE_COLUMN_SORT }; ZmMailMsgListView.prototype._sortColumn=function(e,t,s){ ZmMailListView.prototype._sortColumn.call(this,e,t); var n; var o=AjxDispatcher.run((this._mode==ZmId.VIEW_CONV)?"GetConvController":"GetTradController"); if(this._columnHasCustomQuery(e)){ n=this._getSearchForSort(e._sortable,o) }else{ if(this.getList().size()>1&&this._sortByString){ n=o.getSearchString() }} var l=this._controller.getSearchStringHint(); if(n||l){ if(this._mode==ZmId.VIEW_CONV){ var r=o.getConv(); if(r){ var h=new AjxCallback(this,this._handleResponseSortColumn,[r,e,o,s]); var i={ query:n,queryHint:l,sortBy:this._sortByString,getFirstMsg:o.isReadingPaneOn()}; r.load(i,h) }}else{ var i={ query:n,queryHint:l,types:[ZmItem.MSG],sortBy:this._sortByString,limit:this.getLimit(),callback:s}; appCtxt.getSearchController().search(i) }}}; ZmMailMsgListView.prototype._columnHasCustomQuery=function(e){ return(e._sortable==ZmItem.F_FLAG||e._sortable==ZmItem.F_ATTACHMENT) }; ZmMailMsgListView.prototype._handleResponseSortColumn=function(s,o,i,r,t){ var e=t.getResponse(); var n=e.getResults(ZmItem.MSG); i.setList(n); i._activeSearch=e; this.offset=0; this.set(s.msgs,o); this.setSelection(s.getFirstHotMsg({ offset:this.offset,limit:this.getLimit(this.offset)} )); if(r instanceof AjxCallback){ r.run() }}; ZmMailMsgListView.prototype._getParentForColResize=function(){ return this.parent } } if(AjxPackage.define("zimbraMail.mail.view.ZmConvListView")){ ZmConvDoublePaneView=function(e){ e.className=e.className||"ZmConvDoublePaneView"; e.mode=ZmId.VIEW_CONVLIST; ZmDoublePaneView.call(this,e) }; ZmConvDoublePaneView.prototype=new ZmDoublePaneView; ZmConvDoublePaneView.prototype.constructor=ZmConvDoublePaneView; ZmConvDoublePaneView.prototype.toString=function(){ return"ZmConvDoublePaneView" }; ZmConvDoublePaneView.prototype._createMailListView=function(e){ e.parent=this; e.posStyle=Dwt.ABSOLUTE_STYLE; return new ZmConvListView(e) }; ZmConvListView=function(e){ this.view=e.view=ZmId.VIEW_CONVLIST; e.type=ZmItem.CONV; e.headerList=this._getHeaderList(parent,e.controller); ZmMailListView.call(this,e); this._handleEventType[ZmItem.CONV]=true; this._handleEventType[ZmItem.MSG]=true; this._mode=ZmId.VIEW_CONVLIST; this._hasHiddenRows=true; this._resetExpansion() }; ZmConvListView.prototype=new ZmMailListView; ZmConvListView.prototype.constructor=ZmConvListView; ZmListView.FIELD_CLASS[ZmItem.F_EXPAND]="Expand"; ZmConvListView.MSG_STYLE="ZmConvExpanded"; ZmConvListView.prototype._changeFolderName=ZmMailMsgListView.prototype._changeFolderName; ZmConvListView.prototype._changeTrashStatus=ZmMailMsgListView.prototype._changeTrashStatus; ZmConvListView.prototype.toString=function(){ return"ZmConvListView" }; ZmConvListView.prototype.set=function(t,e){ if(this.offset==0){ this._resetExpansion() } ZmMailListView.prototype.set.apply(this,arguments) }; ZmConvListView.prototype.handleKeyAction=function(e,t){ switch(e){ case DwtKeyMap.DBLCLICK:return false; default:return ZmMailListView.prototype.handleKeyAction.call(this,e,t) }}; ZmConvListView.prototype._isAllChecked=function(){ var t=this.getSelection(); var o=0; for(var e=0; e2){ i.push(ZmItem.F_ACCOUNT) } i.push(ZmItem.F_DATE) }else{ i=[ZmItem.F_SELECTION,ZmItem.F_SORTED_BY] } return this._getHeaders(ZmId.VIEW_CONVLIST,i) }; ZmConvListView.prototype._resetFromColumnLabel=function(){ var e=this._headerHash[ZmItem.F_FROM]; if(e){ e._sortable=this._isOutboundFolder()?ZmItem.F_FROM:null } ZmMailListView.prototype._resetFromColumnLabel.apply(this,arguments) }; ZmConvListView.prototype._getDivClass=function(t,e,i){ if(e.type==ZmItem.MSG){ if(i.isDragProxy||i.isMatched){ return ZmMailMsgListView.prototype._getDivClass.apply(this,arguments) }else{ return[t,ZmConvListView.MSG_STYLE].join(" ") }}else{ return ZmMailListView.prototype._getDivClass.apply(this,arguments) }}; ZmConvListView.prototype._getRowClass=function(e){ return(e.type==ZmItem.MSG)?ZmMailMsgListView.prototype._getRowClass.apply(this,arguments):ZmMailListView.prototype._getRowClass.apply(this,arguments) }; ZmConvListView.prototype._addParams=function(e,t){ if(e.type==ZmItem.MSG){ ZmMailMsgListView.prototype._addParams.apply(this,arguments) }}; ZmConvListView.prototype._getStyleViaZimlet=function(i,t){ if(i!="fr"&&i!="su"&&i!="st"){ return"" } if(appCtxt.zimletsPresent()&&this._ignoreProcessingGetMailCellStyle==undefined){ if(!this._zimletMgr){ this._zimletMgr=appCtxt.getZimletMgr() } var e=this._zimletMgr.processARequest("getMailCellStyle",t,i); if(e!=undefined&&e!=null){ return e }else{ if(e==null&&this._zimletMgr.isLoaded()){ this._ignoreProcessingGetMailCellStyle=true }}} return"" }; ZmConvListView.prototype._getCell=function(t,e,i,o,s,n){ if(o==ZmItem.F_SORTED_BY&&i.type==ZmItem.MSG){ t[e++]="" } return ZmMailListView.prototype._getCell.apply(this,arguments) }; ZmConvListView.prototype._getCellId=function(e,t){ return(t==ZmItem.F_FROM)?this._getFieldId(e,t):ZmMailListView.prototype._getCellId.apply(this,arguments) }; ZmConvListView.prototype._getCellClass=function(e,t,i){ return(e.type==ZmItem.CONV&&t==ZmItem.F_SIZE)?"Count":(ZmMailListView.prototype._getCellClass.apply(this,arguments)) }; ZmConvListView.prototype._getCellContents=function(t,e,o,n,r,s){ if(n==ZmItem.F_SELECTION){ e=ZmMailListView.prototype._getCellContents.apply(this,arguments) }else{ if(n==ZmItem.F_EXPAND){ e=this._getImageHtml(t,e,this._isExpandable(o)?"NodeCollapsed":null,this._getFieldId(o,n)) }else{ if(o.type==ZmItem.MSG){ e=ZmMailMsgListView.prototype._getCellContents.apply(this,arguments) }else{ if(n==ZmItem.F_STATUS){ if(o.type==ZmItem.CONV&&o.numMsgs==1&&o.isScheduled){ e=this._getImageHtml(t,e,"SendLater",this._getFieldId(o,n)) }else{ t[e++]=" " }}else{ if(n==ZmItem.F_FROM){ t[e++]=this._getParticipantHtml(o,this._getFieldId(o,ZmItem.F_PARTICIPANT)) }else{ if(n==ZmItem.F_SUBJECT){ t[e++]=o.subject?AjxStringUtil.htmlEncode(o.subject,true):AjxStringUtil.htmlEncode(ZmMsg.noSubject); if(appCtxt.get(ZmSetting.SHOW_FRAGMENTS)&&o.fragment){ t[e++]=this._getFragmentSpan(o) }}else{ if(n==ZmItem.F_FOLDER){ if(o.folderId){ t[e++]=""; var i=appCtxt.getById(o.folderId); if(i){ t[e++]=i.getName() } t[e++]="" }}else{ if(n==ZmItem.F_SIZE){ if(o.size){ t[e++]=""; t[e++]=AjxUtil.formatSize(o.size); t[e++]="" }else{ if(o.numMsgs>1){ t[e++]="("; t[e++]=o.numMsgs; t[e++]=")" }}}else{ if(n==ZmItem.F_TYPE){ if(o.isDraft){ t[e++]=AjxImg.getImageHtml("MsgStatusDraft",null,["id='",this._getFieldId(o,ZmItem.F_STATUS),"'"].join("")) }else{ e=ZmMailListView.prototype._getCellContents.apply(this,arguments) }}else{ if(n==ZmItem.F_SORTED_BY){ t[e++]=this._getAbridgedContent(o,r) }else{ e=ZmMailListView.prototype._getCellContents.apply(this,arguments) }}}}}}}}}} return e }; ZmConvListView.prototype._getAbridgedContent=function(n,s){ var t=[]; var e=0; var o=(AjxEnv.isIE||AjxEnv.isSafari)?22:16; t[e++]="
"; e=this._getCellContents(t,e,i,ZmItem.F_EXPAND,s,n); t[e++]="
"; t[e++]=(n.isUnread)?"0){ var t=appCtxt.getById(this._folderId); if((u==1)&&(n[0].type==AjxEmailAddress.FROM)&&t&&(t.isUnder(ZmFolder.ID_SENT)||t.isUnder(ZmFolder.ID_DRAFTS)||t.isUnder(ZmFolder.ID_OUTBOX))){ var o=p.getFirstHotMsg(); if(o){ var l=o.getAddresses(AjxEmailAddress.TO).getArray(); if(l&&l.length){ n=l }else{ return" " }}} var d=this._headerHash[ZmItem.F_FROM]; var e=d?d._width:ZmMsg.COLUMN_WIDTH_FROM_CLV; var i=this._fitParticipants(n,p,e); for(var r=0; r1&&r>0){ h[m++]=AjxStringUtil.LIST_SEP }} var f=(i&&i[r]&&(i[r].index!=null))?i[r].index:""; var s=[c,f].join(DwtId.SEP); h[m++]=""; h[m++]=(i&&i[r])?AjxStringUtil.htmlEncode(i[r].name):""; h[m++]="" }}else{ h[m++]=ZmMsg.noWhere } return h.join("") }; ZmConvListView.prototype._getHeaderToolTip=function(t,e){ return(t==ZmItem.F_EXPAND)?ZmMsg.expandCollapse:ZmMailListView.prototype._getHeaderToolTip.call(this,t,e,this._isOutboundFolder()) }; ZmConvListView.prototype._getToolTip=function(n){ if(!n.item){ return } if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&(n.field==ZmItem.F_PARTICIPANT||n.field==ZmItem.F_FROM)){ var o=n.item.participants; var i=n.match&&n.match.participant; var s=o&&o.get(i||0); if(!s){ return"" } var t={ address:s,ev:n.ev}; var e=new AjxCallback(this,function(r){ appCtxt.getToolTipMgr().getToolTip(ZmToolTipMgr.PERSON,t,r) } ); return{ callback:e} }else{ return ZmMailListView.prototype._getToolTip.apply(this,arguments) }}; ZmConvListView.prototype._expand=function(m,t){ var f=t||m; var l=(f.type==ZmItem.CONV); var n=this._msgRowIdList[f.id]; var g; if(n&&n.length&&this._rowsArePresent(f)){ this._showMsgs(n,true); g=document.getElementById(n[n.length-1]) }else{ this._msgRowIdList[f.id]=[]; var r=m.msgs; if(!r){ return } if(l){ r.addChangeListener(this._listChangeListener) } var o=(appCtxt.get(ZmSetting.CONVERSATION_ORDER)==ZmSearch.DATE_ASC); var c=this._getRowIndex(f); if(o&&t){ c-- } var s=this._msgOffset[f.id]||0; var u=m.getMsgList(s,o); for(var h=0; hDwt.getSize(g.parentNode).y){ this._scrollList(this._getElFromItem(f)) }}; ZmConvListView.prototype._collapse=function(o){ var s=(o.type==ZmItem.CONV); var n=s?o.id:o.cid; var i=this._expandedItems[n]; if(i&&i.length){ var t=false; while(!t){ var e=i.pop(); this._doCollapse(e); t=((e.id==o.id)||(i.length==0)) }} if(s){ this._expanded[o.id]=false; this._expandedItems[n]=[] } this._resetColWidth() }; ZmConvListView.prototype._doCollapse=function(t){ var e=this._msgRowIdList[t.id]; if(e&&e.length){ this._showMsgs(e,false) } this._setImage(t,ZmItem.F_EXPAND,"NodeCollapsed"); this._expanded[t.id]=false }; ZmConvListView.prototype._showMsgs=function(o,e){ if(!(o&&o.length)){ return } for(var t=0; t1) }else{ var h=appCtxt.getById(r.cid); if(!h){ return false } var o=h.msgs?h.msgs.getArray():null; if(o&&o.length){ var t=appCtxt.get(ZmSetting.CONVERSATION_PAGE_SIZE); var e=null; for(var s=0; s1&&this._sortByString){ i=this._controller.getSearchString() }} var e=this._controller.getSearchStringHint(); if(i||e){ var o={ query:i,queryHint:e,types:[ZmItem.CONV],sortBy:this._sortByString,limit:this.getLimit(),callback:s}; appCtxt.getSearchController().search(o) }}; ZmConvListView.prototype._columnHasCustomQuery=function(e){ return(e._sortable==ZmItem.F_FLAG||e._sortable==ZmItem.F_ATTACHMENT) }; ZmConvListView.prototype._changeListener=function(A){ var O=this._getItemFromEvent(A); if(!O||A.handled||!this._handleEventType[O.type]){ if(A&&A.event==ZmEvent.E_CREATE){ AjxDebug.println(AjxDebug.NOTIFY,"ZmConvListView: initial check failed") } return } var g=A.getDetail("fields"); var n=(O.type==ZmItem.CONV); var y=this._sortByString||ZmSearch.DATE_DESC; var c=false; if(!n&&(A.event==ZmEvent.E_MOVE||A.event==ZmEvent.E_DELETE)){ var p=A.batchMode?this._getItemsFromBatchEvent(A):[O]; for(var x=0,q=p.length; x1?["(",O.numMsgs,")"].join(""):"" } var b=!this._isExpandable(O)?null:this._expanded[O.id]?"NodeExpanded":"NodeCollapsed"; this._setImage(O,ZmItem.F_EXPAND,b) } if(A.event==ZmEvent.E_MODIFY&&(g&&g[ZmItem.F_DATE])){ var v=this._getFieldId(O,ZmItem.F_DATE); var h=document.getElementById(v); if(h){ var u=[]; var m=this._headerHash[ZmItem.F_DATE]&&this._headerHash[ZmItem.F_DATE]._index; this._getCellContents(u,0,O,ZmItem.F_DATE,m,new Date()); h.innerHTML=u.join("") }} if(!c){ if(n){ ZmMailListView.prototype._changeListener.apply(this,arguments) }else{ ZmMailMsgListView.prototype._changeListener.apply(this,arguments) }}}; ZmConvListView.prototype._getSortIndex=function(r,h){ var s=parseInt(r.date); var e=this.getList(true).getArray(); for(var o=0; o=t))||(h==ZmSearch.DATE_ASC&&(s<=t))){ return o }} return o }; ZmConvListView.prototype._removeMsgRows=function(n){ var e=this._msgRowIdList[n]; if(e&&e.length){ for(var t=0; t1){ return e[e.length-1] } return null }; ZmConvListView.prototype._getActionMenuForColHeader=function(t){ var i=ZmMailListView.prototype._getActionMenuForColHeader.apply(this,arguments); if(!this.isMultiColumn()){ var e=this._colHeaderActionMenu.getItemById(ZmItem.F_FROM); if(e){ e.setVisible(false) }} return i }; ZmConvListView.prototype._saveState=function(e){ ZmMailListView.prototype._saveState.apply(this,arguments); this._state.expanded=e&&e.expansion&&this._expanded }; ZmConvListView.prototype._restoreState=function(){ var e=this._state; if(e.expanded){ for(var t in e.expanded){ if(e.expanded[t]){ this._expandItem(e.expanded[t]) }}} ZmMailListView.prototype._restoreState.call(this) } } if(AjxPackage.define("zimbraMail.mail.controller.ZmMailFolderTreeController")){ ZmMailFolderTreeController=function(t,e){ if(arguments.length==0){ return } ZmFolderTreeController.apply(this,arguments) }; ZmMailFolderTreeController.prototype=new ZmFolderTreeController; ZmMailFolderTreeController.prototype.constructor=ZmMailFolderTreeController; ZmMailFolderTreeController.prototype.toString=function(){ return"ZmMailFolderTreeController" }; ZmMailFolderTreeController.prototype._updateOverview=function(o,s,i,t,n){ ZmTreeController.prototype._updateOverview.call(this,o,s,i,t,n); if(appCtxt.multiAccounts&&(i[ZmOrganizer.F_UNREAD]&&t.isSystem())||(i[ZmOrganizer.F_TOTAL]&&(t.nId==ZmFolder.ID_DRAFTS||t.nId==ZmOrganizer.ID_OUTBOX))){ var e=appCtxt.getApp(ZmApp.MAIL).getOverviewContainer(true); if(e){ e.updateLabel(t) }}}; ZmMailFolderTreeController.prototype._deleteListener=function(s){ if(appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)){ var e=this._getActionedOrganizer(s); if(e.isDataSource()){ var n=appCtxt.getDataSourceCollection().getPopAccountsFor(e.id); var t=[e.getName(),n[0].getName()]; var o=AjxMessageFormat.format(ZmMsg.errorDeletePopFolder,t); var i=appCtxt.getMsgDialog(); i.setMessage(o); i.popup(); return }} ZmFolderTreeController.prototype._deleteListener.apply(this,arguments) }; ZmMailFolderTreeController.prototype._dropListener=function(s){ if((appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)||appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED))&&s.action==DwtDropEvent.DRAG_DROP){ var h=s.srcData.data; var r=h instanceof ZmOrganizer?h:null; if(r&&r.isDataSource()){ var e=appCtxt.getDataSourceCollection(); var i=appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)?e.getPopAccountsFor(r.id):[]; var t=appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED)?e.getImapAccountsFor(r.id):[]; if(i.length||t.length){ var n=[r.getName(),i.length?i[0].getName():t[0].getName()]; var l=AjxMessageFormat.format(i.length?ZmMsg.errorMovePopFolder:ZmMsg.errorMoveImapFolder,n); var o=appCtxt.getMsgDialog(); o.setMessage(l); o.popup(); return }}} ZmFolderTreeController.prototype._dropListener.apply(this,arguments) }; ZmMailFolderTreeController.prototype.resetOperations=function(i,t,o){ ZmFolderTreeController.prototype.resetOperations.apply(this,arguments); if(appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)){ var e=appCtxt.getById(o); if(e.isDataSource()){ i.enable(ZmOperation.MOVE,false) }}}; ZmMailFolderTreeController.prototype._doMarkAllRead=function(e){ if(appCtxt.isOffline){ appCtxt.getApp(ZmApp.MAIL).clearNewMailBadge() } ZmTreeController.prototype._doMarkAllRead.apply(this,arguments) } } if(AjxPackage.define("zimbraMail.mail.controller.ZmMailListController")){ ZmMailListController=function(e,t){ if(arguments.length==0){ return } ZmListController.call(this,e,t); ZmMailListController.INVITE_REPLY_MAP={}; ZmMailListController.INVITE_REPLY_MAP[ZmOperation.INVITE_REPLY_ACCEPT]=ZmOperation.REPLY_ACCEPT; ZmMailListController.INVITE_REPLY_MAP[ZmOperation.INVITE_REPLY_DECLINE]=ZmOperation.REPLY_DECLINE; ZmMailListController.INVITE_REPLY_MAP[ZmOperation.INVITE_REPLY_TENTATIVE]=ZmOperation.REPLY_TENTATIVE; ZmMailListController.REPLY_ACTION_MAP={}; ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_ACCEPT_NOTIFY]=ZmOperation.REPLY_ACCEPT; ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_ACCEPT_IGNORE]=ZmOperation.REPLY_ACCEPT; ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_DECLINE_NOTIFY]=ZmOperation.REPLY_DECLINE; ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_DECLINE_IGNORE]=ZmOperation.REPLY_DECLINE; ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_TENTATIVE_NOTIFY]=ZmOperation.REPLY_TENTATIVE; ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_TENTATIVE_IGNORE]=ZmOperation.REPLY_TENTATIVE; ZmMailListController.ACTION_CODE_TO_OP={}; ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.REPLY]=ZmOperation.REPLY; ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.REPLY_ALL]=ZmOperation.REPLY_ALL; ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.FORWARD_INLINE]=ZmOperation.FORWARD_INLINE; ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.FORWARD_ATT]=ZmOperation.FORWARD_ATT; this._listeners[ZmOperation.MARK_READ]=new AjxListener(this,this._markReadListener); this._listeners[ZmOperation.MARK_UNREAD]=new AjxListener(this,this._markUnreadListener); if(appCtxt.get(ZmSetting.REPLY_MENU_ENABLED)){ this._listeners[ZmOperation.REPLY]=new AjxListener(this,this._replyListener); this._listeners[ZmOperation.REPLY_ALL]=new AjxListener(this,this._replyListener) } if(appCtxt.get(ZmSetting.FORWARD_MENU_ENABLED)){ this._listeners[ZmOperation.FORWARD]=new AjxListener(this,this._forwardListener) } this._listeners[ZmOperation.EDIT]=new AjxListener(this,this._editListener); this._listeners[ZmOperation.CHECK_MAIL]=new AjxListener(this,this._checkMailListener); if(appCtxt.get(ZmSetting.SPAM_ENABLED)){ this._listeners[ZmOperation.SPAM]=new AjxListener(this,this._spamListener) } this._listeners[ZmOperation.DETACH]=new AjxListener(this,this._detachListener); this._inviteReplyListener=new AjxListener(this,this._inviteReplyHandler); this._shareListener=new AjxListener(this,this._shareHandler); this._acceptShareListener=new AjxListener(this,this._acceptShareHandler); this._declineShareListener=new AjxListener(this,this._declineShareHandler) }; ZmMailListController.prototype=new ZmListController; ZmMailListController.prototype.constructor=ZmMailListController; ZmMailListController.GROUP_BY_ITEM={}; ZmMailListController.GROUP_BY_SETTING={}; ZmMailListController.GROUP_BY_ICON={}; ZmMailListController.GROUP_BY_MSG_KEY={}; ZmMailListController.GROUP_BY_SHORTCUT={}; ZmMailListController.GROUP_BY_VIEWS=[]; ZmMailListController.READING_PANE_TEXT={}; ZmMailListController.READING_PANE_TEXT[ZmSetting.RP_OFF]=ZmMsg.readingPaneOff; ZmMailListController.READING_PANE_TEXT[ZmSetting.RP_BOTTOM]=ZmMsg.readingPaneAtBottom; ZmMailListController.READING_PANE_TEXT[ZmSetting.RP_RIGHT]=ZmMsg.readingPaneOnRight; ZmMailListController.READING_PANE_ICON={}; ZmMailListController.READING_PANE_ICON[ZmSetting.RP_OFF]="SplitPaneOff"; ZmMailListController.READING_PANE_ICON[ZmSetting.RP_BOTTOM]="SplitPane"; ZmMailListController.READING_PANE_ICON[ZmSetting.RP_RIGHT]="SplitPaneVertical"; ZmMailListController.CONV_ORDER_DESC=ZmSearch.DATE_DESC; ZmMailListController.CONV_ORDER_ASC=ZmSearch.DATE_ASC; ZmMailListController.CONV_ORDER_TEXT={}; ZmMailListController.CONV_ORDER_TEXT[ZmMailListController.CONV_ORDER_DESC]=ZmMsg.convOrderDescending; ZmMailListController.CONV_ORDER_TEXT[ZmMailListController.CONV_ORDER_ASC]=ZmMsg.convOrderAscending; ZmMailListController.ACTION_CODE_TO_FOLDER={}; ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_INBOX]=ZmFolder.ID_INBOX; ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_DRAFTS]=ZmFolder.ID_DRAFTS; ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_JUNK]=ZmFolder.ID_SPAM; ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_SENT]=ZmFolder.ID_SENT; ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_TRASH]=ZmFolder.ID_TRASH; ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE={}; ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[ZmKeyMap.MOVE_TO_INBOX]=ZmFolder.ID_INBOX; ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[ZmKeyMap.MOVE_TO_TRASH]=ZmFolder.ID_TRASH; ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[ZmKeyMap.MOVE_TO_JUNK]=ZmFolder.ID_SPAM; ZmMailListController.ACTION_CODE_TO_MENU_ID={}; ZmMailListController.ACTION_CODE_TO_MENU_ID[ZmKeyMap.READING_PANE_OFF]=ZmSetting.RP_OFF; ZmMailListController.ACTION_CODE_TO_MENU_ID[ZmKeyMap.READING_PANE_BOTTOM]=ZmSetting.RP_BOTTOM; ZmMailListController.ACTION_CODE_TO_MENU_ID[ZmKeyMap.READING_PANE_RIGHT]=ZmSetting.RP_RIGHT; ZmMailListController.ACTION_CODE_WHICH={}; ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.FIRST_UNREAD]=DwtKeyMap.SELECT_FIRST; ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.LAST_UNREAD]=DwtKeyMap.SELECT_LAST; ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.NEXT_UNREAD]=DwtKeyMap.SELECT_NEXT; ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.PREV_UNREAD]=DwtKeyMap.SELECT_PREV; ZmMailListController.prototype.toString=function(){ return"ZmMailListController" }; ZmMailListController.prototype.switchView=function(h,e){ if(h==ZmId.VIEW_TRAD||h==ZmId.VIEW_CONVLIST){ if(appCtxt.multiAccounts){ delete this._showingAccountColumn } var t=ZmMailListController.GROUP_BY_SETTING[h]; var s=this._app._groupBy[appCtxt.getActiveAccount().name]; if(t&&(t!=s)){ this._app.setGroupMailBy(t) }else{ if(!e){ return }} var l=appCtxt.get(ZmSetting.SORTING_PREF,h); var o=this._listView[this._currentView].getLimit(); var n=appCtxt.get(ZmSetting.VIEW_AS_HTML); var r=this._app.getGroupMailBy(); var i={ types:[r],offset:0,limit:o,sortBy:l,getHtml:n}; appCtxt.getSearchController().redoSearch(this._app.currentSearch,null,i) }}; ZmMailListController.prototype._setupReadingPaneMenuItems=function(){}; ZmMailListController.prototype._setupConvOrderMenuItems=function(){}; ZmMailListController.prototype.isReadingPaneOn=function(){ return(this._getReadingPanePref()!=ZmSetting.RP_OFF) }; ZmMailListController.prototype.isReadingPaneOnRight=function(){ return(this._getReadingPanePref()==ZmSetting.RP_RIGHT) }; ZmMailListController.prototype._getReadingPanePref=function(){ return appCtxt.get(ZmSetting.READING_PANE_LOCATION) }; ZmMailListController.prototype._setReadingPanePref=function(e){ appCtxt.set(ZmSetting.READING_PANE_LOCATION,e) }; ZmMailListController.prototype.getKeyMapName=function(){ return"ZmMailListController" }; ZmMailListController.prototype.handleKeyAction=function(u){ var i=this._getSearchFolder(); var h=(i&&i.nId==ZmOrganizer.ID_SYNC_FAILURES); var m=(i&&i.nId==ZmFolder.ID_DRAFTS); var n=this._listView[this._currentView]; var r=n.getSelectionCount(); switch(u){ case ZmKeyMap.FORWARD:if(!m){ this._doAction({ action:ZmOperation.FORWARD} ) } break; case ZmKeyMap.GET_MAIL:this._checkMailListener(); break; case ZmKeyMap.GOTO_INBOX:case ZmKeyMap.GOTO_DRAFTS:case ZmKeyMap.GOTO_JUNK:case ZmKeyMap.GOTO_SENT:case ZmKeyMap.GOTO_TRASH:if(u==ZmKeyMap.GOTO_JUNK&&!appCtxt.get(ZmSetting.SPAM_ENABLED)){ break } this._folderSearch(ZmMailListController.ACTION_CODE_TO_FOLDER[u]); break; case ZmKeyMap.MOVE_TO_INBOX:case ZmKeyMap.MOVE_TO_TRASH:case ZmKeyMap.MOVE_TO_JUNK:if(h){ break } if(u==ZmKeyMap.MOVE_TO_JUNK&&!appCtxt.get(ZmSetting.SPAM_ENABLED)){ break } if(r&&!(m&&u!=ZmKeyMap.MOVE_TO_TRASH)){ var o=ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[u]; i=appCtxt.getById(o); var d=n.getSelection(); this._doMove(d,i) } break; case ZmKeyMap.REPLY:case ZmKeyMap.REPLY_ALL:if(!m&&(r==1)&&!h){ this._doAction({ action:ZmMailListController.ACTION_CODE_TO_OP[u]} ) } break; case ZmKeyMap.SELECT_ALL:n.selectAll(true); break; case ZmKeyMap.SPAM:if(r&&!m&&!h&&appCtxt.get(ZmSetting.SPAM_ENABLED)){ this._spamListener() } break; case ZmKeyMap.MARK_READ:if(r&&(!i||(i&&!i.isReadOnly()))){ this._markReadListener() } break; case ZmKeyMap.MARK_UNREAD:if(r&&(!i||(i&&!i.isReadOnly()))){ this._markUnreadListener() } break; case ZmKeyMap.VIEW_BY_CONV:if(!h){ this.switchView(ZmId.VIEW_CONVLIST) } break; case ZmKeyMap.VIEW_BY_MSG:if(!h){ this.switchView(ZmId.VIEW_TRAD) } break; case ZmKeyMap.READING_PANE_BOTTOM:case ZmKeyMap.READING_PANE_RIGHT:case ZmKeyMap.READING_PANE_OFF:var c=ZmMailListController.ACTION_CODE_TO_MENU_ID[u]; this._updateViewMenu(c); this.switchView(c,true); break; case ZmKeyMap.SHOW_FRAGMENT:if(r==1){ var p=n.getSelection()[0]; if(!p){ break } var t=n._getFieldId(p,ZmItem.F_SUBJECT); var e=document.getElementById(t); if(e){ var l=Dwt.getLocation(e); var f; if((p.type==ZmItem.MSG&&p.isInvite()&&p.needsRsvp())||(p.type==ZmId.ITEM_CONV&&this.getMsg()&&this.getMsg().isInvite()&&this.getMsg().needsRsvp())){ f=p.invite?p.invite.getToolTip():this.getMsg().invite.getToolTip() }else{ f=p.fragment?p.fragment:ZmMsg.fragmentIsEmpty; if(f!=""){ n.setToolTipContent(AjxStringUtil.htmlEncode(f)) }} var g=this._shell.getToolTip(); g.popdown(); if(f!=""){ g.setContent(f); g.popup(l.x,l.y) }}} break; case ZmKeyMap.NEXT_UNREAD:case ZmKeyMap.PREV_UNREAD:this.lastListAction=u; case ZmKeyMap.FIRST_UNREAD:case ZmKeyMap.LAST_UNREAD:var s=this._getUnreadItem(ZmMailListController.ACTION_CODE_WHICH[u]); if(s){ this._selectItem(n,s) } break; default:return ZmListController.prototype.handleKeyAction.call(this,u) } return true }; ZmMailListController.prototype._selectItem=function(e,i){ e._unmarkKbAnchorElement(true); e.setSelection(i); var t=e._getElFromItem(i); if(t){ e._scrollList(t) }}; ZmMailListController.prototype.mapSupported=function(e){ return(e=="list") }; ZmMailListController.prototype.sendReadReceipt=function(i){ if(!appCtxt.get(ZmSetting.MAIL_READ_RECEIPT_ENABLED)||i.readReceiptSent||i.isSent){ return } var e=appCtxt.get(ZmSetting.MAIL_SEND_READ_RECEIPTS); if(e==ZmMailApp.SEND_RECEIPT_PROMPT){ var o=new AjxCallback(this,this._sendReadReceipt,i); var t=appCtxt.getYesNoMsgDialog(); t.registerCallback(DwtDialog.YES_BUTTON,this._sendReadReceipt,this,[i,t]); t.registerCallback(DwtDialog.NO_BUTTON,this._sendReadReceiptNotified,this,[i,t]); t.setMessage(ZmMsg.readReceiptSend,DwtMessageDialog.WARNING_STYLE); t.popup() }else{ if(e==ZmMailApp.SEND_RECEIPT_ALWAYS){ i.readReceiptSent=true; this._sendReadReceipt(i) }}}; ZmMailListController.prototype._sendReadReceipt=function(i,t){ if(t){ t.popdown() } var n={ SendDeliveryReportRequest:{ _jsns:"urn:zimbraMail"}}; request=n.SendDeliveryReportRequest; request.mid=i.id; var o=new AjxCallback(this,this._handleSendReadReceipt,[i]); var e=window.parentAppCtxt||window.appCtxt; e.getRequestMgr().sendRequest({ jsonObj:n,asyncMode:true,callback:o} ) }; ZmMailListController.prototype._handleSendReadReceipt=function(e){ appCtxt.setStatusMsg(ZmMsg.readReceiptSent); this._sendReadReceiptNotified(e) }; ZmMailListController.prototype._sendReadReceiptNotified=function(i,t){ var o=t?(new AjxCallback(t,t.popdown)):null; var e=i.setFlag(ZmItem.FLAG_READ_RECEIPT_SENT,true); i.list.flagItems({ items:[i],op:"update",value:e,callback:o} ) }; ZmMailListController.prototype._updateViewMenu=function(o){ var t=this._toolbar[this._currentView].getButton(ZmOperation.VIEW_MENU); var i=t&&t.getMenu(); if(i){ var e=i.getItemById(ZmOperation.MENUITEM_ID,o); if(e){ e.setChecked(true,true) }}}; ZmMailListController.prototype._initialize=function(e){ this._setActiveSearch(e); ZmListController.prototype._initialize.call(this,e) }; ZmMailListController.prototype._initializeParticipantActionMenu=function(){ if(!this._participantActionMenu){ var e=this._participantOps(); e.push(ZmOperation.SEP); var t=this._getActionMenuOps(); if(t&&t.length){ e=e.concat(t) } this._participantActionMenu=new ZmActionMenu({ parent:this._shell,menuItems:e,controller:this,context:this._currentView,menuType:ZmId.MENU_PARTICIPANT} ); if(appCtxt.get(ZmSetting.SEARCH_ENABLED)){ this._setSearchMenu(this._participantActionMenu) } this._addMenuListeners(this._participantActionMenu); this._participantActionMenu.addPopdownListener(this._menuPopdownListener); this._setupTagMenu(this._participantActionMenu); this._setupEditButton(this._participantActionMenu); appCtxt.notifyZimlets("onParticipantActionMenuInitialized",[this,this._participantActionMenu]) } return this._participantActionMenu }; ZmMailListController.prototype._initializeDraftsActionMenu=function(){ if(!this._draftsActionMenu){ var e=[ZmOperation.EDIT,ZmOperation.SEP,ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.PRINT,ZmOperation.SEP,ZmOperation.SHOW_ORIG]; this._draftsActionMenu=new ZmActionMenu({ parent:this._shell,menuItems:e,context:this._currentView,menuType:ZmId.MENU_DRAFTS} ); if(appCtxt.get(ZmSetting.SEARCH_ENABLED)){ this._setSearchMenu(this._draftsActionMenu) } this._addMenuListeners(this._draftsActionMenu); this._draftsActionMenu.addPopdownListener(this._menuPopdownListener); this._setupTagMenu(this._draftsActionMenu) }}; ZmMailListController.prototype._setDraftSearchMenu=function(e,i,t){ if(e&&appCtxt.get(ZmSetting.SEARCH_ENABLED)&&(t.field==ZmItem.F_PARTICIPANT||t.field==ZmItem.F_FROM)){ if(!this._draftsActionMenu.getOp(ZmOperation.SEARCH_MENU)){ ZmOperation.addOperation(this._draftsActionMenu,ZmOperation.SEARCH_MENU,[ZmOperation.SEARCH_MENU,ZmOperation.SEP],0); this._setSearchMenu(this._draftsActionMenu) } if(i&&(i.getAddresses(AjxEmailAddress.TO).getArray().length+i.getAddresses(AjxEmailAddress.CC).getArray().length)>1){ ZmOperation.setOperation(this._draftsActionMenu.getSearchMenu(),ZmOperation.SEARCH_TO,ZmOperation.SEARCH_TO,ZmMsg.findEmailToRecipients); ZmOperation.setOperation(this._draftsActionMenu.getSearchMenu(),ZmOperation.SEARCH,ZmOperation.SEARCH,ZmMsg.findEmailFromRecipients) }else{ ZmOperation.setOperation(this._draftsActionMenu.getSearchMenu(),ZmOperation.SEARCH_TO,ZmOperation.SEARCH_TO,ZmMsg.findEmailToRecipient); ZmOperation.setOperation(this._draftsActionMenu.getSearchMenu(),ZmOperation.SEARCH,ZmOperation.SEARCH,ZmMsg.findEmailFromRecipient) }}else{ if(this._draftsActionMenu.getOp(ZmOperation.SEARCH_MENU)){ this._draftsActionMenu=null; this._initializeDraftsActionMenu() }}}; ZmMailListController.prototype._initializeToolBar=function(e){ if(!this._toolbar[e]){ ZmListController.prototype._initializeToolBar.call(this,e); this._createViewMenu(e); if(appCtxt.isOffline&&appCtxt.accountList.size()>2){ this._createSendReceiveMenu(this._toolbar[e]) } this._setReplyText(this._toolbar[e]); this._toolbar[e].addOp(ZmOperation.FILLER); this._initializeNavToolBar(e) } this._setupViewMenu(e); this._setupDeleteButton(this._toolbar[e]); if(appCtxt.get(ZmSetting.SPAM_ENABLED)){ this._setupSpamButton(this._toolbar[e]) } this._setupCheckMailButton(this._toolbar[e]); this._setupPrintButton(this._toolbar[e]); this._setNewButtonProps(e,ZmMsg.compose,"NewMessage","NewMessageDis",ZmOperation.NEW_MESSAGE) }; ZmMailListController.prototype._getNumTotal=function(){ if(AjxEnv.is1024x768orLower){ return null } return ZmListController.prototype._getNumTotal.call(this) }; ZmMailListController.prototype._initializeActionMenu=function(){ var e=(this._actionMenu!=null); ZmListController.prototype._initializeActionMenu.call(this); if(this._actionMenu){ this._setupSpamButton(this._actionMenu); if(!e){ this._setupEditButton(this._actionMenu) }} appCtxt.notifyZimlets("onActionMenuInitialized",[this,this._actionMenu]) }; ZmMailListController.prototype._standardToolBarOps=function(){ return[ZmOperation.NEW_MENU,ZmOperation.SEP,ZmOperation.CHECK_MAIL,ZmOperation.SEP,ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.PRINT,ZmOperation.SEP] }; ZmMailListController.prototype._flagOps=function(){ return[ZmOperation.MARK_READ,ZmOperation.MARK_UNREAD] }; ZmMailListController.prototype._msgOps=function(){ var e=[]; if(appCtxt.get(ZmSetting.REPLY_MENU_ENABLED)){ e.push(ZmOperation.REPLY,ZmOperation.REPLY_ALL) } if(appCtxt.get(ZmSetting.FORWARD_MENU_ENABLED)){ e.push(ZmOperation.FORWARD) } return e }; ZmMailListController.prototype._setActiveSearch=function(e){ if(this._activeSearch){ if(this._list){ this._list.setHasMore(this._activeSearch.getAttribute("more")) } if(this._listView[e]){ this._listView[e].offset=parseInt(this._activeSearch.getAttribute("offset")) }}}; ZmMailListController.prototype._listSelectionListener=function(t){ if(appCtxt.isOffline&&t.detail==DwtListView.ITEM_DBL_CLICKED&&t.item&&t.item.isDraft&&appCtxt.getCurrentSearch().folderId==ZmFolder.ID_OUTBOX){ var i=t.item.account||ZmOrganizer.parseId(t.item.id).account; var e=appCtxt.getById(ZmOrganizer.getSystemId(ZmFolder.ID_DRAFTS,i)); this._list.moveItems({ items:[t.item],folder:e} ) } ZmListController.prototype._listSelectionListener.apply(this,arguments) }; ZmMailListController.prototype._listActionListener=function(c){ ZmListController.prototype._listActionListener.call(this,c); var r=this._listView[this._currentView].getSelection(); var h=false; var n=false; var t=this._getSearchFolder(); if(!t||(t&&!t.isReadOnly())){ for(var o=0; o1){ ZmOperation.setOperation(this._participantActionMenu.getSearchMenu(),ZmOperation.SEARCH_TO,ZmOperation.SEARCH_TO,ZmMsg.findEmailToRecipients); ZmOperation.setOperation(this._participantActionMenu.getSearchMenu(),ZmOperation.SEARCH,ZmOperation.SEARCH,ZmMsg.findEmailFromRecipients) }else{ ZmOperation.setOperation(this._participantActionMenu.getSearchMenu(),ZmOperation.SEARCH_TO,ZmOperation.SEARCH_TO,ZmMsg.findEmailToRecipient); ZmOperation.setOperation(this._participantActionMenu.getSearchMenu(),ZmOperation.SEARCH,ZmOperation.SEARCH,ZmMsg.findEmailFromRecipient) }}else{ if(this._participantActionMenu&&this._participantActionMenu.getOp(ZmOperation.SEARCH_MENU)){ ZmOperation.setOperation(this._participantActionMenu.getSearchMenu(),ZmOperation.SEARCH_TO,ZmOperation.SEARCH_TO,ZmMsg.findEmailToSender); ZmOperation.setOperation(this._participantActionMenu.getSearchMenu(),ZmOperation.SEARCH,ZmOperation.SEARCH,ZmMsg.findEmailFromSender) }}}; ZmMailListController.prototype._handleResponseGetContact=function(i,t,o,e){ this._actionEv.contact=e; this._setContactText(e!=null); if(i){ if(e){ ZmImApp.updateImMenuItemByContact(i,e,t) }else{ ZmImApp.handleResponseGetContact(i,t,true) }} this._participantActionMenu.popup(0,o.docX,o.docY) }; ZmMailListController.prototype._markReadListener=function(e){ var t=this._getMarkReadCallback(); this._doMarkRead(this._listView[this._currentView].getSelection(),true,t) }; ZmMailListController.prototype._getMarkReadCallback=function(){ var e=this._listView[this._currentView]; var t=e.getSelection(); if(this.isReadingPaneOn()&&appCtxt.get(ZmSetting.MARK_MSG_READ)==-1){ var r=e.parent.getMsgView?e.parent.getMsgView().getMsg():null; if(r&&r.readReceiptRequested){ for(var o=0; o1){ h=r.action=ZmOperation.FORWARD_ATT; var n=new ZmBatchCommand(); var m=new AjxCallback(this,this._handleLoadMsgs,[r,u]); for(var l=0; l0){ n.run(m) }else{ this._handleLoadMsgs(r,u) } return }}else{ if(appCtxt.isOffline&&h==ZmOperation.DRAFT){ var e=appCtxt.getById(o.folderId); r.accountName=e&&e.getAccount().name }else{ if(h==ZmOperation.DECLINE_PROPOSAL){ r.subjOverride=this._getInviteReplySubject(h)+o.subject }}} r.msg=o; AjxDispatcher.run("Compose",r) }; ZmMailListController.prototype._handleLoadMsgs=function(s,o){ var e=new AjxVector(); for(var t=0; t"+o+"

"; var d=new ZmMimePart(); d.setContentType(ZmMimeTable.TEXT_HTML); d.setContent(g); var i=new ZmMimePart(); i.setContentType(ZmMimeTable.MULTI_ALT); i.children.add(p); i.children.add(d); r.setTopPart(i) } var l=this._getInviteReplySubject(e)+r._origMsg.invite.getEventName(); if(l!=null){ r.setSubject(l) } var h=new AjxCallback(this,this._handleErrorInviteReply); r.sendInviteReply(true,y,s,h,b,t,m) }; ZmMailListController.prototype._handleErrorInviteReply=function(e){ if(e.code==ZmCsfeException.MAIL_NO_SUCH_ITEM){ var t=appCtxt.getErrorDialog(); t.setMessage(ZmMsg.inviteOutOfDate); t.popup(null,true); return true }}; ZmMailListController.prototype._spamListener=function(i){ var e=this._listView[this._currentView].getSelection(); var t=this.getCurrentToolbar().getButton(ZmOperation.SPAM); this._doSpam(e,t.isMarkAsSpam) }; ZmMailListController.prototype._detachListener=function(e,i){ var t=this.getMsg(); if(t){ if(t._loaded){ ZmMailMsgView.detachMsgInNewWindow(t,false,this._msgControllerMode); if(t.isUnread&&!appCtxt.getById(t.folderId).isReadOnly()){ t.list.markRead({ items:[t],value:true} ) }}else{ ZmMailMsgView.rfc822Callback(t.id,null,this._msgControllerMode) }} if(i){ i.run() }}; ZmMailListController.prototype._printListener=function(l){ var d=this._listView[this._currentView]; var h=d.getSelection(); h=AjxUtil.toArray(h); var e=[]; var c=false; for(var r=0; r0); if(e&&e.nId==ZmOrganizer.ID_SYNC_FAILURES){ c.enableAll(false); c.enable([ZmOperation.NEW_MENU,ZmOperation.CHECK_MAIL],true); c.enable([ZmOperation.DELETE,ZmOperation.FORWARD],s>0); return } if(c&&c instanceof ZmToolBar){ var r=appCtxt.isChildWindow&&window.newWindowParams&&window.newWindowParams.isRfc822; if(r||(e&&e.isReadOnly()&&s>0)){ c.enable([ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.SPAM,ZmOperation.TAG_MENU],false) }else{ var u; if(s==1&&(t!=ZmFolder.ID_DRAFTS)){ var i=this._listView[this._currentView].getSelection(); if(i&&i.length){ u=i[0] }} var h=u&&u.folderId&&appCtxt.getById(u.folderId); var d=(u&&u.isDraft)||(t==ZmFolder.ID_DRAFTS); var n=(h&&h.isFeed()); c.enable([ZmOperation.REPLY,ZmOperation.REPLY_ALL],(!d&&!n&&s==1)); c.enable(ZmOperation.DETACH,(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)&&!d&&s==1)); c.enable([ZmOperation.SPAM,ZmOperation.MOVE,ZmOperation.FORWARD],(!d&&s>0)); c.enable([ZmOperation.CHECK_MAIL,ZmOperation.VIEW_MENU],true); var o=c.getOp(ZmOperation.EDIT); if(o){ o.setVisible(d&&(!h||!h.isReadOnly())) }}}else{ if(e&&e.isReadOnly()&&s>0){ c.enable([ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.SPAM,ZmOperation.TAG_MENU],false) }else{ c.enable([ZmOperation.SPAM],(!d&&s>0)) }} if(this._draftsActionMenu){ var l=this._draftsActionMenu.getOp(ZmOperation.EDIT); if(l){ l.setEnabled(s==1&&e&&!e.isReadOnly()) }} if(appCtxt.multiAccounts&&s>1&&appCtxt.getCurrentSearch().isMultiAccount()){ c.enable(ZmOperation.TAG_MENU,false) }}; ZmMailListController.prototype._enableFlags=function(i,t,e){ i.enable([ZmOperation.MARK_READ,ZmOperation.MARK_UNREAD],true); if(!t){ i.enable(ZmOperation.MARK_READ,false) } if(!e){ i.enable(ZmOperation.MARK_UNREAD,false) }}; ZmMailListController.prototype.pageItemSilently=function(i,e,o){ var t=this._getNextItem(i,e); if(t){ if(o){ o.inactive=true } var n=this._listView[this._currentView]; n.emulateDblClick(t) }}; ZmMailListController.prototype._getNextItem=function(n,t){ var r=this._list.getArray(); var e=r.length; for(var o=0; o=e){ if(!this._list.hasMore()){ return } this._paginate(this._currentView,true,s); return } return r[s] }; ZmMailListController.prototype._handleResponsePaginate=function(t,o,i,s,e){ ZmListController.prototype._handleResponsePaginate.apply(this,arguments); var n=i?this._list.getVector().get(i):null; if(n){ this._listView[this._currentView].emulateDblClick(n) }}; ZmMailListController.prototype._getMenuContext=function(){ return this._getViewType() }; ZmMailListController.prototype._doFlag=function(t,e){ ZmListController.prototype._doFlag.call(this,t,e); appCtxt.notifyZimlets("onMailFlagClick",[t,e]) }; ZmMailListController.prototype._doTag=function(t,e,i){ ZmListController.prototype._doTag.call(this,t,e,i); appCtxt.notifyZimlets("onTagAction",[t,e,i]) }; ZmMailListController.prototype._getUnreadItem=function(n,l,s){ var i=this._listView[this._currentView]; var h=i.getList(true).getArray(); var u=h.length; if(!u){ return } var e,r; if(n==DwtKeyMap.SELECT_FIRST){ r=0 }else{ if(n==DwtKeyMap.SELECT_LAST){ r=h.length-1 }else{ var t=i.getSelection(); var e,r; if(t&&t.length){ e=(n==DwtKeyMap.SELECT_NEXT)?t[t.length-1]:t[0] }else{ e=(n==DwtKeyMap.SELECT_NEXT)?h[0]:h[h.length-1] } if(e){ var c=i.getItemIndex(e,true); if(t&&t.length&&!s){ r=(n==DwtKeyMap.SELECT_NEXT)?c+1:c-1 }else{ r=c }}}} var o=null; while((r>=0&&r0){ AjxTimedAction.cancelAction(appCtxt.markReadActionId); appCtxt.markReadActionId=-1 } this._doublePaneView.setMsg(i); this._curMsg=i; if(i.isUnread){ var e=appCtxt.getById(i.folderId); var o=e?e.isReadOnly():false; if(!o){ var t=appCtxt.get(ZmSetting.MARK_MSG_READ); if(t==ZmSetting.MARK_READ_NOW){ this._doMarkRead([i],true) }else{ if(t>0){ if(!appCtxt.markReadAction){ appCtxt.markReadAction=new AjxTimedAction(this,this._markReadAction) } appCtxt.markReadAction.args=[i]; appCtxt.markReadActionId=AjxTimedAction.scheduleAction(appCtxt.markReadAction,t*1000) }}}}}; ZmDoublePaneController.prototype._markReadAction=function(e){ this._doMarkRead([e],true) }; ZmDoublePaneController.prototype._preHideCallback=function(){ if(appCtxt.markReadActionId>0){ AjxTimedAction.cancelAction(appCtxt.markReadActionId); appCtxt.markReadActionId=-1 } return ZmController.prototype._preHideCallback.call(this) }; ZmDoublePaneController.prototype._setupReadingPaneMenuItems=function(r,o,l){ if(o.getItemCount()>0){ new DwtMenuItem({ parent:o,style:DwtMenuItem.SEPARATOR_STYLE} ) } var h={ text:ZmMsg.readingPaneAtBottom,style:DwtMenuItem.RADIO_STYLE,radioGroupId:"RP"}; var e=ZmDoublePaneController.RP_IDS; var c=this._getReadingPanePref(); for(var n=0; n=0; n--){ var d=l.getItemFromElement(c[n]); if(d&&!o[d.id]&&!t[d.id]&&!(d.cid&&(o[d.cid]||t[d.cid]))){ return d }} return ZmMailListView.FIRST_ITEM }else{ var r=l._getRowIndex(h[0]); var c=l._parentEl.childNodes; for(var n=r+1; n=0&&t0){ new DwtMenuItem({ parent:h,style:DwtMenuItem.SEPARATOR_STYLE} ) } var s=[ZmMailListController.CONV_ORDER_DESC,ZmMailListController.CONV_ORDER_ASC]; var n=appCtxt.get(ZmSetting.CONVERSATION_ORDER); var r={ style:DwtMenuItem.RADIO_STYLE,radioGroupId:"CO"}; for(var o=0; oo.size())&&o.hasMore())){ var s=(i+t)-o.size(); var n=s0?s:t; if(n0){ var s={}; var h=AjxSoapDoc.create("ImportDataRequest","urn:zimbraMail"); for(var n=0; n0){ var u=[AjxMessageFormat.format(ZmMsg.dataSourceFailureDescription,[c])]; for(var h=0; h0){ this.checkStatus(n,u) }} } if(AjxPackage.define("zimbraMail.mail.model.ZmPopAccount")){ ZmPopAccount=function(e){ ZmDataSource.call(this,ZmAccount.TYPE_POP,e) }; ZmPopAccount.prototype=new ZmDataSource; ZmPopAccount.prototype.constructor=ZmPopAccount; ZmPopAccount.PORT_CLEAR=110; ZmPopAccount.PORT_SSL=995; ZmPopAccount.PORT_DEFAULT=ZmPopAccount.PORT_CLEAR; ZmPopAccount.prototype.ELEMENT_NAME="pop3"; ZmPopAccount.prototype.port=ZmPopAccount.PORT_DEFAULT; ZmPopAccount.prototype.toString=function(){ return"ZmPopAccount" }; ZmPopAccount.prototype.getDefaultPort=function(){ return(this.connectionType==ZmDataSource.CONNECT_SSL)?ZmPopAccount.PORT_SSL:ZmPopAccount.PORT_DEFAULT } } if(AjxPackage.define("zimbraMail.mail.model.ZmImapAccount")){ ZmImapAccount=function(e){ ZmDataSource.call(this,ZmAccount.TYPE_IMAP,e) }; ZmImapAccount.prototype=new ZmDataSource; ZmImapAccount.prototype.constructor=ZmImapAccount; ZmImapAccount.PORT_CLEAR=143; ZmImapAccount.PORT_SSL=993; ZmImapAccount.PORT_DEFAULT=ZmImapAccount.PORT_CLEAR; ZmImapAccount.prototype.ELEMENT_NAME="imap"; ZmImapAccount.prototype.port=ZmImapAccount.PORT_DEFAULT; ZmImapAccount.prototype.toString=function(){ return"ZmImapAccount" }; ZmImapAccount.prototype.getDefaultPort=function(){ return(this.connectionType==ZmDataSource.CONNECT_SSL)?ZmImapAccount.PORT_SSL:ZmImapAccount.PORT_DEFAULT }; ZmImapAccount.sortCompare=function(n,o){ var e=ZmOrganizer.checkSortArgs(n,o); if(e!=null){ return e } var i=ZmFolder.getIdForName(n.name); var t=ZmFolder.getIdForName(o.name); if(ZmFolder.SORT_ORDER[i]&&ZmFolder.SORT_ORDER[t]){ return(ZmFolder.SORT_ORDER[i]-ZmFolder.SORT_ORDER[t]) } if(!ZmFolder.SORT_ORDER[i]&&ZmFolder.SORT_ORDER[t]){ return 1 } if(ZmFolder.SORT_ORDER[i]&&!ZmFolder.SORT_ORDER[t]){ return -1 } if(n.name.toLowerCase()>o.name.toLowerCase()){ return 1 } if(n.name.toLowerCase()"; e[n++]=AjxImg.getImageHtml(r.sentByIcon,"cursor:pointer"); e[n++]="
" } e[n++]=""; if(r.obo&&(r.oboAddr!=r.sentByAddr)){ e[n++]="" } e[n++]="
 "; e[n++]=r.sentBy; e[n++]="  "; e[n++]=ZmMsg.onBehalfOfLabel; e[n++]=""; e[n++]=r.obo; e[n++]="
"; for(var o=0; o
" } e[n++]="
"; return s?e.length:e.join("") } ,{ id:"mail.Message#MessageHeader"} ,false); AjxTemplate.register("mail.Message",AjxTemplate.getTemplate("mail.Message#MessageHeader"),AjxTemplate.getParams("mail.Message#MessageHeader")); AjxTemplate.register("mail.Message#InviteHeader",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="
 
"; e[i++]=AjxImg.getImageHtml("Information"); e[i++]=""; e[i++]=n.counterInvMsg; e[i++]="
" } e[i++]=""; e[i++]=ZmMsg.organizerLabel; e[i++]=""; e[i++]=n.invOrganizer; e[i++]=""; if(n.invSentBy){ e[i++]=""; e[i++]=ZmMsg.sentByLabel; e[i++]=""; e[i++]=n.invSentBy; e[i++]="" } if(n.obo&&(AjxStringUtil.stripTags(n.obo)!=AjxStringUtil.stripTags(n.invSentBy))){ e[i++]=""; e[i++]=ZmMsg.onBehalfOfLabel; e[i++]=" "; e[i++]=n.obo; e[i++]="" } e[i++]=""; e[i++]=n.counterInvMsg?ZmMsg.proposedTimeLabel:ZmMsg.timeLabel; e[i++]=""; e[i++]=n.invDate; e[i++]="
"; e[i++]=n.timezone; e[i++]=""; if(n.invite.getLocation()){ e[i++]=""; e[i++]=ZmMsg.locationLabel; e[i++]=""; e[i++]=AjxStringUtil.htmlEncode(n.invite.getLocation()); e[i++]="" } if(n.ptstId){ e[i++]=""; e[i++]=ZmMsg.inviteesLabel; e[i++]="" }else{ if(n.invite.hasOtherAttendees()){ e[i++]=""; e[i++]=ZmMsg.inviteesLabel; e[i++]=""; e[i++]=n.invitees; e[i++]=""; if(n.optInvitees){ e[i++]=""; e[i++]=ZmMsg.optionalLabel; e[i++]=""; e[i++]=n.optInvitees; e[i++]="" }}} if(n.recur){ e[i++]=""; e[i++]=ZmMsg.repeats; e[i++]=":"; e[i++]=n.recur; e[i++]="" } e[i++]=""; if(n.hasAttachments){ e[i++]='
" } e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#InviteHeader"} ,false); AjxTemplate.register("mail.Message#InviteHeaderPtst",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="
"; e[i++]=AjxImg.getImageHtml(n.icon); e[i++]=""; e[i++]=n.attendee; e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#InviteHeaderPtst"} ,false); AjxTemplate.register("mail.Message#AttachmentsView",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="
Loading...
"; return o?e.length:e.join("") } ,{ id:"mail.Message#AttachmentsView"} ,false); AjxTemplate.register("mail.Message#MessageListHeader",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]=""; if(n.tagDivId){ e[i++]="" } e[i++]="
"; e[i++]=AjxImg.getImageHtml("ConversationView"); e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#MessageListHeader"} ,false); AjxTemplate.register("mail.Message#InformationBar",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="
"; e[i++]=AjxImg.getImageHtml("Warning"); e[i++]=""; e[i++]=n.text; e[i++]=" "; e[i++]=n.link; e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#InformationBar"} ,false); AjxTemplate.register("mail.Message#ExtImageInformationBar",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="
'; e[i++]=n.text; e[i++]=" "; e[i++]=n.link; e[i++]=" - "; e[i++]=n.alwaysText; e[i++]=" "; e[i++]=n.domain; e[i++]=" "; e[i++]=n.or; e[i++]=" "; e[i++]=n.email; e[i++]='
'; return o?e.length:e.join("") } ,{ id:"mail.Message#ExtImageInformationBar"} ,false); AjxTemplate.register("mail.Message#AllAttachments",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]=""; if(n.viewAllUrl&&!appCtxt.get(ZmSetting.ATTACHMENTS_BLOCKED)){ e[i++]="" } if(!appCtxt.get(ZmSetting.ATTACHMENTS_BLOCKED)){ e[i++]="" } e[i++]="
"; e[i++]=AjxImg.getImageHtml("ViewAll","position:relative;"); e[i++]="'; e[i++]=ZmMsg.viewAllImages; e[i++]="
"; e[i++]=AjxImg.getImageHtml(ZmMimeTable.getInfo(ZmMimeTable.APP_ZIP).image,"position:relative;"); e[i++]=""; e[i++]=ZmMsg.downloadAll; e[i++]="
"; e[i++]=AjxImg.getImageHtml("AttachmentRemove","position:relative;"); e[i++]=""; e[i++]=ZmMsg.removeAllAttachments; e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#AllAttachments"} ,false); AjxTemplate.register("mail.Message#Compose",function(i,h,s,t){ var n=Boolean(t); s=(typeof s=="string"?{ id:s} :s)||{}; t=t||[]; var o=t.length; var e="width:"+(AjxEnv.isIE?60:64)+"px; overflow:visible; white-space:nowrap"; var r=AjxEnv.isSafari&&!AjxEnv.isSafariNightly?"height:52px;":"height:21px; overflow:hidden"; t[o++]=""; if(appCtxt.multiAccounts){ t[o++]="" }else{ t[o++]="
"; t[o++]=ZmMsg.fromLabel; t[o++]="
' } t[o++]="
"; t[o++]=ZmMsg.dndTooltip; t[o++]="
"; return n?t.length:t.join("") } ,{ id:"mail.Message#Compose"} ,false); AjxTemplate.register("mail.Message#ForwardMessages",function(t,l,h,e){ var r=Boolean(e); h=(typeof h=="string"?{ id:h} :h)||{}; e=e||[]; var s=e.length; e[s++]=""; for(var o=0; o":">" } r[s++]="" } r[s++]="
"; if(appCtxt.get(ZmSetting.ATTACHMENTS_BLOCKED)){ r[s++]=AjxStringUtil.htmlEncode(AjxStringUtil.clipFile(c.label,100)) }else{ r[s++]=""; r[s++]=c.link; r[s++]=AjxStringUtil.htmlEncode(AjxStringUtil.clipFile(c.label,100)); r[s++]="" } if(c.size){ r[s++]="\n"; r[s++]="\t\t\t\t\t("; r[s++]=c.size; r[s++]=")\n"; r[s++]="\t\t\t\t" } r[s++]="
"; return n?r.length:r.join("") } ,{ id:"mail.Message#ForwardAttachments"} ,false); AjxTemplate.register("mail.Message#ZmMailConfirmView",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="
"; e[i++]=ZmMsg.loading; e[i++]="

'; e[i++]=ZmMsg.confirmDisplayAddresss; e[i++]="
'; e[i++]=ZmMsg.confirmNewAddresses; e[i++]="
"; e[i++]=ZmMsg.confirmNewAddressesCheck; e[i++]="
'; e[i++]=ZmMsg.confirmExistingContacts; e[i++]="

 
"; return o?e.length:e.join("") } ,{ id:"mail.Message#ZmMailConfirmView"} ,false); AjxTemplate.register("mail.Message#ZmMailConfirmViewNewAddress",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]='
"; return o?e.length:e.join("") } ,{ id:"mail.Message#ZmMailConfirmViewNewAddress"} ,false); AjxTemplate.register("mail.Message#ZmMailConfirmViewExistingContact",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]='
'; e[i++]=n.text; e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#ZmMailConfirmViewExistingContact"} ,false); AjxTemplate.register("mail.Message#viewMessage",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="

"; e[i++]=ZmMsg.viewMessage; e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#viewMessage"} ,false); AjxTemplate.register("mail.Message#EmptyMessage",function(t,s,n,e){ var o=Boolean(e); n=(typeof n=="string"?{ id:n} :n)||{}; e=e||[]; var i=e.length; e[i++]="

"; e[i++]=ZmMsg.messageEmptyTextContent; e[i++]="
"; return o?e.length:e.join("") } ,{ id:"mail.Message#EmptyMessage"} ,false) }; ZWC

",AjxEnv.isGeckoBased?"
":"","

"].join(""); DwtHtmlEditor.TAB="\t"; DwtHtmlEditor.prototype.focus=function(t){ if(!AjxEnv.isIE&&this._mode==DwtHtmlEditor.TEXT){ document.getElementById(this._textAreaId).focus() }else{ try{ if(!this._htmlModeInited){ t=t||0; if(t<10){ setTimeout(AjxCallback.simpleClosure(this.focus,this,t+1),DwtHtmlEditor._INITDELAY) } return } if(AjxEnv.isSafari){ document.getElementById(this._iFrameId).focus() }else{ this._getIframeWin().focus() } if(AjxEnv.isIE){ if(this._currInsPt){ if(this._currInsPt.text.length<=1){ this._currInsPt.collapse(false) } this._currInsPt.select() }}} catch(e){}}}; DwtHtmlEditor.prototype.moveCaretToTop=function(){ var n=document.activeElement; if(this._mode==DwtHtmlEditor.TEXT){ var o=document.getElementById(this._textAreaId); if(o.createTextRange){ var t=o.createTextRange(); t.collapse(true); t.select() }else{ if(o.setSelectionRange){ o.setSelectionRange(0,0) }}}else{ this._moveCaretToTopHtml(true) } if(n){ try{ n.focus() } catch(a){}}}; DwtHtmlEditor.prototype._moveCaretToTopHtml=function(t){ var e=this._getIframeDoc().body; var n=false; if(AjxEnv.isIE){ if(e){ e.createTextRange().collapse(true); n=true }}else{ var a=this._getSelection(); if(a){ a.collapse(e,0); n=true }} if(!n&&t){ var o=new AjxTimedAction(this,this._moveCaretToTopHtml); AjxTimedAction.scheduleAction(o,DwtHtmlEditor._INITDELAY+1) }}; DwtHtmlEditor.prototype.addStateChangeListener=function(e){ this.addListener(DwtEvent.STATE_CHANGE,e) }; DwtHtmlEditor.prototype.removeStateChangeListener=function(e){ this.removeListener(DwtEvent.STATE_CHANGE,e) }; DwtHtmlEditor.prototype.clear=function(){ AjxDebug.println(AjxDebug.REPLY,"DwtHtmlEditor::clear"); this.setContent("") }; DwtHtmlEditor.prototype.enable=function(e){ if(this._textAreaId!=null){ document.getElementById(this._textAreaId).disabled=!e } if(this._iFrameId!=null){ document.getElementById(this._iFrameId).disabled=!e }}; DwtHtmlEditor.prototype.isHtmlEditingSupported=function(){ return(!!(AjxEnv.isGeckoBased||AjxEnv.isIE||AjxEnv.isSafari3up)) }; DwtHtmlEditor.prototype.getContent=function(){ if(this._mode==DwtHtmlEditor.HTML){ var a=this._getIframeDoc(); var e=a&&a.body?(this._getIframeDoc().body.innerHTML):""; return this._embedHtmlContent(e) }else{ var t=document.getElementById(this._textAreaId); return t&&t.value }}; DwtHtmlEditor.prototype._embedHtmlContent=function(e){ return["",e,""].join("") }; DwtHtmlEditor.prototype.setContent=function(e){ if(AjxEnv.isIE){ this._currInsPt=null } e=e||""; AjxDebug.println(AjxDebug.REPLY,"DwtHtmlEditor::setContent - Content length: "+e.length); if(this._mode==DwtHtmlEditor.HTML){ this._pendingContent=e; AjxDebug.println(AjxDebug.REPLY,"HTML mode, initialized: "+this._htmlModeInited); if(this._htmlModeInited){ this._setContentOnTimer() }}else{ AjxDebug.println(AjxDebug.REPLY,"Text mode, set textarea value"); document.getElementById(this._textAreaId).value=e }}; DwtHtmlEditor.prototype.insertElement=function(e){ this._execCommand(e) }; DwtHtmlEditor.prototype.insertText=function(a,e){ var t=this._getIframeDoc().createTextNode(a); this._insertNodeAtSelection(t,e) }; DwtHtmlEditor.prototype.insertImage=function(s,h,a,e){ if(h){ var o=this._getIframeDoc(); var t=o.createElement("img"); if(s&&s.indexOf("cid:")==0){ t.setAttribute("dfsrc",s) }else{ t.setAttribute("src",s) } if(a){ t.width=a }else{ t.removeAttribute("width") } if(e){ t.height=e }else{ t.removeAttribute("height") } t.style.border="0"; var n=o.createDocumentFragment(); n.appendChild(t); this._insertNodeAtSelection(n) }else{ this._execCommand(DwtHtmlEditor.IMAGE,s) }}; DwtHtmlEditor.prototype.replaceImage=function(o,a){ var t=this._getIframeDoc(); if(t){ var e=t.getElementById(o); if(e&&e.getAttribute("data-zim-uri")===o){ e.src=a; e.removeAttribute("id"); e.removeAttribute("data-zim-uri") }}}; DwtHtmlEditor.prototype.insertTable=function(b,m,a,t,l,u){ if(this._mode!=DwtHtmlEditor.HTML){ return } var g=this._getIframeDoc(); var y=g.createElement("table"); y.style.borderRight="1px solid #000"; y.style.borderLeft="1px solid #000"; y.style.borderTop="1px solid #000"; y.style.borderBottom="1px solid #000"; if(a!=null){ y.style.width=a }else{ y.style.width="100%" } y.style.textAlign="left"; y.style.verticalAlign="middle"; if(u!=null){ y.align=u.toLowerCase() } if(t!=null){ y.cellSpacing=t }else{ y.cellSpacing=0 } if(l!=null){ y.cellPadding=l }else{ y.cellPadding=0 } if(!AjxEnv.isIE){ y.style.border="1px solid #000" } y.style.borderCollapse="collapse"; var c; c=Math.floor(100/m)+"%"; var h=g.createElement("tbody"); y.appendChild(h); for(var s=0; s0?u[0]:null; if(t&&!u){ u=c.createElement("caption"); d.insertBefore(u,d.firstChild) } if(!t&&u){ u.parentNode.removeChild(u) } if(u){ u.innerHTML=e } break; case"summary":case"align":case"cellSpacing":case"cellPadding":if(!t){ d.removeAttribute(s,0) }else{ d[s]=e } break; case"borderWidth":case"borderStyle":case"borderColor":d.style[s]=e; h.push([s,e]); break; default:d.style[s]=e; break }} if(h.length>0){ var n=d.getElementsByTagName("td"); for(var s=n.length; --s>=0; ){ var a=n[s]; for(var o=h.length; --o>=0; ){ a.style[h[o][0]]=h[o][1] }}} if(AjxEnv.isGeckoBased){ this._forceRedraw() }}; DwtHtmlEditor.prototype.applyCellProperties=function(u,m,s){ var h=true; for(var a=m.length; --a>=0; ){ var f=m[a]; if(!f){ continue } var n=(a==0); var d=true; for(var t=f.length; --t>=0; ){ var c=(t==0); var e=f[t]; if(s.backgroundColor!=null){ e.style.backgroundColor=s.backgroundColor } if(s.color!=null){ e.style.color=s.color } if(s.textAlign!=null){ e.style.textAlign=s.textAlign } if(s.verticalAlign!=null){ e.style.verticalAlign=s.verticalAlign } if(s.width!=null){ if(s.width){ e.style.width=s.width+"px" }else{ e.style.width="" }} if(s.height!=null){ if(s.height){ e.style.height=s.height+"px" }else{ e.style.height="" }} if(s.vertPadding!=null){ if(s.vertPadding){ e.style.paddingTop=e.style.paddingBottom=s.vertPadding+"px" }else{ e.style.paddingTop=e.style.paddingBottom="" }} if(s.horizPadding!=null){ if(s.horizPadding){ e.style.paddingLeft=e.style.paddingRight=s.horizPadding+"px" }else{ e.style.paddingLeft=e.style.paddingRight="" }} var o=s.borders,l; l=o[DwtHtmlEditor.BORDER_TOP]; if(l!=null&&n){ e.style.borderTop=l.width+" "+l.style+" "+l.color } l=o[DwtHtmlEditor.BORDER_MIDDLE]; if(l!=null){ l=l.width+" "+l.style+" "+l.color; if(!h){ e.style.borderBottom=l } if(!n){ e.style.borderTop=l }} l=o[DwtHtmlEditor.BORDER_BOTTOM]; if(l!=null&&h){ e.style.borderBottom=l.width+" "+l.style+" "+l.color } l=o[DwtHtmlEditor.BORDER_LEFT]; if(l!=null&&c){ e.style.borderLeft=l.width+" "+l.style+" "+l.color } l=o[DwtHtmlEditor.BORDER_CENTER]; if(l!=null){ l=l.width+" "+l.style+" "+l.color; if(!d){ e.style.borderRight=l } if(!c){ e.style.borderLeft=l }} l=o[DwtHtmlEditor.BORDER_RIGHT]; if(l!=null&&d){ e.style.borderRight=l.width+" "+l.style+" "+l.color } d=false } h=false } if(AjxEnv.isGeckoBased){ this._forceRedraw() }}; DwtHtmlEditor.prototype._insertHTML=function(o,a){ var n=this._getSelection(); var e=this._createRange(n); if(AjxEnv.isIE){ if(this.insertRange){ this.insertRange.pasteHTML(o) }else{ e.pasteHTML(o) }}else{ var h=this._getIframeDoc(); var t=h.createDocumentFragment(); var s=h.createElement("div"); s.innerHTML=o; while(s.firstChild){ t.appendChild(s.firstChild) } this._insertNodeAtSelection(t,null,null,a) }}; DwtHtmlEditor.prototype._getSelectionHtml=function(o){ var e=o.createRange(); var e=o.createRange(); var a=o.type.toLowerCase(); if(a=="text"){ return e.htmlText }else{ if(a=="control"){ var t=""; for(i=0; i") } catch(d){ l.collapse(false); l.pasteHTML("") } var o=this._getIframeDoc().getElementById(a); o.parentNode.insertBefore(s,o); o.parentNode.removeChild(o); return f }}; DwtHtmlEditor.prototype.isHtmlModeInited=function(){ return this._htmlModeInited }; DwtHtmlEditor.prototype.setMode=function(h,n,a){ if(h==this._mode||(h!=DwtHtmlEditor.HTML&&h!=DwtHtmlEditor.TEXT)){ return } var t=this._getIframeDoc(); this._mode=h; if(h==DwtHtmlEditor.HTML){ var s=Dwt.byId(this._textAreaId); var e; var o=n?AjxStringUtil.convertToHtml(s.value,true):s.value; if(this._iFrameId){ AjxDebug.println(AjxDebug.REPLY,"DwtHtmlEditor::setMode - content length = "+o.length); AjxDebug.println(AjxDebug.REPLY,"Set innerHTML of iframe body"); t.body.innerHTML=o; e=document.getElementById(this._iFrameId) }else{ e=this._initHtmlMode(o) } Dwt.setVisible(s,false); Dwt.setVisible(e,true); if(AjxEnv.isGeckoBased||AjxEnv.isSafari){ this._enableDesignMode(t) }}else{ var s=this._textAreaId?Dwt.byId(this._textAreaId):this._initTextMode(true); s.value=n?this._convertHtml2Text(a):t.innerHTML; Dwt.setVisible(document.getElementById(this._iFrameId),false); Dwt.setVisible(s,true) }}; DwtHtmlEditor.prototype.getMode=function(){ return this._mode }; DwtHtmlEditor.prototype.setFont=function(n,o,a,e,t){ if(n){ this._execCommand(DwtHtmlEditor._FONT_NAME,n) } if(o){ this._execCommand(o) } if(a){ this._execCommand(DwtHtmlEditor._FONT_SIZE,a) } if(e){ this._execCommand(DwtHtmlEditor._FONT_COLOR,e) } if(t){ this._execCommand((AjxEnv.isIE)?DwtHtmlEditor._FONT_HILITE_IE:DwtHtmlEditor._FONT_HILITE,t) }}; DwtHtmlEditor.prototype.setJustification=function(e){ this._execCommand(e) }; DwtHtmlEditor.prototype.setIndent=function(e){ this._execCommand(e) }; DwtHtmlEditor.prototype.setStyle=function(e){ this._execCommand(DwtHtmlEditor._FORMAT_BLOCK,DwtHtmlEditor._STYLES[e]) }; DwtHtmlEditor.prototype.setSize=function(a,t){ DwtComposite.prototype.setSize.call(this,a,t); var o=this.getHtmlElement(); if(this._iFrameId!=null){ var e=document.getElementById(this._iFrameId); e.width=o.style.width; e.height=o.style.height }else{ var n=document.getElementById(this._textAreaId); n.style.width=o.style.width; n.style.height=o.style.height }}; DwtHtmlEditor.prototype.getIframe=function(){ return document.getElementById(this._iFrameId) }; DwtHtmlEditor.prototype.getInputElement=function(){ var e=(this._mode==DwtHtmlEditor.HTML)?this._iFrameId:this._textAreaId; return document.getElementById(e) }; DwtHtmlEditor.prototype._initialize=function(){ if(this._mode==DwtHtmlEditor.HTML){ this._initHtmlMode(this._pendingContent) }else{ this._initTextMode() }}; DwtHtmlEditor.prototype.TEXTAREA_CLASSNAME="DwtHtmlEditorTextArea"; DwtHtmlEditor.prototype._initTextMode=function(t){ var e=this.getHtmlElement(); if(!this._textAreaId){ this._textAreaId="textarea_"+Dwt.getNextId() } var a=document.createElement("textarea"); a.className=this.TEXTAREA_CLASSNAME; a.id=this._textAreaId; e.appendChild(a); if(!t){ a.value=this._pendingContent; this._pendingContent=null } return a }; DwtHtmlEditor.prototype._initHtmlMode=function(o){ this._pendingContent=o||""; this._keyEvent=new DwtKeyEvent(); this._stateEvent=new DwtHtmlEditorStateEvent(); this._stateEvent.dwtObj=this; this._updateStateAction=new AjxTimedAction(this,this._updateState); var n=this.getHtmlElement(); this._iFrameId="iframe_"+Dwt.getNextId(); var a=document.createElement("iframe"); a.id=this._iFrameId; a.className="DwtHtmlEditorIFrame"; a.setAttribute("border","0",false); a.setAttribute("frameborder","0",false); a.setAttribute("vspace","0",false); a.setAttribute("autocomplete","off",false); var t=AjxCallback.simpleClosure(this._finishHtmlModeInit,this); setTimeout(t,DwtHtmlEditor._INITDELAY); if(this._isPasteEnabled){ var e=AjxCallback.simpleClosure(this._registerPasteEvent,this); a.onload=e } a.src='javascript:(function(d){d.open();d.write("");d.close();})(document)'; n.appendChild(a); return a }; DwtHtmlEditor.prototype._registerPasteEvent=function(){ var e=this,t=e._getIframeDoc(); e._unregisterEditorEventHandler(t,"paste"); e._registerEditorEventHandler(t,"paste") }; DwtHtmlEditor.prototype._finishHtmlModeInit=function(){ var a=this._getIframeDoc(); try{ if(AjxEnv.isSafari&&a.body==null){ a.open(); a.write(""); a.close() }} catch(t){ return } if(AjxEnv.isGeckoBased){ a.open(); a.write(DwtHtmlEditor.INIT_HTML); a.close() } function e(o){ this._enableDesignMode(o); this._setContentOnTimer(); this._updateState(); this._htmlModeInited=true; this._registerEditorEventHandlers(document.getElementById(this._iFrameId),o) } setTimeout(AjxCallback.simpleClosure(e,this,a),DwtHtmlEditor._INITDELAY*4) }; DwtHtmlEditor.prototype._focus=function(){ this.focus() }; DwtHtmlEditor.prototype._getIframeDoc=function(){ return this._iFrameId?Dwt.getIframeDoc(document.getElementById(this._iFrameId)):null }; DwtHtmlEditor.prototype._getIframeWin=function(){ return Dwt.getIframeWindow(document.getElementById(this._iFrameId)) }; DwtHtmlEditor.prototype._getParentElement=function(){ if(AjxEnv.isIE){ var s=this._getIframeDoc(); var a=s.selection; var t=a.createRange(); if(a.type=="None"||a.type=="Text"){ return a.createRange().parentElement() } if(a.type=="Control"){ return a.createRange().item(0) } return s.body }else{ try{ var t=this._getRange(); var n=t.commonAncestorContainer; if(!t.collapsed&&t.startContainer==t.endContainer&&t.startOffset-t.endOffset<=1&&t.startContainer.hasChildNodes()){ n=t.startContainer.childNodes[t.startOffset] } while(n.nodeType==3){ n=n.parentNode } return n } catch(o){ return null }}}; DwtHtmlEditor.prototype.getNearestElement=function(t){ try{ var a=this._getParentElement(); t=t.toLowerCase(); while(a&&a.nodeName.toLowerCase()!=t){ a=a.parentNode } return a } catch(e){ return null }}; DwtHtmlEditor.prototype.selectNodeContents=function(a,s,e){ var t; var n=(typeof s=="boolean"); if(AjxEnv.isIE){ t=this._getIframeDoc().body.createTextRange(); t.moveToElementText(a); (n)&&t.collapse(s); t.select() }else{ var o=this._getSelection(); t=this._getIframeDoc().createRange(); if(e){ t.selectNode(a) }else{ t.selectNodeContents(a) } (n)&&t.collapse(s); o.removeAllRanges(); o.addRange(t) }}; DwtHtmlEditor.prototype._forceRedraw=function(){ var e=this._getIframeDoc().body; e.style.display="none"; var t=this; setTimeout(function(){ e.style.display=""; t.focus(); t=null } ,10) }; DwtHtmlEditor.prototype.getSelectedCells=function(){ var l=null; var e=this._getSelection(); var s,n=0; var a=1000; var d=[]; var c=null; if(!AjxEnv.isIE){ try{ for(n=0; (s=e.getRangeAt(n))&&n=0&&n":""; function t(f){ var m=f.rowSpan; var u=f.colSpan; f.rowSpan=1; tr=f.parentNode; var c=tr.rowIndex; var h=tr.parentNode.rows; var l=f.cellIndex; while(--m>0){ tr=h[++c]; var d=f.cloneNode(false); d.removeAttribute("rowspan"); d.colSpan=f.colSpan; d.innerHTML=e; tr.insertBefore(d,tr.cells[l]) }} function n(d){ var c=d.colSpan; d.colSpan=1; tr=d.parentNode; var l=d.nextSibling; while(--c>0){ var h=d.cloneNode(false); h.removeAttribute("colspan"); h.rowSpan=d.rowSpan; h.innerHTML=e; tr.insertBefore(h,l) }} function a(d){ var c=d.colSpan; n(d); var h=d.parentNode.cells; var l=d.cellIndex; while(c-->0){ t(h[l++]) }} a(s) }; DwtHtmlEditor.prototype.doTableOperation=function(e,a){ var d=a.table||this.getNearestElement("table"); var t=a.td||this.getNearestElement("td"); var l,c,h; if(t){ l=t.cellIndex; h=t.parentNode; c=h.rowIndex }else{ l=0; h=this.getNearestElement("tr"); if(h){ c=h.rowIndex }} var u=a.cells; while(true){ switch(e){ case"insertRowAbove":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t)); break; case"insertRowUnder":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t,true)); break; case"insertColumnBefore":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t)); break; case"insertColumnAfter":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t,true)); break; case"deleteRow":for(var n=0; n$/i,"")]; for(var n=0; n$/i,"")); m[o].parentNode.removeChild(m[o]) }}} t.colSpan=u[0].length; t.rowSpan=u.length; s=s.join(" "); if(AjxEnv.isGeckoBased){ s+="
" } t.innerHTML=s; this.selectNodeContents(t,true); break; case"splitCells":this._splitCells(t); break; case"deleteTable":if(!AjxEnv.isIE){ this.selectNodeContents(d,null,true); this.deleteSelectedNodes() }else{ d.parentNode.removeChild(d) } break } break } if(AjxEnv.isGeckoBased){ this._forceRedraw() } this._updateState() }; DwtHtmlEditor.prototype._getRange=function(){ var o=this._getIframeDoc(); if(AjxEnv.isIE){ return o.selection }else{ this.focus(); var t=this._getIframeWin().getSelection(); if(t!=null){ try{ return t.getRangeAt(0) } catch(a){ return o.createRange() }}else{ return o.createRange() }}}; DwtHtmlEditor.prototype._createRange=function(t){ var o=this._getIframeDoc(); if(AjxEnv.isIE){ return t.createRange() }else{ this.focus(); if(t!=null){ try{ return t.getRangeAt(0) } catch(a){ return o.createRange() }}else{ return o.createRange() }}}; DwtHtmlEditor.prototype.deleteSelectedNodes=function(){ var e=this._getSelection(); if(AjxEnv.isGeckoBased){ e.deleteFromDocument() }else{ e.clear() }}; DwtHtmlEditor.prototype._getSelection=function(){ if(AjxEnv.isIE){ return this._getIframeDoc().selection }else{ return this._getIframeWin().getSelection() }}; DwtHtmlEditor.prototype.__eventClosure=function(e){ return this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e) }; DwtHtmlEditor.prototype._registerEditorEventHandlers=function(e,n){ var a=["mouseup","drag","mousedown","keydown"]; if(!AjxEnv.isIE7up){ a.push("keypress") } for(var t=0; t0){ var a=(s)?(0):(n.length-1); this._setCursor(n[a]) }}}}}} catch(l){}}}}; DwtHtmlEditor.prototype._setCursor=function(a){ var s=this._getIframeDoc(); var e=s.body; var t; if(AjxEnv.isIE){ t=e.createTextRange(); t.moveToElementText(a); t.collapse(0); t.select() }else{ t=s.createRange(); t.selectNodeContents(a); t.collapse(false); var n=this._getIframeWin().contentWindow; var o=n.getSelection(); o.addRange(t); o.collapseToEnd() }}; DwtHtmlEditor.prototype._locateNode=function(t,e){ if(t&&e){ for(var a=0; a=0; ){ if(d[n].href==e){ l=d[n]; break }} if(l){ l.href=o.url; if(o.title){ l.title=o.title }} return l }}; DwtHtmlEditor.prototype.getLinkProps=function(){ this.focus(); var e=this.getNearestElement("a"); if(e){ this.selectNodeContents(e) } var t=this._getRange(); var o={ text:AjxEnv.isIE?t.createRange().text:t.toString()}; if(e){ o.url=e.href; o.title=e.title } return o }; DwtHtmlEditor.table_analyzeCells=function(c){ var d=c.parentNode.parentNode; while(d&&!/table/i.test(d.tagName)){ d=d.parentNode } var l={}; var m=d.rows; for(var n=0; n=s){ var t=(e.rowSpan||1)-1; return{ td:e,cs:n,rs:t} }else{ if(e.ZmIndexs&&!o){ o=e }}}} return{ last:l,next:o} }; DwtHtmlEditor.table_getPrevCellAt=function(n,e){ var a=n.parentNode; while(a&&!/table/i.test(a.tagName)){ a=a.parentNode } var o=a.rows; for(var t=n.rowIndex; --t>=0; ){ var s=DwtHtmlEditor.table_getCellAt(o[t],e); if(s.td){ s.dist=n.rowIndex-t; return s }} return null }; DwtHtmlEditor.table_fixCells=function(e){ for(var t=0; t0){ if(a.last){ e=d.insertCell(a.last.cellIndex+1) }else{ if(a.next){ e=d.insertCell(a.next.cellIndex) }} --s }} if(e){ l.push(e) }} return l }; DwtHtmlEditor.table_insertRow=function(o,t){ var c=o.parentNode; var f=DwtHtmlEditor.table_analyzeCells(o); var l=c.rowIndex; if(t){ l+=o.rowSpan; c=f.rows[l-1] } o=f.rows[0].cells[f.rows[0].cells.length-1]; var d=o.ZmIndex+o.colSpan; var u=f.insertRow(l); var h=[]; var m=c.cells; var e; for(var s=0; s=0; ){ l=e[o]; l.parentNode.removeChild(l) } if(c.rows.length==0){ c.parentNode.removeChild(c) } return s }; DwtHtmlEditor.table_deleteRow=function(t){ if(!t){ return } var s=t.parentNode; var c=DwtHtmlEditor.table_analyzeCells(t); t=c.rows[0].cells[c.rows[0].cells.length-1]; var h=t.ZmIndex+t.colSpan; var l; for(var a=h; --a>=0; ){ var e=DwtHtmlEditor.table_getCellAt(s,a); if(e.td){ if(e.rs){ l=c.rows[s.rowIndex+1]; var o=DwtHtmlEditor.table_getCellAt(l,a); t=null; if(o.last){ t=l.insertCell(o.last.cellIndex+1) }else{ if(o.next){ t=l.insertCell(o.next.cellIndex) }} if(t){ if(e.cs>0){ t.colSpan=e.cs+1 } if(e.rs>1){ t.rowSpan=e.rs }}} s.removeChild(e.td) }else{ e=DwtHtmlEditor.table_getPrevCellAt(s,a); if(e){ if(e.rs){ e.td.rowSpan=e.rs; a-=e.cs }}}} try{ l=c.rows[s.rowIndex+1]; if(!l){ l=c.rows[s.rowIndex-1] }} catch(n){ l=null } s.parentNode.removeChild(s); if(c.rows.length==0){ c.parentNode.removeChild(c) } if(l){ return l.cells[0] }}; DwtHtmlEditor.prototype.searchnReplace=function(a){ var n=this._getIframeWin(); n.focus(); var l=this._getIframeDoc(); var o=l.body; var s=this._getSelectedText(); if(o.innerHTML==""){ return true } str1=a.searchstring; str2=s; if(a.replacemode=="current"){ str1=str1.toString(); str2=str2.toString(); if(!a.casesensitive){ str1=str1.toLowerCase(); str2=str2.toLowerCase() } if(str1==str2){ this.replaceSel(a.searchstring,a.replacestring); a.replacemode="none" }} if(AjxEnv.isIE){ var e=this.lastSearchRng?this.lastSearchRng:this.range_findnreplace; var t=0; if(a.wholeword){ t=t|2 } if(a.casesensitive){ t=t|4 } if(!e.findText){ alert("This operation is currently not supported by this browser."); return true } if(a.replacemode=="all"){ if(AjxEnv.isIE){ this.focus() } var h=new RegExp(a.searchstring,((a.casesensitive)?"":"i")+"g"); var c=this.replaceNodeContent(o,h,a.replacestring,"all",0); return true } if(e.findText(a.searchstring,a.backwards?-1:1,t)){ e.scrollIntoView(); e.select(); e.collapse(a.backwards); this.lastSearchRng=e; if(AjxEnv.isIE&&(a.replacemode=="current")){ this.replaceSel(a.searchstring,a.replacestring) }}else{ rng1=o.createTextRange(); rng1.findText(a.searchstring,a.backwards?-1:1,t); rng1.scrollIntoView(); if(rng1.text.toLowerCase()==a.searchstring.toLowerCase()){ rng1.select() } rng1.collapse(false); this.lastSearchRng=rng1; if(AjxEnv.isIE&&(a.replacemode=="current")){ this.replaceSel(a.searchstring,a.replacestring) }}}else{ if(a.replacemode=="all"){ var h=new RegExp(a.searchstring,(a.casesensitive?"":"i")+"g"); var c=this.replaceNodeContent(o,h,a.replacestring,"all",0); return true } if(!n.find(a.searchstring,a.casesensitive,a.backwards,a.wrap,a.wholeword,false,false)){ while(n.find(a.searchstring,a.casesensitive,true,a.wrap,a.wholeword,false,false)){}}}}; DwtHtmlEditor.prototype.replaceSel=function(e,s){ if(s==null){ return } var n=this._getIframeWin(); var o=n.document; var t; if(!AjxEnv.isIE){ var a=n.getSelection(); t=a.getRangeAt(0) }else{ t=n.document.selection.createRange() } if(!AjxEnv.isIE){ if(s.indexOf(e)==-1){ t.deleteContents(); t.insertNode(t.createContextualFragment(s)); t.collapse(false) }}else{ if(t.item){ t.item(0).outerHTML=s }else{ t.pasteHTML(s) }}}; DwtHtmlEditor.prototype._getSelectedText=function(){ var a=this._getIframeWin(); var t=this._getIframeDoc(); var e=""; if(a.getSelection){ e=a.getSelection() }else{ if(t.getSelection){ e=t.getSelection() }else{ if(t.selection){ e=t.selection.createRange().text }}} return e }; DwtHtmlEditor.prototype.replaceNodeContent=function(a,h,o,l,t){ for(var n=0; n0)){ return t }} return t }; DwtHtmlEditor.prototype.setTextAreaId=function(e){ this._textAreaId=e }; DwtHtmlEditor._normalizeFontId=function(l,h){ var o=l; l=l.replace(/,\s/g,",").replace(/'/g,"").toLowerCase(); if(!h){ var n=DwtHtmlEditor.FONT_FAMILY; if(n&&!n[l]){ var a=AjxUtil.keys(n); if(a.length){ var s=l.split(","); for(var t=0; t=this._weekDays[n]){ this._date2CellId[(s*10000)+(y*100)+c]=f.id; f._day=c; f._month=y; f._year=s; f.innerHTML=c++; f._dayType=DwtCalendar._THIS_MONTH; if(this._readOnly){ f.style.fontFamily="Arial"; f.style.fontSize="10px" }}else{ if(this._hidePrevNextMo){ f.innerHTML="" }else{ this._date2CellId[(u*10000)+(w*100)+o]=f.id; f._day=o; f._month=w; f._year=u; f.innerHTML=o++; f._dayType=DwtCalendar._PREV_MONTH }}}else{ if(!this._hidePrevNextMo){ this._date2CellId[(e*10000)+(p*100)+b]=f.id; f._day=b; f._month=p; f._year=e; f.innerHTML=b++; f._dayType=DwtCalendar._NEXT_MONTH }} this._setClassName(f,DwtCalendar._NORMAL) } if(this._showWeekNumber){ var h=this._getWeekNumberCellId("kw"+d*7); var m=document.getElementById(h); if(m){ var t=document.getElementById(this._getDayCellId(d*7)); m.innerHTML=AjxDateUtil.getWeekNumber(new Date(t._year,t._month,t._day),this._firstDayOfWeek,null,this._useISO8601WeekNo) }}} this._setTitle(y,s); if(!this._readOnly){ this._setSelectedDate(); this._setToday() } this._setRange() }; DwtCalendar.prototype._setRange=function(){ var e=document.getElementById(this._getDayCellId(0)); var o=new Date(e._year,e._month,e._day,0,0,0,0); e=document.getElementById(this._getDayCellId(DwtCalendar._LAST_DAY_CELL_IDX)); var a=this._getDaysInMonth(e._month,e._year); var t; if(e._day":""; if(this._showWeekNumber){ o[e++]=" " } for(var t=0; t<7; t++){ o[e++]=" " } o[e++]="" } o[e++]=""; this.getHtmlElement().innerHTML=o.join(""); if(!this._readOnly){ document.getElementById("b:py:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastRevArrowSmall"); document.getElementById("b:pm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("RevArrowSmall"); document.getElementById("b:nm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FwdArrowSmall"); document.getElementById("b:ny:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastFwdArrowSmall") } this._calWidgetInited=true }; DwtCalendar.prototype.setMouseOverDayCallback=function(e){ this._mouseOverDayCB=e }; DwtCalendar.prototype.setMouseOutDayCallback=function(e){ this._mouseOutDayCB=e }; DwtCalendar.prototype.getDndDate=function(){ var e=this._lastDndCell; if(e){ return new Date(e._year,e._month,e._day) } return null }; DwtCalendar._tmpDate=new Date(); DwtCalendar._tmpDate.setHours(0,0,0,0); DwtCalendar.prototype._mouseOverListener=function(t){ var a=t.target; if(a.id.charAt(0)=="c"){ this._setClassName(a,DwtCalendar._HOVERED); if(this._mouseOverDayCB){ DwtCalendar._tmpDate.setFullYear(a._year,a._month,a._day); this._mouseOverDayCB.run(this,DwtCalendar._tmpDate) }}else{ if(a.id.charAt(0)=="t"){ return }else{ if(a.id.charAt(0)=="b"){ var e; if(a.firstChild==null){ e=a; AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS }else{ a.className=DwtCalendar._BUTTON_HOVERED_CLASS; e=AjxImg.getImageElement(a) } e.className=e._origClassName }}} t._stopPropagation=true }; DwtCalendar.prototype._mouseOutListener=function(t){ this.setToolTipContent(null); var a=t.target; if(a.id.charAt(0)=="c"){ this._setClassName(a,DwtCalendar._NORMAL); if(this._mouseOutDayCB){ this._mouseOutDayCB.run(this) }}else{ if(a.id.charAt(0)=="b"){ var e; a.className=DwtCalendar._BUTTON_CLASS; if(a.firstChild==null){ e=a; AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_CLASS }else{ a.className=DwtCalendar._BUTTON_CLASS; e=AjxImg.getImageElement(a) } e.className=e._origClassName }}}; DwtCalendar.prototype._mouseDownListener=function(t){ if(t.button==DwtMouseEvent.LEFT){ var a=t.target; if(a.id.charAt(0)=="c"){ this._setClassName(a,DwtCalendar._ACTIVE) }else{ if(a.id.charAt(0)=="t"){ a.className=DwtCalendar._TITLE_ACTIVE_CLASS }else{ if(a.id.charAt(0)=="b"){ var e; if(a.firstChild==null){ e=a; AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_ACTIVE_CLASS }else{ a.className=DwtCalendar._BUTTON_ACTIVE_CLASS; e=AjxImg.getImageElement(a) } e.className=e._origClassName }else{ if(a.id.charAt(0)=="w"){}}}}}}; DwtCalendar.prototype._mouseUpListener=function(t){ var o=t.target; if(t.button==DwtMouseEvent.LEFT){ if(o.id.charAt(0)=="c"){ if(this.parent instanceof DwtMenu){ DwtMenu.closeActiveMenu() } var a=new Date(o._year,o._month,o._day); if(a.getDate()!=o._day){ a.setDate(o._day) } if(this.setDate(a)){ return } this._setClassName(o,DwtCalendar._HOVERED) }else{ if(o.id.charAt(0)=="b"){ var e; if(o.firstChild==null){ e=o; AjxImg.getParentElement(o).className=DwtCalendar._BUTTON_HOVERED_CLASS }else{ o.className=DwtCalendar._BUTTON_HOVERED_CLASS; e=AjxImg.getImageElement(o) } e.className=e._origClassName; if(e.id.indexOf("py")!=-1){ this._prevYear() }else{ if(e.id.indexOf("pm")!=-1){ this._prevMonth() }else{ if(e.id.indexOf("nm")!=-1){ this._nextMonth() }else{ this._nextYear() }}}}else{ if(o.id.charAt(0)=="t"){ o.className=DwtCalendar._TITLE_HOVERED_CLASS; this.setDate(new Date(),this._skipNotifyOnPage); if(this.parent instanceof DwtMenu){ DwtMenu.closeActiveMenu() }}}}}else{ if(t.button==DwtMouseEvent.RIGHT&&o.id.charAt(0)=="c"){ this._notifyListeners(DwtEvent.ACTION,0,new Date(o._year,o._month,o._day),t) }}}; DwtCalendar.prototype._doubleClickListener=function(e){ var t=e.target; if(this._selectionEvent){ this._selectionEvent.type=DwtCalendar.DATE_DBL_CLICKED } if(t.id.charAt(0)=="c"){ if(this.parent instanceof DwtMenu){ DwtMenu.closeActiveMenu() } this.setDate(new Date(t._year,t._month,t._day),false,false,true) }}; DwtCalendar.prototype._prevMonth=function(e){ var t=new Date(this._date.getTime()); this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,-1),this._skipNotifyOnPage) }; DwtCalendar.prototype._nextMonth=function(e){ var t=new Date(this._date.getTime()); this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,1),this._skipNotifyOnPage) }; DwtCalendar.prototype._prevYear=function(e){ var t=new Date(this._date.getTime()); this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,-1),this._skipNotifyOnPage) }; DwtCalendar.prototype._nextYear=function(e){ var t=new Date(this._date.getTime()); this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,1),this._skipNotifyOnPage) }; DwtCalendar.getDateFormatter=function(){ if(!DwtCalendar._dateFormatter){ DwtCalendar._dateFormatter=new AjxDateFormat(AjxMsg.formatCalDate) } return DwtCalendar._dateFormatter }; DwtCalendar.getDateLongFormatter=function(){ if(!DwtCalendar._dateLongFormatter){ DwtCalendar._dateLongFormatter=new AjxDateFormat(AjxMsg.formatCalDateLong) } return DwtCalendar._dateLongFormatter }; DwtCalendar.getDateFullFormatter=function(){ if(!DwtCalendar._dateFullFormatter){ DwtCalendar._dateFullFormatter=new AjxDateFormat(AjxMsg.formatCalDateFull) } return DwtCalendar._dateFullFormatter }; DwtCalendar.getHourFormatter=function(){ if(!DwtCalendar._hourFormatter){ DwtCalendar._hourFormatter=new AjxMessageFormat(AjxMsg.formatCalHour) } return DwtCalendar._hourFormatter }; DwtCalendar.getDayFormatter=function(){ if(!DwtCalendar._dayFormatter){ DwtCalendar._dayFormatter=new AjxDateFormat(AjxMsg.formatCalDay) } return DwtCalendar._dayFormatter }; DwtCalendar.getMonthFormatter=function(){ if(!DwtCalendar._monthFormatter){ DwtCalendar._monthFormatter=new AjxDateFormat(AjxMsg.formatCalMonth) } return DwtCalendar._monthFormatter }; DwtCalendar.getShortMonthFormatter=function(){ if(!DwtCalendar._shortMonthFormatter){ DwtCalendar._shortMonthFormatter=new AjxDateFormat(AjxMsg.formatShortCalMonth) } return DwtCalendar._shortMonthFormatter }; DwtCalendar.prototype._dragEnter=function(e){}; DwtCalendar.prototype._dragHover=function(e){}; DwtCalendar.prototype._dragOver=function(e){ var t=e.target; if(t.id.charAt(0)=="c"){ this._setClassName(t,DwtCalendar._HOVERED); this._lastDndCell=t }else{ this._lastDndCell=null }}; DwtCalendar.prototype._dragLeave=function(e){} } if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyPage")){ DwtPropertyPage=function(e){ if(arguments.length==0){ return } e=Dwt.getParams(arguments,DwtPropertyPage.PARAMS); e.className=e.className||"DwtPropertyPage"; DwtComposite.call(this,e); this._fieldIds=new Object(); this._fildDivIds=new Object(); this._isDirty=false }; DwtPropertyPage.prototype=new DwtComposite; DwtPropertyPage.prototype.constructor=DwtPropertyPage; DwtPropertyPage.prototype.toString=function(){ return"DwtPropertyPage" }; DwtPropertyPage.PARAMS=DwtComposite.PARAMS; DwtPropertyPage.prototype.setDirty=function(e){ this._isDirty=e }; DwtPropertyPage.prototype.isDirty=function(){ return this._isDirty }; DwtPropertyPage.prototype._installOnKeyUpHandler=function(o,t){ if(!o){ return } var a=null; a=document.getElementById(this._fieldIds[o]); if(a){ Dwt.setHandler(a,DwtEvent.ONKEYUP,t?t:this._onKeyUp); a._view=this; a._field=o }}; DwtPropertyPage.prototype._installOnClickHandler=function(o,t){ if(!o){ return } var a=document.getElementById(this._fieldIds[o]); if(a){ Dwt.setHandler(a,DwtEvent.ONCLICK,t?t:this._onClick); a._view=this; a._field=o }}; DwtPropertyPage.prototype._onClick=function(e){ this._view.setDirty(true); return true }; DwtPropertyPage.prototype._onKeyUp=function(e){ this._view.setDirty(true); return true }; DwtPropertyPage.prototype._installOnChangeHandler=function(o,t){ if(!o){ return } var a=null; a=document.getElementById(this._fieldIds[o]); if(a){ Dwt.setHandler(a,DwtEvent.ONCHANGE,t?t:this._onChange); a._view=this; a._field=o }}; DwtPropertyPage._onChange=function(e){ this._view.setDirty(true); return true }; DwtPropertyPage.prototype._onChange2=function(e){ this.setDirty(true); return true }; DwtPropertyPage.prototype._addDwtSelectEntryRow=function(n,s,a,e,o){ var t="30ex"; if(o){ t=o } a[e++]=""; e=this._addDwtSelectEntryCell(n,s,a,e,t); a[e++]=""; return e }; DwtPropertyPage.prototype._addDwtSelectEntryCell=function(a,o,t,e,s){ var n=Dwt.getNextId(); this._fieldIds[a]=n; if(o){ t[e++]=""; t[e++]=AjxStringUtil.htmlEncode(o)+":"; t[e++]="" } t[e++]=""; t[e++]="
"; return e }; DwtPropertyPage.prototype._addBoolEntryRow=function(a,o,t,e,n){ t[e++]=""; e=this._addBoolEntryCell(a,o,t,e,n); t[e++]=""; return e }; DwtPropertyPage.prototype._addBoolEntryCell=function(o,n,t,e,h){ var s=Dwt.getNextId(); this._fieldIds[o]=s; var a="20ex"; if(h){ a=h } if(n){ t[e++]=""; t[e++]=AjxStringUtil.htmlEncode(n)+":"; t[e++]="" } t[e++]=""; t[e++]=""; t[e++]=""; return e }; DwtPropertyPage.prototype._addTextAreaEntryRow=function(o,n,t,e,h){ var a="on"; if(h){ a="off" } var s=Dwt.getNextId(); this._fieldIds[o]=s; t[e++]=""; t[e++]=""; t[e++]=AjxStringUtil.htmlEncode(n)+":"; t[e++]=""; t[e++]=""; return e }; DwtPropertyPage.prototype._addEntryRow=function(h,s,t,c,o,n,e,l,a){ t[c++]=""; c=this._addEntryCell(h,s,t,c,o,n,e,l,a); t[c++]=""; return c }; DwtPropertyPage.prototype._addEntryCell=function(c,l,o,u,s,h,t,d,n){ if(s==null){ s="text" } if(h==null){ h=35 } var a="20ex"; if(d){ a=d } var e=Dwt.getNextId(); this._fieldIds[c]=e; if(l){ o[u++]=""; o[u++]=AjxStringUtil.htmlEncode(l)+":"; o[u++]="" } o[u++]="1){ this.switchToTab(a-1) } break; default:var t=o.match(DwtKeyMap.GOTO_TAB_RE); if(t&&t.length){ var e=t[1]; if((e<=this.getNumTabs())&&(e!=this.getCurrentTab())){ this.switchToTab(e) }}else{ return false }} return true }; DwtTabView.prototype._resetTabSizes=function(a,e){ if(this._tabs&&this._tabs.length){ for(var n in this._tabs){ var t=this._tabs[n].view; if(t&&!(t instanceof AjxCallback)){ var o; o=o||e-Dwt.getSize(this._tabBarEl).y; t.resetSize(a,o) }}}}; DwtTabView.prototype._getTabSize=function(){ var t=this.getSize(); var a=t.x||this.getHtmlElement().clientWidth; var e=t.y||this.getHtmlElement().clientHeight; var o=this._tabBar.getSize(); var n=o.y||this._tabBar.getHtmlElement().clientHeight; return new DwtPoint(a,(e-n)) }; DwtTabView.prototype._createHtml=function(e){ this._createHtmlFromTemplate(e||this.TEMPLATE,{ id:this._htmlElId} ) }; DwtTabView.prototype._createHtmlFromTemplate=function(e,t){ DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t); this._tabBarEl=document.getElementById(t.id+"_tabbar"); this._tabBar=new DwtTabBar(this); this._tabBar.reparentHtmlElement(this._tabBarEl); this._pageEl=document.getElementById(t.id+"_page") }; DwtTabView.prototype._showTab=function(t){ if(this._tabs&&this._tabs[t]){ this._currentTabKey=t; this._hideAllTabs(); var e=this.getTabView(t); if(e){ e.setVisible(true); e.showMe() }}}; DwtTabView.prototype._hideAllTabs=function(){ if(this._tabs&&this._tabs.length){ for(var t in this._tabs){ var e=this._tabs[t].view; if(e&&!(e instanceof AjxCallback)){ e.hideMe(); Dwt.setVisible(e.getHtmlElement(),false) }}}}; DwtTabView.prototype._tabButtonListener=function(e){ this.switchToTab(e.item.getData("tabKey")) }; DwtTabViewPage=function(a,t,e){ if(arguments.length==0){ return } params=Dwt.getParams(arguments,DwtTabViewPage.PARAMS); params.className=params.className||"ZTabPage"; params.posStyle=params.posStyle||DwtControl.ABSOLUTE_STYLE; this._rendered=true; DwtPropertyPage.call(this,params); this._createHtml(); this.getHtmlElement().style.overflowY="auto"; this.getHtmlElement().style.overflowX="visible"; if(params.contentTemplate){ this.getContentHtmlElement().innerHTML=AjxTemplate.expand(params.contentTemplate,this._htmlElId) }}; DwtTabViewPage.prototype=new DwtPropertyPage; DwtTabViewPage.prototype.constructor=DwtTabViewPage; DwtTabViewPage.prototype.toString=function(){ return"DwtTabViewPage" }; DwtTabViewPage.prototype.TEMPLATE="dwt.Widgets#ZTabPage"; DwtTabViewPage.PARAMS=DwtPropertyPage.PARAMS.concat("contentTemplate"); DwtTabViewPage.prototype.getContentHtmlElement=function(){ return this._contentEl||this.getHtmlElement() }; DwtTabViewPage.prototype.showMe=function(){ this.setZIndex(DwtTabView.Z_ACTIVE_TAB); if(this.parent.getHtmlElement().offsetHeight>80){ this._contentEl.style.height=this.parent.getHtmlElement().offsetHeight-80 }else{ var t=parseInt(this.parent.getHtmlElement().style.height); var e=AjxStringUtil.getUnitsFromSizeString(this.parent.getHtmlElement().style.height); if(t>80){ this._contentEl.style.height=(Number(t-80).toString()+e) }} this._contentEl.style.width=this.parent.getHtmlElement().style.width }; DwtTabViewPage.prototype.hideMe=function(){ this.setZIndex(DwtTabView.Z_HIDDEN_TAB) }; DwtTabViewPage.prototype.resetSize=function(t,e){ this.setSize(t,e) }; DwtTabViewPage.prototype._createHtml=function(e){ this._createHtmlFromTemplate(e||this.TEMPLATE,{ id:this._htmlElId} ) }; DwtTabViewPage.prototype._createHtmlFromTemplate=function(e,t){ DwtPropertyPage.prototype._createHtmlFromTemplate.call(this,e,t); this._contentEl=document.getElementById(t.id+"_content")||this.getHtmlElement() }; DwtTabBar=function(a,t,o){ if(arguments.length==0){ return } this._buttons=[]; this._btnStyle=o||"ZTab"; this._btnImage=null; this._currentTabKey=1; var e=t||"ZTabBar"; DwtToolBar.call(this,{ parent:a,className:e,posStyle:DwtControl.STATIC_STYLE} ); if(AjxEnv.isFirefox){ if(this._prefixEl&&this.constructor==DwtTabBar){ this._prefixEl.style.cssFloat="none" }}}; DwtTabBar.prototype=new DwtToolBar; DwtTabBar.prototype.constructor=DwtTabBar; DwtTabBar.prototype.TEMPLATE="dwt.Widgets#ZTabBar"; DwtTabBar.prototype.toString=function(){ return"DwtTabBar" }; DwtTabBar.prototype.getCurrentTab=function(){ return this._currentTabKey }; DwtTabBar.prototype.addStateChangeListener=function(e){ this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e) }; DwtTabBar.prototype.removeStateChangeListener=function(e){ this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e) }; DwtTabBar.prototype.addSelectionListener=function(t,e){ this._buttons[t].addSelectionListener(e) }; DwtTabBar.prototype.removeSelectionListener=function(t,e){ this._buttons[t].removeSelectionListener(e) }; DwtTabBar.prototype.addButton=function(s,n,h,a){ var t=this._buttons[s]=new DwtTabButton(this,h,a); this._buttons[s].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab)); if(this._btnImage!=null){ t.setImage(this._btnImage) } if(n!=null){ t.setText(n) } t.setEnabled(true); t.setData("tabKey",s); if(parseInt(s)==1){ this.openTab(s,true) } var e=this.__getButtonIndex(this._currentTabKey); if(e!=-1){ var o=this.__getButtonIndex(s); if(o==e+1){ Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT) }} return t }; DwtTabBar.prototype.getButton=function(e){ return(this._buttons[e])?this._buttons[e]:null }; DwtTabBar.prototype.openTab=function(e,n){ this._currentTabKey=e; var o=this._buttons.length; for(var t=0; t",AjxStringUtil.htmlEncode(e.getDisplayValue()),""].join(""); this.setMenu(this._menuCallback,true); this._optionValuesToIndices[e.getValue()]=this._options.size()-1; return(this._options.size()-1) }; DwtSelect.prototype.removeOption=function(o){ if(!o){ return -1 } this.setMenu(this._menuCallback,true); this._options.remove(o); var a=this._options.size(); var n=o.getValue(); var e=this._optionValuesToIndices[n]; if(e!=null){ this._pseudoItemsEl.deleteRow(e); if(this._selectedOption==o&&a>0){ var s=(e>=a)?a-1:e; this._setSelectedOption(this._options.get(s)) }} delete this._optionValuesToIndices[n]; for(var t=e; t0){ if(!o){ o="DwtPropertyEditor" } DwtComposite.call(this,{ parent:n,className:o,posStyle:a,deferred:e} ); this._useDwtInputField=t!=null?t:true; this._schema=null; this._init() }}; DwtPropertyEditor.MSG_TIMEOUT=4000; DwtPropertyEditor.MSG={ mustMatch:"This field does not match validators: REGEXP",mustNotMatch:"This field matches anti-validators: REGEXP"}; DwtPropertyEditor.prototype=new DwtComposite; DwtPropertyEditor.prototype.constructor=DwtPropertyEditor; DwtPropertyEditor.prototype.toString=function(){ return"DwtPropertyEditor" }; DwtPropertyEditor.prototype._init=function(){ var t=document.createElement("div"); t.id=this._relDivId=Dwt.getNextId(); t.style.position="relative"; var e=document.createElement("table"); e.id=this._tableId=Dwt.getNextId(); e.cellSpacing=e.cellPadding=0; e.appendChild(document.createElement("tbody")); t.appendChild(e); this.getHtmlElement().appendChild(t); this.maxLabelWidth=0; this.maxFieldWidth=0; this._setMouseEventHdlrs(); this._onMouseDown=new AjxListener(this,this._onMouseDown); this.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown) }; DwtPropertyEditor.prototype.getRelDiv=function(){ return document.getElementById(this._relDivId) }; DwtPropertyEditor.prototype.getTable=function(){ return document.getElementById(this._tableId) }; DwtPropertyEditor.prototype._onMouseDown=function(a){ var o=a.target; var e=o.tagName.toLowerCase(); if(e=="input"){ a._stopPropagation=false; a._returnValue=true; return true } if(this._currentInputField&&!this._currentInputField.onblur()){ a._stopPropagation=true; a._returnValue=false; return false } try{ while(o&&e!="tr"){ o=o.parentNode; e=o.tagName.toLowerCase() } if(o&&o.__msh_doMouseDown){ o.__msh_doMouseDown(a) }} catch(t){}}; DwtPropertyEditor.prototype.getProperties=function(){ if(this._currentInputField){ this._currentInputField.onblur() } function e(o){ var h={} ,a,s=o.length; for(var t=0; tthis.maxLabelWidth){ this.maxLabelWidth=a.offsetWidth } if(o.offsetWidth>this.maxFieldWidth){ this.maxFieldWidth=o.offsetWidth }}else{ var n=document.createElement("td"); n.colSpan=2; l.appendChild(n); n.className="label"; l.className+=" expander-collapsed"; n.innerHTML=["
",AjxStringUtil.htmlEncode(e.label),"
"].join(""); this.initProperties(e.children,e); l.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._toggle,e) } if(t>0){ l.style.display="none"; c._hidden=true }}; DwtPropertyEditor.prototype.setFixedLabelWidth=function(e){ try{ this.getTable().rows[0].cells[0].style.width=(e||this.maxLabelWidth)+"px" } catch(t){}}; DwtPropertyEditor.prototype.setFixedFieldWidth=function(e){ try{ this.getTable().rows[0].cells[1].style.width=(e||this.maxFieldWidth)+"px" } catch(t){}}; DwtPropertyEditor.prototype._setCurrentMsgDiv=function(e){ this._currentMsgDiv=e; this._currentMsgDivTimer=setTimeout(DwtPropertyEditor.simpleClosure(this._clearMsgDiv,this),DwtPropertyEditor.MSG_TIMEOUT) }; DwtPropertyEditor.prototype._clearMsgDiv=function(){ try{ this._stopMsgDivTimer() } catch(e){} var t=this._currentMsgDiv; if(t){ t.parentNode.removeChild(t); this._currentMsgDiv=t=null; this._currentMsgDivTimer=null }}; DwtPropertyEditor.prototype._stopMsgDivTimer=function(){ if(this._currentMsgDivTimer){ clearTimeout(this._currentMsgDivTimer); this._currentMsgDivTimer=null }}; DwtPropertyEditor.prototype.addChild=function(e){ if(!this._currentFieldCell){ DwtComposite.prototype.addChild.call(this,e) }else{ this._children.add(e); this._currentFieldCell.appendChild(e.getHtmlElement()) }}; DwtPropertyEditor.prototype._createCheckbox=function(a,t){ var e=document.createElement("input"); e._prop=a; e.id=a.name; e.type="checkbox"; if(AjxEnv.isIE){ e.attachEvent("onclick",a._onCheckboxChange) }else{ e.addEventListener("click",a._onCheckboxChange,false) } this._children.add(e); t.appendChild(e); if(a.value=="true"){ e.checked=a.value }}; DwtPropertyEditor.prototype._createCheckBoxGroup=function(e,n){ var t=document.createElement("div"); t._prop=e; t.id=e.name; e._checkBox=[]; t.appendChild(document.createTextNode(e.value)); var l=document.createElement("table"); l.id=Dwt.getNextId(); l.border=0; l.cellSpacing=l.cellPadding=0; l.appendChild(document.createElement("tbody")); for(var a=0; a=0){ n[e]._getRowEl().style.display=a; if(!o){ n[e]._display(false) }} this._hidden=!o; var t=this._getRowEl(); t.className=t.className.replace(/expander-[^\s]+/,o?"expander-expanded":"expander-collapsed") }} ,_toggle:function(){ this._display(this._hidden) } ,_edit:function(){ if(this.readonly){ return } switch(this.type){ case"string":case"number":case"integer":case"password":setTimeout(DwtPropertyEditor.simpleClosure(this._createInputField,this),50); break }} ,_createInputField:function(){ var e=this._propertyEditor; var s=document.getElementById(this._fieldCellId); var a=e.getRelDiv(); var t=document.createElement("input"); t.className="DwtPropertyEditor-input "+this.type; t.setAttribute("autocomplete","off"); t.type=this.type=="password"?"password":"text"; var n=s.offsetLeft,o=s.offsetTop; if(AjxEnv.isGeckoBased){ --n; --o } t.style.left=n+"px"; t.style.top=o+"px"; t.style.width=s.offsetWidth+1+"px"; t.style.height=s.offsetHeight+1+"px"; t.value=this._getValue(); a.appendChild(t); t.focus(); t.onblur=DwtPropertyEditor.simpleClosure(this._saveInput,this); t.onkeydown=DwtPropertyEditor.simpleClosure(this._inputKeyPress,this); this._propertyEditor._currentInputField=this._inputField=t; if(!AjxEnv.isGeckoBased){ t.select() }else{ t.setSelectionRange(0,t.value.length) }} ,_getValue:function(){ return this.value||"" } ,_checkValue:function(a){ var e=a==""; if(e){ if(!this.required){ return a } this._displayMsg(AjxMsg.valueIsRequired); return null } if(this.maxLength!=null&&a.length>this.maxLength){ this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooLong,this.maxLength)); return null } if(this.minLength!=null&&a.lengththis.maxValue){ this._displayMsg(AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this.maxValue)); return null } a=s; if(this.type=="number"&&this.decimals!=null){ var t=a.toString(); var o=t.indexOf("."); if(o==-1){ o=t.length } a=a.toPrecision(o+this.decimals) } break } return a } ,_displayMsg:function(t){ var l,s,c,o; var n=this._propertyEditor; var e=n._currentMsgDiv; if(!e){ e=document.createElement("div"); e.className="DwtPropertyEditor-ErrorMsg"; n.getRelDiv().appendChild(e) }else{ n._stopMsgDivTimer() } e.style.visibility="hidden"; e.innerHTML=AjxStringUtil.htmlEncode(t); var d=n.getTable(); c=d.offsetWidth; if(!AjxEnv.isIE){ c-=12 } l=d.offsetLeft; e.style.left=l+"px"; e.style.width=c+"px"; o=e.offsetHeight; var a=document.getElementById(this._fieldCellId); s=a.offsetTop+a.offsetHeight; if(s+o>d.offsetTop+d.offsetHeight){ s=a.offsetTop-o } e.style.top=s+"px"; e.style.visibility=""; n._setCurrentMsgDiv(e) } ,_saveInput:function(){ var e=this._inputField; var t=this._checkValue(e.value); if(t!=null){ this._setValue(t); e.onblur=e.onkeyup=e.onkeydown=e.onkeypress=null; var a=document.getElementById(this._fieldCellId); a.innerHTML=this._makeDisplayValue(); this._inputField=null; this._propertyEditor._currentInputField=null; this._propertyEditor._clearMsgDiv(); e.parentNode.removeChild(e); return true }else{ if(e.className.indexOf(" DwtPropertyEditor-input-error")==-1){ e.className+=" DwtPropertyEditor-input-error" } e.focus(); return false }} ,_inputKeyPress:function(t){ t||(t=window.event); var e=this._inputField; if(t.keyCode==13){ this._saveInput() }else{ if(t.keyCode==27){ e.value=this._getValue(); this._saveInput() }else{ this._propertyEditor._clearMsgDiv(); e.className=e.className.replace(/ DwtPropertyEditor-input-error/,"") }}} ,_onCheckboxChange:function(t){ t||(t=window.event); var e=AjxEnv.isIE?t.srcElement:t.target; e._prop._setValue(e.checked?"true":"false") } ,_onSelectChange:function(){ this._setValue(this._select.getValue()) } ,_onCheckboxGroupChange:function(o){ o||(o=window.event); var a=AjxEnv.isIE?o.srcElement:o.target; var e=a._prop._checkBox; var n=[]; for(var t=0; t0)?[s[0]]:s } for(var a=0; a1&&this._mode==DwtChooser.MODE_MOVE){ this.addItems(e.slice(1),DwtChooserListView.SOURCE,true) } this._enableButtons() }} this.sourceListView.multiSelectEnabled=(o==DwtChooser.MULTI_SELECT); this.targetListView.multiSelectEnabled=(o==DwtChooser.MULTI_SELECT) }; DwtChooser.prototype.reset=function(e){ this._reset(e); this._setActiveButton(this._buttonInfo[0].id); this._enableButtons(); if(this._hasTextField){ this._textField.setValue("") }}; DwtChooser.prototype._reset=function(e){ if(!e||e==DwtChooserListView.SOURCE){ this.sourceListView._resetList() } if(!e||e==DwtChooserListView.TARGET){ this.targetListView._resetList(); for(var t in this._data){ this._data[t].removeAll() }}}; DwtChooser.prototype.addStateChangeListener=function(e){ this.targetListView.addStateChangeListener(e) }; DwtChooser.prototype.removeStateChangeListener=function(e){ this.targetListView.removeStateChangeListener(e) }; DwtChooser.prototype.getSourceListView=function(){ return document.getElementById(this._sourceListViewDivId) }; DwtChooser.prototype.getButtons=function(){ return document.getElementById(this._buttonsDivId) }; DwtChooser.prototype.getTargetListView=function(){ return document.getElementById(this._targetListViewDivId) }; DwtChooser.prototype.getTextField=function(){ return this._textField }; DwtChooser.prototype._createHtml=function(){ this._sourceListViewDivId=Dwt.getNextId(); this._targetListViewDivId=Dwt.getNextId(); this._buttonsDivId=Dwt.getNextId(); this._removeButtonDivId=Dwt.getNextId(); if(this._allButtons){ this._addAllButtonDivId=Dwt.getNextId(); this._removeAllButtonDivId=Dwt.getNextId() } if(this._hasTextField){ this._textFieldTdId=Dwt.getNextId() } var a=[]; var e=0; if(this._layoutStyle==DwtChooser.HORIZ_STYLE){ a[e++]=""; a[e++]=""; a[e++]=""; a[e++]="
"; if(this._allButtons){ a[e++]="

" } for(var t=0; t1) }; DwtChooser.prototype._initialize=function(){ var e=new AjxListener(this,this._transferButtonListener); this._button={}; this._buttonIndex={}; this._data={}; for(var t=0; t0)); for(var s=0; s0)); this._removeButton.setEnabled(c); if(this._allButtons&&(this._selectStyle==DwtChooser.MULTI_SELECT)){ var e=l?l.size():0; var n=d?d.size():0; this._addAllButton.setEnabled(e>0); this._removeAllButton.setEnabled(n>0) }}; DwtChooser.prototype._selectFirst=function(t,a){ var e=(t==DwtChooserListView.SOURCE)?this.sourceListView:this.targetListView; var o=e.getList(); if(o&&o.size()>0){ e.setSelection(o.get(0)) }}; DwtChooser.prototype._setActiveButton=function(o){ if(!this._hasMultiButtons){ return } if(o!=this._activeButtonId){ var a=(this._activeButtonId==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[this._activeButtonId]; if(a){ var e=DwtControl.findControl(document.getElementById(a)); if(e){ e.setDisplayState(DwtControl.NORMAL) }} a=(o==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[o]; var t=DwtControl.findControl(document.getElementById(a)); if(t){ t.setDisplayState(DwtControl.DEFAULT) } this._activeButtonId=o; if(o!=DwtChooser.REMOVE_BTN_ID){ this._lastActiveTransferButtonId=o }}}; DwtChooser.prototype._isDuplicate=function(e,t){ return t.contains(e) }; DwtChooser.prototype._addToSource=function(a,e,t){ if(!a){ return } if(!a._chooserIndex){ var o=this.sourceListView.getList(); a._chooserIndex=o?o.size()+1:1 } this.sourceListView.addItem(a,e,t) }; DwtChooser.prototype._addToTarget=function(c,e,s){ if(!c){ return } e=e?e:this._activeButtonId; if(this._noDuplicates&&this._data[e]&&this._isDuplicate(c,this._data[e])){ return } var n=this.targetListView.getList(); if(n&&n.contains(c)&&c.clone){ var a=c.clone(); a.id=Dwt.getNextId(); c=a } var h=null; if(this._hasMultiButtons){ n=[]; for(var t=0; to){ break }}} c._buttonId=e; c.id=c.id||Dwt.getNextId(); this._data[e].add(c); this.targetListView.addItem(c,h,s) }; DwtChooser.prototype._removeFromSource=function(t,e){ if(!t){ return } var a=this.sourceListView.getList(); if(!a){ return } if(!a.contains(t)){ return } this.sourceListView.removeItem(t,e) }; DwtChooser.prototype._removeFromTarget=function(t,e){ if(!t){ return } var a=this.targetListView.getList(); if(!a){ return } if(!a.contains(t)){ return } this._data[t._buttonId].remove(t); this.targetListView.removeItem(t,e) }; DwtChooser.prototype._getInsertionIndex=function(t,n){ var s=t.getList(); if(!s){ return null } var e=s.getArray(); for(var o=0; o=n._chooserIndex)){ return o }} return null }; DwtChooser.prototype._getEmailFromText=function(){ if(this._hasTextField){ var t=this._textField.getValue(); var e=AjxEmailAddress.parse(t); if(e){ e.id=Dwt.getNextId(); return e }}}; DwtChooser._onKeyUp=function(n){ var a=DwtUiEvent.getTarget(n); var s=DwtControl.findControl(a); var o=s._chooser; var t=DwtKeyEvent.getCharCode(n); if(t==3||t==13){ var e=o._getEmailFromText(); if(e){ o.transfer([e],o._activeButtonId); a.value="" }} o._enableButtons(a.value.length) }; DwtChooserListView=function(e){ if(arguments.length==0){ return } e=Dwt.getParams(arguments,DwtChooserListView.PARAMS); e.className=e.className||"DwtChooserListView"; e.headerList=this._getHeaderList(parent); DwtListView.call(this,e); this.type=e.type; this._chooserParent=e.parent.parent }; DwtChooserListView.PARAMS=["parent","type","className","view"]; DwtChooserListView.SOURCE=1; DwtChooserListView.TARGET=2; DwtChooserListView.prototype=new DwtListView; DwtChooserListView.prototype.constructor=DwtChooserListView; DwtChooserListView.prototype._getHeaderList=function(){}; DwtChooserListView.prototype.toString=function(){ return"DwtChooserListView" }; DwtChooserListView.prototype.setUI=function(t,e){ e=e?e:((this.type==DwtChooserListView.TARGET)||this.parent._sourceEmptyOk); DwtListView.prototype.setUI.call(this,t,e) }; DwtChooserListView.prototype._itemClicked=function(e,t){ if(!t.shiftKey&&!t.ctrlKey&&t.button==DwtMouseEvent.RIGHT){ return }else{ DwtListView.prototype._itemClicked.call(this,e,t) }}; DwtChooserListView.prototype._sortColumn=function(t,e){ this._chooserParent.search(t,e) }; DwtChooserListView.prototype._getHeaderSashLocation=function(){ var t=this.getHtmlElement(); if(Dwt.getPosition(t)==Dwt.ABSOLUTE_STYLE){ return DwtListView.prototype._getHeaderSashLocation.call(this) } var a=Dwt.toWindow(t,0,0); var e=Dwt.toWindow(this._chooserParent.getHtmlElement(),0,0); if(!this._tmpPoint){ this._tmpPoint=new DwtPoint() } this._tmpPoint.x=a.x-e.x; this._tmpPoint.y=a.y-e.y; return this._tmpPoint } } if(AjxPackage.define("ajax.dwt.widgets.DwtGridSizePicker")){ DwtGridSizePicker=function(e,t){ if(arguments.length==0){ return } DwtControl.call(this,{ parent:e,className:"DwtGridSizePicker"} ); this._title=t; if(e instanceof DwtMenu){ e.addPopdownListener(new AjxListener(this,this._reset)) } this._reset() }; DwtGridSizePicker.prototype=new DwtControl; DwtGridSizePicker.prototype.constructor=DwtGridSizePicker; DwtGridSizePicker.prototype.addSelectionListener=function(e){ this.addListener(DwtEvent.SELECTION,e) }; DwtGridSizePicker.prototype.removeSelectionListener=function(e){ this.removeListener(DwtEvent.SELECTION,e) }; DwtGridSizePicker.prototype._createGrid=function(){ var a=this.getHtmlElement(); var t=["",""]; var o=[""]; for(var e=0; e") } o.push(""); o=o.join(""); for(var e=0; e"); t=t.join(""); a.innerHTML=t; a.onmouseover=DwtGridSizePicker._onMouseOver; a.onmouseup=DwtGridSizePicker._onSelect }; DwtGridSizePicker.prototype._reset=function(){ this._endRow=-1; this._endCol=-1; this.maxRows=7; this.maxCols=7; this._createGrid() }; DwtGridSizePicker._onSelect=function(e){ if(AjxEnv.isIE){ e=window.event } DwtControl.getTargetControl(e)._onSelect(e) }; DwtGridSizePicker.prototype._onSelect=function(o){ if(AjxEnv.isIE){ o=window.event } var a=new DwtUiEvent(); a.setFromDhtmlEvent(o); var n=a.target; if(n.tagName.toLowerCase()=="td"){ var s=n.parentNode.rowIndex; if(s>0){ var e=n.cellIndex; var t=DwtShell.selectionEvent; t.item=this; t.detail={ rows:s,cols:e+1}; if(this.parent instanceof DwtMenu){ DwtMenu.closeActiveMenu() } this.notifyListeners(DwtEvent.SELECTION,t) }}}; DwtGridSizePicker.prototype._onMouseOut=function(o){ if(AjxEnv.isIE){ o=window.event } var t=new DwtUiEvent(); t.setFromDhtmlEvent(o); var n=t.target; var a=this.getHtmlElement().firstChild; try{ while(n&&n!==a){ n=n.parentNode }} catch(e){ n=null } if(!n){ this._endRow=this._endCol=-1; this._update() }}; DwtGridSizePicker._onMouseOver=function(e){ if(AjxEnv.isIE){ e=window.event } DwtControl.getTargetControl(e)._onMouseOver(e) }; DwtGridSizePicker.prototype._onMouseOver=function(t){ var e=new DwtUiEvent(true); e.setFromDhtmlEvent(t); var a=e.target; if(this._updateTimeout){ clearTimeout(this._updateTimeout) } this._updateTimeout=setTimeout(AjxCallback.simpleClosure(this._updateOnTimeout,this,a),10); e.setToDhtmlEvent(t) }; DwtGridSizePicker.prototype._addRow=function(){ var t=this.getHtmlElement().firstChild; var a=t.insertRow(-1); a.className="grid"; for(var e=0; e0){ t=this._endCol=a.cellIndex; this._endRow=a.parentNode.rowIndex-1; e=false }} if(e){ this._endRow=this._endCol=-1 } this._update(); if(!e){ if(o==this.maxRows){ this._addRow() } if(t==this.maxCols-1){ this._addCol() }}}; DwtGridSizePicker.prototype._update=function(){ var t=this._endRow; var s=this._endCol; var l=this.getHtmlElement().firstChild; var n=l.rows[0].cells[0]; this._rows=t+1; this._cols=s+1; if(this._rows>0&&this._cols>0){ n.innerHTML=this._rows+" x "+this._cols }else{ n.innerHTML=this._title } for(var a=0; athis._endRow)||(e>this._endCol); if(o){ Dwt.delClass(h,"Hovered") }else{ Dwt.addClass(h,"Hovered") }}}} } if(AjxPackage.define("ajax.dwt.widgets.DwtSpinner")){ DwtSpinner=function(e){ if(arguments.length==0){ return } DwtControl.call(this,{ parent:e.parent,className:e.className,posStyle:e.posStyle,parentElement:e.parentElement} ); this._maxValue=e.max!=null?e.max:null; this._minValue=e.min!=null?e.min:null; this._fieldSize=e.size!=null?e.size:3; this._origValue=e.value||0; this._maxLen=e.maxLen||null; this._step=e.step||1; this._decimals="decimals" in e?e.decimals:0; this._align=e.align||null; this._timerFunc=AjxCallback.simpleClosure(this._timerFunc,this); this._btnPressCapture=new DwtMouseEventCapture({ targetObj:this,id:"DwtSpinner",mouseUpHdlr:AjxCallback.simpleClosure(this._stopCapture,this)} ); this._createElements() }; DwtSpinner.prototype=new DwtControl; DwtSpinner.prototype.constructor=DwtSpinner; DwtSpinner.INIT_TIMER=250; DwtSpinner.SLOW_TIMER=125; DwtSpinner.FAST_TIMER=33; DwtSpinner.prototype._createElements=function(){ var s=this.getHtmlElement(); var n=Dwt.getNextId(); this._idField=n; this._idUpButton=n+"-up"; this._idDownButton=n+"-down"; var o=["
",this._title,"
","","","","","
","","
 
 
"]; s.innerHTML=o.join(""); var a=this._getUpButton(); a.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Up"); var t=this._getDownButton(); t.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Down"); var e=this.getInputElement(); if(this._maxLen){ e.maxLength=this._maxLen } if(this._fieldSize){ e.size=this._fieldSize } if(this._align){ e.style.textAlign=this._align } if(this._origValue!=null){ this.setValue(this._origValue) } e.onblur=AjxCallback.simpleClosure(this.setValue,this,null); e[(AjxEnv.isIE||AjxEnv.isOpera)?"onkeydown":"onkeypress"]=AjxCallback.simpleClosure(this.__onKeyPress,this) }; DwtSpinner.prototype._getValidValue=function(e){ var t=parseFloat(e); if(isNaN(t)||t==null){ t=this._lastValidValue } if(t==null){ t=this._minValue||0 } if(this._minValue!=null&&tthis._maxValue){ t=this._maxValue } t=parseFloat(t); if(this._decimals!=null){ t=t.toFixed(this._decimals) } this._lastValidValue=t; return t }; DwtSpinner.prototype.getInputElement=function(){ return document.getElementById(this._idField) }; DwtSpinner.prototype._getUpButton=function(){ return document.getElementById(this._idUpButton) }; DwtSpinner.prototype._getDownButton=function(){ return document.getElementById(this._idDownButton) }; DwtSpinner.prototype._getButton=function(e){ switch(e){ case"Up":return this._getUpButton(); case"Down":return this._getDownButton() }}; DwtSpinner.prototype._setBtnState=function(e,a){ var t=this._getButton(e); if(a){ Dwt.addClass(t,"DwtSpinner-"+e+"-disabled"); t.firstChild.className="Img"+e+"ArrowSmallDis" }else{ Dwt.delClass(t,"DwtSpinner-"+e+"-disabled"); t.firstChild.className="Img"+e+"ArrowSmall" }}; DwtSpinner.prototype.getValue=function(){ return parseFloat(this._getValidValue(this.getInputElement().value)) }; DwtSpinner.prototype.setValue=function(e){ if(e==null){ e=this.getInputElement().value } e=this._getValidValue(e); this.getInputElement().value=e; e=parseFloat(e); this._setBtnState("Down",this._minValue!=null&&this._minValue==e); this._setBtnState("Up",this._maxValue!=null&&this._maxValue==e) }; DwtSpinner.prototype.setEnabled=function(e){ DwtControl.prototype.setEnabled.call(this,e); this.getInputElement().disabled=!e; var t=this.getHtmlElement().firstChild; if(!e){ Dwt.addClass(t,"DwtSpinner-disabled") }else{ Dwt.delClass(t,"DwtSpinner-disabled") }}; DwtSpinner.prototype._rotateVal=function(e){ var t=this.getValue(); switch(e){ case"Up":t+=this._step; break; case"Down":t-=this._step; break } this.setValue(t) }; DwtSpinner.prototype._btnPressed=function(e){ if(!this.getEnabled()){ return } Dwt.addClass(this._getButton(e),"DwtSpinner-"+e+"-pressed"); this._direction=e; this._rotateVal(e); this._btnPressCapture.capture(); this._timerSteps=0; this._timer=setTimeout(this._timerFunc,DwtSpinner.INIT_TIMER) }; DwtSpinner.prototype._timerFunc=function(){ var a=this.getValue(); this._rotateVal(this._direction); var t=this.getValue(); this._timerSteps++; var e=this._timerSteps>4?DwtSpinner.FAST_TIMER:DwtSpinner.SLOW_TIMER; if(a!=t){ this._timer=setTimeout(this._timerFunc,e) }else{ this._stopCapture() }}; DwtSpinner.prototype._stopCapture=function(){ if(this._timer){ clearTimeout(this._timer) } this._timer=null; this._timerSteps=null; var t=this._direction; Dwt.delClass(this._getButton(t),"DwtSpinner-"+t+"-pressed"); this._direction=null; this._btnPressCapture.release(); var e=this.getInputElement(); e.focus(); Dwt.setSelectionRange(e,0,e.value.length) }; DwtSpinner.prototype.__onKeyPress=function(a){ if(AjxEnv.isIE){ a=window.event } var t=null; switch(a.keyCode){ case 38:t="Up"; break; case 40:t="Down"; break } if(t){ this._rotateVal(t); var e=this.getInputElement(); Dwt.setSelectionRange(e,0,e.value.length) }}; DwtSpinner.prototype.focus=function(){ this.getInputElement().focus() }; DwtSpinner.prototype.select=function(){ var e=this.getInputElement(); e.focus(); Dwt.setSelectionRange(e,0,e.value.length) } } if(AjxPackage.define("ajax.dwt.widgets.DwtButtonColorPicker")){ DwtButtonColorPicker=function(a){ if(arguments.length==0){ return } a=Dwt.getParams(arguments,DwtButtonColorPicker.PARAMS); a.actionTiming=DwtButton.ACTION_MOUSEUP; DwtButton.call(this,a); var e=new DwtMenu({ parent:this,style:DwtMenu.COLOR_PICKER_STYLE} ); this.setMenu(e); var t=new DwtColorPicker(e,null,null,a.noFillLabel,a.allowColorInput); t.addSelectionListener(new AjxListener(this,this._colorPicked)); this.__colorPicker=t; this.__color="" }; DwtButtonColorPicker.PARAMS=["parent","style","className","posStyle","id","index","noFillLabel","allowColorInput"]; DwtButtonColorPicker.prototype=new DwtButton; DwtButtonColorPicker.prototype.constructor=DwtButtonColorPicker; DwtButtonColorPicker._RGB_RE=/rgb\(([0-9]{1,3}),\s*([0-9]{1,3}),\s*([0-9]{1,3})\)/; DwtButtonColorPicker._hexdigits=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"]; DwtButtonColorPicker.toHex=function(o,t){ var e=[]; while(o){ var a=DwtButtonColorPicker._hexdigits[o&15]; e.push(a); o=o>>4 } if(t!=null){ t-=e.length; while(t-->0){ e.push("0") }} e.reverse(); return e.join("") }; DwtButtonColorPicker.prototype.showColorDisplay=function(e){ if(!this._colorEl){ return } if(!e){ this._colorEl.onmouseover=DwtButtonColorPicker.__colorDisplay_onMouseOver; this._colorEl.onmouseout=DwtButtonColorPicker.__colorDisplay_onMouseOut; this._colorEl.onmousedown=DwtButtonColorPicker.__colorDisplay_onMouseDown }}; DwtButtonColorPicker.prototype.getColor=function(){ return this.__color }; DwtButtonColorPicker.prototype.setColor=function(e){ var t=e.match(DwtButtonColorPicker._RGB_RE); if(t){ e="#"+DwtButtonColorPicker.toHex(parseInt(t[1]),2)+DwtButtonColorPicker.toHex(parseInt(t[2]),2)+DwtButtonColorPicker.toHex(parseInt(t[3]),2) } this.__color=e; var a=this._colorEl; if(a){ a.style.backgroundColor=e }}; DwtButtonColorPicker.prototype._createHtmlFromTemplate=function(t,a){ DwtButton.prototype._createHtmlFromTemplate.call(this,t,a); var e=AjxTemplate.expand("dwt.Widgets#ZButtonColorDisplay",a); this.setText(e); this._colorEl=document.getElementById(a.id+"_color") }; DwtButtonColorPicker.prototype._setMinWidth=function(){}; DwtButtonColorPicker.prototype._colorPicked=function(a){ var e=a.detail; this.__color=this.__detail=e; var t=this._colorEl; if(t){ t.style.backgroundColor=e } if(this.isListenerRegistered(DwtEvent.SELECTION)){ var o=DwtShell.selectionEvent; o.item=this; o.detail=e; this.notifyListeners(DwtEvent.SELECTION,o) }}; DwtButtonColorPicker.prototype.__colorDisplay_onMouseOver=function(e,t){ if(!this.getEnabled()){ return } Dwt.addClass(t,"ImgDisable") }; DwtButtonColorPicker.prototype.__colorDisplay_onMouseOut=function(e,t){ if(!this.getEnabled()){ return } Dwt.delClass(t,"ImgDisable") }; DwtButtonColorPicker.prototype.__colorDisplay_onMouseDown=function(t,o){ if(!this.getEnabled()){ return } var e=DwtShell.mouseEvent; e.setFromDhtmlEvent(t); this.__color=this.__detail=o.style.backgroundColor=""; if(this.isListenerRegistered(DwtEvent.SELECTION)){ var a=DwtShell.selectionEvent; a.item=this; a.detail=""; this.notifyListeners(DwtEvent.SELECTION,a) } e._stopPropagation=true; e._returnValue=false; e.setToDhtmlEvent(t); return false }; DwtButtonColorPicker.__colorDisplay_onMouseOver=function(e){ var t=DwtControl.getTargetControl(e); t.__colorDisplay_onMouseOver(e,this) }; DwtButtonColorPicker.__colorDisplay_onMouseOut=function(e){ var t=DwtControl.getTargetControl(e); t.__colorDisplay_onMouseOut(e,this) }; DwtButtonColorPicker.__colorDisplay_onMouseDown=function(e){ var t=DwtControl.getTargetControl(e); t.__colorDisplay_onMouseDown(e,this) } } if(AjxPackage.define("ajax.dwt.widgets.DwtMessageComposite")){ DwtMessageComposite=function(a,t,e){ if(arguments.length==0){ return } t=t||"DwtMessageComposite"; DwtComposite.call(this,{ parent:a,className:t,posStyle:e} ) }; DwtMessageComposite.prototype=new DwtComposite; DwtMessageComposite.prototype.constructor=DwtMessageComposite; DwtMessageComposite.prototype.toString=function(){ return"DwtMessageComposite" }; DwtMessageComposite.prototype._formatter; DwtMessageComposite.prototype._controls; DwtMessageComposite.prototype.setFormat=function(f,l,n){ this._formatter=new AjxMessageFormat(f); this._controls={}; var y=this._htmlElId; var x=[""]; var b=this._formatter.getSegments(); var s={}; var w={}; for(var v=0; v"); if(k){ var u=l?l.run(this,t,v):null; if(!u){ u=new DwtInputField({ parent:this} ) } s[d]=u.getHtmlElement(); w[d]=n&&n.run(this,t,v); var m=t.getIndex(); this._controls[m]=this._controls[m]||u }else{ x.push(t.toSubPattern()) } x.push("") } x.push("
"); var o=this.getHtmlElement(); var c=o.childNodes.length; var q=document.createElement("DIV"); q.className=y+"_container"; o.appendChild(q); q.innerHTML=x.join(""); for(var d in s){ var e=s[d]; var h=document.getElementById(d); h.appendChild(e); for(var g in w[d]){ h[g]=w[d][g] }}}; DwtMessageComposite.prototype.format=function(){ var t=[]; for(var e in this._controls){ t[e]=this._controls[e].getValue() } return this._formatter.format(t) } } if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButtonGroup")){ DwtRadioButtonGroup=function(a,e){ this._radios={}; this._radioButtons={}; this._values={}; this._value2id={}; this._eventMgr=new AjxEventMgr(); for(var t in a){ this.addRadio(t,a[t],(t==e)) }}; DwtRadioButtonGroup.prototype.toString=function(){ return"DwtRadioButtonGroup" }; DwtRadioButtonGroup.prototype._enabled=true; DwtRadioButtonGroup.prototype._visible=true; DwtRadioButtonGroup.prototype.addSelectionListener=function(e){ return this._eventMgr.addListener(DwtEvent.SELECTION,e) }; DwtRadioButtonGroup.prototype.removeSelectionListener=function(e){ return this._eventMgr.removeListener(DwtEvent.SELECTION,e) }; DwtRadioButtonGroup.prototype.setEnabled=function(e){ this._enabled=e; for(var t in this._radios){ this._radios[t].disabled=!e }}; DwtRadioButtonGroup.prototype.isEnabled=function(){ return this._enabled }; DwtRadioButtonGroup.prototype.setVisible=function(e){ this._visible=e; for(var t in this._radioButtons){ this._radioButtons[t].setVisible(e) } for(var t in this._radios){ Dwt.setVisible(this._radios[t],e) }}; DwtRadioButtonGroup.prototype.isVisible=function(){ return this._visible }; DwtRadioButtonGroup.prototype.addRadio=function(l,h,o){ var e=h instanceof DwtRadioButton; var n=e?h:null; var s=n?n.getValue():h; this._values[l]=s; this._value2id[s]=l; var t=document.getElementById(l); this._radios[l]=t; this._radioButtons[l]=n; var a=AjxCallback.simpleClosure(this._handleClick,this); Dwt.setHandler(t,DwtEvent.ONCLICK,a); t.checked=o; if(o){ this._selectedId=l }}; DwtRadioButtonGroup.prototype.getRadioByValue=function(e){ var t=this._value2id[e]; return this._radios[t] }; DwtRadioButtonGroup.prototype.getRadioButtonByValue=function(e){ var t=this._value2id[e]; return this._radioButtons[t] }; DwtRadioButtonGroup.prototype.setSelectedId=function(o,e){ if(o!=this._selectedId){ var t=document.getElementById(o); if(!t){ return } t.checked=true; this._selectedId=o; if(!e){ var a=DwtShell.selectionEvent; a.reset(); this._notifySelection(a) }}}; DwtRadioButtonGroup.prototype.setSelectedValue=function(t,e){ var a=this._valueToId(t); this.setSelectedId(a,e) }; DwtRadioButtonGroup.prototype.getSelectedId=function(){ return this._selectedId }; DwtRadioButtonGroup.prototype.getSelectedValue=function(){ return this._values[this._selectedId] }; DwtRadioButtonGroup.prototype.getValue=function(){ return this.getSelectedValue() }; DwtRadioButtonGroup.prototype.getData=function(t){ var e=!AjxUtil.isUndefined(this._selectedId)&&this._radioButtons[this._selectedId]; if(e){ return e.getData(t) }}; DwtRadioButtonGroup.prototype._valueToId=function(e){ for(var t in this._values){ if(this._values[t]==e){ return t } if(e===true&&this._values[t]=="true"){ return t } if(e===false&&(this._values[t]=="false"||this._values[t]=="")){ return t }} return null }; DwtRadioButtonGroup.prototype._notifySelection=function(e){ e.item=this; e.detail={ id:this._selectedId,value:this._values[this._selectedId]}; this._eventMgr.notifyListeners(DwtEvent.SELECTION,e) }; DwtRadioButtonGroup.prototype._handleClick=function(e){ e=DwtUiEvent.getEvent(e); var a=DwtUiEvent.getTarget(e); if(a&&a.nodeName.match(/label/i)){ a=document.getElementById(a.getAttribute(AjxEnv.isIE?"htmlFor":"for")) } var o=a.id; if(!a.checked){ for(o in this._radios){ if(this._radios[o].checked){ break }}} if(o!=this._selectedId){ this._selectedId=o; var t=DwtShell.selectionEvent; DwtUiEvent.copy(t,e); this._notifySelection(t) }} } if(AjxPackage.define("ajax.dwt.widgets.DwtComboBox")){ DwtComboBox=function(e){ if(arguments.length==0){ return } e=Dwt.getParams(arguments,DwtComboBox.PARAMS); e.className=e.className||"DwtComboBox"; DwtComposite.call(this,e); this.input=null; this._button=null; this._textToValue={}; this._valueToText={}; this._valueToItem={}; this._size=0; this._hasMenuCallback=true; this._menuItemListenerObj=new AjxListener(this,this._menuItemListener); this._inputParams=e.inputParams; this._createHtml() }; DwtComboBox.PARAMS=["parent","inputParams","className","posStyle","dialog"]; DwtComboBox.prototype=new DwtComposite; DwtComboBox.prototype.constructor=DwtComboBox; DwtComboBox.prototype.toString=function(){ return"DwtComboBox" }; DwtComboBox.prototype.TEMPLATE="dwt.Widgets#DwtComboBox"; DwtComboBox.prototype.getTabGroupMember=function(){ return this._tabGroup }; DwtComboBox.prototype.addChangeListener=function(e){ this.addListener(DwtEvent.ONCHANGE,e) }; DwtComboBox.prototype.removeChangeListener=function(e){ this.removeListener(DwtEvent.ONCHANGE,e) }; DwtComboBox.prototype.add=function(o,t,e){ this._textToValue[o]=t; this._valueToText[t]=o; if(!this._hasMenuCallback){ var a=this._button.getMenu(); this._createMenuItem(a,o) } if(e){ this.setText(o) } this._size++; this._updateButton() }; DwtComboBox.prototype.remove=function(t){ var e=this._valueToItem[t]; if(e){ this._button.getMenu().removeChild(e); var a=this._valueToText[t]; delete this._textToValue[a]; delete this._valueToText[t]; delete this._valueToItem[t]; if(this.getText()==a){ this.setText("") } this._size--; this._updateButton() }}; DwtComboBox.prototype.removeAll=function(){ this._button.setMenu(new AjxCallback(this,this._createMenu),true); this._hasMenuCallback=true; this._textToValue={}; this._valueToText={}; this._valueToItem={}; this._size=0; this._updateButton() }; DwtComboBox.prototype.getValue=function(){ var e=this.getText(); return this._textToValue[e] }; DwtComboBox.prototype.setValue=function(e){ var t=this._valueToText[e]; this.setText(t||e) }; DwtComboBox.prototype.getText=function(){ return this.input.getValue() }; DwtComboBox.prototype.setText=function(e){ this.input.setValue(e) }; DwtComboBox.prototype.setEnabled=function(e){ if(e!=this._enabled){ DwtComposite.prototype.setEnabled.call(this,e); this.input.setEnabled(e); this._button.setEnabled(e) }}; DwtComboBox.prototype.focus=function(){ this.input.focus() }; DwtComboBox.prototype._createMenu=function(){ var o=new DwtMenu({ parent:this} ); for(var e in this._textToValue){ var t=this._createMenuItem(o,e); var a=this._textToValue[e]; this._valueToItem[a]=t } this._hasMenuCallback=false; return o }; DwtComboBox.prototype._createMenuItem=function(a,t){ var e=new DwtMenuItem({ parent:a} ); e.setText(t); e.addSelectionListener(this._menuItemListenerObj); if(!this._menuWidth){ this._menuWidth=this.getW()-10 } e.getHtmlElement().style.minWidth=this._menuWidth; return e }; DwtComboBox.prototype._menuItemListener=function(o){ var t=o.dwtObj; var n=this.input.getValue(); var s=t.getText(); this.input.setValue(s); var a=DwtUiEvent.getEvent(o); a._args={ selectObj:this,newValue:s,oldValue:n}; this.notifyListeners(DwtEvent.ONCHANGE,a); var e=this.input.getInputElement(); e.focus(); e.select() }; DwtComboBox.prototype._handleKeyDown=function(e){ this.__ovalue=this.input.getValue(); return true }; DwtComboBox.prototype._handleKeyUp=function(t){ DwtInputField._keyUpHdlr(t); var e=DwtUiEvent.getEvent(t); e._args={ selectObj:this,newValue:this.input.getValue(),oldValue:this.__ovalue}; this.notifyListeners(DwtEvent.ONCHANGE,e); return true }; DwtComboBox.prototype._updateButton=function(){ this._button.setVisible(this._size>0) }; DwtComboBox.prototype._createHtml=function(e){ var t={ id:this._htmlElId}; this._createHtmlFromTemplate(e||this.TEMPLATE,t) }; DwtComboBox.prototype._createHtmlFromTemplate=function(t,a){ DwtComposite.prototype._createHtmlFromTemplate.call(this,t,a); var e=this._inputParams||{}; e.parent=this; e.size=e.size||40; delete this._inputParams; this.input=new DwtInputField(e); this.input.replaceElement(a.id+"_input"); this.input.setHandler(DwtEvent.ONKEYDOWN,AjxCallback.simpleClosure(this._handleKeyDown,this)); this.input.setHandler(DwtEvent.ONKEYUP,AjxCallback.simpleClosure(this._handleKeyUp,this)); this._button=new DwtComboBoxButton({ parent:this} ); this._button.setMenu(new AjxListener(this,this._createMenu),true); this._button.replaceElement(a.id+"_button"); this._updateButton(); this._tabGroup=new DwtTabGroup(this._htmlElId); this._tabGroup.addMember(this.input); this._tabGroup.addMember(this._button) }; DwtComboBox.prototype._replaceElementHook=function(t,a,e,o){ DwtComposite.prototype._replaceElementHook.apply(this,arguments); if(t.size){ this.input.getInputElement().size=t.size } if(t.title){ this.input.setHint(t.title) }}; DwtComboBoxButton=function(e){ e=Dwt.getParams(arguments,DwtComboBoxButton.PARAMS); e.posStyle=Dwt.RELATIVE_STYLE; DwtButton.call(this,e) }; DwtComboBoxButton.prototype=new DwtButton; DwtComboBoxButton.prototype.constructor=DwtComboBoxButton; DwtComboBoxButton.prototype.toString=function(){ return"DwtComboBoxButton" }; DwtComboBoxButton.PARAMS=["parent","className"]; DwtComboBoxButton.prototype.TEMPLATE="dwt.Widgets#DwtComboBoxButton" } if(AjxPackage.define("zimbra.common.ZLoginFactory")){ ZLoginFactory=function(){}; ZLoginFactory.USER_ID="ZLoginUserName"; ZLoginFactory.PASSWORD_ID="ZLoginPassword"; ZLoginFactory.REMEMBER_ME_ID="rememberMe"; ZLoginFactory.REMEMBER_ME_CONTAINER_ID="ZLoginRememberMeContainer"; ZLoginFactory.NEW_PASSWORD_ID="newpass1"; ZLoginFactory.NEW_PASSWORD_TR_ID="ZLoginNewPassword1Tr"; ZLoginFactory.PASSWORD_CONFIRM_TR_ID="ZLoginNewPassword2Tr"; ZLoginFactory.PASSWORD_CONFIRM_ID="newpass2"; ZLoginFactory.LOGIN_BUTTON_ID="ZLoginButton"; ZLoginFactory.MORE_ID="ZLoginMore"; ZLoginFactory.TEXT_TYPE=0; ZLoginFactory.CHECKBOX_TYPE=1; ZLoginFactory.BUTTON_TYPE=2; ZLoginFactory.TAB_ORDER=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_ID,ZLoginFactory.PASSWORD_CONFIRM_ID,ZLoginFactory.REMEMBER_ME_ID,ZLoginFactory.LOGIN_BUTTON_ID]; ZLoginFactory.VISIBILITY=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_TR_ID,ZLoginFactory.PASSWORD_CONFIRM_TR_ID,ZLoginFactory.REMEMBER_ME_CONTAINER_ID,ZLoginFactory.LOGIN_BUTTON_ID]; ZLoginFactory.TAB_TYPE=[ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.CHECKBOX_TYPE,ZLoginFactory.BUTTON_TYPE]; ZLoginFactory.copyDefaultParams=function(e){ return{ showPanelBorder:true,companyURL:e.splashScreenCompanyURL||"",shortVersion:"",longVersion:"",appName:e.splashScreenAppName||"",productName:"",showError:false,errorMsg:"",showLongVersion:false,showAbout:false,aboutMsg:"",showLoading:false,loadingMsg:e.splashScreenLoading||"",showForm:false,showUserField:false,userNameMsg:e.username?e.username+":":"",showMoreField:false,moreMsg:e.more||"",showPasswordField:false,passwordMsg:e.password?e.password+":":"",showNewPasswordFields:false,newPassword1Msg:e.newPassword+":"||"",newPassword2Msg:e.confirm+":"||"",showLicenseMsg:false,licenseMsg:"",showRememberMeCheckbox:false,rememberMeMsg:e.rememberMe||"",showLogOff:false,logOffMsg:e.loginAsDiff||"",logOffAction:"",showButton:false,buttonName:e.login||"",copyrightText:ZaItem.getSplashScreenCopyright()||""} }; ZLoginFactory.getLoginPanel=function(){ var e=document.getElementsByName("loginForm"); return e }; ZLoginFactory.showErrorMsg=function(e){ this.setHTML("ZLoginErrorMsg",e); this.show("ZLoginErrorPanel"); this._flickerErrorMessagePanel() }; ZLoginFactory.hideErrorMsg=function(){ this.hide("ZLoginErrorPanel") }; ZLoginFactory.getErrorMsgPanel=function(){ return this.get("ZLoginErrorPanel") }; ZLoginFactory.showAboutMsg=function(e){ this.setHTML("ZLoginAboutPanel",e); this.show("ZLoginAboutPanel") }; ZLoginFactory.hideAboutMsg=function(){ this.hide("ZLoginAboutPanel") }; ZLoginFactory.getAboutMsg=function(){ return this.get("ZLoginAboutPanel") }; ZLoginFactory.showLoadingMsg=function(e){ this.setHTML("ZLoginLoadingMsg",e); this.show("ZLoginAboutPanel") }; ZLoginFactory.hideLoadingMsg=function(){ this.hide("ZLoginAboutPanel") }; ZLoginFactory.getLoadingMsg=function(){ return this.get("ZLoginAboutPanel") }; ZLoginFactory.showForm=function(){ this.show("ZLoginFormPanel") }; ZLoginFactory.hideForm=function(){ this.hide("ZLoginFormPanel") }; ZLoginFactory.getForm=function(){ return this.get("ZLoginFormPanel") }; ZLoginFactory.showMoreField=function(e){ this.setValue(ZLoginFactory.MORE_ID,e); this.show(ZLoginFactory.MORE_ID) }; ZLoginFactory.hideMoreField=function(){ this.hide(ZLoginFactory.MORE_ID) }; ZLoginFactory.getMoreField=function(){ return this.get(ZLoginFactory.MORE_ID) }; ZLoginFactory.showUserField=function(e){ this.setValue(ZLoginFactory.USER_ID,e); this.show(ZLoginFactory.USER_ID) }; ZLoginFactory.hideUserField=function(){ this.hide(ZLoginFactory.USER_ID) }; ZLoginFactory.getUserField=function(){ return this.get(ZLoginFactory.USER_ID) }; ZLoginFactory.showPasswordField=function(e){ this.show(ZLoginFactory.PASSWORD_ID) }; ZLoginFactory.hidePasswordField=function(){ this.hide(ZLoginFactory.PASSWORD_ID) }; ZLoginFactory.getPasswordField=function(){ return this.get(ZLoginFactory.PASSWORD_ID) }; ZLoginFactory.showNewPasswordFields=function(){ this.show(ZLoginFactory.NEW_PASSWORD_TR_ID); this.show(ZLoginFactory.PASSWORD_CONFIRM_TR_ID) }; ZLoginFactory.hideNewPasswordFields=function(){ this.hide(ZLoginFactory.NEW_PASSWORD_TR_ID); this.hide(ZLoginFactory.PASSWORD_CONFIRM_TR_ID) }; ZLoginFactory.areNewPasswordFieldsShown=function(){ return this.isShown(ZLoginFactory.NEW_PASSWORD_TR_ID) }; ZLoginFactory.getNewPasswordField=function(){ return this.get(ZLoginFactory.NEW_PASSWORD_ID) }; ZLoginFactory.getPasswordConfirmField=function(){ return this.get(ZLoginFactory.PASSWORD_CONFIRM_ID) }; ZLoginFactory.showRememberMeCheckbox=function(){ this.show(ZLoginFactory.REMEMBER_ME_CONTAINER_ID) }; ZLoginFactory.hideRememberMeCheckbox=function(){ this.hide(ZLoginFactory.REMEMBER_ME_CONTAINER_ID) }; ZLoginFactory.showLogOff=function(){ this.show("ZLoginLogOffContainer") }; ZLoginFactory.hideLogOff=function(){ this.hide("ZLoginLogOffContainer") }; ZLoginFactory.setLoginButtonName=function(e){ this.setHTML("ZLoginButtonText",e) }; ZLoginFactory.setLoginButtonAction=function(t){ var e=document.getElementById(ZLoginFactory.LOGIN_BUTTON_ID); if(e){ e.onclick=t }}; ZLoginFactory.getLoginButton=function(){ return this.get(ZLoginFactory.LOGIN_BUTTON_ID) }; ZLoginFactory.getLoginDialogHTML=function(t){ var e=["
","

","","

","
","
","
","
","
","","","","","","","","","","","","","","","","","","","","","","","","","","","","","
       
",t.licenseMsg,"
 ","","","","
","
","
","
",t.aboutMsg,"
","
",t.longVersion,"
","
",""].join(""); return e }; ZLoginFactory.setHTML=function(a,e){ var t=document.getElementById(a); if(t&&e!=null){ t.innerHTML=e }}; ZLoginFactory.setValue=function(a,e){ var t=document.getElementById(a); if(t&&e!=null){ t.value=e }}; ZLoginFactory.show=function(a,e){ var t=document.getElementById(a); if(t){ t.style.display="" }}; ZLoginFactory.isShown=function(t){ var e=document.getElementById(t); return e?(e.style.display!="none"):false }; ZLoginFactory.hide=function(t){ var e=document.getElementById(t); if(e){ e.style.display="none" }}; ZLoginFactory.get=function(e){ return document.getElementById(e) }; ZLoginFactory.handleKeyPress=function(h){ h=h||window.event; if(h==null){ return true } var n=h.target?h.target:h.srcElement; if(!n){ return true } var c=h.keyCode; var e=false; if(c==13){ if(n.id==ZLoginFactory.USER_ID||n.id==ZLoginFactory.NEW_PASSWORD_ID){ e=true }else{ var t=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID).onclick; if(t){ t.call(n) } ZLoginFactory._cancelEvent(h); return false }} if(e||(c==9)){ var l=ZLoginFactory.TAB_ORDER.length-1; for(var a=0; awindow.NREUM||(NREUM={});NREUM.info = {"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"dee0e5b8c5","applicationID":"23370385","transactionName":"ZAYAZBQAXUNUVBBaX11MI2M2TmFVRlgRQVNWKwNeAg1WQg==","queueTime":0,"applicationTime":1868,"agent":"","atts":""}