mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
376 lines
No EOL
189 KiB
JavaScript
376 lines
No EOL
189 KiB
JavaScript
(function(h,j,f,Wa,P,Y,sa,i){function B(){this.sBase="#/";this.sCdnStaticDomain=e.settingsGet("CdnStaticDomain");this.sVersion=e.settingsGet("Version");this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0";this.sServer="./?";this.sCdnStaticDomain=""===this.sCdnStaticDomain?this.sCdnStaticDomain:"/"===this.sCdnStaticDomain.substr(-1)?this.sCdnStaticDomain:this.sCdnStaticDomain+"/"}function q(a,b,c,l){this.oOptions=l=j.extend({DisableHtml:!1,onSwitch:!1,LangSwitcherConferm:"EDITOR_TEXT_SWITCHER_CONFIRM",
|
|
LangSwitcherTextLabel:"EDITOR_SWITCHER_TEXT_LABEL",LangSwitcherHtmlLabel:"EDITOR_SWITCHER_HTML_LABEL"},d.isUnd(l)?{}:l);this.bOnlyPlain=!!this.oOptions.DisableHtml;this.fOnSwitch=this.oOptions.onSwitch;this.textarea=j(a).empty().addClass("editorTextArea");this.htmlarea=j(b).empty().addClass("editorHtmlArea").prop("contentEditable","true");this.toolbar=j(c).empty().addClass("editorToolbar");q.htmlInitEditor.apply(this);q.htmlInitToolbar.apply(this);q.htmlAttachEditorEvents.apply(this);this.bOnlyPlain&&
|
|
this.toolbar.hide()}function K(a,b,c,l,e){this.list=a;this.selectedItem=b;this.selectedItem.extend({toggleSubscribe:[null,function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]});this.oContentScrollable=this.oContentVisible=null;this.sItemSelector=c;this.sItemSelectedSelector=l;this.sItemCheckedSelector=e;this.sLastUid="";this.oCallbacks={};this.iSelectTimer=0;this.bUseKeyboard=!0;this.emptyFunction=function(){};this.useItemSelectCallback=!0;this.throttleSelection=!1;this.selectedItem.subscribe(function(a){this.useItemSelectCallback&&
|
|
(this.throttleSelection?(this.throttleSelection=!1,this.selectItemCallbacksThrottle(a)):this.selectItemCallbacks(a))},this);var f=this,g=[],k=null;this.list.subscribe(function(){var a=this,b=this.list();d.isArray(b)&&i.each(b,function(b){b.checked()&&g.push(a.getItemUid(b));null===k&&b.selected()&&(k=a.getItemUid(b))})},this,"beforeChange");this.list.subscribe(function(a){this.useItemSelectCallback=!1;this.selectedItem(null);if(d.isArray(a)){var b=this,c=g.length;i.each(a,function(a){0<c&&-1<d.inArray(b.getItemUid(a),
|
|
g)&&(a.checked(!0),c--);null!==k&&k===b.getItemUid(a)&&(a.selected(!0),k=null,b.selectedItem(a))})}this.useItemSelectCallback=!0;g=[];k=null},this);this.list.setSelectedByUid=function(a){f.selectByUid(a,!1)};this.selectItemCallbacksThrottle=i.debounce(this.selectItemCallbacks,300)}function ta(){}function ua(){}function va(){var a=i.find([ua,ta],function(a){return a.supported()});a&&(this.oDriver=new a)}function Xa(){}function C(a,b){this.sPosition=d.pString(a);this.sTemplate=d.pString(b);this.viewModelName=
|
|
"";this.viewModelVisibility=f.observable(!1);"Popups"===this.sPosition&&(this.modalVisibility=f.observable(!1));this.viewModelDom=null}function J(a,b){this.sScreenName=a;this.aViewModels=d.isArray(b)?b:[]}function E(){this.sDefaultScreenName="";this.oScreens={};this.oCurrentScreen=this.oBoot=null;this.popupVisibility=f.observable(!1);this.popupVisibility.subscribe(function(a){e&&e.popupVisibility(a)})}function F(a,b){this.email=a||"";this.name=b||"";this.privateType=null;this.clearDuplicateName()}
|
|
function ka(){this.idContact=0;this.name=this.listName=this.imageHash="";this.emails=[];this.checked=f.observable(!1);this.selected=f.observable(!1);this.deleted=f.observable(!1)}function D(){this.fileName=this.mimeType="";this.estimatedSize=0;this.friendlySize="";this.isLinked=this.isInline=!1;this.mimeIndex=this.uid=this.folder=this.download=this.cidWithOutTags=this.cid=""}function M(a,b,c,l,e,r){this.id=a;this.isInline=d.isUnd(l)?!1:!!l;this.isLinked=d.isUnd(e)?!1:!!e;this.CID=d.isUnd(r)?"":r;
|
|
this.fromMessage=!1;this.fileName=f.observable(b);this.size=f.observable(d.isUnd(c)?null:c);this.tempName=f.observable("");this.progress=f.observable("");this.error=f.observable("");this.waiting=f.observable(!0);this.uploading=f.observable(!1);this.enabled=f.observable(!0);this.friendlySize=f.computed(function(){return null===this.size()?"":d.friendlySize(this.size())},this)}function m(){this.requestHash=this.uid=this.folderFullNameRaw="";this.subject=f.observable("");this.size=f.observable(0);this.dateTimeStampInUTC=
|
|
f.observable(0);this.priority=f.observable(g.MessagePriority.Normal);this.fromEmailString=f.observable("");this.toEmailsString=f.observable("");this.senderEmailsString=f.observable("");this.prefetched=!1;this.emails=[];this.from=[];this.to=[];this.cc=[];this.bcc=[];this.replyTo=[];this.newForAnimation=f.observable(!1);this.deleted=f.observable(!1);this.unseen=f.observable(!1);this.flagged=f.observable(!1);this.answered=f.observable(!1);this.forwarded=f.observable(!1);this.selected=f.observable(!1);
|
|
this.checked=f.observable(!1);this.hasAttachments=f.observable(!1);this.moment=f.observable(Y());this.fullFormatDateValue=f.computed(function(){return m.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this);this.fullFormatDateValue=f.computed(function(){return m.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this);this.momentDate=d.createMomentDate(this);this.momentShortDate=d.createMomentShortDate(this);this.dateTimeStampInUTC.subscribe(function(a){var b=Y().unix();this.moment(Y.unix(b<
|
|
a?b:a))},this);this.body=null;this.isHtml=f.observable(!1);this.hasImages=f.observable(!1);this.attachments=f.observableArray([]);this.priority=f.observable(g.MessagePriority.Normal);this.aDraftInfo=[];this.sReferences=this.sInReplyTo=this.sMessageId="";this.parentUid=f.observable(0);this.threads=f.observableArray([]);this.threadsLen=f.observable(0);this.hasUnseenSubMessage=f.observable(!1);this.hasFlaggedSubMessage=f.observable(!1);this.lastInCollapsedThread=f.observable(!1);this.lastInCollapsedThreadLoading=
|
|
f.observable(!1);this.threadsLenResult=f.computed(function(){var a=this.threadsLen();return 0===this.parentUid()&&0<a?a+1:""},this)}function G(){this.name=f.observable("");this.namespace=this.delimiter=this.fullNameHash=this.fullNameRaw=this.fullName="";this.deep=0;this.selectable=!1;this.existen=!0;this.isUnpaddigFolder=this.isGmailFolder=this.isNamespaceFolder=!1;this.type=f.observable(g.FolderType.User);this.selected=f.observable(!1);this.edited=f.observable(!1);this.collapsed=f.observable(!0);
|
|
this.subScribed=f.observable(!0);this.subFolders=f.observableArray([]);this.deleteAccess=f.observable(!1);this.actionBlink=f.observable(!1).extend({falseTimeout:1E3});this.nameForEdit=f.observable("");this.name.subscribe(function(a){this.nameForEdit(a)},this);this.edited.subscribe(function(a){a&&this.nameForEdit(this.name())},this);this.canBeEdited=f.computed(function(){return g.FolderType.User===this.type()},this);this.privateMessageCountAll=f.observable(0);this.privateMessageCountUnread=f.observable(0);
|
|
this.collapsedPrivate=f.observable(!0)}function La(a,b){this.email=a;this.deleteAccess=f.observable(!1);this.canBeDalete=f.observable(b)}function wa(){C.call(this,"Popups","PopupsFolderClear");this.selectedFolder=f.observable(null);this.clearingProcess=f.observable(!1);this.clearingError=f.observable("");this.folderFullNameForClear=f.computed(function(){var a=this.selectedFolder();return a?a.printableFullName():""},this);this.folderNameForClear=f.computed(function(){var a=this.selectedFolder();return a?
|
|
a.localName():""},this);this.dangerDescHtml=f.computed(function(){return d.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this);this.clearCommand=d.createCommand(this,function(){var a=this,b=this.selectedFolder();b&&(e.data().message(null),e.data().messageList([]),this.clearingProcess(!0),e.cache().setFolderHash(b.fullNameRaw,""),e.remote().folderClear(function(b,l){a.clearingProcess(!1);g.StorageResultType.Success===b&&l&&l.Result?(e.reloadMessageList(!0),a.cancelCommand()):
|
|
l&&l.ErrorCode?a.clearingError(d.getNotification(l.ErrorCode)):a.clearingError(d.getNotification(g.Notification.MailServerError))},b.fullNameRaw))},function(){var a=this.selectedFolder();return!this.clearingProcess()&&null!==a})}function ba(){C.call(this,"Popups","PopupsFolderCreate");d.initOnStartOrLangChange(function(){this.sNoParentText=d.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this);this.folderName=f.observable("");this.focusTrigger=f.observable(!1);this.selectedParentValue=f.observable(t.Values.UnuseOptionValue);
|
|
this.parentFolderSelectList=f.computed(function(){var a=e.data(),b=[],c=null,l=a.folderList();b.push(["",this.sNoParentText]);""!==a.namespace&&(c=function(b){return a.namespace!==b.fullNameRaw.substr(0,a.namespace.length)});return e.folderListOptionsBuilder([],l,[],b,null,c,null,function(a){return a?a.isSystemFolder()?a.name()+" "+a.manageFolderSystemName():a.name():""})},this);this.createFolder=d.createCommand(this,function(){var a=e.data(),b=this.selectedParentValue();""===b&&1<a.namespace.length&&
|
|
(b=a.namespace.substr(0,a.namespace.length-1));a.foldersCreating(!0);e.remote().folderCreate(function(a,b){e.data().foldersCreating(!1);g.StorageResultType.Success===a&&b&&b.Result?e.folders(!1):e.data().foldersListError(b&&b.ErrorCode?d.getNotification(b.ErrorCode):d.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"))},this.folderName(),b);this.cancelCommand()},function(){return this.simpleFolderNameValidation(this.folderName())});this.defautOptionsAfterRender=d.defautOptionsAfterRender}function X(){C.call(this,
|
|
"Popups","PopupsFolderSystem");d.initOnStartOrLangChange(function(){this.sChooseOnText=d.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE");this.sUnuseText=d.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME")},this);this.notification=f.observable("");this.folderSelectList=f.computed(function(){return e.folderListOptionsBuilder([],e.data().folderList(),e.data().folderListSystemNames(),[["",this.sChooseOnText],[t.Values.UnuseOptionValue,this.sUnuseText]])},this);var a=e.data(),b=this,c=null,l=null;this.sentFolder=
|
|
a.sentFolder;this.draftFolder=a.draftFolder;this.spamFolder=a.spamFolder;this.trashFolder=a.trashFolder;c=i.debounce(function(){e.settingsSet("SentFolder",b.sentFolder());e.settingsSet("DraftFolder",b.draftFolder());e.settingsSet("SpamFolder",b.spamFolder());e.settingsSet("TrashFolder",b.trashFolder());e.remote().saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder()})},1E3);l=function(){e.settingsSet("SentFolder",
|
|
b.sentFolder());e.settingsSet("DraftFolder",b.draftFolder());e.settingsSet("SpamFolder",b.spamFolder());e.settingsSet("TrashFolder",b.trashFolder());c()};this.sentFolder.subscribe(l);this.draftFolder.subscribe(l);this.spamFolder.subscribe(l);this.trashFolder.subscribe(l);this.defautOptionsAfterRender=d.defautOptionsAfterRender}function y(){C.call(this,"Popups","PopupsCompose");this.aDraftInfo=this.oEditor=null;this.sInReplyTo="";this.bFromDraft=!1;this.sReferences="";this.bReloadFolder=!1;var a=this,
|
|
b=function(a){for(var b=0,c=a.length,d=[];b<c;b++)d.push(a[b].toLine(!1));return d.join(", ")},c=function(a){!1===this.showCcAndBcc()&&0<a.length&&this.showCcAndBcc(!0)};this.resizer=f.observable(!1).extend({throttle:50});this.to=f.observableArray([]);this.cc=f.observableArray([]);this.bcc=f.observableArray([]);this.subject=f.observable("");this.sendError=f.observable(!1);this.sendSuccessButSaveError=f.observable(!1);this.savedError=f.observable(!1);this.savedTime=f.observable(0);this.savedOrSendingText=
|
|
f.observable("");this.emptyToError=f.observable(!1);this.showCcAndBcc=f.observable(!1);this.cc.subscribe(c,this);this.bcc.subscribe(c,this);this.draftFolder=f.observable("");this.draftUid=f.observable("");this.sending=f.observable(!1);this.saving=f.observable(!1);this.attachments=f.observableArray([]);this.attachmentsInProcess=f.computed(function(){return i.filter(this.attachments(),function(a){return a&&""===a.tempName()})},this);this.attachmentsInReady=f.computed(function(){return i.filter(this.attachments(),
|
|
function(a){return a&&""!==a.tempName()})},this);this.attachments.subscribe(function(){this.triggerForResize()},this);this.isDraftFolderMessage=f.computed(function(){return""!==this.draftFolder()&&""!==this.draftUid()},this);this.composeUploaderButton=f.observable(null);this.composeUploaderDropPlace=f.observable(null);this.dragAndDropEnabled=f.observable(!1);this.dragAndDropOver=f.observable(!1).extend({throttle:1});this.dragAndDropVisible=f.observable(!1).extend({throttle:1});this.attacheMultipleAllowed=
|
|
f.observable(!1);this.addAttachmentEnabled=f.observable(!1);this.composeEditorTextArea=f.observable(null);this.composeEditorHtmlArea=f.observable(null);this.composeEditorToolbar=f.observable(null);this.to.subscribe(function(a){this.emptyToError()&&0<a.length&&this.emptyToError(!1)},this);this.canBeSended=f.computed(function(){return!this.sending()&&!this.saving()&&0===this.attachmentsInProcess().length&&0<this.to().length},this);this.canBeSendedOrSaved=f.computed(function(){return!this.sending()&&
|
|
!this.saving()},this);this.deleteCommand=d.createCommand(this,function(){var a=null,b=this.draftFolder(),c=this.draftUid();this.bFromDraft&&(a=e.data().message())&&(b===a.folderFullNameRaw&&c===a.uid)&&e.data().message(null);e.data().currentFolderFullNameRaw()===this.draftFolder()&&i.each(e.data().messageList(),function(a){a&&(b===a.folderFullNameRaw&&c===a.uid)&&a.deleted(true)});e.data().messageListIsNotCompleted(!0);e.remote().messagesDelete(function(){e.cache().setFolderHash(b,"");e.reloadMessageList()},
|
|
this.draftFolder(),[this.draftUid()]);this.bReloadFolder=!1;s.hideScreenPopup(y)},function(){return this.isDraftFolderMessage()});this.sendMessageResponse=i.bind(this.sendMessageResponse,this);this.saveMessageResponse=i.bind(this.saveMessageResponse,this);this.sendCommand=d.createCommand(this,function(){var a=this.to(),c=e.data().sentFolder(),f=[];if(0===a.length)this.emptyToError(!0);else if(e.data().replySameFolder()&&d.isArray(this.aDraftInfo)&&(3===this.aDraftInfo.length&&d.isNormal(this.aDraftInfo[2])&&
|
|
0<this.aDraftInfo[2].length)&&(c=this.aDraftInfo[2]),""===c)s.showScreenPopup(X,[g.SetSystemFoldersNotification.Sent]);else{this.sendError(!1);this.sending(!0);this.bReloadFolder=!0;if(d.isArray(this.aDraftInfo)&&3===this.aDraftInfo.length&&(f=e.cache().getMessageFlagsFromCache(this.aDraftInfo[2],this.aDraftInfo[1])))"forward"===this.aDraftInfo[0]?f[3]=!0:f[2]=!0,e.cache().setMessageFlagsToCache(this.aDraftInfo[2],this.aDraftInfo[1],f),e.reloadFlagsCurrentMessageListAndMessageFromCache();c=t.Values.UnuseOptionValue===
|
|
c?"":c;e.cache().setFolderHash(this.draftFolder(),"");e.cache().setFolderHash(c,"");e.remote().sendMessage(this.sendMessageResponse,this.draftFolder(),this.draftUid(),c,b(a),b(this.cc()),b(this.bcc()),this.subject(),this.oEditor.isHtml(),this.oEditor.getTextForRequest(),this.prepearAttachmentsForSendOrSave(),this.aDraftInfo,this.sInReplyTo,this.sReferences)}},this.canBeSendedOrSaved);this.saveCommand=d.createCommand(this,function(){e.data().draftFolderNotEnabled()?s.showScreenPopup(X,[g.SetSystemFoldersNotification.Draft]):
|
|
(this.savedError(!1),this.saving(!0),this.bReloadFolder=!0,e.cache().setFolderHash(e.data().draftFolder(),""),e.remote().saveMessage(this.saveMessageResponse,this.draftFolder(),this.draftUid(),e.data().draftFolder(),b(this.to()),b(this.cc()),b(this.bcc()),this.subject(),this.oEditor.isHtml(),this.oEditor.getTextForRequest(),this.prepearAttachmentsForSendOrSave(),this.aDraftInfo,this.sInReplyTo,this.sReferences))},this.canBeSendedOrSaved);xa.subscribe(function(){this.modalVisibility()&&(!e.data().draftFolderNotEnabled()&&
|
|
!this.isEmptyForm(!1)&&!this.saving()&&!this.sending()&&!this.savedError())&&this.saveCommand()},this);d.initOnStartOrLangChange(null,this,function(){this.oEditor&&this.oEditor.initLanguage(d.i18n("EDITOR/TEXT_SWITCHER_CONFIRM"),d.i18n("EDITOR/TEXT_SWITCHER_PLAINT_TEXT"),d.i18n("EDITOR/TEXT_SWITCHER_RICH_FORMATTING"))});this.showCcAndBcc.subscribe(function(){this.triggerForResize()},this);this.dropboxEnabled=f.observable(e.settingsGet("DropboxApiKey")?!0:!1);this.dropboxCommand=d.createCommand(this,
|
|
function(){Dropbox.choose({success:function(b){b&&(b[0]&&b[0].link)&&a.addDropboxAttachment(b[0])},linkType:"direct",multiselect:!1});return!0},function(){return this.dropboxEnabled()});this.modalVisibility.subscribe(function(a){!a&&this.bReloadFolder&&(this.bReloadFolder=!1,e.reloadMessageList())},this);this.driveEnabled=f.observable(!1);this.driveCommand=d.createCommand(this,function(){return!0},function(){return this.driveEnabled()})}function L(){C.call(this,"Popups","PopupsContacts");var a=this;
|
|
this.imageUploader=f.observable(null);this.imageDom=f.observable(null);this.imageTrigger=f.observable(!1);this.search=f.observable("");this.contacts=f.observableArray([]);this.contacts.loading=f.observable(!1).extend({throttle:200});this.currentContact=f.observable(null);this.emptySelection=f.observable(!0);this.viewClearSearch=f.observable(!1);this.viewID=f.observable("");this.viewName=f.observable("");this.viewName.focused=f.observable(!1);this.viewEmail=f.observable("").validateEmail();this.viewEmail.focused=
|
|
f.observable(!1);this.viewImageUrl=f.observable(e.link().emptyContactPic());this.viewSaving=f.observable(!1);this.useCheckboxesInList=e.data().useCheckboxesInList;this.search.subscribe(function(){this.reloadContactList()},this);this.contacts.subscribe(function(){d.windowResize()},this);this.viewImageUrl.subscribe(function(a){this.imageDom().src=a},this);this.contactsChecked=f.computed(function(){return i.filter(this.contacts(),function(a){return a.checked()})},this);this.contactsCheckedOrSelected=
|
|
f.computed(function(){var a=this.contactsChecked(),c=this.currentContact();return i.union(a,c?[c]:[])},this);this.contactsCheckedOrSelectedUids=f.computed(function(){return i.map(this.contactsCheckedOrSelected(),function(a){return a.idContact})},this);this.newCommand=d.createCommand(this,function(){this.populateViewContact(null)});this.selector=new K(this.contacts,this.currentContact,".e-contact-item .actionHandle",".e-contact-item.selected",".e-contact-item .checkboxItem");this.selector.on("onItemSelect",
|
|
i.bind(function(a){this.populateViewContact(a?a:null)},this));this.selector.on("onItemGetUid",function(a){return a?a.generateUid():""});this.selector.on("onDelete",i.bind(function(){this.deleteCommand()},this));this.newCommand=d.createCommand(this,function(){this.populateViewContact(null);this.currentContact(null)});this.deleteCommand=d.createCommand(this,function(){this.deleteSelectedContacts()},function(){return 0<this.contactsCheckedOrSelected().length});this.newMessageCommand=d.createCommand(this,
|
|
function(){var a=this.contactsCheckedOrSelected(),c=[];d.isNonEmptyArray(a)&&(c=i.map(a,function(a){return a&&a.emails&&(a=new F(a.emails[0]||"",a.name),a.validate())?a:null}),c=i.compact(c));d.isNonEmptyArray(a)&&(s.hideScreenPopup(L),s.showScreenPopup(y,[g.ComposeType.Empty,null,c]))},function(){return 0<this.contactsCheckedOrSelected().length});this.clearCommand=d.createCommand(this,function(){this.search("")});this.saveCommand=d.createCommand(this,function(){var b=d.fakeMd5(),c=this.imageTrigger();
|
|
this.viewSaving(!0);e.remote().contactSave(function(l,f){a.viewSaving(!1);g.StorageResultType.Success===l&&(f&&f.Result&&f.Result.RequestUid===b&&0<d.pInt(f.Result.ResultID))&&(""===a.viewID()&&a.viewID(d.pInt(f.Result.ResultID)),a.reloadContactList(),c&&e.emailsPicsHashes())},b,this.viewID(),this.viewName(),this.viewEmail(),c?this.imageDom().src:"")},function(){var a=this.viewName(),c=this.viewEmail();return!this.viewSaving()&&(""!==a||""!==c)})}function ca(){C.call(this,"Popups","PopupsAdvancedSearch");
|
|
this.fromFocus=f.observable(!1);this.from=f.observable("");this.to=f.observable("");this.subject=f.observable("");this.text=f.observable("");this.selectedDateValue=f.observable(-1);this.hasAttachments=f.observable(!1);this.searchCommand=d.createCommand(this,function(){var a=this.buildSearchString();""!==a&&e.data().mainMessageListSearch(a);this.cancelCommand()})}function da(){C.call(this,"Popups","PopupsAddAccount");this.email=f.observable("");this.login=f.observable("");this.password=f.observable("");
|
|
this.emailError=f.observable(!1);this.loginError=f.observable(!1);this.passwordError=f.observable(!1);this.email.subscribe(function(){this.emailError(!1)},this);this.login.subscribe(function(){this.loginError(!1)},this);this.password.subscribe(function(){this.passwordError(!1)},this);this.allowCustomLogin=f.observable(!1);this.submitRequest=f.observable(!1);this.submitError=f.observable("");this.emailFocus=f.observable(!1);this.loginFocus=f.observable(!1);this.addAccountCommand=d.createCommand(this,
|
|
function(){this.emailError(""===d.trim(this.email()));this.passwordError(""===d.trim(this.password()));if(this.emailError()||this.passwordError())return!1;this.submitRequest(!0);e.remote().accountAdd(i.bind(function(a,b){this.submitRequest(!1);g.StorageResultType.Success===a&&b&&"AccountAdd"===b.Action?b.Result?(e.accounts(),this.cancelCommand()):b.ErrorCode&&this.submitError(d.getNotification(b.ErrorCode)):this.submitError(d.getNotification(g.Notification.UnknownError))},this),this.email(),this.login(),
|
|
this.password());return!0},function(){return!this.submitRequest()});this.loginFocus.subscribe(function(a){a&&(""===this.login()&&""!==this.email())&&this.login(this.email())},this)}function la(){C.call(this,"Right","Login");this.email=f.observable("");this.login=f.observable("");this.password=f.observable("");this.signMe=f.observable(!1);this.logoMain=f.observable("RainLoop");this.emailError=f.observable(!1);this.loginError=f.observable(!1);this.passwordError=f.observable(!1);this.emailFocus=f.observable(!1);
|
|
this.loginFocus=f.observable(!1);this.submitFocus=f.observable(!1);this.email.subscribe(function(){this.emailError(!1)},this);this.login.subscribe(function(){this.loginError(!1)},this);this.password.subscribe(function(){this.passwordError(!1)},this);this.allowCustomLogin=f.observable(!1);this.submitRequest=f.observable(!1);this.submitError=f.observable("");this.signMeType=f.observable(g.LoginSignMeType.Unused);this.signMeType.subscribe(function(a){this.signMe(g.LoginSignMeType.DefaultOn===a)},this);
|
|
this.signMeVisibility=f.computed(function(){return g.LoginSignMeType.Unused!==this.signMeType()},this);this.submitCommand=d.createCommand(this,function(){this.emailError(""===d.trim(this.email()));this.passwordError(""===d.trim(this.password()));if(this.emailError()||this.passwordError())return!1;this.submitRequest(!0);e.remote().login(i.bind(function(a,b){g.StorageResultType.Success===a&&b&&"Login"===b.Action?b.Result?e.loginAndLogoutReload():b.ErrorCode?(this.submitRequest(!1),this.submitError(d.getNotification(b.ErrorCode))):
|
|
this.submitRequest(!1):(this.submitRequest(!1),this.submitError(d.getNotification(g.Notification.UnknownError)))},this),this.email(),this.login(),this.password(),!!this.signMe());return!0},function(){return!this.submitRequest()});this.facebookLoginEnabled=f.observable(!1);this.facebookCommand=d.createCommand(this,function(){h.open(e.link().socialFacebook(),"Facebook","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes");return!0},function(){return!this.submitRequest()&&
|
|
this.facebookLoginEnabled()});this.googleLoginEnabled=f.observable(!1);this.googleCommand=d.createCommand(this,function(){h.open(e.link().socialGoogle(),"Google","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes");return!0},function(){return!this.submitRequest()&&this.googleLoginEnabled()});this.twitterLoginEnabled=f.observable(!1);this.twitterCommand=d.createCommand(this,function(){h.open(e.link().socialTwitter(),"Twitter","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes");
|
|
return!0},function(){return!this.submitRequest()&&this.twitterLoginEnabled()});this.loginFocus.subscribe(function(a){a&&(""===this.login()&&""!==this.email())&&this.login(this.email())},this)}function Q(){C.call(this,"Right","SystemDropDown");var a=e.data();this.accounts=a.accounts;this.accountEmail=a.accountEmail;this.accountsLoading=a.accountsLoading;this.allowAddAccount=e.settingsGet("AllowAdditionalAccounts");this.loading=f.computed(function(){return this.accountsLoading()},this);this.accountClick=
|
|
i.bind(this.accountClick,this)}function Ya(){Q.call(this)}function Za(){Q.call(this)}function ea(){C.call(this,"Left","MailFolderList");this.folderList=e.data().folderList;this.folderListSystem=e.data().folderListSystem;this.allowContacts=!!e.settingsGet("ContactsIsSupported")}function z(){C.call(this,"Right","MailMessageList");this.sLastUid=null;this.emptySubjectValue="";var a=e.data();this.popupVisibility=e.popupVisibility;this.messageList=a.messageList;this.currentMessage=a.currentMessage;this.isMessageSelected=
|
|
a.isMessageSelected;this.messageListSearch=a.messageListSearch;this.messageListError=a.messageListError;this.folderMenuForMove=a.folderMenuForMove;this.useCheckboxesInList=a.useCheckboxesInList;this.mainMessageListSearch=a.mainMessageListSearch;this.messageListEndFolder=a.messageListEndFolder;this.messageListChecked=a.messageListChecked;this.messageListCheckedOrSelected=a.messageListCheckedOrSelected;this.messageListCheckedOrSelectedUidsWithSubMails=a.messageListCheckedOrSelectedUidsWithSubMails;
|
|
this.messageListCompleteLoadingThrottle=a.messageListCompleteLoadingThrottle;d.initOnStartOrLangChange(function(){this.emptySubjectValue=d.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this);this.userQuota=a.userQuota;this.userUsageSize=a.userUsageSize;this.userUsageProc=a.userUsageProc;this.dragOver=f.observable(!1).extend({throttle:1});this.dragOverEnter=f.observable(!1).extend({throttle:1});this.dragOverArea=f.observable(null);this.dragOverBodyArea=f.observable(null);this.messageListItemTemplate=f.computed(function(){return a.usePreviewPane()?
|
|
"MailMessageListItem":"MailMessageListItemNoPreviewPane"});this.messageListSearchDesc=f.computed(function(){var b=a.messageListEndSearch();return""===b?"":d.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:b})});this.messageListPagenator=f.computed(function(){var b=0,c=0,l=2,e=[],f=a.messageListPage(),g=a.messageListPageCount(),k=function(a,b,c){a={current:a===f,name:d.isUnd(c)?a.toString():c.toString(),custom:d.isUnd(c)?!1:!0,title:d.isUnd(c)?"":a.toString(),value:a.toString()};d.isUnd(b)||b?e.push(a):
|
|
e.unshift(a)};if(1<g||0<g&&g<f){if(g<f)k(g),c=b=g;else{if(3>=f||g-2<=f)l+=2;k(f);c=b=f}for(;0<l;)if(b-=1,c+=1,0<b&&(k(b,!1),l--),g>=c)k(c,!0),l--;else if(0>=b)break;3===b?k(2,!1):3<b&&k(Math.round((b-1)/2),!1,"...");g-2===c?k(g-1,!0):g-2>c&&k(Math.round((g+c)/2),!0,"...");1<b&&k(1,!1);g>c&&k(g,!0)}return e},this);this.checkAll=f.computed({read:function(){return 0<e.data().messageListCheckedOrSelected().length},write:function(a){a=!!a;i.each(e.data().messageList(),function(c){c.checked(a)});a||e.data().message(null)}});
|
|
this.inputMessageListSearchFocus=f.observable(!1);this.sLastSearchValue="";this.inputProxyMessageListSearch=f.computed({read:this.mainMessageListSearch,write:function(a){this.sLastSearchValue=a},owner:this});this.isIncompleteChecked=f.computed(function(){var a=e.data().messageList().length,c=e.data().messageListCheckedOrSelected().length;return 0<a&&0<c&&a>c},this);this.hasMessages=f.computed(function(){return 0<this.messageList().length},this);this.hasCheckedLines=f.computed(function(){return 0<
|
|
this.messageListChecked().length},this);this.hasCheckedOrSelectedLines=f.computed(function(){return 0<this.messageListCheckedOrSelected().length},this);this.isSpamFolder=f.computed(function(){return e.data().spamFolder()===this.messageListEndFolder()},this);this.isTrashFolder=f.computed(function(){return e.data().trashFolder()===this.messageListEndFolder()},this);this.canBeMoved=this.hasCheckedOrSelectedLines;this.clearCommand=d.createCommand(this,function(){s.showScreenPopup(wa,[e.data().currentFolder()])});
|
|
this.multyForwardCommand=d.createCommand(this,function(){s.showScreenPopup(y,[g.ComposeType.ForwardAsAttachment,e.data().messageListCheckedOrSelected()])},this.canBeMoved);this.deleteWithoutMoveCommand=d.createCommand(this,function(){this.deleteSelectedMessageFromCurrentFolder(g.FolderType.Trash,!1)},this.canBeMoved);this.deleteCommand=d.createCommand(this,function(){this.deleteSelectedMessageFromCurrentFolder(g.FolderType.Trash,!0)},this.canBeMoved);this.spamCommand=d.createCommand(this,function(){this.deleteSelectedMessageFromCurrentFolder(g.FolderType.Spam,
|
|
!0)},this.canBeMoved);this.moveCommand=d.createCommand(this,d.emptyFunction,this.canBeMoved);this.setCommand=d.createCommand(this,d.emptyFunction,this.hasCheckedLines);this.checkCommand=d.createCommand(this,d.emptyFunction,this.hasCheckedLines);this.reloadCommand=d.createCommand(this,function(){e.data().messageListCompleteLoadingThrottle()||e.reloadMessageList(!1,!0)});this.quotaTooltip=i.bind(this.quotaTooltip,this);this.selector=new K(this.messageList,this.currentMessage,".messageListItem .actionHandle",
|
|
".messageListItem.selected",".messageListItem .checkboxMessage");this.selector.on("onItemSelect",i.bind(function(b){b?(a.message(a.staticMessageList.populateByMessageListItem(b)),this.populateMessageBody(a.message())):a.message(null)},this));this.selector.on("onItemGetUid",function(a){return a?a.generateUid():""});this.selector.on("onDelete",i.bind(function(){0<e.data().messageListCheckedOrSelected().length&&this.deleteCommand()},this))}function H(){C.call(this,"Right","MailMessageView");var a="",
|
|
b=e.data(),c=this,l=function(a){return d.createCommand(c,function(){this.replyOrforward(a)},c.canBeRepliedOrForwarded)};this.oMessageScrollerDom=null;this.message=b.message;this.messageLoading=b.messageLoading;this.messageLoadingThrottle=b.messageLoadingThrottle;this.messagesBodiesDom=b.messagesBodiesDom;this.useThreads=b.useThreads;this.replySameFolder=b.replySameFolder;this.usePreviewPane=b.usePreviewPane;this.isMessageSelected=b.isMessageSelected;this.messageActiveDom=b.messageActiveDom;this.messageError=
|
|
b.messageError;this.fullScreenMode=b.messageFullScreenMode;this.showFullInfo=f.observable(!1);this.canBeRepliedOrForwarded=this.messageVisibility=f.computed(function(){return!this.messageLoadingThrottle()&&!!this.message()},this);this.closeMessage=d.createCommand(this,function(){b.message(null)});this.replyCommand=l(g.ComposeType.Reply);this.replyAllCommand=l(g.ComposeType.ReplyAll);this.forwardCommand=l(g.ComposeType.Forward);this.forwardAsAttachmentCommand=l(g.ComposeType.ForwardAsAttachment);this.messageVisibilityCommand=
|
|
d.createCommand(this,d.emptyFunction,this.messageVisibility);this.viewSubject=f.observable("");this.viewFromShort=f.observable("");this.viewToShort=f.observable("");this.viewFrom=f.observable("");this.viewTo=f.observable("");this.viewCc=f.observable("");this.viewBcc=f.observable("");this.viewDate=f.observable("");this.viewMoment=f.observable("");this.viewLineAsCcc=f.observable("");this.viewHasImages=f.observable(!1);this.viewHasVisibleAttachments=f.observable(!1);this.viewAttachments=f.observableArray([]);
|
|
this.viewIsHtml=f.observable(!1);this.viewViewLink=f.observable("");this.viewDownloadLink=f.observable("");this.viewUserPic=f.observable(t.DataImages.UserDotPic);this.viewUserPicVisible=f.observable(!1);this.message.subscribe(function(b){this.messageActiveDom(null);b&&(this.viewSubject(b.subject()),this.viewFromShort(b.fromToLine(!0,!0)),this.viewToShort(b.toToLine(!0,!0)),this.viewFrom(b.fromToLine(!1)),this.viewTo(b.toToLine(!1)),this.viewCc(b.ccToLine(!1)),this.viewBcc(b.bccToLine(!1)),this.viewDate(b.fullFormatDateValue()),
|
|
this.viewMoment(b.momentDate()),this.viewLineAsCcc(b.lineAsCcc()),this.viewHasImages(b.hasImages()),this.viewHasVisibleAttachments(b.hasVisibleAttachments()),this.viewAttachments(b.attachments()),this.viewIsHtml(b.isHtml()),this.viewViewLink(b.viewLink()),this.viewDownloadLink(b.downloadLink()),a=e.cache().getUserPic(b.fromAsSingleEmail()),a!==this.viewUserPic()&&(this.viewUserPicVisible(!1),this.viewUserPic(t.DataImages.UserDotPic),""!==a&&(this.viewUserPicVisible(!0),this.viewUserPic(a))))},this);
|
|
this.fullScreenMode.subscribe(function(a){a?Z.addClass("rl-message-fullscreen"):Z.removeClass("rl-message-fullscreen")});this.messageActiveDom.subscribe(function(){this.scrollMessageToTop();d.windowResize()},this)}function ya(a){C.call(this,"Left","SettingsMenu");this.menu=a.menu}function za(){C.call(this,"Right","SettingsPane")}function Ma(){var a=e.data();this.mainLanguage=a.mainLanguage;this.mainMessagesPerPage=a.mainMessagesPerPage;this.editorDefaultType=a.editorDefaultType;this.showImages=a.showImages;
|
|
this.showAnimation=a.showAnimation;this.useDesktopNotifications=a.useDesktopNotifications;this.useThreads=a.useThreads;this.replySameFolder=a.replySameFolder;this.usePreviewPane=a.usePreviewPane;this.useCheckboxesInList=a.useCheckboxesInList;this.languagesOptions=f.computed(function(){return i.map(a.languages(),function(a){return{optValue:a,optText:d.convertLangName(a)}})});this.isDesctopNotificationsSupported=f.computed(function(){return g.DesctopNotifications.NotSupported!==a.desktopNotificationsPermisions()});
|
|
this.isDesctopNotificationsDenied=f.computed(function(){return g.DesctopNotifications.NotSupported===a.desktopNotificationsPermisions()||g.DesctopNotifications.Denied===a.desktopNotificationsPermisions()});this.languageTrigger=f.observable(g.SaveSettingsStep.Idle).extend({throttle:100});this.mppTrigger=f.observable(g.SaveSettingsStep.Idle)}function $a(){var a=e.data();this.displayName=a.displayName;this.replyTo=a.replyTo;this.signature=a.signature;this.nameTrigger=f.observable(g.SaveSettingsStep.Idle);
|
|
this.replyTrigger=f.observable(g.SaveSettingsStep.Idle);this.signatureTrigger=f.observable(g.SaveSettingsStep.Idle)}function ma(){this.accounts=e.data().accounts;this.processText=f.computed(function(){return e.data().accountsLoading()?d.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this);this.visibility=f.computed(function(){return""===this.processText()?"hidden":"visible"},this);this.accountForDeletion=f.observable(null).extend({falseTimeout:3E3}).extend({toggleSubscribe:[this,function(a){a&&a.deleteAccess(!1)},
|
|
function(a){a&&a.deleteAccess(!0)}]})}function Na(){var a=e.data();this.googleEnable=a.googleEnable;this.googleActions=a.googleActions;this.googleLoggined=a.googleLoggined;this.googleUserName=a.googleUserName;this.facebookEnable=a.facebookEnable;this.facebookActions=a.facebookActions;this.facebookLoggined=a.facebookLoggined;this.facebookUserName=a.facebookUserName;this.twitterEnable=a.twitterEnable;this.twitterActions=a.twitterActions;this.twitterLoggined=a.twitterLoggined;this.twitterUserName=a.twitterUserName;
|
|
this.connectGoogle=d.createCommand(this,function(){this.googleLoggined()||e.googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()});this.disconnectGoogle=d.createCommand(this,function(){e.googleDisconnect()});this.connectFacebook=d.createCommand(this,function(){this.facebookLoggined()||e.facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()});this.disconnectFacebook=d.createCommand(this,function(){e.facebookDisconnect()});this.connectTwitter=
|
|
d.createCommand(this,function(){this.twitterLoggined()||e.twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()});this.disconnectTwitter=d.createCommand(this,function(){e.twitterDisconnect()})}function na(){this.changeProcess=f.observable(!1);this.passwordUpdateError=f.observable(!1);this.passwordUpdateSuccess=f.observable(!1);this.currentPassword=f.observable("");this.newPassword=f.observable("");this.currentPassword.subscribe(function(){this.passwordUpdateError(!1);
|
|
this.passwordUpdateSuccess(!1)},this);this.newPassword.subscribe(function(){this.passwordUpdateError(!1);this.passwordUpdateSuccess(!1)},this);this.saveNewPasswordCommand=d.createCommand(this,function(){this.changeProcess(!0);this.passwordUpdateError(!1);this.passwordUpdateSuccess(!1);e.remote().changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword())},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()});this.onChangePasswordResponse=
|
|
i.bind(this.onChangePasswordResponse,this)}function R(){var a=e.data();this.ignoreFolderSubscribe=a.ignoreFolderSubscribe;this.foldersListError=a.foldersListError;this.folderList=a.folderList;this.processText=f.computed(function(){var a=e.data(),c=a.foldersLoading(),l=a.foldersCreating(),f=a.foldersDeleting(),a=a.foldersRenaming();return l?d.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):f?d.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):a?d.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):c?d.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):
|
|
""},this);this.visibility=f.computed(function(){return""===this.processText()?"hidden":"visible"},this);this.folderForDeletion=f.observable(null).extend({falseTimeout:3E3}).extend({toggleSubscribe:[this,function(a){a&&a.deleteAccess(!1)},function(a){a&&a.deleteAccess(!0)}]});this.folderForEdit=f.observable(null).extend({toggleSubscribe:[this,function(a){a&&a.edited(!1)},function(a){a&&a.canBeEdited()&&a.edited(!0)}]})}function Aa(){var a=this;this.mainTheme=e.data().mainTheme;this.customThemeType=
|
|
f.observable(e.settingsGet("CustomThemeType"));this.customThemeImg=f.observable(e.settingsGet("CustomThemeImg"));this.themesObjects=f.observableArray([]);this.customThemeUploaderProgress=f.observable(!1);this.customThemeUploaderButton=f.observable(null);this.showCustomThemeConfig=f.computed(function(){return"Custom"===this.mainTheme()},this);this.showCustomThemeConfig.subscribe(function(){d.windowResize()});this.themeTrigger=f.observable(g.SaveSettingsStep.Idle).extend({throttle:100});this.oLastAjax=
|
|
null;this.iTimer=0;e.data().theme.subscribe(function(b){i.each(this.themesObjects(),function(a){a.selected(b===a.name)});var c=j("#rlThemeLink"),l=j("#rlThemeStyle"),f=c.attr("href");f||(f=l.attr("data-href"));f&&(f=f.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+b+"/-/"),f=f.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/"+("Custom"===b&&h.__rlah?h.__rlah()||"0":"0")+"/User/"),"Json/"!==f.substring(f.length-5,f.length)&&(f+="Json/"),h.clearTimeout(a.iTimer),a.themeTrigger(g.SaveSettingsStep.Animate),
|
|
this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=j.ajax({url:f,dataType:"json"}).done(function(b){if(b&&d.isArray(b)&&2===b.length){if(c&&c[0]&&(!l||!l[0]))l=j('<style id="rlThemeStyle"></style>'),c.after(l),c.remove();l&&l[0]&&l.attr("data-href",f).attr("data-theme",b[0]).text(b[1]);a.themeTrigger(g.SaveSettingsStep.TrueResult)}}).always(function(){a.iTimer=h.setTimeout(function(){a.themeTrigger(g.SaveSettingsStep.Idle)},1E3);a.oLastAjax=null}));e.remote().saveSettings(null,
|
|
{Theme:b})},this)}function Oa(){d.initDataConstructorBySettings(this)}function S(){d.initDataConstructorBySettings(this);var a=function(a){return function(){var b=e.cache().getFolderFromCacheList(a());b&&b.type(g.FolderType.User)}},b=function(a){return function(b){(b=e.cache().getFolderFromCacheList(b))&&b.type(a)}};this.devPassword=this.devLogin=this.devEmail="";this.accountEmail=f.observable("");this.accountLogin=f.observable("");this.projectHash=f.observable("");this.threading=!1;this.lastFoldersHash=
|
|
"";this.remoteChangePassword=this.remoteSuggestions=!1;this.sentFolder=f.observable("");this.draftFolder=f.observable("");this.spamFolder=f.observable("");this.trashFolder=f.observable("");this.sentFolder.subscribe(a(this.sentFolder),this,"beforeChange");this.draftFolder.subscribe(a(this.draftFolder),this,"beforeChange");this.spamFolder.subscribe(a(this.spamFolder),this,"beforeChange");this.trashFolder.subscribe(a(this.trashFolder),this,"beforeChange");this.sentFolder.subscribe(b(g.FolderType.SentItems),
|
|
this);this.draftFolder.subscribe(b(g.FolderType.Draft),this);this.spamFolder.subscribe(b(g.FolderType.Spam),this);this.trashFolder.subscribe(b(g.FolderType.Trash),this);this.draftFolderNotEnabled=f.computed(function(){return""===this.draftFolder()||t.Values.UnuseOptionValue===this.draftFolder()},this);this.displayName=f.observable("");this.signature=f.observable("");this.replyTo=f.observable("");this.accounts=f.observableArray([]);this.accountsLoading=f.observable(!1);this.namespace="";this.folderList=
|
|
f.observableArray([]);this.foldersListError=f.observable("");this.foldersLoading=f.observable(!1);this.foldersCreating=f.observable(!1);this.foldersDeleting=f.observable(!1);this.foldersRenaming=f.observable(!1);this.currentFolder=f.observable(null).extend({toggleSubscribe:[null,function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]});this.currentFolderFullNameRaw=f.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this);this.currentFolderFullName=f.computed(function(){return this.currentFolder()?
|
|
this.currentFolder().fullName:""},this);this.currentFolderFullNameHash=f.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this);this.currentFolderName=f.computed(function(){return this.currentFolder()?this.currentFolder().name():""},this);this.folderListSystemNames=f.computed(function(){var a=["INBOX"],b=this.folderList(),e=this.sentFolder(),f=this.draftFolder(),g=this.spamFolder(),k=this.trashFolder();d.isArray(b)&&0<b.length&&(""!==e&&t.Values.UnuseOptionValue!==
|
|
e&&a.push(e),""!==f&&t.Values.UnuseOptionValue!==f&&a.push(f),""!==g&&t.Values.UnuseOptionValue!==g&&a.push(g),""!==k&&t.Values.UnuseOptionValue!==k&&a.push(k));return a},this);this.folderListSystem=f.computed(function(){return i.compact(i.map(this.folderListSystemNames(),function(a){return e.cache().getFolderFromCacheList(a)}))},this);this.folderMenuForMove=f.computed(function(){return e.folderListOptionsBuilder(this.folderListSystem(),this.folderList(),[this.currentFolderFullNameRaw()],null,null,
|
|
null,null,function(a){return a?a.localName():""})},this);this.staticMessageList=[];this.messageList=f.observableArray([]);this.messageListCount=f.observable(0);this.messageListSearch=f.observable("");this.messageListPage=f.observable(1);this.messageListThreadFolder=f.observable("");this.messageListThreadUids=f.observableArray([]);this.messageListThreadFolder.subscribe(function(){this.messageListThreadUids([])},this);this.messageListEndSearch=f.observable("");this.messageListEndFolder=f.observable("");
|
|
this.messageListPageCount=f.computed(function(){var a=Math.ceil(this.messageListCount()/this.messagesPerPage());return 0===a?1:a},this);this.mainMessageListSearch=f.computed({read:this.messageListSearch,write:function(a){s.setHash(e.link().mailBox(this.currentFolderFullNameHash(),1,d.trim(a.toString())))},owner:this});this.messageListError=f.observable("");this.messageListLoading=f.observable(!1);this.messageListIsNotCompleted=f.observable(!1);this.messageListCompleteLoadingThrottle=f.observable(!1).extend({throttle:200});
|
|
this.messageListCompleteLoading=f.computed(function(){var a=this.messageListLoading(),b=this.messageListIsNotCompleted();return a||b},this);this.messageListCompleteLoading.subscribe(function(a){this.messageListCompleteLoadingThrottle(a)},this);this.messageList.subscribe(i.debounce(function(a){i.each(a,function(a){a.newForAnimation()&&a.newForAnimation(!1)})},500));this.staticMessageList=new m;this.message=f.observable(null);this.messageLoading=f.observable(!1);this.messageLoadingThrottle=f.observable(!1).extend({throttle:50});
|
|
this.messageLoading.subscribe(function(a){this.messageLoadingThrottle(a)},this);this.messageFullScreenMode=f.observable(!1);this.messageError=f.observable("");this.messagesBodiesDom=f.observable(null);this.messagesBodiesDom.subscribe(function(a){a&&!(a instanceof jQuery)&&this.messagesBodiesDom(j(a))},this);this.messageActiveDom=f.observable(null);this.isMessageSelected=f.computed(function(){return null!==this.message()},this);this.currentMessage=f.observable(null);this.message.subscribe(function(a){null===
|
|
a&&this.currentMessage(null)},this);this.messageListChecked=f.computed(function(){return i.filter(this.messageList(),function(a){return a.checked()})},this);this.messageListCheckedOrSelected=f.computed(function(){var a=this.messageListChecked(),b=this.currentMessage();return i.union(a,b?[b]:[])},this);this.messageListCheckedUids=f.computed(function(){var a=[];i.each(this.messageListChecked(),function(b){b&&(a.push(b.uid),0<b.threadsLen()&&(0===b.parentUid()&&b.lastInCollapsedThread())&&(a=i.union(a,
|
|
b.threads())))});return a},this);this.messageListCheckedOrSelectedUidsWithSubMails=f.computed(function(){var a=[];i.each(this.messageListCheckedOrSelected(),function(b){b&&(a.push(b.uid),0<b.threadsLen()&&(0===b.parentUid()&&b.lastInCollapsedThread())&&(a=i.union(a,b.threads())))});return a},this);this.userQuota=f.observable(0);this.userUsageSize=f.observable(0);this.userUsageProc=f.computed(function(){var a=this.userQuota(),b=this.userUsageSize();return 0<a?Math.ceil(100*(b/a)):0},this);this.useKeyboardShortcuts=
|
|
f.observable(!0);this.googleActions=f.observable(!1);this.googleLoggined=f.observable(!1);this.googleUserName=f.observable("");this.facebookActions=f.observable(!1);this.facebookLoggined=f.observable(!1);this.facebookUserName=f.observable("");this.twitterActions=f.observable(!1);this.twitterLoggined=f.observable(!1);this.twitterUserName=f.observable("");this.customThemeType=f.observable(g.CustomThemeType.Light)}function aa(){this.oRequests={}}function p(){this.oRequests={};this.oRequests={}}function T(){this.oEmailsPicsHashes=
|
|
{};this.oServices={}}function v(){T.call(this);this.oFoldersCache={};this.oFoldersNamesCache={};this.oFolderHashCache={};this.oFolderUidNextCache={};this.oMessageListHashCache={};this.oMessageFlagsCache={};this.oNewMessage={};this.oRequestedMessage={}}function fa(a){J.call(this,"settings",a);this.menu=f.observableArray([]);this.oCurrentSubScreen=null}function Ba(){J.call(this,"login",[la])}function U(){J.call(this,"mailbox",[Ya,ea,z,H]);this.oLastRoute={};var a=e.data();this.mailBoxScreenVisibily=
|
|
f.observable(!1);this.resizeTrigger=f.computed(function(){var b=this.mailBoxScreenVisibily(),c=a.messageFullScreenMode();return a.usePreviewPane()&&!c&&b?!0:!1},this)}function Pa(){fa.call(this,[Za,ya,za]);d.initOnStartOrLangChange(function(){this.sSettingsTitle=d.i18n("TITLES/SETTINGS")},this,function(){e.setTitle(this.sSettingsTitle)})}function I(){this.oLocal=this.oLink=this.oPlugins=this.oSettings=null;this.isLocalAutocomplete=!0;this.popupVisibility=f.observable(!1);this.iframe=j('<iframe style="display:none" src="javascript:;" />').appendTo("body");
|
|
N.on("error",function(a){e&&(a&&a.originalEvent&&a.originalEvent.message&&-1===d.inArray(a.originalEvent.message,["Uncaught Error: Error calling method on NPObject."]))&&(d.log(""+a.originalEvent.message+" ("+a.originalEvent.filename+":"+a.originalEvent.lineno+")"),e.remote().jsError(d.emptyFunction,a.originalEvent.message,a.originalEvent.filename,a.originalEvent.lineno))})}function A(){I.call(this);this.oCache=this.oRemote=this.oData=null;this.iSuggestionsLimit=d.pInt(this.settingsGet("SuggestionsLimit"));
|
|
this.iSuggestionsLimit=0===this.iSuggestionsLimit?20:this.iSuggestionsLimit;this.quotaDebounce=i.debounce(this.quota,3E4)}var t={},g={},u={},d={},x={},ga={},Ca,Qa,oa,Ra,ab,ha,xa=f.observable(!0),ia=f.observable(!0),s=null,Da=h.rainloopAppData||{},Sa=h.rainloopI18N||{},Z=j("html"),N=j(h),Ea=j(h.document),Fa=[],Ta=[],Ua=[],ja=h.Notification&&h.Notification.requestPermission?h.Notification:null,e=null;Ca=0;Qa=!1;oa=(navigator.userAgent||"").toLowerCase();Ra=-1<oa.indexOf("iphone")||-1<oa.indexOf("ipod")||
|
|
-1<oa.indexOf("ipad");ab=-1<oa.indexOf("android");ha=Ra||ab;t.Defaults={};t.Values={};t.DataImages={};t.Defaults.MessagesPerPage=25;t.Defaults.DefaultAjaxTimeout=2E4;t.Defaults.SearchAjaxTimeout=12E4;t.Defaults.SendMessageAjaxTimeout=2E5;t.Defaults.SaveMessageAjaxTimeout=2E5;t.Values.UnuseOptionValue="__UNUSE__";t.Values.GmailFolderName="[Gmail]";t.Values.ClientSideCookieIndexName="rlcsc";t.Values.ImapDefaulPort=143;t.Values.ImapDefaulSecurePort=993;t.Values.SmtpDefaulPort=25;t.Values.SmtpDefaulSecurePort=
|
|
465;t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=";t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=";g.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"};g.State={Empty:10,Login:20,Auth:30};g.StateType={Webmail:0,Admin:1};g.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,User:99};
|
|
g.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"};g.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2};g.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft"};g.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99};g.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4};
|
|
g.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3};g.EventKeyCode={Backspace:8,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Insert:45,Delete:46,A:65,S:83};g.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3};g.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6};g.DesctopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9};g.MessagePriority={Low:5,Normal:3,High:1};
|
|
g.EditorDefaultType={Html:"Html",Plain:"Plain"};g.CustomThemeType={Light:"Light",Dark:"Dark"};g.ServerSecure={None:0,SSL:1,TLS:2};g.SearchDateType={All:-1,Days3:3,Days7:7,Month:30};g.EmailType={Defailt:0,Facebook:1,Google:2};g.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0};g.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,
|
|
CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,
|
|
LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,MailServerError:901,UnknownError:999};d.trim=j.trim;d.inArray=j.inArray;d.isArray=i.isArray;d.isFunc=i.isFunction;d.isUnd=i.isUndefined;d.isNull=i.isNull;d.emptyFunction=function(){};d.isNormal=function(a){return!d.isUnd(a)&&!d.isNull(a)};d.windowResize=i.debounce(function(a){d.isUnd(a)?N.resize():h.setTimeout(function(){N.resize()},a)},50);d.isPosNumeric=function(a,b){return d.isNormal(a)?d.isUnd(b)||b?/^[0-9]*$/.test(a.toString()):
|
|
/^[1-9]+[0-9]*$/.test(a.toString()):!1};d.pInt=function(a){return d.isNormal(a)&&""!==a?h.parseInt(a,10):0};d.pString=function(a){return d.isNormal(a)?a+"":""};d.isNonEmptyArray=function(a){return d.isArray(a)&&0<a.length};d.exportPath=function(a,b,c){for(var l=null,a=a.split("."),c=c||h;a.length&&(l=a.shift());)!a.length&&!d.isUnd(b)?c[l]=b:c=c[l]?c[l]:c[l]={}};d.pImport=function(a,b,c){a[b]=c};d.pExport=function(a,b,c){return d.isUnd(a[b])?c:a[b]};d.encodeHtml=function(a){return d.isNormal(a)?a.toString().replace(/&/g,
|
|
"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""};d.splitPlainText=function(a,b){for(var c="",l="",e=a,f=0,g=0,b=d.isUnd(b)?100:b;e.length>b;)l=e.substring(0,b),f=l.lastIndexOf(" "),g=l.lastIndexOf("\n"),-1!==g&&(f=g),-1===f&&(f=b),c+=l.substring(0,f)+"\n",e=e.substring(f+1);return c+e};var Ga={};d.timeOutAction=function(a,b,c){d.isUnd(Ga[a])&&(Ga[a]=0);h.clearTimeout(Ga[a]);Ga[a]=h.setTimeout(b,c)};var Va={};d.timeOutActionSecond=function(a,b,c){Va[a]||
|
|
(Va[a]=h.setTimeout(function(){b();Va[a]=0},c))};var O=!1;d.audio=function(a,b){if(!1===O)if(Ra)O=null;else{var c=!1,d=!1,e=h.Audio?new h.Audio:null;e&&e.canPlayType&&e.play?((c=""!==e.canPlayType('audio/mpeg; codecs="mp3"'))||(d=""!==e.canPlayType('audio/ogg; codecs="vorbis"')),c||d?(O=e,O.preload="none",O.loop=!1,O.autoplay=!1,O.muted=!1,O.src=c?a:b):O=null):O=null}return O};d.hos=function(a,b){return a&&Object.hasOwnProperty?Object.hasOwnProperty.call(a,b):!1};d.i18n=function(a,b,c){var l="",a=
|
|
d.isUnd(Sa[a])?d.isUnd(c)?a:c:Sa[a];if(!d.isUnd(b)&&!d.isNull(b))for(l in b)d.hos(b,l)&&(a=a.replace("%"+l+"%",b[l]));return a};d.i18nToNode=function(a){i.defer(function(){j(".i18n",a).each(function(){var a=j(this),c="";(c=a.data("i18n-text"))?a.text(d.i18n(c)):((c=a.data("i18n-html"))&&a.html(d.i18n(c)),(c=a.data("i18n-placeholder"))&&a.attr("placeholder",d.i18n(c)))})})};d.i18nToDoc=function(){h.rainloopI18N&&(Sa=h.rainloopI18N||{},d.i18nToNode(Ea),ia(!ia()));h.rainloopI18N={}};d.initOnStartOrLangChange=
|
|
function(a,b,c){a&&a.call(b);c?ia.subscribe(function(){a&&a.call(b);c.call(b)}):a&&ia.subscribe(a,b)};d.inFocus=function(){var a=document.activeElement;return a&&("INPUT"===a.tagName||"TEXTAREA"===a.tagName||"IFRAME"===a.tagName||"DIV"===a.tagName&&"editorHtmlArea"===a.className&&a.contentEditable)};d.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var a=j(document.activeElement);(a.is("input")||a.is("textarea"))&&document.activeElement.blur()}};d.removeSelection=
|
|
function(){if(h&&h.getSelection){var a=h.getSelection();a&&a.removeAllRanges&&a.removeAllRanges()}else document&&(document.selection&&document.selection.empty)&&document.selection.empty()};d.replySubjectAdd=function(a,b){var c=null,l=d.trim(b);null!==(c=(new h.RegExp("^"+a+"[\\s]?\\:(.*)$","gi")).exec(b))&&!d.isUnd(c[1])?l=a+"[2]: "+c[1]:null!==(c=(new h.RegExp("^("+a+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi")).exec(b))&&!d.isUnd(c[1])&&!d.isUnd(c[2])&&!d.isUnd(c[3])?(d.pInt(c[2]),l=
|
|
c[1]+(d.pInt(c[2])+1)+c[3]):l=a+": "+b;return l};d.roundNumber=function(a,b){return Math.round(a*Math.pow(10,b))/Math.pow(10,b)};d.friendlySize=function(a){a=d.pInt(a);return 1073741824<=a?d.roundNumber(a/1073741824,1)+"GB":1048576<=a?d.roundNumber(a/1048576,1)+"MB":1024<=a?d.roundNumber(a/1024,0)+"KB":a+"B"};d.log=function(a){h.console&&h.console.log&&h.console.log(a)};d.getNotification=function(a){a=d.pInt(a);return d.isUnd(u[a])?"":u[a]};d.initNotificationLanguage=function(){u[g.Notification.InvalidToken]=
|
|
d.i18n("NOTIFICATIONS/INVALID_TOKEN");u[g.Notification.AuthError]=d.i18n("NOTIFICATIONS/AUTH_ERROR");u[g.Notification.AccessError]=d.i18n("NOTIFICATIONS/ACCESS_ERROR");u[g.Notification.ConnectionError]=d.i18n("NOTIFICATIONS/CONNECTION_ERROR");u[g.Notification.CaptchaError]=d.i18n("NOTIFICATIONS/CAPTCHA_ERROR");u[g.Notification.SocialFacebookLoginAccessDisable]=d.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE");u[g.Notification.SocialTwitterLoginAccessDisable]=d.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE");
|
|
u[g.Notification.SocialGoogleLoginAccessDisable]=d.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE");u[g.Notification.DomainNotAllowed]=d.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED");u[g.Notification.CantGetMessageList]=d.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST");u[g.Notification.CantGetMessage]=d.i18n("NOTIFICATIONS/CANT_GET_MESSAGE");u[g.Notification.CantDeleteMessage]=d.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE");u[g.Notification.CantMoveMessage]=d.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE");u[g.Notification.CantSaveMessage]=
|
|
d.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE");u[g.Notification.CantSendMessage]=d.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE");u[g.Notification.InvalidRecipients]=d.i18n("NOTIFICATIONS/INVALID_RECIPIENTS");u[g.Notification.CantCreateFolder]=d.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER");u[g.Notification.CantRenameFolder]=d.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER");u[g.Notification.CantDeleteFolder]=d.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER");u[g.Notification.CantDeleteNonEmptyFolder]=d.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER");
|
|
u[g.Notification.CantSubscribeFolder]=d.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER");u[g.Notification.CantUnsubscribeFolder]=d.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER");u[g.Notification.CantSaveSettings]=d.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS");u[g.Notification.CantSavePluginSettings]=d.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS");u[g.Notification.DomainAlreadyExists]=d.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS");u[g.Notification.CantInstallPackage]=d.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE");
|
|
u[g.Notification.CantDeletePackage]=d.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE");u[g.Notification.InvalidPluginPackage]=d.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE");u[g.Notification.UnsupportedPluginPackage]=d.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE");u[g.Notification.LicensingServerIsUnavailable]=d.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE");u[g.Notification.LicensingExpired]=d.i18n("NOTIFICATIONS/LICENSING_EXPIRED");u[g.Notification.LicensingBanned]=d.i18n("NOTIFICATIONS/LICENSING_BANNED");
|
|
u[g.Notification.DemoSendMessageError]=d.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR");u[g.Notification.AccountAlreadyExists]=d.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS");u[g.Notification.MailServerError]=d.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR");u[g.Notification.UnknownError]=d.i18n("NOTIFICATIONS/UNKNOWN_ERROR")};d.getUploadErrorDescByCode=function(a){var b="";switch(d.pInt(a)){case g.UploadErrorCode.FileIsTooBig:b=d.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case g.UploadErrorCode.FilePartiallyUploaded:b=
|
|
d.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case g.UploadErrorCode.FileNoUploaded:b=d.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case g.UploadErrorCode.MissingTempFolder:b=d.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case g.UploadErrorCode.FileOnSaveingError:b=d.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case g.UploadErrorCode.FileType:b=d.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:b=d.i18n("UPLOAD/ERROR_UNKNOWN")}return b};d.killCtrlAandS=function(a){if(a=a||h.event){var b=a.target||
|
|
a.srcElement,c=a.keyCode||a.which;if(a.ctrlKey&&c===g.EventKeyCode.S)a.preventDefault();else if((!b||!b.tagName||!b.tagName.match(/INPUT|TEXTAREA/i))&&a.ctrlKey&&c===g.EventKeyCode.A)h.getSelection?h.getSelection().removeAllRanges():h.document.selection&&h.document.selection.clear&&h.document.selection.clear(),a.preventDefault()}};d.createCommand=function(a,b,c){var l=b?function(){l.canExecute&&l.canExecute()&&b.apply(a,Array.prototype.slice.call(arguments));return!1}:function(){};l.enabled=f.observable(!0);
|
|
c=d.isUnd(c)?!0:c;l.canExecute=d.isFunc(c)?f.computed(function(){return l.enabled()&&c.call(a)}):f.computed(function(){return l.enabled()&&!!c});return l};d.initDataConstructorBySettings=function(a){a.ignoreFolderSubscribe=f.observable(!1);a.editorDefaultType=f.observable(g.EditorDefaultType.Html);a.showImages=f.observable(!1);a.showAnimation=f.observable(!1);a.desktopNotifications=f.observable(!1);a.useThreads=f.observable(!0);a.replySameFolder=f.observable(!0);a.usePreviewPane=f.observable(!0);
|
|
a.useCheckboxesInList=f.observable(!0);a.showAnimation.subscribe(function(a){ha?Z.removeClass("rl-anim").addClass("no-rl-anim"):Z.toggleClass("rl-anim",a).toggleClass("no-rl-anim",!a)});a.showAnimation.valueHasMutated();a.desktopNotificationsPermisions=f.computed(function(){a.desktopNotifications();var b=g.DesctopNotifications.NotSupported;if(ja&&ja.permission)switch(ja.permission.toLowerCase()){case "granted":b=g.DesctopNotifications.Allowed;break;case "denied":b=g.DesctopNotifications.Denied;break;
|
|
case "default":b=g.DesctopNotifications.NotAllowed}else h.webkitNotifications&&h.webkitNotifications.checkPermission&&(b=h.webkitNotifications.checkPermission());return b});a.useDesktopNotifications=f.computed({read:function(){return a.desktopNotifications()&&g.DesctopNotifications.Allowed===a.desktopNotificationsPermisions()},write:function(b){b?(b=a.desktopNotificationsPermisions(),g.DesctopNotifications.Allowed===b?a.desktopNotifications(!0):g.DesctopNotifications.NotAllowed===b?ja.requestPermission(function(){a.desktopNotifications.valueHasMutated();
|
|
h.console.log(a.desktopNotificationsPermisions());g.DesctopNotifications.Allowed===a.desktopNotificationsPermisions()?a.desktopNotifications()?a.desktopNotifications.valueHasMutated():a.desktopNotifications(!0):a.desktopNotifications()?a.desktopNotifications(!1):a.desktopNotifications.valueHasMutated()}):a.desktopNotifications(!1)):a.desktopNotifications(!1)}});a.language=f.observable("");a.languages=f.observableArray([]);a.mainLanguage=f.computed({read:a.language,write:function(b){b!==a.language()?
|
|
-1<d.inArray(b,a.languages())?a.language(b):0<a.languages().length&&a.language(a.languages()[0]):a.language.valueHasMutated()}});a.theme=f.observable("");a.themes=f.observableArray([]);a.mainTheme=f.computed({read:a.theme,write:function(b){if(b!==a.theme()){var c=a.themes();-1<d.inArray(b,c)?a.theme(b):0<c.length&&a.theme(c[0])}else a.theme.valueHasMutated()}});a.allowCustomTheme=f.observable(!0);a.allowAdditionalAccounts=f.observable(!0);a.messagesPerPage=f.observable(t.Defaults.MessagesPerPage);
|
|
a.mainMessagesPerPage=a.messagesPerPage;a.mainMessagesPerPage=f.computed({read:a.messagesPerPage,write:function(b){-1<d.inArray(d.pInt(b),[10,20,30,50,100,150,200])?b!==a.messagesPerPage()&&a.messagesPerPage(b):a.messagesPerPage.valueHasMutated()}});a.facebookEnable=f.observable(!1);a.facebookAppID=f.observable("");a.facebookAppSecret=f.observable("");a.twitterEnable=f.observable(!1);a.twitterConsumerKey=f.observable("");a.twitterConsumerSecret=f.observable("");a.googleEnable=f.observable(!1);a.googleClientID=
|
|
f.observable("");a.googleClientSecret=f.observable("");a.dropboxEnable=f.observable(!1);a.dropboxApiKey=f.observable("");a.contactsIsSupported=f.observable(!1)};d.createMomentDate=function(a){return f.computed(function(){xa();return this.moment().fromNow()},a)};d.createMomentShortDate=function(a){return f.computed(function(){var a="",a=Y(),c=this.moment(),l=this.momentDate();return a=4>=a.diff(c,"hours")?l:a.format("L")===c.format("L")?d.i18n("MESSAGE_LIST/TODAY_AT",{TIME:c.format("LT")}):a.clone().subtract("days",
|
|
1).format("L")===c.format("L")?d.i18n("MESSAGE_LIST/YESTERDAY_IN",{TIME:c.format("LT")}):a.year()===c.year()?c.format("D MMM."):c.format("LL")},a)};d.isFolderExpanded=function(a){var b=e.local().get(g.ClientSideKeyName.ExpandedFolders);return i.isArray(b)&&-1!==i.indexOf(b,a)};d.setExpandedFolder=function(a,b){var c=e.local().get(g.ClientSideKeyName.ExpandedFolders);i.isArray(c)||(c=[]);b?(c.push(a),c=i.uniq(c)):c=i.without(c,a);e.local().set(g.ClientSideKeyName.ExpandedFolders,c)};d.initLayoutResizer=
|
|
function(a,b,c,d){var f=j(a),r=j(b),w=j(c),a=e.local().get(g.ClientSideKeyName.MailBoxListSize),k=function(a,b,c){if(b||c)a=w.width(),b=b?100*(b.size.width/a):null,null===b&&c&&(b=100*(f.width()/a)),null!==b&&(f.css({width:"",height:"",right:""+(100-b)+"%"}),r.css({width:"",height:"",left:""+b+"%"}))};a&&f.width(a);f.resizable({minWidth:350,maxWidth:w.width()-250,handles:"e",resize:k,stop:k});k(null,null,!0);N.resize(i.throttle(function(a,b){if(d&&d()){var c=w.width();f.resizable("option","maxWidth",
|
|
c-250);b&&(b.size&&b.size.width)&&e.local().set(g.ClientSideKeyName.MailBoxListSize,b.size.width);k(null,null,!0)}},400))};d.initBlockquoteSwitcher=function(a){if(a){var b=j("blockquote:not(.rl-bq-switcher)",a).filter(function(){return 0===j(this).parent().closest("blockquote",a).length});b&&0<b.length&&b.each(function(){var a=j(this),b=a.height();if(0===b||100<b)a.addClass("rl-bq-switcher hidden-bq"),j('<span class="rlBlockquoteSwitcher"><i class="icon-ellipsis" /></span>').insertBefore(a).click(function(){a.toggleClass("hidden-bq");
|
|
d.windowResize()}).after("<br />").before("<br />")})}};d.removeBlockquoteSwitcher=function(a){a&&(j(a).find("blockquote.rl-bq-switcher").each(function(){j(this).removeClass("rl-bq-switcher hidden-bq")}),j(a).find(".rlBlockquoteSwitcher").each(function(){j(this).remove()}))};d.extendAsViewModel=function(a,b){b&&(b.__name=a,x.regViewModelHook(a,b),i.extend(b.prototype,C.prototype))};d.addSettingsViewModel=function(a,b,c,d,e){a.__rlSettingsData={Label:c,Template:b,Route:d,IsDefault:!!e};Fa.push(a)};
|
|
d.removeSettingsViewModel=function(a){Ta.push(a)};d.disableSettingsViewModel=function(a){Ua.push(a)};d.convertThemeName=function(a){return d.trim(a.replace(/[^a-zA-Z]/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))};d.convertLangName=function(a){return d.i18n("LANGS_NAMES/LANG_"+a.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,a)};d.fakeMd5=function(a){for(var b="",a=d.isUnd(a)?32:d.pInt(a);b.length<a;)b+="0123456789abcdefghijklmnopqrstuvwxyz".substr(h.Math.round(36*h.Math.random()),1);return b};
|
|
d.convertPlainTextToHtml=function(a){return a.toString().replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/\r/g,"").replace(/\n/g,"<br />")};d.draggeblePlace=function(){return j('<div class="draggablePlace"><span class="text"></span> <i class="icon-envelope icon-white"></i></div>').appendTo("#rl-hidden")};d.defautOptionsAfterRender=function(a,b){b&&!d.isUnd(b.disable)&&f.applyBindingsToNode(a,{disable:b.disable},b)};d.windowPopupKnockout=function(a,b,c,l){var e=null,f=
|
|
h.open(""),g="__OpenerApplyBindingsUid"+d.fakeMd5()+"__",k=j("#"+b);h[g]=function(){if(f&&f.document.body&&k&&k[0]){var b=j(f.document.body);j("#rl-content",b).html(k.html());j("html",f.document).addClass("external "+j("html").attr("class"));d.i18nToNode(b);E.prototype.applyExternal(a,j("#rl-content",b)[0]);h[g]=null;l(f)}};f.document.open();f.document.write('<html><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="viewport" content="user-scalable=no" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="robots" content="noindex, nofollow, noodp" /><title>'+
|
|
d.encodeHtml(c)+'</title></head><body><div id="rl-content"></div></body></html>');f.document.close();e=f.document.createElement("script");e.innerHTML="if(window&&window.opener&&window.opener['"+g+"']){window.opener['"+g+"']();window.opener['"+g+"']=null}";f.document.getElementsByTagName("head")[0].appendChild(e)};d.settingsSaveHelperFunction=function(a,b,c,l){c=c||null;l=d.isUnd(l)?1E3:d.pInt(l);return function(d,e,f,k,h){b.call(c,e&&e.Result?g.SaveSettingsStep.TrueResult:g.SaveSettingsStep.FalseResult);
|
|
a&&a.call(c,d,e,f,k,h);i.delay(function(){b.call(c,g.SaveSettingsStep.Idle)},l)}};d.settingsSaveHelperSimpleFunction=function(a,b){return d.settingsSaveHelperFunction(null,a,b,1E3)};d.resizeAndCrop=function(a,b,c){var d=new Image;d.onload=function(){var a=[0,0],d=document.createElement("canvas"),l=d.getContext("2d");d.width=b;d.height=b;a=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width];l.fillStyle="#fff";l.fillRect(0,0,b,b);l.drawImage(this,a[0]/2,a[1]/2,this.width-a[0],
|
|
this.height-a[1],0,0,b,b);c(d.toDataURL("image/jpeg"))};d.src=a};ga={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(a){return ga.encode(a).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(a){for(var b="",c,d,e,f,g,k,i=0,a=ga._utf8_encode(a);i<a.length;)c=a.charCodeAt(i++),d=a.charCodeAt(i++),e=a.charCodeAt(i++),f=c>>2,c=(c&3)<<4|d>>4,g=(d&15)<<2|e>>6,k=e&63,isNaN(d)?g=k=64:isNaN(e)&&(k=64),b=b+this._keyStr.charAt(f)+
|
|
this._keyStr.charAt(c)+this._keyStr.charAt(g)+this._keyStr.charAt(k);return b},decode:function(a){for(var b="",c,d,e,f,g,k=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)c=this._keyStr.indexOf(a.charAt(k++)),d=this._keyStr.indexOf(a.charAt(k++)),f=this._keyStr.indexOf(a.charAt(k++)),g=this._keyStr.indexOf(a.charAt(k++)),c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),64!==f&&(b+=String.fromCharCode(d)),64!==g&&(b+=String.fromCharCode(e));return ga._utf8_decode(b)},_utf8_encode:function(a){for(var a=
|
|
a.replace(/\r\n/g,"\n"),b="",c=0,d=a.length,e=0;c<d;c++)e=a.charCodeAt(c),128>e?b+=String.fromCharCode(e):(127<e&&2048>e?b+=String.fromCharCode(e>>6|192):(b+=String.fromCharCode(e>>12|224),b+=String.fromCharCode(e>>6&63|128)),b+=String.fromCharCode(e&63|128));return b},_utf8_decode:function(a){for(var b="",c=0,d=0,e=0,f=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|e&63),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+
|
|
2),b+=String.fromCharCode((d&15)<<12|(e&63)<<6|f&63),c+=3);return b}};f.bindingHandlers.tooltip={init:function(a,b){if(!ha){var c=j(a).data("tooltip-class")||"";j(a).tooltip({delay:{show:500,hide:100},html:!0,trigger:"hover",title:function(){return'<span class="tooltip-class '+c+'">'+d.i18n(f.utils.unwrapObservable(b()))+"</span>"}})}}};f.bindingHandlers.tooltip2={init:function(a,b){var c=j(a).data("tooltip-class")||"";j(a).tooltip({delay:{show:500,hide:100},html:!0,title:function(){return'<span class="tooltip-class '+
|
|
c+'">'+b()()+"</span>"}})}};f.bindingHandlers.popover={init:function(a,b){var c=f.utils.unwrapObservable(b());j(a).popover({trigger:c[2]||"click",placement:c[3]||"right",title:function(){return d.i18n(c[0]||"")},content:function(){return d.i18n(c[1]||"")}})}};f.bindingHandlers.resizecrop={init:function(a){j(a).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(a,b){b()();j(a).resizecrop({width:"100",height:"100"})}};f.bindingHandlers.onEnter=
|
|
{init:function(a,b){j(a).on("keypress",function(c){c&&13===h.parseInt(c.keyCode,10)&&(j(a).trigger("change"),b().call(this))})}};f.bindingHandlers.onEsc={init:function(a,b){j(a).on("keypress",function(c){c&&27===h.parseInt(c.keyCode,10)&&(j(a).trigger("change"),b().call(this))})}};f.bindingHandlers.modal={init:function(a,b){j(a).modal({keyboard:!1,show:f.utils.unwrapObservable(b())}).on("hidden",function(){b()(!1)})},update:function(a,b){var c=f.utils.unwrapObservable(b());j(a).modal(c?"show":"hide");
|
|
i.delay(function(){j(a).toggleClass("popup-active",c)},1)}};f.bindingHandlers.i18nInit={init:function(a){d.i18nToNode(a)}};f.bindingHandlers.i18nUpdate={update:function(a,b){f.utils.unwrapObservable(b());d.i18nToNode(a)}};f.bindingHandlers.link={update:function(a,b){j(a).attr("href",f.utils.unwrapObservable(b()))}};f.bindingHandlers.title={update:function(a,b){j(a).attr("title",f.utils.unwrapObservable(b()))}};f.bindingHandlers.textF={init:function(a,b){j(a).text(f.utils.unwrapObservable(b()))}};
|
|
f.bindingHandlers.initDom={init:function(a,b){b()(a)}};f.bindingHandlers.initResizeTrigger={init:function(a,b){var c=f.utils.unwrapObservable(b());j(a).css({height:c[1],"min-height":c[1]})},update:function(a,b){var c=f.utils.unwrapObservable(b()),l=d.pInt(c[1]),e=0,e=j(a).offset().top;0<e&&(e+=d.pInt(c[2]),e=N.height()-e,l<e&&(l=e),j(a).css({height:l,"min-height":l}))}};f.bindingHandlers.appendDom={update:function(a,b){j(a).hide().empty().append(f.utils.unwrapObservable(b())).show()}};f.bindingHandlers.draggable=
|
|
{init:function(a,b){j(a).draggable({distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},helper:function(a){return b()(a&&a.target?f.dataFor(a.target):null)}}).on("mousedown",function(){d.removeInFocus()})}};f.bindingHandlers.droppable={init:function(a,b){var c=b();!1!==c&&j(a).droppable({tolerance:"pointer",hoverClass:"droppableHover",drop:function(a,b){c(a,b)}})}};f.bindingHandlers.nano={init:function(a){ha||j(a).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}};
|
|
f.bindingHandlers.saveTrigger={init:function(a){j(a).append(' <i class="icon-spinner-2 animated"></i><i class="icon-remove error"></i><i class="icon-ok success"></i>').addClass("settings-saved-trigger")},update:function(a,b){var c=f.utils.unwrapObservable(b()),d=j(a);switch(c.toString()){case "1":d.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case "0":d.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");
|
|
break;case "-2":d.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:d.find(".animated").hide().end().find(".error,.success").removeClass("visible")}}};f.bindingHandlers.select2={init:function(a,b){var c=0,l=null,g=new h.RegExp(/[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\.\-_]+/),r=new h.RegExp(/(.+) [<]?([^\s<@]+@[a-zA-Z0-9\.\-_]+)[>]?/),w=function(){return""},k=function(a){e.getAutocomplete(a.term,a.page,function(b,c){a.callback({more:!!c,results:i.map(b,
|
|
function(a){var b=a.toLine(!1);return{id:b,text:b,c:a}})})})};j(a).addClass("ko-select2").select2({query:function(a){a&&(0===c?(k(a),c=h.setTimeout(d.emptyFunction,200)):(h.clearInterval(c),c=h.setTimeout(function(){k(a)},200)))},formatSelection:function(a,b){var c=a&&a.c?a.c.select2Selection(b):a.text;if(null!==c)return c},formatResult:function(a,b,c,d){b=a&&a.c?a.c.select2Result(b):"";return""===b?d(a.text):b},createSearchChoice:function(a,b){return 0===b.length&&g.test(a)?{id:a,text:a}:null},formatNoMatches:w,
|
|
formatSearching:function(){return d.i18n("SUGGESTIONS/SEARCHING_DESC")},formatInputTooShort:w,formatSelectionTooBig:w,multiple:!0,tokenSeparators:[",",";"],minimumInputLength:2,selectOnBlur:!1,closeOnSelect:!0,openOnEnter:!1});f.utils.domNodeDisposal.addDisposeCallback(a,function(){j(a).select2("destroy")});j(a).on("change",function(){for(var a=j(this).select2("data"),c=0,e=a.length,f=null,g=[];c<e;c++)if((f=a[c])&&f.id)f.c||(f.c=new F,(l=r.exec(d.trim(f.id)))&&!d.isUnd(l[2])?(f.c.name=l[1],f.c.email=
|
|
l[2]):f.c.email=f.id),g.push(f.c);b()(g)})},update:function(a,b){for(var c=f.utils.unwrapObservable(b()),d=0,e=c.length,g=null,w="",k=[];d<e;d++)g=c[d],w=g.toLine(!1),k.push({id:w,text:w,c:g});j(a).select2("data",k)}};f.bindingHandlers.command={init:function(a,b,c,d){var e=j(a),g=b();if(!g||!g.enabled||!g.canExecute)throw Error("You are not using command function");e.addClass("command");f.bindingHandlers[e.is("form")?"submit":"click"].init.apply(d,arguments)},update:function(a,b){var c=!0,d=j(a),
|
|
e=b(),c=e.enabled();d.toggleClass("command-not-enabled",!c);c&&(c=e.canExecute(),d.toggleClass("command-can-not-be-execute",!c));d.toggleClass("command-disabled disable disabled",!c);(d.is("input")||d.is("button"))&&d.prop("disabled",!c)}};f.extenders.trimmer=function(a){var b=f.computed({read:a,write:function(b){a(d.trim(b.toString()))},owner:this});b(a());return b};f.extenders.reversible=function(a){var b=a();a.commit=function(){b=a()};a.reverse=function(){a(b)};a.commitedValue=function(){return b};
|
|
return a};f.extenders.toggleSubscribe=function(a,b){a.subscribe(b[1],b[0],"beforeChange");a.subscribe(b[2],b[0]);return a};f.extenders.falseTimeout=function(a,b){a.iTimeout=0;a.subscribe(function(c){c&&(h.clearTimeout(a.iTimeout),a.iTimeout=h.setTimeout(function(){a(!1);a.iTimeout=0},d.pInt(b)))});return a};f.observable.fn.validateEmail=function(){this.hasError=f.observable(!1);this.subscribe(function(a){a=d.trim(a);this.hasError(""!==a&&!/^[^@\s]+@[^@\s]+$/.test(a))},this);this.valueHasMutated();
|
|
return this};f.observable.fn.validateFunc=function(a){this.hasFuncError=f.observable(!1);d.isFunc(a)&&(this.subscribe(function(b){this.hasFuncError(!a(b))},this),this.valueHasMutated());return this};B.prototype.root=function(){return this.sBase};B.prototype.attachmentDownload=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+a};B.prototype.attachmentPreview=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+a};B.prototype.attachmentPreviewAsPlain=function(a){return this.sServer+
|
|
"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+a};B.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"};B.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"};B.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"};B.prototype.change=function(a){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+h.encodeURIComponent(a)+"/"};B.prototype.ajax=function(a){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+
|
|
a};B.prototype.messageViewLink=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+a};B.prototype.messageDownloadLink=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+a};B.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"};B.prototype.settings=function(a){var b=this.sBase+"settings";!d.isUnd(a)&&""!==a&&(b+="/"+a);return b};B.prototype.admin=function(a){var b=this.sBase;switch(a){case "AdminDomains":b+="domains";break;case "AdminSecurity":b+="security";
|
|
break;case "AdminLicensing":b+="licensing"}return b};B.prototype.mailBox=function(a,b,c){var b=d.isNormal(b)?d.pInt(b):1,c=d.pString(c),e=this.sBase+"mailbox/";""!==a&&(e+=encodeURI(a));1<b&&(e=e.replace(/[\/]+$/,""),e+="/p"+b);""!==c&&(e=e.replace(/[\/]+$/,""),e+="/"+encodeURI(c));return e};B.prototype.phpInfo=function(){return this.sServer+"Info"};B.prototype.langLink=function(a){return this.sServer+"/Lang/0/"+encodeURI(a)+"/"+this.sVersion+"/"};B.prototype.getUserPicUrlFromHash=function(a){return this.sServer+
|
|
"/Raw/"+this.sSpecSuffix+"/UserPic/"+a+"/"+this.sVersion+"/"};B.prototype.emptyContactPic=function(){return(""===this.sCdnStaticDomain?"rainloop/v/":this.sCdnStaticDomain)+this.sVersion+"/static/css/images/empty-contact.png"};B.prototype.sound=function(a){return(""===this.sCdnStaticDomain?"rainloop/v/":this.sCdnStaticDomain)+this.sVersion+"/static/sounds/"+a};B.prototype.themePreviewLink=function(a){return(""===this.sCdnStaticDomain?"rainloop/v/":this.sCdnStaticDomain)+this.sVersion+"/themes/"+encodeURI(a)+
|
|
"/images/preview.png"};B.prototype.notificationMailIcon=function(){return(""===this.sCdnStaticDomain?"rainloop/v/":this.sCdnStaticDomain)+this.sVersion+"/static/css/images/icom-message-notification.png"};B.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")};B.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")};B.prototype.socialFacebook=function(){return this.sServer+
|
|
"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")};x.oViewModelsHooks={};x.oSimpleHooks={};x.regViewModelHook=function(a,b){b&&(b.__hookName=a)};x.addHook=function(a,b){d.isFunc(b)&&(d.isArray(x.oSimpleHooks[a])||(x.oSimpleHooks[a]=[]),x.oSimpleHooks[a].push(b))};x.runHook=function(a,b){d.isArray(x.oSimpleHooks[a])&&(b=b||[],i.each(x.oSimpleHooks[a],function(a){a.apply(null,b)}))};x.mainSettingsGet=function(a){return e?e.settingsGet(a):null};x.remoteRequest=function(a,b,c,d,f,g){e&&
|
|
e.remote().defaultRequest(a,b,c,d,f,g)};x.settingsGet=function(a,b){var c=x.mainSettingsGet("Plugins");return(c=c&&d.isUnd(c[a])?null:c[a])?d.isUnd(c[b])?null:c[b]:null};q.prototype.initLanguage=function(a,b,c){this.oOptions.LangSwitcherConferm=a;this.oOptions.LangSwitcherTextLabel=b;this.oOptions.LangSwitcherHtmlLabel=c};q.prototype.execCom=function(a,b,c){h.document&&(h.document.execCommand(a,b||!1,c||null),this.updateTextArea())};q.prototype.getEditorSelection=function(){var a=null;h.getSelection?
|
|
a=h.getSelection():h.document.getSelection?a=h.document.getSelection():h.document.selection&&(a=h.document.selection);return a};q.prototype.getEditorRange=function(){var a=this.getEditorSelection();return!a||0===a.rangeCount?null:a.getRangeAt?a.getRangeAt(0):a.createRange()};q.prototype.ec=function(a,b,c){this.execCom(a,b,c)};q.prototype.heading=function(a){this.ec("formatblock",!1,j.browser.msie?"Heading "+a:"h"+a)};q.prototype.insertImage=function(a){this.isHtml()&&!this.bOnlyPlain&&(this.htmlarea.focus(),
|
|
this.ec("insertImage",!1,a))};q.prototype.focus=function(){this.isHtml()&&!this.bOnlyPlain?this.htmlarea.focus():this.textarea.focus()};q.prototype.setcolor=function(a,b){var c=null,c="";j.browser.msie&&9>d.pInt(j.browser.version)?(c=this.getEditorRange())&&c.execCommand("forecolor"===a?"ForeColor":"BackColor",!1,b):(c=j.browser.msie?"forecolor"===a?"ForeColor":"BackColor":"forecolor"===a?"foreColor":"backColor",this.ec(c,!1,b))};q.prototype.isHtml=function(){return!0===this.bOnlyPlain?!1:this.textarea.is(":hidden")};
|
|
q.prototype.toHtmlString=function(){return this.editor.innerHTML};q.prototype.toString=function(){return this.editor.innerText};q.prototype.updateTextArea=function(){this.textarea.val(this.toHtmlString())};q.prototype.updateHtmlArea=function(){this.editor.innerHTML=this.textarea.val()};q.prototype.setRawText=function(a,b){b&&!this.bOnlyPlain?(this.isHtml()||(this.textarea.val(""),this.switchToHtml()),this.textarea.val(a.toString()),this.updateHtmlArea()):(this.textarea.val(a.toString()),this.updateHtmlArea(),
|
|
this.switchToPlain(!1))};q.prototype.clear=function(){this.textarea.val("");this.editor.innerHTML="";this.bOnlyPlain?(this.toolbar.hide(),this.switchToPlain(!1)):this.switchToHtml()};q.prototype.getTextForRequest=function(){this.isHtml()&&this.updateTextArea();return this.textarea.val()};q.prototype.getTextFromHtml=function(a){var b="",c=function(){if(arguments&&1<arguments.length){var a=d.trim(arguments[1]).replace(/__bq__start__([\s\S\n\r]*)__bq__end__/gm,c),a="\n> "+d.trim(a).replace(/\n/gm,"\n> ")+
|
|
"\n>\n";return a.replace(/\n([> ]+)/gm,function(){return arguments&&1<arguments.length?"\n"+d.trim(arguments[1].replace(/[\s]/,""))+" ":""})}return""},e=function(){if(arguments&&1<arguments.length){var a=d.trim(arguments[1]);0<a.length&&(a=a.replace(/<div[^>]*>([\s\S]*)<\/div>/gmi,e),a="\n"+d.trim(a)+"\n");return a}return""},a=d.isUnd(a)?!0:!!a,b=this.toHtmlString().replace(/[\s]+/gm," ").replace(/<br\s?\/?>/gmi,"\n").replace(/<\/h\d>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,
|
|
"\n").replace(/<\/tr>/gi,"\n").replace(/<hr[^>]*>/gmi,"\n_______________________________\n\n").replace(/<img [^>]*>/gmi,"").replace(/<div[^>]*>([\s\S]*)<\/div>/gmi,e).replace(/<blockquote[^>]*>/gmi,"\n__bq__start__\n").replace(/<\/blockquote>/gmi,"\n__bq__end__\n").replace(/<a [^>]*>([\s\S]*?)<\/a>/gmi,function(){return arguments&&1<arguments.length?d.trim(arguments[1]):""}).replace(/ /gi," ").replace(/<[^>]*>/gm,"").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&").replace(/&\w{2,6};/gi,
|
|
"");return(a?d.splitPlainText(b):b).replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/__bq__start__([\s\S]*)__bq__end__/gm,c).replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")};q.prototype.getHtmlFromText=function(){return d.convertPlainTextToHtml(this.textarea.val())};q.prototype.switchToggle=function(){this.isHtml()?this.switchToPlain():this.switchToHtml()};q.prototype.switchToPlain=function(a){var a=d.isUnd(a)?!0:a,b=this.getTextFromHtml(),c=i.bind(function(a){a&&(this.toolbar.addClass("editorHideToolbar"),
|
|
j(".editorSwitcher",this.toolbar).text(this.switcherLinkText(!1)),this.textarea.val(b),this.textarea.show(),this.htmlarea.hide(),this.fOnSwitch&&this.fOnSwitch(!1))},this);!a||0===d.trim(b).length?c(!0):c(h.confirm(this.oOptions.LangSwitcherConferm))};q.prototype.switcherLinkText=function(a){return a?this.oOptions.LangSwitcherTextLabel:this.oOptions.LangSwitcherHtmlLabel};q.prototype.switchToHtml=function(){this.toolbar.removeClass("editorHideToolbar");j(".editorSwitcher",this.toolbar).text(this.switcherLinkText(!0));
|
|
this.textarea.val(this.getHtmlFromText());this.updateHtmlArea();this.textarea.hide();this.htmlarea.show();this.fOnSwitch&&this.fOnSwitch(!0)};q.prototype.addButton=function(a,b){var c=this;j("<div />").addClass("editorToolbarButtom").append(j('<a tabindex="-1" href="javascript:void(0);"></a>').addClass(a)).attr("title",b).click(function(b){d.isUnd(q.htmlFunctions[a])?h.alert(a):q.htmlFunctions[a].apply(c,[j(this),b])}).appendTo(this.toolbar)};q.htmlInitToolbar=function(){if(!this.bOnlyPlain){this.addButton("bold",
|
|
"Bold");this.addButton("italic","Italic");this.addButton("underline","Underline");this.addButton("strikethrough","Strikethrough");this.addButton("removeformat","removeformat");this.addButton("justifyleft","justifyleft");this.addButton("justifycenter","justifycenter");this.addButton("justifyright","justifyright");this.addButton("horizontalrule","horizontalrule");this.addButton("orderedlist","orderedlist");this.addButton("unorderedlist","unorderedlist");this.addButton("indent","indent");this.addButton("outdent",
|
|
"outdent");this.addButton("forecolor","forecolor");var a=this;j("<span />").addClass("editorSwitcher").text(a.switcherLinkText(!0)).click(function(){a.switchToggle()}).appendTo(a.toolbar)}};q.htmlInitEditor=function(){this.editor=this.htmlarea[0];this.editor.innerHTML=this.textarea.val()};q.htmlAttachEditorEvents=function(){var a=this,b=function(b){if(b=(b&&b.originalEvent?b.originalEvent:b)||h.event){b.stopPropagation();b.preventDefault();var c=null,d=null;if((b=b.files||(b.dataTransfer?b.dataTransfer.files:
|
|
null))&&1===b.length&&b[0]&&b[0].type&&0===b[0].type.indexOf("image/")){var d=b[0],c=new h.FileReader,e=d;c.onload=function(b){a.insertImage(b.target.result,e.name)};c.readAsDataURL(d)}}a.htmlarea.removeClass("editorDragOver")},c=function(){a.htmlarea.removeClass("editorDragOver")},d=function(b){b.stopPropagation();b.preventDefault();a.htmlarea.addClass("editorDragOver")},e=function(b){(b=b&&b.clipboardData?b.clipboardData:b&&b.originalEvent&&b.originalEvent.clipboardData?b.originalEvent.clipboardData:
|
|
null)&&b.items&&i.each(b.items,function(b){if(b&&(b.type&&0===b.type.indexOf("image/"))&&b.getAsFile){var c=null,d=b.getAsFile();d&&(c=new h.FileReader,c.onload=function(b){a.insertImage(b.target.result,d.name)},c.readAsDataURL(d))}})};!this.bOnlyPlain&&(h.File&&h.FileReader&&h.FileList)&&(this.htmlarea.bind("dragover",d),this.htmlarea.bind("dragleave",c),this.htmlarea.bind("drop",b),this.htmlarea.bind("paste",e))};for(var kb=q,pa=[],bb=[],V=0,Ha=0,Ia=0,Ja=0,Ka="",V=0;256>V;V+=85)Ka=V.toString(16),
|
|
pa.push(1===Ka.length?"0"+Ka:Ka);Ja=pa.length;for(V=0;V<Ja;V++)for(Ha=0;Ha<Ja;Ha++)for(Ia=0;Ia<Ja;Ia++)bb.push("#"+pa[V]+""+pa[Ha]+""+pa[Ia]);kb.htmlColorPickerColors=bb;var lb=q,cb=j(h.document),db=!1,qa=j('<div style="position: absolute;" class="editorFontStylePicker"><div class="editorFpFonts"></div></div>'),eb=qa.find(".editorFpFonts"),fb=function(){};j.each("Arial;Arial Black;Courier New;Tahoma;Times New Roman;Verdana".split(";"),function(a,b){eb.append(j('<a href="javascript:void(0);" tabindex="-1" class="editorFpFont" style="font-family: '+
|
|
b+';">'+b+"</a>").click(function(){fb(b)}));eb.append("<br />")});qa.hide();lb.htmlFontPicker=function(a,b,c){db||(qa.appendTo(c),db=!0);fb=b;cb.unbind("click.fpNamespace");h.setTimeout(function(){cb.one("click.fpNamespace",function(){qa.hide()})},500);b=j(a).position();qa.css("top",5+b.top+j(a).height()+"px").css("left",b.left+"px").show()};var mb=q,gb=j(h.document),hb=!1,ra=j('<div style="position: absolute;" class="editorColorPicker"><div class="editorCpColors"></div></div>'),ib=ra.find(".editorCpColors"),
|
|
jb=function(){};j.each(q.htmlColorPickerColors,function(a,b){ib.append('<a href="javascript:void(0);" tabindex="-1" class="editorCpColor" style="background-color: '+b+';"></a>')});ra.hide();j(".editorCpColor",ib).click(function(a){var b=1,c="#000000",a=j(a.target).css("background-color"),c=a.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(null!==c){for(delete c[0];3>=b;++b)c[b]=d.pInt(c[b]).toString(16),1===c[b].length&&(c[b]="0"+c[b]);c="#"+c.join("")}else c=a;jb(c)});mb.htmlColorPicker=function(a,
|
|
b,c){hb||(ra.appendTo(c),hb=!0);c=j(a).position();jb=b;gb.unbind("click.cpNamespace");h.setTimeout(function(){gb.one("click.cpNamespace",function(){ra.hide()})},100);ra.css("top",5+c.top+j(a).height()+"px").css("left",c.left+"px").show()};q.htmlFunctions={bold:function(){this.ec("bold")},italic:function(){this.ec("italic")},underline:function(){this.ec("underline")},strikethrough:function(){this.ec("strikethrough")},indent:function(){this.ec("indent")},outdent:function(){this.ec("outdent")},justifyleft:function(){this.ec("justifyLeft")},
|
|
justifycenter:function(){this.ec("justifyCenter")},justifyright:function(){this.ec("justifyRight")},horizontalrule:function(){this.ec("insertHorizontalRule",!1,"ht")},removeformat:function(){this.ec("removeFormat")},orderedlist:function(){this.ec("insertorderedlist")},unorderedlist:function(){this.ec("insertunorderedlist")},forecolor:function(a){q.htmlColorPicker(a,i.bind(function(a){this.setcolor("forecolor",a)},this),this.toolbar)},backcolor:function(a){q.htmlColorPicker(a,i.bind(function(a){this.setcolor("backcolor",
|
|
a)},this),this.toolbar)},fontname:function(a){q.htmlFontPicker(a,i.bind(function(a){this.ec("fontname",!1,a)},this),this.toolbar)}};K.prototype.selectItemCallbacks=function(a){(this.oCallbacks.onItemSelect||this.emptyFunction)(a)};K.prototype.init=function(a,b){this.oContentVisible=a;this.oContentScrollable=b;if(this.oContentVisible&&this.oContentScrollable){var c=this;j(this.oContentVisible).on("click",this.sItemSelector,function(a){c.actionClick(f.dataFor(this),a)}).on("click",this.sItemCheckedSelector,
|
|
function(a){var b=f.dataFor(this);b&&(a&&a.shiftKey?c.actionClick(b,a):(c.sLastUid=c.getItemUid(b),b.selected()?(b.checked(!1),c.selectedItem(null)):b.checked(!b.checked())))});j(h.document).on("keydown",function(a){var b=!0;if(a&&c.bUseKeyboard&&!d.inFocus())if(-1<d.inArray(a.keyCode,[g.EventKeyCode.Up,g.EventKeyCode.Down,g.EventKeyCode.Insert,g.EventKeyCode.Home,g.EventKeyCode.End,g.EventKeyCode.PageUp,g.EventKeyCode.PageDown]))c.newSelectPosition(a.keyCode,a.shiftKey),b=!1;else if(g.EventKeyCode.Delete===
|
|
a.keyCode&&!a.ctrlKey&&!a.shiftKey){if(c.oCallbacks.onDelete)c.oCallbacks.onDelete();b=!1}return b})}};K.prototype.selectByUid=function(a,b){this.useItemSelectCallback=b=d.isUnd(b)?!0:!!b;var c=i.find(this.list(),function(b){return a===this.getItemUid(b)},this);c&&this.selectedItem(c);this.useItemSelectCallback=!0};K.prototype.useKeyboard=function(a){this.bUseKeyboard=!!a};K.prototype.getItemUid=function(a){var b="",c=this.oCallbacks.onItemGetUid||null;c&&a&&(b=c(a));return b.toString()};K.prototype.newSelectPosition=
|
|
function(a,b){var c=this,d=0,e=!1,f=!1,w=null,k=this.list(),j=k?k.length:0,o=this.selectedItem();if(0<j)if(o){if(o)if(g.EventKeyCode.Down===a||g.EventKeyCode.Up===a||g.EventKeyCode.Insert===a)i.each(k,function(b){if(!f)switch(a){case g.EventKeyCode.Up:o===b?f=!0:w=b;break;case g.EventKeyCode.Down:case g.EventKeyCode.Insert:e?(w=b,f=!0):o===b&&(e=!0)}});else if(g.EventKeyCode.Home===a||g.EventKeyCode.End===a)g.EventKeyCode.Home===a?w=k[0]:g.EventKeyCode.End===a&&(w=k[k.length-1]);else if(g.EventKeyCode.PageDown===
|
|
a)for(;d<j;d++){if(o===k[d]){d+=10;d=j-1<d?j-1:d;w=k[d];break}}else if(g.EventKeyCode.PageUp===a)for(d=j;0<=d;d--)if(o===k[d]){d-=10;d=0>d?0:d;w=k[d];break}}else if(g.EventKeyCode.Down===a||g.EventKeyCode.Insert===a||g.EventKeyCode.Home===a||g.EventKeyCode.PageUp===a)w=k[0];else if(g.EventKeyCode.Up===a||g.EventKeyCode.End===a||g.EventKeyCode.PageDown===a)w=k[k.length-1];w?(o&&(b?(g.EventKeyCode.Up===a||g.EventKeyCode.Down===a)&&o.checked(!o.checked()):g.EventKeyCode.Insert===a&&o.checked(!o.checked())),
|
|
this.throttleSelection=!0,this.selectedItem(w),this.throttleSelection=!0,0!==this.iSelectTimer?(h.clearTimeout(this.iSelectTimer),this.iSelectTimer=h.setTimeout(function(){c.iSelectTimer=0;c.actionClick(w)},1E3)):(this.iSelectTimer=h.setTimeout(function(){c.iSelectTimer=0},200),this.actionClick(w)),this.scrollToSelected()):o&&(b&&(g.EventKeyCode.Up===a||g.EventKeyCode.Down===a)?o.checked(!o.checked()):g.EventKeyCode.Insert===a&&o.checked(!o.checked()))};K.prototype.scrollToSelected=function(){if(!this.oContentVisible||
|
|
!this.oContentScrollable)return!1;var a=j(this.sItemSelectedSelector,this.oContentScrollable),b=a.position(),c=this.oContentVisible.height(),a=a.outerHeight();return b&&(0>b.top||b.top+a>c)?(0>b.top?this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+b.top-20):this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+b.top-c+a+20),!0):!1};K.prototype.eventClickFunction=function(a,b){var c=this.getItemUid(a),d=0,e=0,f=null,g="",k=!1,i=!1,h=[],j=!1;if(b&&b.shiftKey&&""!==
|
|
c&&""!==this.sLastUid&&c!==this.sLastUid){h=this.list();j=a.checked();d=0;for(e=h.length;d<e;d++){f=h[d];g=this.getItemUid(f);k=!1;if(g===this.sLastUid||g===c)k=!0;k&&(i=!i);(i||k)&&f.checked(j)}}this.sLastUid=""===c?"":c};K.prototype.actionClick=function(a,b){if(a){var c=!0,d=this.getItemUid(a);b&&(b.shiftKey?(c=!1,""===this.sLastUid&&(this.sLastUid=d),a.checked(!a.checked()),this.eventClickFunction(a,b)):b.ctrlKey&&(c=!1,this.sLastUid=d,a.checked(!a.checked())));c&&(this.selectedItem(a),this.sLastUid=
|
|
d)}};K.prototype.on=function(a,b){this.oCallbacks[a]=b};ta.supported=function(){return!0};ta.prototype.set=function(a,b){var c=j.cookie(t.Values.ClientSideCookieIndexName),d=null;try{(d=null===c?null:JSON.parse(c))||(d={}),d[a]=b,j.cookie(t.Values.ClientSideCookieIndexName,JSON.stringify(d),{expires:30})}catch(e){}return d};ta.prototype.get=function(a){var b=j.cookie(t.Values.ClientSideCookieIndexName),c=null;try{c=(c=null===b?null:JSON.parse(b))&&!d.isUnd(c[a])?c[a]:null}catch(e){}return c};ua.supported=
|
|
function(){return!!h.localStorage};ua.prototype.set=function(a,b){var c=h.localStorage[t.Values.ClientSideCookieIndexName]||null,d=null;try{(d=null===c?null:JSON.parse(c))||(d={}),d[a]=b,h.localStorage[t.Values.ClientSideCookieIndexName]=JSON.stringify(d)}catch(e){}return d};ua.prototype.get=function(a){var b=h.localStorage[t.Values.ClientSideCookieIndexName]||null,c=null;try{c=(c=null===b?null:JSON.parse(b))&&!d.isUnd(c[a])?c[a]:null}catch(e){}return c};va.prototype.oDriver=null;va.prototype.set=
|
|
function(a,b){return this.oDriver?this.oDriver.set("p"+a,b):!1};va.prototype.get=function(a){return this.oDriver?this.oDriver.get("p"+a):null};Xa.prototype.bootstart=function(){};C.prototype.sPosition="";C.prototype.sTemplate="";C.prototype.viewModelName="";C.prototype.viewModelDom=null;C.prototype.viewModelTemplate=function(){return this.sTemplate};C.prototype.viewModelPosition=function(){return this.sPosition};C.prototype.cancelCommand=C.prototype.closeCommand=function(){};J.prototype.oCross=null;
|
|
J.prototype.sScreenName="";J.prototype.aViewModels=[];J.prototype.viewModels=function(){return this.aViewModels};J.prototype.screenName=function(){return this.sScreenName};J.prototype.routes=function(){return null};J.prototype.__cross=function(){return this.oCross};J.prototype.__start=function(){var a=this.routes(),b=null,c=null;d.isNonEmptyArray(a)&&(c=i.bind(this.onRoute||d.emptyFunction,this),b=Wa.create(),i.each(a,function(a){b.addRoute(a[0],c).rules=a[1]}),this.oCross=b)};E.prototype.sDefaultScreenName=
|
|
"";E.prototype.oScreens={};E.prototype.oBoot=null;E.prototype.oCurrentScreen=null;E.prototype.showLoading=function(){j("#rl-loading").show()};E.prototype.hideLoading=function(){j("#rl-loading").hide()};E.prototype.routeOff=function(){P.changed.active=!1};E.prototype.routeOn=function(){P.changed.active=!0};E.prototype.setBoot=function(a){d.isNormal(a)&&(this.oBoot=a);return this};E.prototype.screen=function(a){return""!==a&&!d.isUnd(this.oScreens[a])?this.oScreens[a]:null};E.prototype.delegateRun=
|
|
function(a,b,c){a&&a[b]&&a[b].apply(a,d.isArray(c)?c:[])};E.prototype.buildViewModel=function(a,b){if(a&&!a.__builded){var c=new a(b),l=c.viewModelPosition(),g=j("#rl-content #rl-"+l.toLowerCase()),r=null;a.__builded=!0;a.__vm=c;c.data=e.data();c.viewModelName=a.__name;g&&1===g.length?(r=j("<div>").addClass("rl-view-model").addClass("RL-"+c.viewModelTemplate()).hide().attr("data-bind",'template: {name: "'+c.viewModelTemplate()+'"}, i18nInit: true'),r.appendTo(g),c.viewModelDom=r,a.__dom=r,"Popups"===
|
|
l&&(c.cancelCommand=c.closeCommand=d.createCommand(c,function(){s.hideScreenPopup(a)})),x.runHook("view-model-pre-build",[a.__name,c,r]),f.applyBindings(c,r[0]),this.delegateRun(c,"onBuild",[r]),x.runHook("view-model-post-build",[a.__name,c,r])):d.log("Cannot find view model position: "+l)}return a?a.__vm:null};E.prototype.applyExternal=function(a,b){a&&b&&f.applyBindings(a,b)};E.prototype.hideScreenPopup=function(a){a&&(a.__vm&&a.__dom)&&(a.__dom.hide(),a.__vm.modalVisibility(!1),this.delegateRun(a.__vm,
|
|
"onHide"),this.popupVisibility(!1),i.defer(function(){a.__dom.find(".ko-select2").select2("close")}))};E.prototype.showScreenPopup=function(a,b){a&&(this.buildViewModel(a),a.__vm&&a.__dom&&(a.__dom.show(),a.__vm.modalVisibility(!0),this.delegateRun(a.__vm,"onShow",b||[]),this.popupVisibility(!0),x.runHook("view-model-on-show",[a.__name,a.__vm,b||[]])))};E.prototype.screenOnRoute=function(a,b){var c=this,e=null,f=null;""===d.pString(a)&&(a=this.sDefaultScreenName);if(""!==a){e=this.screen(a);if(!e&&
|
|
(e=this.screen(this.sDefaultScreenName)))b=a+"/"+b,a=this.sDefaultScreenName;e&&e.__started&&(e.__builded||(e.__builded=!0,d.isNonEmptyArray(e.viewModels())&&i.each(e.viewModels(),function(a){this.buildViewModel(a,e)},this),this.delegateRun(e,"onBuild")),i.defer(function(){if(c.oCurrentScreen){c.delegateRun(c.oCurrentScreen,"onHide");d.isNonEmptyArray(c.oCurrentScreen.viewModels())&&i.each(c.oCurrentScreen.viewModels(),function(a){if(a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()){a.__dom.hide();
|
|
a.__vm.viewModelVisibility(false);c.delegateRun(a.__vm,"onHide")}})}c.oCurrentScreen=e;if(c.oCurrentScreen){c.delegateRun(c.oCurrentScreen,"onShow");x.runHook("screen-on-show",[c.oCurrentScreen.screenName(),c.oCurrentScreen]);d.isNonEmptyArray(c.oCurrentScreen.viewModels())&&i.each(c.oCurrentScreen.viewModels(),function(a){if(a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()){a.__dom.show();a.__vm.viewModelVisibility(true);c.delegateRun(a.__vm,"onShow");x.runHook("view-model-on-show",[a.__name,
|
|
a.__vm])}},c)}(f=e.__cross())&&f.parse(b)}))}};E.prototype.startScreens=function(a){i.each(a,function(a){var c=(a=new a)?a.screenName():"";a&&""!==c&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=c),this.oScreens[c]=a)},this);i.each(this.oScreens,function(a){a&&(!a.__started&&a.__start)&&(a.__started=!0,a.__start(),x.runHook("screen-pre-start",[a.screenName(),a]),this.delegateRun(a,"onStart"),x.runHook("screen-post-start",[a.screenName(),a]))},this);a=Wa.create();a.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,
|
|
i.bind(this.screenOnRoute,this));P.initialized.add(a.parse,a);P.changed.add(a.parse,a);P.init()};E.prototype.setHash=function(a,b){a="#"===a.substr(0,1)?a.substr(1):a;a="/"===a.substr(0,1)?a.substr(1):a;(d.isUnd(b)?0:b)?(P.changed.active=!1,P.setHash(a),P.changed.active=!0):(P.changed.active=!0,P.setHash(a))};E.prototype.bootstart=function(){this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart();return this};s=new E;F.newInstanceFromJson=function(a){var b=new F;return b.initByJson(a)?b:null};F.prototype.name=
|
|
"";F.prototype.email="";F.prototype.privateType=null;F.prototype.validate=function(){return""!==this.name||""!==this.email};F.prototype.hash=function(a){return"#"+(a?"":this.name)+"#"+this.email+"#"};F.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")};F.prototype.type=function(){if(null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=g.EmailType.Facebook),null===this.privateType))this.privateType=g.EmailType.Default;return this.privateType};
|
|
F.prototype.search=function(a){return-1<(this.name+" "+this.email).toLowerCase().indexOf(a.toLowerCase())};F.prototype.parse=function(a){var a=d.trim(a),b=/(?:"([^"]+)")? ?<?(.*?@[^>,]+)>?,? ?/g.exec(a);b?(this.name=b[1]||"",this.email=b[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(a)&&(this.name="",this.email=a)};F.prototype.initByJson=function(a){var b=!1;a&&"Object/Email"===a["@Object"]&&(this.name=d.trim(a.Name),this.email=d.trim(a.Email),b=""!==this.email,this.clearDuplicateName());
|
|
return b};F.prototype.toLine=function(a,b){var c="";""!==this.email&&(b=d.isUnd(b)?!1:!!b,a&&""!==this.name?c=b?'<a href="mailto:'+d.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+d.encodeHtml(this.name)+"</a>":this.name:(c=this.email,""!==this.name?c=b?d.encodeHtml('"'+this.name+'" <')+'<a href="mailto:'+d.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+d.encodeHtml(c)+"</a>"+d.encodeHtml(">"):'"'+this.name+'" <'+c+">":b&&(c='<a href="mailto:'+
|
|
d.encodeHtml(this.email)+'" target="_blank" tabindex="-1">'+d.encodeHtml(this.email)+"</a>")));return c};F.prototype.select2Result=function(){var a="",b=e.cache().getUserPic(this.email),a=""!==b?a+('<img class="select2-user-pic pull-left" src="'+d.encodeHtml(b)+'" />'):a+('<img class="select2-user-pic pull-left" src="'+e.link().emptyContactPic()+'" />');g.EmailType.Facebook===this.type()?(a+=""+(0<this.name.length?this.name:this.email),a+='<i class="icon-facebook pull-right select2-icon-result" />'):
|
|
a+=""+(0<this.name.length?this.email+' <span class="select2-subname">('+this.name+")</span>":this.email);return a+""};F.prototype.select2Selection=function(a){var b="";if(g.EmailType.Facebook===this.type()){if(b=0<this.name.length?this.name:this.email,""!==b)return j("<pan>").text(b).appendTo(a),a.append('<i class="icon-facebook select2-icon"></i>'),null}else b=0<this.name.length?this.name+" ("+this.email+")":this.email;return b};ka.prototype.parse=function(a){var b=!1;a&&"Object/Contact"===a["@Object"]&&
|
|
(this.idContact=d.pInt(a.IdContact),this.listName=d.pString(a.ListName),this.name=d.pString(a.Name),this.emails=d.isNonEmptyArray(a.Emails)?a.Emails:[],this.imageHash=d.pString(a.ImageHash),b=!0);return b};ka.prototype.srcAttr=function(){return""===this.imageHash?e.link().emptyContactPic():e.link().getUserPicUrlFromHash(this.imageHash)};ka.prototype.generateUid=function(){return""+this.idContact};ka.prototype.lineAsCcc=function(){var a=[];this.deleted()&&a.push("deleted");this.selected()&&a.push("selected");
|
|
this.checked()&&a.push("checked");return a.join(" ")};D.newInstanceFromJson=function(a){var b=new D;return b.initByJson(a)?b:null};D.prototype.mimeType="";D.prototype.fileName="";D.prototype.estimatedSize=0;D.prototype.friendlySize="";D.prototype.isInline=!1;D.prototype.isLinked=!1;D.prototype.cid="";D.prototype.cidWithOutTags="";D.prototype.download="";D.prototype.folder="";D.prototype.uid="";D.prototype.mimeIndex="";D.prototype.initByJson=function(a){var b=!1;a&&"Object/Attachment"===a["@Object"]&&
|
|
(this.mimeType=a.MimeType,this.fileName=a.FileName,this.estimatedSize=d.pInt(a.EstimatedSize),this.isInline=!!a.IsInline,this.isLinked=!!a.IsLinked,this.cid=a.CID,this.download=a.Download,this.folder=a.Folder,this.uid=a.Uid,this.mimeIndex=a.MimeIndex,this.friendlySize=d.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),b=!0);return b};D.prototype.isImage=function(){return"image/"===this.mimeType.substr(0,6)};D.prototype.isText=function(){return"text/"===
|
|
this.mimeType.substr(0,5)};D.prototype.linkDownload=function(){return e.link().attachmentDownload(this.download)};D.prototype.linkPreview=function(){return e.link().attachmentPreview(this.download)};D.prototype.linkPreviewAsPlain=function(){return e.link().attachmentPreviewAsPlain(this.download)};D.prototype.generateTransferDownloadUrl=function(){var a=this.linkDownload();"http"!==a.substr(0,4)&&(a=h.location.protocol+"//"+h.location.host+h.location.pathname+a);return this.mimeType+":"+this.fileName+
|
|
":"+a};D.prototype.eventDragStart=function(a,b){var c=b.originalEvent||b;a&&(c&&c.dataTransfer&&c.dataTransfer.setData)&&c.dataTransfer.setData("DownloadURL",this.generateTransferDownloadUrl());return!0};D.prototype.iconClass=function(){var a=this.mimeType.toLocaleString().split("/"),b="icon-file";a&&a[1]&&("image"===a[0]?b="icon-image":"text"===a[0]?b="icon-file-xml":"audio"===a[0]?b="icon-music":"video"===a[0]?b="icon-film":-1<d.inArray(a[1],"zip 7z tar rar gzip bzip bzip2 x-zip x-7z x-rar x-tar x-gzip x-bzip x-bzip2 x-zip-compressed x-7z-compressed x-rar-compressed".split(" "))?
|
|
b="icon-file-zip":-1<d.inArray(a[1],["pdf","x-pdf"])?b="icon-file-pdf":-1<d.inArray(a[1],["exe","x-exe","x-winexe","bat"])?b="icon-console":-1<d.inArray(a[1],"rtf msword vnd.msword vnd.openxmlformats-officedocument.wordprocessingml.document vnd.openxmlformats-officedocument.wordprocessingml.template vnd.ms-word.document.macroEnabled.12 vnd.ms-word.template.macroEnabled.12".split(" "))?b="icon-file-word":-1<d.inArray(a[1],"excel ms-excel vnd.ms-excel vnd.openxmlformats-officedocument.spreadsheetml.sheet vnd.openxmlformats-officedocument.spreadsheetml.template vnd.ms-excel.sheet.macroEnabled.12 vnd.ms-excel.template.macroEnabled.12 vnd.ms-excel.addin.macroEnabled.12 vnd.ms-excel.sheet.binary.macroEnabled.12".split(" "))?
|
|
b="icon-file-excel":-1<d.inArray(a[1],"powerpoint ms-powerpoint vnd.ms-powerpoint vnd.openxmlformats-officedocument.presentationml.presentation vnd.openxmlformats-officedocument.presentationml.template vnd.openxmlformats-officedocument.presentationml.slideshow vnd.ms-powerpoint.addin.macroEnabled.12 vnd.ms-powerpoint.presentation.macroEnabled.12 vnd.ms-powerpoint.template.macroEnabled.12 vnd.ms-powerpoint.slideshow.macroEnabled.12".split(" "))&&(b="icon-file-powerpoint"));return b};M.prototype.id=
|
|
"";M.prototype.isInline=!1;M.prototype.isLinked=!1;M.prototype.CID="";M.prototype.fromMessage=!1;M.prototype.cancel=d.emptyFunction;M.prototype.initByUploadJson=function(a){var b=!1;a&&(this.fileName(a.Name),this.size(d.isUnd(a.Size)?0:d.pInt(a.Size)),this.tempName(d.isUnd(a.TempName)?"":a.TempName),this.isInline=!1,b=!0);return b};m.newInstanceFromJson=function(a){var b=new m;return b.initByJson(a)?b:null};m.calculateFullFromatDateValue=function(a){return Y.unix(a).format("LLL")};m.emailsToLine=
|
|
function(a,b,c){var e=[],f=0,g=0;if(d.isNonEmptyArray(a)){f=0;for(g=a.length;f<g;f++)e.push(a[f].toLine(b,c))}return e.join(", ")};m.initEmailsFromJson=function(a){var b=0,c=0,e=null,f=[];if(d.isNonEmptyArray(a)){b=0;for(c=a.length;b<c;b++)(e=F.newInstanceFromJson(a[b]))&&f.push(e)}return f};m.replyHelper=function(a,b,c){if(a&&0<a.length)for(var e=0,f=a.length;e<f;e++)d.isUnd(b[a[e].email])&&(b[a[e].email]=!0,c.push(a[e]))};m.prototype.initByJson=function(a){var b=!1;a&&"Object/Message"===a["@Object"]&&
|
|
(this.folderFullNameRaw=a.Folder,this.uid=a.Uid,this.requestHash=a.RequestHash,this.prefetched=!1,this.size(d.pInt(a.Size)),this.from=m.initEmailsFromJson(a.From),this.to=m.initEmailsFromJson(a.To),this.cc=m.initEmailsFromJson(a.Cc),this.bcc=m.initEmailsFromJson(a.Bcc),this.replyTo=m.initEmailsFromJson(a.ReplyTo),this.subject(a.Subject),this.dateTimeStampInUTC(d.pInt(a.DateTimeStampInUTC)),this.hasAttachments(!!a.HasAttachments),this.fromEmailString(m.emailsToLine(this.from,!0)),this.toEmailsString(m.emailsToLine(this.to,
|
|
!0)),this.parentUid(d.pInt(a.ParentThread)),this.threads(d.isArray(a.Threads)?a.Threads:[]),this.threadsLen(d.pInt(a.ThreadsLen)),this.initFlagsByJson(a),this.computeSenderEmail(),b=!0);return b};m.prototype.computeSenderEmail=function(){var a=e.data().sentFolder(),b=e.data().draftFolder();this.senderEmailsString(this.folderFullNameRaw===a||this.folderFullNameRaw===b?this.toEmailsString():this.fromEmailString())};m.prototype.initUpdateByMessageJson=function(a){var b=!1,c=g.MessagePriority.Normal;
|
|
a&&"Object/Message"===a["@Object"]&&(c=d.pInt(a.Priority),this.priority(-1<d.inArray(c,[g.MessagePriority.High,g.MessagePriority.Low])?c:g.MessagePriority.Normal),this.aDraftInfo=a.DraftInfo,this.sMessageId=a.MessageId,this.sInReplyTo=a.InReplyTo,this.sReferences=a.References,this.hasAttachments(!!a.HasAttachments),this.foundedCIDs=d.isArray(a.FoundedCIDs)?a.FoundedCIDs:[],this.attachments(this.initAttachmentsFromJson(a.Attachments)),this.computeSenderEmail(),b=!0);return b};m.prototype.initAttachmentsFromJson=
|
|
function(a){var b=0,c=0,e=null,f=[];if(a&&"Collection/AttachmentCollection"===a["@Object"]&&d.isNonEmptyArray(a["@Collection"])){b=0;for(c=a["@Collection"].length;b<c;b++)if(e=D.newInstanceFromJson(a["@Collection"][b]))""!==e.cidWithOutTags&&(0<this.foundedCIDs.length&&0<=d.inArray(e.cidWithOutTags,this.foundedCIDs))&&(e.isLinked=!0),f.push(e)}return f};m.prototype.initFlagsByJson=function(a){var b=!1;a&&"Object/Message"===a["@Object"]&&(this.unseen(!a.IsSeen),this.flagged(!!a.IsFlagged),this.answered(!!a.IsAnswered),
|
|
this.forwarded(!!a.IsForwarded),b=!0);return b};m.prototype.fromToLine=function(a,b){return m.emailsToLine(this.from,a,b)};m.prototype.toToLine=function(a,b){return m.emailsToLine(this.to,a,b)};m.prototype.ccToLine=function(a,b){return m.emailsToLine(this.cc,a,b)};m.prototype.bccToLine=function(a,b){return m.emailsToLine(this.bcc,a,b)};m.prototype.lineAsCcc=function(){var a=[];this.deleted()&&a.push("deleted");this.selected()&&a.push("selected");this.checked()&&a.push("checked");this.flagged()&&a.push("flagged");
|
|
this.unseen()&&a.push("unseen");this.answered()&&a.push("answered");this.forwarded()&&a.push("forwarded");this.hasAttachments()&&a.push("withAttachments");this.newForAnimation()&&a.push("new");""===this.subject()&&a.push("emptySubject");0<this.parentUid()&&a.push("hasParentMessage");0<this.threadsLen()&&a.push("hasChildrenMessage");this.hasUnseenSubMessage()&&a.push("hasUnseenSubMessage");this.hasFlaggedSubMessage()&&a.push("hasFlaggedSubMessage");return a.join(" ")};m.prototype.hasVisibleAttachments=
|
|
function(){return!!i.find(this.attachments(),function(a){return!a.isLinked})};m.prototype.findAttachmentByCid=function(a){var b=null,c=this.attachments();d.isNonEmptyArray(c)&&(a=a.replace(/^<+/,"").replace(/>+$/,""),b=i.find(c,function(b){return a===b.cidWithOutTags}));return b||null};m.prototype.messageId=function(){return this.sMessageId};m.prototype.inReplyTo=function(){return this.sInReplyTo};m.prototype.references=function(){return this.sReferences};m.prototype.fromAsSingleEmail=function(){return d.isArray(this.from)&&
|
|
this.from[0]?this.from[0].email:""};m.prototype.viewLink=function(){return e.link().messageViewLink(this.requestHash)};m.prototype.downloadLink=function(){return e.link().messageDownloadLink(this.requestHash)};m.prototype.replyEmails=function(a){var b=[],a=d.isUnd(a)?{}:a;m.replyHelper(this.replyTo,a,b);0===b.length&&m.replyHelper(this.from,a,b);return b};m.prototype.replyAllEmails=function(a){var b=[],c=[],a=d.isUnd(a)?{}:a;m.replyHelper(this.replyTo,a,b);0===b.length&&m.replyHelper(this.from,a,
|
|
b);m.replyHelper(this.to,a,b);m.replyHelper(this.cc,a,c);return[b,c]};m.prototype.textBodyToString=function(){return this.body?this.body.html():""};m.prototype.attachmentsToStringLine=function(){var a=i.map(this.attachments(),function(a){return a.fileName+" ("+a.friendlySize+")"});return a&&0<a.length?a.join(", "):""};m.prototype.getDataForWindowPopup=function(){return{popupFrom:this.fromToLine(!1),popupTo:this.toToLine(!1),popupCc:this.ccToLine(!1),popupBcc:this.bccToLine(!1),popupSubject:this.subject(),
|
|
popupDate:this.fullFormatDateValue(),popupAttachments:this.attachmentsToStringLine(),popupBody:this.textBodyToString()}};m.prototype.viewPopupMessage=function(a){d.windowPopupKnockout(this.getDataForWindowPopup(),"PopupsWindowSimpleMessage",this.subject(),function(b){b&&(b.document&&b.document.body)&&(j("img.lazy",b.document.body).each(function(a,b){var d=j(b),e=d.data("original"),f=d.attr("src");0<=a&&(e&&!f)&&d.attr("src",e)}),a&&h.setTimeout(function(){b.print()},100))})};m.prototype.printMessage=
|
|
function(){this.viewPopupMessage(!0)};m.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid};m.prototype.populateByMessageListItem=function(a){this.folderFullNameRaw=a.folderFullNameRaw;this.uid=a.uid;this.requestHash=a.requestHash;this.subject(a.subject());this.size(a.size());this.dateTimeStampInUTC(a.dateTimeStampInUTC());this.priority(a.priority());this.fromEmailString(a.fromEmailString());this.toEmailsString(a.toEmailsString());this.emails=a.emails;this.from=a.from;this.to=
|
|
a.to;this.cc=a.cc;this.bcc=a.bcc;this.replyTo=a.replyTo;this.unseen(a.unseen());this.flagged(a.flagged());this.answered(a.answered());this.forwarded(a.forwarded());this.selected(a.selected());this.checked(a.checked());this.hasAttachments(a.hasAttachments());this.moment(a.moment());this.body=null;this.priority(g.MessagePriority.Normal);this.aDraftInfo=[];this.sReferences=this.sInReplyTo=this.sMessageId="";this.parentUid(a.parentUid());this.threads(a.threads());this.threadsLen(a.threadsLen());this.computeSenderEmail();
|
|
return this};m.prototype.showExternalImages=function(a){this.body&&this.body.data("rl-has-images")&&(a=d.isUnd(a)?!1:a,this.hasImages(!1),this.body.data("rl-has-images",!1),j("[data-x-src]",this.body).each(function(){a&&j(this).is("img")?j(this).addClass("lazy").attr("data-original",j(this).attr("data-x-src")).removeAttr("data-x-src"):j(this).attr("src",j(this).attr("data-x-src")).removeAttr("data-x-src")}),j("[data-x-style-url]",this.body).each(function(){var a=d.trim(j(this).attr("style")),a=""===
|
|
a?"":";"===a.substr(-1)?a+" ":a+"; ";j(this).attr("style",a+j(this).attr("data-x-style-url")).removeAttr("data-x-style-url")}),a&&(j("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:j(".RL-MailMessageView .messageView .messageItem .content")[0]}),N.resize()),d.windowResize(500))};m.prototype.showInternalImages=function(a){if(this.body&&!this.body.data("rl-init-internal-images")){var a=d.isUnd(a)?!1:a,b=this;this.body.data("rl-init-internal-images",
|
|
!0);j("[data-x-src-cid]",this.body).each(function(){var c=b.findAttachmentByCid(j(this).attr("data-x-src-cid"));c&&c.download&&(a&&j(this).is("img")?j(this).addClass("lazy").attr("data-original",c.linkPreview()):j(this).attr("src",c.linkPreview()))});j("[data-x-style-cid]",this.body).each(function(){var a="",c="",e=b.findAttachmentByCid(j(this).attr("data-x-style-cid"));e&&e.linkPreview&&(c=j(this).attr("data-x-style-cid-name"),""!==c&&(a=d.trim(j(this).attr("style")),a=""===a?"":";"===a.substr(-1)?
|
|
a+" ":a+"; ",j(this).attr("style",a+c+": url('"+e.linkPreview()+"')")))});if(a){var c=j("img.lazy",b.body),e=j(".RL-MailMessageView .messageView .messageItem .content")[0];i.delay(function(){c.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:e})},300)}d.windowResize(500)}};G.newInstanceFromJson=function(a){var b=new G;return b.initByJson(a)?b.initComputed():null};G.prototype.initComputed=function(){this.hasSubScribedSubfolders=f.computed(function(){return!!i.find(this.subFolders(),
|
|
function(a){return a.subScribed()})},this);this.visible=f.computed(function(){var a=this.subScribed(),b=this.hasSubScribedSubfolders();return a||b&&(!this.existen||!this.selectable)},this);this.isSystemFolder=f.computed(function(){return g.FolderType.User!==this.type()},this);this.hidden=f.computed(function(){var a=this.isSystemFolder(),b=this.hasSubScribedSubfolders();return this.isGmailFolder||a&&this.isNamespaceFolder||a&&!b},this);this.selectableForFolderList=f.computed(function(){return!this.isSystemFolder()&&
|
|
this.selectable},this);this.messageCountAll=f.computed({read:this.privateMessageCountAll,write:function(a){d.isPosNumeric(a,!0)?this.privateMessageCountAll(a):this.privateMessageCountAll.valueHasMutated()},owner:this});this.messageCountUnread=f.computed({read:this.privateMessageCountUnread,write:function(a){d.isPosNumeric(a,!0)?this.privateMessageCountUnread(a):this.privateMessageCountUnread.valueHasMutated()},owner:this});this.printableUnreadCount=f.computed(function(){var a=this.messageCountAll(),
|
|
b=this.messageCountUnread(),c=this.type();return 0<b&&(g.FolderType.Inbox===c||g.FolderType.Spam===c)?""+b:0<a&&g.FolderType.Draft===c?""+a:""},this);this.canBeDeleted=f.computed(function(){return!this.isSystemFolder()&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this);this.canBeSubScribed=f.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this);this.visible.subscribe(function(){d.timeOutAction("folder-list-folder-visibility-change",function(){N.trigger("folder-list-folder-visibility-change")},
|
|
100)});this.localName=f.computed(function(){ia();var a=this.type(),b=this.name();if(this.isSystemFolder())switch(a){case g.FolderType.Inbox:b=d.i18n("FOLDER_LIST/INBOX_NAME");break;case g.FolderType.SentItems:b=d.i18n("FOLDER_LIST/SENT_NAME");break;case g.FolderType.Draft:b=d.i18n("FOLDER_LIST/DRAFTS_NAME");break;case g.FolderType.Spam:b=d.i18n("FOLDER_LIST/SPAM_NAME");break;case g.FolderType.Trash:b=d.i18n("FOLDER_LIST/TRASH_NAME")}return b},this);this.manageFolderSystemName=f.computed(function(){ia();
|
|
var a="",b=this.type(),c=this.name();if(this.isSystemFolder())switch(b){case g.FolderType.Inbox:a="("+d.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case g.FolderType.SentItems:a="("+d.i18n("FOLDER_LIST/SENT_NAME")+")";break;case g.FolderType.Draft:a="("+d.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case g.FolderType.Spam:a="("+d.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case g.FolderType.Trash:a="("+d.i18n("FOLDER_LIST/TRASH_NAME")+")"}if(""!==a&&"("+c+")"===a||"(inbox)"===a.toLowerCase())a="";return a},
|
|
this);this.collapsed=f.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(a){this.collapsedPrivate(a)},owner:this});return this};G.prototype.fullName="";G.prototype.fullNameRaw="";G.prototype.fullNameHash="";G.prototype.delimiter="";G.prototype.namespace="";G.prototype.deep=0;G.prototype.isNamespaceFolder=!1;G.prototype.isGmailFolder=!1;G.prototype.isUnpaddigFolder=!1;G.prototype.collapsedCss=function(){return this.hasSubScribedSubfolders()?this.collapsed()?"icon-arrow-right-3 e-collapsed-sign":
|
|
"icon-arrow-down-3 e-collapsed-sign":"icon-none e-collapsed-sign"};G.prototype.initByJson=function(a){var b=!1;a&&"Object/Folder"===a["@Object"]&&(this.name(a.Name),this.delimiter=a.Delimiter,this.fullName=a.FullName,this.fullNameRaw=a.FullNameRaw,this.fullNameHash=a.FullNameHash,this.deep=a.FullNameRaw.split(this.delimiter).length-1,this.selectable=!!a.IsSelectable,this.existen=!!a.IsExisten,this.subScribed(!!a.IsSubscribed),this.type("INBOX"===this.fullNameRaw?g.FolderType.Inbox:g.FolderType.User),
|
|
b=!0);return b};G.prototype.printableFullName=function(){return this.fullName.split(this.delimiter).join(" / ")};La.prototype.email="";La.prototype.changeAccountLink=function(){return e.link().change(this.email)};d.extendAsViewModel("PopupsFolderClearViewModel",wa);wa.prototype.clearPopup=function(){this.clearingProcess(!1);this.selectedFolder(null)};wa.prototype.onShow=function(a){this.clearPopup();a&&this.selectedFolder(a)};d.extendAsViewModel("PopupsFolderCreateViewModel",ba);ba.prototype.sNoParentText=
|
|
"";ba.prototype.simpleFolderNameValidation=function(a){return/^[^\\\/]+$/g.test(d.trim(a))};ba.prototype.clearPopup=function(){this.folderName("");this.selectedParentValue("");this.focusTrigger(!1)};ba.prototype.onShow=function(){this.clearPopup();this.focusTrigger(!0)};d.extendAsViewModel("PopupsFolderSystemViewModel",X);X.prototype.sChooseOnText="";X.prototype.sUnuseText="";X.prototype.onShow=function(a){var b="",a=d.isUnd(a)?g.SetSystemFoldersNotification.None:a;switch(a){case g.SetSystemFoldersNotification.Sent:b=
|
|
d.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case g.SetSystemFoldersNotification.Draft:b=d.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case g.SetSystemFoldersNotification.Spam:b=d.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case g.SetSystemFoldersNotification.Trash:b=d.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH")}this.notification(b)};d.extendAsViewModel("PopupsComposeViewModel",y);y.prototype.formattedFrom=function(){var a=e.data().displayName(),b=e.data().accountEmail();
|
|
return""===a?b:a+" ("+b+")"};y.prototype.sendMessageResponse=function(a,b){var c=!1;this.sending(!1);g.StorageResultType.Success===a&&(b&&b.Result)&&(c=!0,this.modalVisibility()&&s.delegateRun(this,"closeCommand"));this.modalVisibility()&&!c&&(b&&g.Notification.CantSaveMessage===b.ErrorCode?(this.sendSuccessButSaveError(!0),h.alert(d.trim(d.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(this.sendError(!0),h.alert(d.getNotification(b.ErrorCode?b.ErrorCode:g.Notification.CantSendMessage))))};y.prototype.saveMessageResponse=
|
|
function(a,b){var c=!1,f=null;this.saving(!1);if(g.StorageResultType.Success===a&&(b&&b.Result)&&(b.Result.NewFolder&&b.Result.NewUid)&&(this.bFromDraft&&(f=e.data().message())&&(this.draftFolder()===f.folderFullNameRaw&&this.draftUid()===f.uid)&&e.data().message(null),this.draftFolder(b.Result.NewFolder),this.draftUid(b.Result.NewUid),this.modalVisibility()))this.savedTime(h.Math.round((new h.Date).getTime()/1E3)),this.savedOrSendingText(0<this.savedTime()?d.i18n("COMPOSE/SAVED_TIME",{TIME:Y.unix(this.savedTime()-
|
|
1).format("LT")}):""),c=!0,this.bFromDraft&&e.cache().setFolderHash(this.draftFolder(),"");!this.modalVisibility()&&!c&&(this.savedError(!0),this.savedOrSendingText(d.getNotification(g.Notification.CantSaveMessage)))};y.prototype.onHide=function(){s.routeOn()};y.prototype.onShow=function(a,b,c){s.routeOff();var f=this,W="",r="",w="",k="",h="",o=null,k=o="",m=[],W={},k=e.data().accountEmail(),n=[],n=r=null,m=!1,a=a||g.ComposeType.Empty;(b=b||null)&&d.isNormal(b)&&(n=d.isArray(b)&&1===b.length?b[0]:
|
|
!d.isArray(b)?b:null);null!==k&&(W[k]=!0);this.reset();d.isNonEmptyArray(c)&&this.to(c);if(""!==a&&n){k=n.fullFormatDateValue();h=n.subject();r=n.aDraftInfo;o=j(n.body).clone();d.removeBlockquoteSwitcher(o);o=o.html();switch(a){case g.ComposeType.Reply:this.to(n.replyEmails(W));this.subject(d.replySubjectAdd("Re",h));this.prepearMessageAttachments(n,a);this.aDraftInfo=["reply",n.uid,n.folderFullNameRaw];this.sInReplyTo=n.sMessageId;this.sReferences=d.trim(this.sInReplyTo+" "+n.sReferences);m=!0;break;
|
|
case g.ComposeType.ReplyAll:m=n.replyAllEmails(W);this.to(m[0]);this.cc(m[1]);this.subject(d.replySubjectAdd("Re",h));this.prepearMessageAttachments(n,a);this.aDraftInfo=["reply",n.uid,n.folderFullNameRaw];this.sInReplyTo=n.sMessageId;this.sReferences=d.trim(this.sInReplyTo+" "+n.references());m=!0;break;case g.ComposeType.Forward:this.subject(d.replySubjectAdd("Fwd",h));this.prepearMessageAttachments(n,a);this.aDraftInfo=["forward",n.uid,n.folderFullNameRaw];this.sInReplyTo=n.sMessageId;this.sReferences=
|
|
d.trim(this.sInReplyTo+" "+n.sReferences);break;case g.ComposeType.ForwardAsAttachment:this.subject(d.replySubjectAdd("Fwd",h));this.prepearMessageAttachments(n,a);this.aDraftInfo=["forward",n.uid,n.folderFullNameRaw];this.sInReplyTo=n.sMessageId;this.sReferences=d.trim(this.sInReplyTo+" "+n.sReferences);break;case g.ComposeType.Draft:this.to(n.to),this.cc(n.cc),this.bcc(n.bcc),this.bFromDraft=!0,this.draftFolder(n.folderFullNameRaw),this.draftUid(n.uid),this.subject(h),this.prepearMessageAttachments(n,
|
|
a),this.aDraftInfo=d.isNonEmptyArray(r)&&3===r.length?r:null,this.sInReplyTo=n.sInReplyTo,this.sReferences=n.sReferences}if(this.oEditor){switch(a){case g.ComposeType.Reply:case g.ComposeType.ReplyAll:W=n.fromToLine(!1,!0);k=d.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:k,EMAIL:W});o="<br /><br />"+k+":<blockquote><br />"+o+"</blockquote>";break;case g.ComposeType.Forward:W=n.fromToLine(!1,!0);r=n.toToLine(!1,!0);w=n.ccToLine(!1,!0);o="<br /><br /><br />"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+
|
|
"<br />"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+W+"<br />"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+r+(0<w.length?"<br />"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+w:"")+"<br />"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+d.encodeHtml(k)+"<br />"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+d.encodeHtml(h)+"<br /><br />"+o;break;case g.ComposeType.ForwardAsAttachment:o=""}this.oEditor.setRawText(o,n.isHtml)}}else this.oEditor&&g.ComposeType.Empty===a?this.oEditor.setRawText("<br />"+
|
|
d.convertPlainTextToHtml(e.data().signature()),g.EditorDefaultType.Html===e.data().editorDefaultType()):d.isNonEmptyArray(b)&&i.each(b,function(a){f.addMessageAsAttachment(a)});n=this.getAttachmentsDownloadsForUpload();d.isNonEmptyArray(n)&&e.remote().messageUploadAttachments(function(a,b){if(g.StorageResultType.Success===a&&b&&b.Result){var c=null,d="";if(!f.viewModelVisibility())for(d in b.Result)b.Result.hasOwnProperty(d)&&(c=f.getAttachmentById(b.Result[d]))&&c.tempName(d)}else f.setMessageAttachmentFailedDowbloadText()},
|
|
n);m&&this.oEditor&&this.oEditor.focus();this.triggerForResize()};y.prototype.onBuild=function(){this.initEditor();this.initUploader();var a=this,b=null;N.on("keydown",function(b){var d=!0;b&&(a.modalVisibility()&&e.data().useKeyboardShortcuts())&&(b.ctrlKey&&g.EventKeyCode.S===b.keyCode)&&(a.saveCommand(),d=!1);return d});N.on("resize",function(){a.triggerForResize()});this.dropboxEnabled()&&(b=document.createElement("script"),b.type="text/javascript",b.src="https://www.dropbox.com/static/api/1/dropins.js",
|
|
j(b).attr("id","dropboxjs").attr("data-app-key",e.settingsGet("DropboxApiKey")),document.body.appendChild(b))};y.prototype.getAttachmentById=function(a){for(var b=this.attachments(),c=0,d=b.length;c<d;c++)if(b[c]&&a===b[c].id)return b[c];return null};y.prototype.initEditor=function(){if(this.composeEditorTextArea()&&this.composeEditorHtmlArea()&&this.composeEditorToolbar()){var a=this;this.oEditor=new q(this.composeEditorTextArea(),this.composeEditorHtmlArea(),this.composeEditorToolbar(),{onSwitch:function(b){b||
|
|
a.removeLinkedAttachments()}});this.oEditor.initLanguage(d.i18n("EDITOR/TEXT_SWITCHER_CONFIRM"),d.i18n("EDITOR/TEXT_SWITCHER_PLAINT_TEXT"),d.i18n("EDITOR/TEXT_SWITCHER_RICH_FORMATTING"))}};y.prototype.initUploader=function(){if(this.composeUploaderButton()){var a={},b=d.pInt(e.settingsGet("AttachmentLimit")),c=new sa({action:e.link().upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace(),
|
|
onDragEnter:i.bind(function(){this.dragAndDropOver(!0)},this),onDragLeave:i.bind(function(){this.dragAndDropOver(!1)},this),onBodyDragEnter:i.bind(function(){this.dragAndDropVisible(!0)},this),onBodyDragLeave:i.bind(function(){this.dragAndDropVisible(!1)},this),onProgress:i.bind(function(b,c,e){var f=null;d.isUnd(a[b])?(f=this.getAttachmentById(b))&&(a[b]=f):f=a[b];f&&f.progress(" - "+Math.floor(100*(c/e))+"%")},this),onSelect:i.bind(function(a,e){this.dragAndDropOver(!1);var f=this,g=d.isUnd(e.FileName)?
|
|
"":e.FileName.toString(),i=d.isNormal(e.Size)?d.pInt(e.Size):null,g=new M(a,g,i);g.cancel=function(){f.attachments.remove(function(b){return b&&b.id===a});c&&c.cancel(a)};this.attachments.push(g);return 0<i&&0<b&&b<i?(g.error(d.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this),onStart:i.bind(function(b){var c=null;d.isUnd(a[b])?(c=this.getAttachmentById(b))&&(a[b]=c):c=a[b];c&&(c.waiting(!1),c.uploading(!0))},this),onComplete:i.bind(function(b,c,e){var f="",g=null,i=null,h=this.getAttachmentById(b),
|
|
i=c&&e&&e.Result&&e.Result.Attachment?e.Result.Attachment:null,g=e&&e.Result&&e.Result.ErrorCode?e.Result.ErrorCode:null;null!==g?f=d.getUploadErrorDescByCode(g):i||(f=d.i18n("UPLOAD/ERROR_UNKNOWN"));h&&(""!==f&&0<f.length?h.waiting(!1).uploading(!1).error(f):i&&(h.waiting(!1).uploading(!1),h.initByUploadJson(i)),d.isUnd(a[b])&&delete a[b])},this)});c?this.addAttachmentEnabled(!0).dragAndDropEnabled(c.isDragAndDropSupported()):this.addAttachmentEnabled(!1).dragAndDropEnabled(!1)}};y.prototype.prepearAttachmentsForSendOrSave=
|
|
function(){var a={};i.each(this.attachmentsInReady(),function(b){b&&(""!==b.tempName()&&b.enabled())&&(a[b.tempName()]=[b.fileName(),b.isInline?"1":"0",b.CID])});return a};y.prototype.addMessageAsAttachment=function(a){if(a){var b=this,c=null,c=a.subject(),c=".eml"===c.substr(-4).toLowerCase()?c:c+".eml",c=new M(a.requestHash,c,a.size());c.fromMessage=!0;var d=a.requestHash;c.cancel=function(){b.attachments.remove(function(a){return a&&a.id===d})};c.waiting(!1).uploading(!0);this.attachments.push(c)}};
|
|
y.prototype.addDropboxAttachment=function(a){var b=this,c=d.pInt(e.settingsGet("AttachmentLimit")),f=null,i=a.bytes,f=new M(a.link,a.name,i);f.fromMessage=!1;var r=a.link;f.cancel=function(){b.attachments.remove(function(a){return a&&a.id===r})};f.waiting(!1).uploading(!0);this.attachments.push(f);if(0<i&&0<c&&c<i)return f.uploading(!1),f.error(d.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1;e.remote().composeUploadExternals(function(a,b){var c=!1;f.uploading(!1);g.StorageResultType.Success===a&&(b&&b.Result)&&
|
|
b.Result[f.id]&&(c=!0,f.tempName(b.Result[f.id]));c||f.error(d.getUploadErrorDescByCode(g.UploadErrorCode.FileNoUploaded))},[a.link]);return!0};y.prototype.prepearMessageAttachments=function(a,b){if(a){var c=this,e=d.isNonEmptyArray(a.attachments())?a.attachments():[],f=0,i=e.length,h=null,k=null,j=function(a){return function(){c.attachments.remove(function(b){return b&&b.id===a})}};if(g.ComposeType.ForwardAsAttachment===b)this.addMessageAsAttachment(a);else for(;f<i;f++)k=e[f],h=new M(k.download,
|
|
k.fileName,k.estimatedSize,k.isInline,k.isLinked,k.cid),h.fromMessage=!0,h.cancel=j(k.download),h.waiting(!1).uploading(!0),this.attachments.push(h)}};y.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(a){return a&&a.isLinked})};y.prototype.setMessageAttachmentFailedDowbloadText=function(){i.each(this.attachments(),function(a){a&&a.fromMessage&&a.waiting(!1).uploading(!1).error(d.getUploadErrorDescByCode(g.UploadErrorCode.FileNoUploaded))},this)};y.prototype.isEmptyForm=
|
|
function(a){a=(a=d.isUnd(a)?!0:!!a)?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&a&&""===this.oEditor.getTextForRequest()};y.prototype.reset=function(){this.to([]);this.cc([]);this.bcc([]);this.subject("");this.aDraftInfo=null;this.sInReplyTo="";this.bFromDraft=!1;this.sReferences="";this.bReloadFolder=!1;this.sendError(!1);this.sendSuccessButSaveError(!1);this.savedError(!1);
|
|
this.savedTime(0);this.savedOrSendingText("");this.emptyToError(!1);this.showCcAndBcc(!1);this.attachments([]);this.dragAndDropOver(!1);this.dragAndDropVisible(!1);this.draftFolder("");this.draftUid("");this.sending(!1);this.saving(!1);this.oEditor&&this.oEditor.clear()};y.prototype.getAttachmentsDownloadsForUpload=function(){return i.map(i.filter(this.attachments(),function(a){return a&&""===a.tempName()}),function(a){return a.id})};y.prototype.triggerForResize=function(){this.resizer(!this.resizer())};
|
|
d.extendAsViewModel("PopupsContactsViewModel",L);L.prototype.removeCheckedOrSelectedContactsFromList=function(){var a=this,b=this.contacts,c=this.currentContact(),d=this.contactsCheckedOrSelected();0<d.length&&(i.each(d,function(b){c&&c.idContact===b.idContact&&(c=null,a.currentContact(null));b.deleted(!0)}),i.delay(function(){i.each(d,function(a){b.remove(a)})},500))};L.prototype.deleteSelectedContacts=function(){0<this.contactsCheckedOrSelected().length&&(e.remote().contactsDelete(i.bind(this.deleteResponse,
|
|
this),this.contactsCheckedOrSelectedUids()),this.removeCheckedOrSelectedContactsFromList())};L.prototype.deleteResponse=function(a,b){500<(g.StorageResultType.Success===a&&b&&b.Time?d.pInt(b.Time):0)?this.reloadContactList():i.delay(function(a){return function(){a.reloadContactList()}}(this),500)};L.prototype.populateViewContact=function(a){this.imageTrigger(!1);this.emptySelection(!1);a?(this.viewID(a.idContact),this.viewName(a.name),this.viewEmail(a.emails[0]||""),this.viewImageUrl(a.srcAttr())):
|
|
(this.viewID(""),this.viewName(""),this.viewEmail(""),this.viewImageUrl(e.link().emptyContactPic()))};L.prototype.reloadContactList=function(){var a=this;this.contacts.loading(!0);e.remote().contacts(function(b,c){var e=[];g.StorageResultType.Success===b&&(c&&c.Result&&c.Result.List)&&d.isNonEmptyArray(c.Result.List)&&(e=i.map(c.Result.List,function(a){var b=new ka;return b.parse(a)?b:null}),e=i.compact(e));a.contacts(e);a.viewClearSearch(""!==a.search());a.contacts.loading(!1);""!==a.viewID()&&(!a.currentContact()&&
|
|
a.contacts.setSelectedByUid)&&a.contacts.setSelectedByUid(""+a.viewID())},this.search())};L.prototype.onBuild=function(a){this.initUploader();this.oContentVisible=j(".b-list-content",a);this.oContentScrollable=j(".content",this.oContentVisible);this.selector.init(this.oContentVisible,this.oContentScrollable);this.viewImageUrl.valueHasMutated();f.computed(function(){var a=this.modalVisibility(),c=e.data().useKeyboardShortcuts();this.selector.useKeyboard(a&&c)},this).extend({notify:"always"})};L.prototype.initUploader=
|
|
function(){var a=this,b=null;h.File&&(h.FileReader&&this.imageUploader())&&(b=new sa({queueSize:1,multipleSizeLimit:1,clickElement:this.imageUploader(),disableDragAndDrop:!0,disableMultiple:!0,onSelect:function(b,e){if(e&&e.File&&e.File.type){var f=null,g=e.File;e.File.type.match(/image.*/)?(f=new h.FileReader,f.onload=function(b){b&&(b.target&&b.target.result)&&d.resizeAndCrop(b.target.result,150,function(b){a.viewImageUrl(b);a.imageTrigger(!0)})},f.readAsDataURL(g)):h.alert("this file is not an image.")}return!1}}));
|
|
return b};L.prototype.onShow=function(){s.routeOff();this.reloadContactList()};L.prototype.onHide=function(){s.routeOn();this.currentContact(null);this.emptySelection(!0);this.search("");i.each(this.contacts(),function(a){a.checked(!1)})};d.extendAsViewModel("PopupsAdvancedSearchViewModel",ca);ca.prototype.buildSearchStringValue=function(a){-1<a.indexOf(" ")&&(a='"'+a+'"');return a};ca.prototype.buildSearchString=function(){var a=[],b=d.trim(this.from()),c=d.trim(this.to()),e=d.trim(this.subject()),
|
|
f=d.trim(this.text());b&&""!==b&&a.push("from:"+this.buildSearchStringValue(b));c&&""!==c&&a.push("to:"+this.buildSearchStringValue(c));e&&""!==e&&a.push("subject:"+this.buildSearchStringValue(e));this.hasAttachments()&&a.push("has:attachments");-1<this.selectedDateValue()&&a.push("date:"+Y().subtract("days",this.selectedDateValue()).format("YYYY.MM.DD")+"/");f&&""!==f&&a.push("text:"+this.buildSearchStringValue(f));return d.trim(a.join(" "))};ca.prototype.clearPopup=function(){this.from("");this.to("");
|
|
this.subject("");this.text("");this.selectedDateValue(-1);this.hasAttachments(!1);this.fromFocus(!0)};ca.prototype.onShow=function(){this.clearPopup();this.fromFocus(!0)};d.extendAsViewModel("PopupsAddAccountViewModel",da);da.prototype.clearPopup=function(){this.email("");this.login("");this.password("");this.emailError(!1);this.loginError(!1);this.passwordError(!1);this.submitRequest(!1);this.submitError("")};da.prototype.onShow=function(){this.clearPopup();this.emailFocus(!0)};da.prototype.onBuild=
|
|
function(){this.allowCustomLogin(!!e.settingsGet("AllowCustomLogin"))};d.extendAsViewModel("LoginViewModel",la);la.prototype.onShow=function(){s.routeOff();i.delay(i.bind(function(){""!==this.email()&&""!==this.password()?this.submitFocus(!0):this.emailFocus(!0)},this),100)};la.prototype.onHide=function(){this.submitFocus(!1);this.emailFocus(!1)};la.prototype.onBuild=function(){var a=this,b=e.settingsGet("JsHash"),c=function(b){b=d.pInt(b);0===b?(a.submitRequest(!0),e.loginAndLogoutReload()):a.submitError(d.getNotification(b))};
|
|
this.allowCustomLogin(!!e.settingsGet("AllowCustomLogin"));this.facebookLoginEnabled(!!e.settingsGet("AllowFacebookSocial"));this.twitterLoginEnabled(!!e.settingsGet("AllowTwitterSocial"));this.googleLoginEnabled(!!e.settingsGet("AllowGoogleSocial"));switch((e.settingsGet("SignMe")||"unused").toLowerCase()){case g.LoginSignMeTypeAsString.DefaultOff:this.signMeType(g.LoginSignMeType.DefaultOff);break;case g.LoginSignMeTypeAsString.DefaultOn:this.signMeType(g.LoginSignMeType.DefaultOn);break;default:case g.LoginSignMeTypeAsString.Unused:this.signMeType(g.LoginSignMeType.Unused)}this.email(e.data().devEmail);
|
|
this.login(e.data().devLogin);this.password(e.data().devPassword);this.googleLoginEnabled()&&(h["rl_"+b+"_google_login_service"]=c);this.facebookLoginEnabled()&&(h["rl_"+b+"_facebook_login_service"]=c);this.twitterLoginEnabled()&&(h["rl_"+b+"_twitter_login_service"]=c)};i.extend(Q.prototype,C.prototype);Q.prototype.accountClick=function(a,b){if(a&&b&&!d.isUnd(b.which)&&1===b.which){var c=this;this.accountsLoading(!0);i.delay(function(){c.accountsLoading(!1)},1E3)}return!0};Q.prototype.emailTitle=
|
|
function(){return e.data().accountEmail()};Q.prototype.settingsClick=function(){s.setHash(e.link().settings())};Q.prototype.addAccountClick=function(){this.allowAddAccount&&s.showScreenPopup(da)};Q.prototype.logoutClick=function(){e.remote().logout(function(){h.__rlah_clear&&h.__rlah_clear();e.loginAndLogoutReload(!0,e.settingsGet("ParentEmail")&&0<e.settingsGet("ParentEmail").length)})};i.extend(Ya.prototype,Q.prototype);i.extend(Za.prototype,Q.prototype);d.extendAsViewModel("MailBoxFolderListViewModel",
|
|
ea);ea.prototype.onBuild=function(a){a.on("click",".b-folders .e-item .e-link .e-collapsed-sign",function(a){var c=f.dataFor(this),e=!1;c&&a&&(e=c.collapsed(),d.setExpandedFolder(c.fullNameHash,e),c.collapsed(!e),a.preventDefault(),a.stopPropagation())}).on("click",".b-folders .e-item .e-link.selectable",function(a){a.preventDefault();if(a=f.dataFor(this))e.data().usePreviewPane()||e.data().message(null),a.fullNameRaw===e.data().currentFolderFullNameRaw()&&e.cache().setFolderHash(a.fullNameRaw,""),
|
|
s.setHash(e.link().mailBox(a.fullNameHash))})};ea.prototype.messagesDrop=function(a,b){if(a&&b&&b.helper){var c=b.helper.data("rl-folder"),e=b.helper.data("rl-uids");z&&(z.__vm&&d.isNormal(c)&&d.isArray(e))&&z.__vm.moveMessagesToFolder(c,e,a.fullNameRaw)}};ea.prototype.composeClick=function(){s.showScreenPopup(y)};ea.prototype.contactsClick=function(){this.allowContacts&&s.showScreenPopup(L)};d.extendAsViewModel("MailBoxMessageListViewModel",z);z.prototype.emptySubjectValue="";z.prototype.searchEnterAction=
|
|
function(){this.mainMessageListSearch(this.sLastSearchValue);this.inputMessageListSearchFocus(!1)};z.prototype.cancelSearch=function(){this.mainMessageListSearch("");this.inputMessageListSearchFocus(!1)};z.prototype.removeMessagesFromList=function(a,b,c,f){var c=d.isNormal(c)?c:"",f=d.isUnd(f)?!1:!!f,g=0,r=e.data(),h=e.cache().getFolderFromCacheList(a),k=""===c?null:e.cache().getFolderFromCacheList(c||""),j=r.currentFolderFullNameRaw(),o=r.message(),m=j===a?i.filter(r.messageList(),function(a){return a&&
|
|
-1<d.inArray(a.uid,b)}):[];f||i.each(m,function(a){a&&a.unseen()&&g++});h&&!f&&(h.messageCountAll(0<=h.messageCountAll()-b.length?h.messageCountAll()-b.length:0),0<g&&h.messageCountUnread(0<=h.messageCountUnread()-g?h.messageCountUnread()-g:0));k&&!f&&(k.messageCountAll(k.messageCountAll()+b.length),0<g&&k.messageCountUnread(k.messageCountUnread()+g));0<m.length&&(i.each(m,function(a){if(o&&o.requestHash===a.requestHash){o=null;r.message(null)}a.deleted(true)}),i.delay(function(){i.each(m,function(a){r.messageList.remove(a)})},
|
|
400),f||(e.data().messageListIsNotCompleted(!0),e.cache().setFolderHash(a,""),d.isNormal(c)&&e.cache().setFolderHash(c||"","")))};z.prototype.removeCheckedOrSelectedMessagesFromList=function(a){this.removeMessagesFromList(e.data().currentFolderFullNameRaw(),i.map(e.data().messageListCheckedOrSelected(),function(a){return a.uid}),a)};z.prototype.moveOrDeleteResponse=function(a,b){g.StorageResultType.Success===a&&e.data().currentFolder()&&(b&&d.isArray(b.Result)&&2===b.Result.length?e.cache().setFolderHash(b.Result[0],
|
|
b.Result[1]):(b&&g.Notification.CantMoveMessage===b.ErrorCode&&h.alert(d.getNotification(g.Notification.CantMoveMessage)),e.cache().setFolderHash(e.data().currentFolderFullNameRaw(),"")),e.reloadMessageList(),e.quotaDebounce())};z.prototype.moveMessagesToFolder=function(a,b,c){if(a!==c&&d.isArray(b)&&0<b.length){var f=e.cache().getFolderFromCacheList(a),g=e.cache().getFolderFromCacheList(c);if(f&&g)return e.remote().messagesMove(i.bind(this.moveOrDeleteResponse,this),f.fullNameRaw,g.fullNameRaw,b),
|
|
g.actionBlink(!0),this.removeMessagesFromList(a,b,c),!0}return!1};z.prototype.moveSelectedMessagesToFolder=function(a){return this.canBeMoved()?this.moveMessagesToFolder(e.data().currentFolderFullNameRaw(),e.data().messageListCheckedOrSelectedUidsWithSubMails(),a):!1};z.prototype.deleteSelectedMessageFromCurrentFolder=function(a,b){if(this.canBeMoved()){var b=d.isUnd(b)?!0:!!b,c=e.cache().getFolderFromCacheList(g.FolderType.Spam===a?e.data().spamFolder():e.data().trashFolder());!c&&b?s.showScreenPopup(X,
|
|
[g.FolderType.Spam===a?g.SetSystemFoldersNotification.Spam:g.SetSystemFoldersNotification.Trash]):!b||c&&(t.Values.UnuseOptionValue===c.fullNameRaw||e.data().currentFolderFullNameRaw()===c.fullNameRaw)?(e.remote().messagesDelete(i.bind(this.moveOrDeleteResponse,this),e.data().currentFolderFullNameRaw(),e.data().messageListCheckedOrSelectedUidsWithSubMails()),this.removeCheckedOrSelectedMessagesFromList()):c&&(e.remote().messagesMove(i.bind(this.moveOrDeleteResponse,this),e.data().currentFolderFullNameRaw(),
|
|
c.fullNameRaw,e.data().messageListCheckedOrSelectedUidsWithSubMails()),c.actionBlink(!0),this.removeCheckedOrSelectedMessagesFromList(c.fullNameRaw))}};z.prototype.dragAndDronHelper=function(a){a&&a.checked(!0);a=d.draggeblePlace();a.data("rl-folder",e.data().currentFolderFullNameRaw());a.data("rl-uids",e.data().messageListCheckedOrSelectedUidsWithSubMails());a.find(".text").text(e.data().messageListCheckedOrSelectedUidsWithSubMails().length);return a};z.prototype.onMessageResponse=function(a,b,c){var f=
|
|
e.data();f.messageLoading(!1);g.StorageResultType.Success===a&&b&&b.Result?f.setMessage(b,c):g.StorageResultType.Unload===a?(f.message(null),f.messageError("")):g.StorageResultType.Abort!==a&&(f.message(null),f.messageError(b&&b.ErrorCode?d.getNotification(b.ErrorCode):d.getNotification(g.Notification.UnknownError)))};z.prototype.populateMessageBody=function(a){a&&(e.remote().message(this.onMessageResponse,a.folderFullNameRaw,a.uid)?e.data().messageLoading(!0):d.log("Error: Unknown message request: "+
|
|
a.folderFullNameRaw+" ~ "+a.uid+" [e-101]"))};z.prototype.setAction=function(a,b,c){var f=[],h=null,r=e.cache(),j=0;d.isUnd(c)&&(c=e.data().messageListChecked());f=i.map(c,function(a){return a.uid});if(""!==a&&0<f.length){switch(b){case g.MessageSetAction.SetSeen:i.each(c,function(a){a.unseen()&&j++;a.unseen(!1);r.storeMessageFlagsToCache(a)});(h=r.getFolderFromCacheList(a))&&h.messageCountUnread(h.messageCountUnread()-j);e.remote().messageSetSeen(d.emptyFunction,a,f,!0);break;case g.MessageSetAction.UnsetSeen:i.each(c,
|
|
function(a){a.unseen()&&j++;a.unseen(!0);r.storeMessageFlagsToCache(a)});(h=r.getFolderFromCacheList(a))&&h.messageCountUnread(h.messageCountUnread()-j+f.length);e.remote().messageSetSeen(d.emptyFunction,a,f,!1);break;case g.MessageSetAction.SetFlag:i.each(c,function(a){a.flagged(!0);r.storeMessageFlagsToCache(a)});e.remote().messageSetFlagged(d.emptyFunction,a,f,!0);break;case g.MessageSetAction.UnsetFlag:i.each(c,function(a){a.flagged(!1);r.storeMessageFlagsToCache(a)}),e.remote().messageSetFlagged(d.emptyFunction,
|
|
a,f,!1)}e.reloadFlagsCurrentMessageListAndMessageFromCache()}};z.prototype.setActionForAll=function(a,b){var c=null,f=e.data().messageList(),h=e.cache();if(""!==a&&(c=h.getFolderFromCacheList(a))){switch(b){case g.MessageSetAction.SetSeen:if(c=h.getFolderFromCacheList(a))i.each(f,function(a){a.unseen(!1)}),c.messageCountUnread(0),h.clearMessageFlagsFromCacheByFolder(a);e.remote().messageSetSeenToAll(d.emptyFunction,a,!0);break;case g.MessageSetAction.UnsetSeen:if(c=h.getFolderFromCacheList(a))i.each(f,
|
|
function(a){a.unseen(!0)}),c.messageCountUnread(c.messageCountAll()),h.clearMessageFlagsFromCacheByFolder(a);e.remote().messageSetSeenToAll(d.emptyFunction,a,!1)}e.reloadFlagsCurrentMessageListAndMessageFromCache()}};z.prototype.listSetSeen=function(){this.setAction(e.data().currentFolderFullNameRaw(),g.MessageSetAction.SetSeen,e.data().messageListCheckedOrSelected())};z.prototype.listSetAllSeen=function(){this.setActionForAll(e.data().currentFolderFullNameRaw(),g.MessageSetAction.SetSeen)};z.prototype.listUnsetSeen=
|
|
function(){this.setAction(e.data().currentFolderFullNameRaw(),g.MessageSetAction.UnsetSeen,e.data().messageListCheckedOrSelected())};z.prototype.listSetFlags=function(){this.setAction(e.data().currentFolderFullNameRaw(),g.MessageSetAction.SetFlag,e.data().messageListCheckedOrSelected())};z.prototype.listUnsetFlags=function(){this.setAction(e.data().currentFolderFullNameRaw(),g.MessageSetAction.UnsetFlag,e.data().messageListCheckedOrSelected())};z.prototype.onBuild=function(a){var b=this,c=e.data();
|
|
this.oContentVisible=j(".b-content",a);this.oContentScrollable=j(".content",this.oContentVisible);this.oContentVisible.on("click",".fullThreadHandle",function(){var a=[],b=f.dataFor(this);b&&!b.lastInCollapsedThreadLoading()&&(e.data().messageListThreadFolder(b.folderFullNameRaw),a=e.data().messageListThreadUids(),b.lastInCollapsedThread()?a.push(0<b.parentUid()?b.parentUid():b.uid):a=i.without(a,0<b.parentUid()?b.parentUid():b.uid),e.data().messageListThreadUids(i.uniq(a)),b.lastInCollapsedThreadLoading(!0),
|
|
b.lastInCollapsedThread(!b.lastInCollapsedThread()),e.reloadMessageList());return!1});this.selector.init(this.oContentVisible,this.oContentScrollable);Ea.on("keydown",function(a){var f=!0,i=a?a.keyCode:0;if(a&&b.viewModelVisibility()&&c.useKeyboardShortcuts()&&!e.popupVisibility()&&!c.messageFullScreenMode()&&!d.inFocus()&&(c.usePreviewPane()||!c.message()&&(g.EventKeyCode.Delete===i||g.EventKeyCode.A===i))&&a.ctrlKey&&g.EventKeyCode.A===i)b.checkAll(!(b.checkAll()&&!b.isIncompleteChecked())),f=!1;
|
|
return f});a.on("click",".pagenator .page",function(){var a=f.dataFor(this);a&&s.setHash(e.link().mailBox(c.currentFolderFullNameHash(),a.value,c.messageListSearch()))}).on("click",".messageList .checkboxCkeckAll",function(){b.checkAll(!b.checkAll())}).on("click",".messageList .messageListItem .flagParent",function(){var a=f.dataFor(this),e=c.messageListCheckedOrSelected(),h=[];a&&(0<e.length&&(h=i.map(e,function(a){return a.uid})),0<h.length&&-1<d.inArray(a.uid,h)?b.setAction(a.folderFullNameRaw,
|
|
a.flagged()?g.MessageSetAction.UnsetFlag:g.MessageSetAction.SetFlag,e):b.setAction(a.folderFullNameRaw,a.flagged()?g.MessageSetAction.UnsetFlag:g.MessageSetAction.SetFlag,[a]))});f.computed(function(){var a=e.data(),b=this.viewModelVisibility(),c=e.popupVisibility(),d=a.useKeyboardShortcuts(),a=a.messageFullScreenMode();this.selector.useKeyboard(b&&d&&!a&&!c)},this).extend({notify:"always"});this.initUploaderForAppend()};z.prototype.composeClick=function(){s.showScreenPopup(y)};z.prototype.advancedSearchClick=
|
|
function(){s.showScreenPopup(ca)};z.prototype.quotaTooltip=function(){return d.i18n("MESSAGE_LIST/QUOTA_SIZE",{SIZE:d.friendlySize(this.userUsageSize()),PROC:this.userUsageProc(),LIMIT:d.friendlySize(this.userQuota())})};z.prototype.initUploaderForAppend=function(){return!e.settingsGet("AllowAppendMessage")||!this.dragOverArea()?!1:!!new sa({action:e.link().append(),name:"AppendFile",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,hidden:{Folder:function(){return e.data().currentFolderFullNameRaw()}},
|
|
dragAndDropElement:this.dragOverArea(),dragAndDropBodyElement:this.dragOverBodyArea(),onDragEnter:i.bind(function(){this.dragOverEnter(true)},this),onDragLeave:i.bind(function(){this.dragOverEnter(false)},this),onBodyDragEnter:i.bind(function(){this.dragOver(true)},this),onBodyDragLeave:i.bind(function(){this.dragOver(false)},this),onSelect:i.bind(function(a,b){if(a&&b&&"message/rfc822"===b.Type){e.data().messageListLoading(true);return true}return false}),onComplete:i.bind(function(){e.reloadMessageList(true,
|
|
true)},this)})};d.extendAsViewModel("MailBoxMessageViewViewModel",H);H.prototype.scrollToTop=function(){var a=j(".messageItem.nano .content",this.viewModelDom);a&&a[0]?a.scrollTop(0):j(".messageItem",this.viewModelDom).scrollTop(0);d.windowResize()};H.prototype.fullScreen=function(){this.fullScreenMode(!0);d.windowResize()};H.prototype.unFullScreen=function(){this.fullScreenMode(!1);d.windowResize()};H.prototype.toggleFullScreen=function(){d.removeSelection();this.fullScreenMode(!this.fullScreenMode());
|
|
d.windowResize()};H.prototype.replyOrforward=function(a){s.showScreenPopup(y,[a,e.data().message()])};H.prototype.onBuild=function(a){var b=this,c=e.data();Ea.on("keydown",function(a){var e=!0,a=a?a.keyCode:0;if(0<a&&(g.EventKeyCode.Backspace===a||g.EventKeyCode.Esc===a)&&b.viewModelVisibility()&&c.useKeyboardShortcuts()&&!d.inFocus()&&c.message())b.fullScreenMode(!1),c.usePreviewPane()||c.message(null),e=!1;return e});j(".attachmentsPlace",a).magnificPopup({delegate:".magnificPopupImage:visible",
|
|
type:"image",preload:[1,1],gallery:{enabled:!0},callbacks:{open:function(){c.useKeyboardShortcuts(!1)},close:function(){c.useKeyboardShortcuts(!0)}},mainClass:"mfp-fade",removalDelay:300});a.on("click",".attachmentsPlace .attachmentPreview",function(a){a&&a.stopPropagation&&a.stopPropagation()}).on("click",".attachmentsPlace .attachmentItem",function(){var a=f.dataFor(this);a&&a.download&&e.download(a.linkDownload())});this.oMessageScrollerDom=(this.oMessageScrollerDom=a.find(".messageItem .content"))&&
|
|
this.oMessageScrollerDom[0]?this.oMessageScrollerDom:null};H.prototype.isDraftFolder=function(){return e.data().message()&&e.data().draftFolder()===e.data().message().folderFullNameRaw};H.prototype.isSentFolder=function(){return e.data().message()&&e.data().sentFolder()===e.data().message().folderFullNameRaw};H.prototype.isDraftOrSentFolder=function(){return this.isDraftFolder()||this.isSentFolder()};H.prototype.composeClick=function(){s.showScreenPopup(y)};H.prototype.editMessage=function(){e.data().message()&&
|
|
s.showScreenPopup(y,[g.ComposeType.Draft,e.data().message()])};H.prototype.scrollMessageToTop=function(){this.oMessageScrollerDom&&this.oMessageScrollerDom.scrollTop(0)};H.prototype.showImages=function(a){a&&a.showExternalImages&&a.showExternalImages(!0)};d.extendAsViewModel("SettingsMenuViewModel",ya);ya.prototype.link=function(a){return e.link().settings(a)};ya.prototype.backToMailBoxClick=function(){s.setHash(e.link().inbox())};d.extendAsViewModel("SettingsPaneViewModel",za);za.prototype.onShow=
|
|
function(){e.data().message(null)};za.prototype.backToMailBoxClick=function(){s.setHash(e.link().inbox())};d.addSettingsViewModel(Ma,"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0);Ma.prototype.onBuild=function(){var a=this;i.delay(function(){var b=e.data(),c=d.settingsSaveHelperSimpleFunction(a.mppTrigger,a);b.language.subscribe(function(b){a.languageTrigger(g.SaveSettingsStep.Animate);j.ajax({url:e.link().langLink(b),dataType:"script",cache:!0}).done(function(){d.i18nToDoc();
|
|
a.languageTrigger(g.SaveSettingsStep.TrueResult)}).fail(function(){a.languageTrigger(g.SaveSettingsStep.FalseResult)}).always(function(){i.delay(function(){a.languageTrigger(g.SaveSettingsStep.Idle)},1E3)});e.remote().saveSettings(d.emptyFunction,{Language:b})});b.editorDefaultType.subscribe(function(a){e.remote().saveSettings(d.emptyFunction,{EditorDefaultType:a})});b.messagesPerPage.subscribe(function(a){e.remote().saveSettings(c,{MPP:a})});b.showImages.subscribe(function(a){e.remote().saveSettings(d.emptyFunction,
|
|
{ShowImages:a?"1":"0"})});b.showAnimation.subscribe(function(a){e.remote().saveSettings(d.emptyFunction,{ShowAnimation:a?"1":"0"})});b.useDesktopNotifications.subscribe(function(a){d.timeOutAction("SaveDesktopNotifications",function(){e.remote().saveSettings(d.emptyFunction,{DesktopNotifications:a?"1":"0"})},3E3)});b.replySameFolder.subscribe(function(a){d.timeOutAction("SaveReplySameFolder",function(){e.remote().saveSettings(d.emptyFunction,{ReplySameFolder:a?"1":"0"})},3E3)});b.useThreads.subscribe(function(a){b.messageList([]);
|
|
e.remote().saveSettings(d.emptyFunction,{UseThreads:a?"1":"0"})});b.usePreviewPane.subscribe(function(a){b.messageList.valueHasMutated();e.remote().saveSettings(d.emptyFunction,{UsePreviewPane:a?"1":"0"})});b.useCheckboxesInList.subscribe(function(a){e.remote().saveSettings(d.emptyFunction,{UseCheckboxesInList:a?"1":"0"})})},50)};Ma.prototype.onShow=function(){e.data().desktopNotifications.valueHasMutated()};d.addSettingsViewModel($a,"SettingsPersonal","SETTINGS_LABELS/LABEL_PERSONAL_NAME","personal");
|
|
$a.prototype.onBuild=function(){var a=this;i.delay(function(){var b=e.data(),c=d.settingsSaveHelperSimpleFunction(a.nameTrigger,a),f=d.settingsSaveHelperSimpleFunction(a.replyTrigger,a),g=d.settingsSaveHelperSimpleFunction(a.signatureTrigger,a);b.displayName.subscribe(function(a){e.remote().saveSettings(c,{DisplayName:a})});b.replyTo.subscribe(function(a){e.remote().saveSettings(f,{ReplyTo:a})});b.signature.subscribe(function(a){e.remote().saveSettings(g,{Signature:a})})},50)};d.addSettingsViewModel(ma,
|
|
"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts");ma.prototype.addNewAccount=function(){s.showScreenPopup(da)};ma.prototype.deleteAccount=function(a){if(a&&a.deleteAccess()){this.accountForDeletion(null);var b=function(b){return a===b};a&&(e.data().accounts.remove(b),e.remote().accountDelete(function(){e.accounts()},a.email))}};d.addSettingsViewModel(Na,"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social");d.addSettingsViewModel(na,"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME",
|
|
"change-password");na.prototype.onHide=function(){this.changeProcess(!1);this.currentPassword("");this.newPassword("")};na.prototype.onChangePasswordResponse=function(a,b){this.changeProcess(!1);g.StorageResultType.Success===a&&b&&b.Result?(this.currentPassword(""),this.newPassword(""),this.passwordUpdateSuccess(!0)):this.passwordUpdateError(!0)};d.addSettingsViewModel(R,"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders");R.prototype.folderEditOnEnter=function(a){var b=a?d.trim(a.nameForEdit()):
|
|
"";""!==b&&a.name()!==b&&(e.local().set(g.ClientSideKeyName.FoldersLashHash,""),e.data().foldersRenaming(!0),e.remote().folderRename(function(a,b){e.data().foldersRenaming(!1);if(g.StorageResultType.Success!==a||!b||!b.Result)e.data().foldersListError(b&&b.ErrorCode?d.getNotification(b.ErrorCode):d.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"));e.folders(!1)},a.fullNameRaw,b),e.cache().removeFolderFromCacheList(a.fullNameRaw),a.name(b));a.edited(!1)};R.prototype.folderEditOnEsc=function(a){a&&a.edited(!1)};
|
|
R.prototype.onShow=function(){e.data().foldersListError("")};R.prototype.createFolder=function(){s.showScreenPopup(ba)};R.prototype.systemFolder=function(){s.showScreenPopup(X)};R.prototype.deleteFolder=function(a){if(a&&a.canBeDeleted()&&a.deleteAccess()&&0===a.privateMessageCountAll()){this.folderForDeletion(null);var b=function(c){if(a===c)return!0;c.subFolders.remove(b);return!1};a&&(e.local().set(g.ClientSideKeyName.FoldersLashHash,""),e.data().folderList.remove(b),e.data().foldersDeleting(!0),
|
|
e.remote().folderDelete(function(a,b){e.data().foldersDeleting(!1);if(g.StorageResultType.Success!==a||!b||!b.Result)e.data().foldersListError(b&&b.ErrorCode?d.getNotification(b.ErrorCode):d.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"));e.folders(!1)},a.fullNameRaw),e.cache().removeFolderFromCacheList(a.fullNameRaw))}else 0<a.privateMessageCountAll()&&e.data().foldersListError(d.getNotification(g.Notification.CantDeleteNonEmptyFolder))};R.prototype.subscribeFolder=function(a){e.local().set(g.ClientSideKeyName.FoldersLashHash,
|
|
"");e.remote().folderSetSubscribe(d.emptyFunction,a.fullNameRaw,!0);a.subScribed(!0)};R.prototype.unSubscribeFolder=function(a){e.local().set(g.ClientSideKeyName.FoldersLashHash,"");e.remote().folderSetSubscribe(d.emptyFunction,a.fullNameRaw,!1);a.subScribed(!1)};d.addSettingsViewModel(Aa,"SettingsThemes","SETTINGS_LABELS/LABEL_THEMES_NAME","themes");Aa.prototype.removeCustomThemeImg=function(){this.customThemeImg("")};Aa.prototype.onBuild=function(){var a=this,b=e.data().theme();this.themesObjects(i.map(e.data().themes(),
|
|
function(a){return{name:a,nameDisplay:d.convertThemeName(a),selected:f.observable(a===b),themePreviewSrc:e.link().themePreviewLink(a)}}));i.delay(function(){a.customThemeType.subscribe(function(a){e.remote().saveSettings(function(){e.data().theme.valueHasMutated()},{CustomThemeType:a})});a.customThemeImg.subscribe(function(a){e.remote().saveSettings(function(){e.data().theme.valueHasMutated()},{CustomThemeImg:a})})},50);this.initCustomThemeUploader()};Aa.prototype.initCustomThemeUploader=function(){return this.customThemeUploaderButton()?
|
|
!!new sa({action:e.link().uploadBackground(),name:"uploader",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,clickElement:this.customThemeUploaderButton(),onSelect:i.bind(function(a,b){var c=d.isUnd(b.FileName)?"":b.FileName.toString(),c=c.substring(c.length-4,c.length),e=d.isNormal(b.Size)?d.pInt(b.Size):null;return-1===d.inArray(c,["jpeg",".jpg",".png"])?(h.alert(d.i18n("SETTINGS_THEMES/ERROR_FILE_TYPE_ERROR")),!1):1048576<e?(h.alert(d.i18n("SETTINGS_THEMES/ERROR_FILE_IS_TOO_BIG")),
|
|
!1):!0},this),onStart:i.bind(function(){this.customThemeUploaderProgress(!0)},this),onComplete:i.bind(function(a,b,c){!b||!c||!c.Result?h.alert(c&&c.ErrorCode?d.getUploadErrorDescByCode(c.ErrorCode):d.getUploadErrorDescByCode(g.UploadErrorCode.Unknown)):this.customThemeImg(c.Result);this.customThemeUploaderProgress(!1)},this)}):!1};Oa.prototype.populateDataOnStart=function(){var a=e.settingsGet("Languages"),b=e.settingsGet("Themes");d.isArray(a)&&this.languages(a);d.isArray(b)&&this.themes(b);this.mainLanguage(e.settingsGet("Language"));
|
|
this.mainTheme(e.settingsGet("Theme"));this.allowCustomTheme(!!e.settingsGet("AllowCustomTheme"));this.allowAdditionalAccounts(!!e.settingsGet("AllowAdditionalAccounts"));this.ignoreFolderSubscribe(!!e.settingsGet("IgnoreFolderSubscribe"));this.editorDefaultType(e.settingsGet("EditorDefaultType"));this.showImages(!!e.settingsGet("ShowImages"));this.showAnimation(!!e.settingsGet("ShowAnimation"));this.mainMessagesPerPage(e.settingsGet("MPP"));this.desktopNotifications(!!e.settingsGet("DesktopNotifications"));
|
|
this.useThreads(!!e.settingsGet("UseThreads"));this.replySameFolder(!!e.settingsGet("ReplySameFolder"));this.usePreviewPane(!!e.settingsGet("UsePreviewPane"));this.useCheckboxesInList(!!e.settingsGet("UseCheckboxesInList"));this.facebookEnable(!!e.settingsGet("AllowFacebookSocial"));this.facebookAppID(e.settingsGet("FacebookAppID"));this.facebookAppSecret(e.settingsGet("FacebookAppSecret"));this.twitterEnable(!!e.settingsGet("AllowTwitterSocial"));this.twitterConsumerKey(e.settingsGet("TwitterConsumerKey"));
|
|
this.twitterConsumerSecret(e.settingsGet("TwitterConsumerSecret"));this.googleEnable(!!e.settingsGet("AllowGoogleSocial"));this.googleClientID(e.settingsGet("GoogleClientID"));this.googleClientSecret(e.settingsGet("GoogleClientSecret"));this.dropboxEnable(!!e.settingsGet("AllowDropboxSocial"));this.dropboxApiKey(e.settingsGet("DropboxApiKey"));this.contactsIsSupported(!!e.settingsGet("ContactsIsSupported"))};i.extend(S.prototype,Oa.prototype);S.prototype.populateDataOnStart=function(){Oa.prototype.populateDataOnStart.call(this);
|
|
this.accountEmail(e.settingsGet("Email"));this.accountLogin(e.settingsGet("Login"));this.projectHash(e.settingsGet("ProjectHash"));this.displayName(e.settingsGet("DisplayName"));this.replyTo(e.settingsGet("ReplyTo"));this.signature(e.settingsGet("Signature"));this.lastFoldersHash=e.local().get(g.ClientSideKeyName.FoldersLashHash);this.remoteSuggestions=!!e.settingsGet("RemoteSuggestions");this.remoteChangePassword=!!e.settingsGet("RemoteChangePassword");this.threading=!!e.settingsGet("UseImapThread");
|
|
this.devEmail=e.settingsGet("DevEmail");this.devLogin=e.settingsGet("DevLogin");this.devPassword=e.settingsGet("DevPassword")};S.prototype.initUidNextAndNewMessages=function(a,b,c){if("INBOX"===a&&d.isNormal(b)&&""!==b){if(d.isArray(c)&&0<c.length){var f=e.cache(),g=0,r=c.length,j=function(a,b,c){var d=null;if(ja&&e.data().useDesktopNotifications()&&(d=new ja(b,{body:c,icon:a})))d.show&&d.show(),h.setTimeout(function(a){return function(){a.cancel?a.cancel():a.close&&a.close()}}(d),7E3)};i.each(c,
|
|
function(b){f.addNewMessageCache(a,b.Uid)});if(3<r)j(e.link().notificationMailIcon(),e.data().accountEmail(),d.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;g<r;g++)j(e.link().notificationMailIcon(),m.emailsToLine(m.initEmailsFromJson(c[g].From),!1),c[g].Subject)}e.cache().setFolderUidNext(a,b)}};S.prototype.folderResponseParseRec=function(a,b,c){for(var f=0,g=0,i=null,h=null,j="",i=[],m=[],c=!!c,f=0,g=b.length;f<g;f++)if(i=b[f]){j=i.FullNameRaw;h=e.cache().getFolderFromCacheList(j);
|
|
if(!h&&(h=G.newInstanceFromJson(i)))if(e.cache().setFolderToCacheList(j,h),e.cache().setFolderFullNameRaw(h.fullNameHash,j),h.isGmailFolder=t.Values.GmailFolderName.toLowerCase()===j.toLowerCase(),""!==a&&a===h.fullNameRaw+h.delimiter&&(h.isNamespaceFolder=!0),h.isNamespaceFolder||h.isGmailFolder)h.isUnpaddigFolder=!0;h&&(h.collapsed(!d.isFolderExpanded(h.fullNameHash)),!c&&i.Extended&&(i.Extended.Hash&&e.cache().setFolderHash(h.fullNameRaw,i.Extended.Hash),d.isNormal(i.Extended.MessageCount)&&h.messageCountAll(i.Extended.MessageCount),
|
|
d.isNormal(i.Extended.MessageUnseenCount)&&h.messageCountUnread(i.Extended.MessageUnseenCount)),(i=i.SubFolders)&&("Collection/FolderCollection"===i["@Object"]&&i["@Collection"]&&d.isArray(i["@Collection"]))&&h.subFolders(this.folderResponseParseRec(a,i["@Collection"],c)),m.push(h))}return m};S.prototype.setFolders=function(a,b){var c=[],f=!1,h=e.data(),i=0===h.folderList().length,j=function(a){return""===a||t.Values.UnuseOptionValue===a||null!==e.cache().getFolderFromCacheList(a)?a:""};a&&(a.Result&&
|
|
"Collection/FolderCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&d.isArray(a.Result["@Collection"]))&&(d.isUnd(a.Result.Namespace)||(h.namespace=a.Result.Namespace),c=this.folderResponseParseRec(h.namespace,a.Result["@Collection"],!!b),h.folderList(c),a.Result.SystemFolders&&""===""+e.settingsGet("SentFolder")+e.settingsGet("DraftFolder")+e.settingsGet("SpamFolder")+e.settingsGet("TrashFolder")&&(e.settingsSet("SentFolder",a.Result.SystemFolders[2]||null),e.settingsSet("DraftFolder",
|
|
a.Result.SystemFolders[3]||null),e.settingsSet("SpamFolder",a.Result.SystemFolders[4]||null),e.settingsSet("TrashFolder",a.Result.SystemFolders[5]||null),f=!0),h.sentFolder(j(e.settingsGet("SentFolder"))),h.draftFolder(j(e.settingsGet("DraftFolder"))),h.spamFolder(j(e.settingsGet("SpamFolder"))),h.trashFolder(j(e.settingsGet("TrashFolder"))),f&&e.remote().saveSystemFolders(d.emptyFunction,{SentFolder:h.sentFolder(),DraftFolder:h.draftFolder(),SpamFolder:h.spamFolder(),TrashFolder:h.trashFolder()}),
|
|
b||e.local().set(g.ClientSideKeyName.FoldersLashHash,a.Result.FoldersHash),i&&b&&e.folders(!1))};S.prototype.hideMessageBodies=function(){var a=this.messagesBodiesDom();a&&a.find(".b-text-part").hide()};S.prototype.setMessage=function(a,b){var c=!1,f=!1,g=!1,h=null,f=null,c="",i=this.messagesBodiesDom(),k=this.message();if(a&&k&&a.Result&&"Object/Message"===a.Result["@Object"]&&k.folderFullNameRaw===a.Result.Folder&&k.uid===a.Result.Uid){this.messageError("");k.initUpdateByMessageJson(a.Result);e.cache().addRequestedMessage(k.folderFullNameRaw,
|
|
k.uid);b||k.initFlagsByJson(a.Result);if(i=i&&i[0]?i:null)c="rl-"+k.requestHash.replace(/[^a-zA-Z0-9]/g,""),f=i.find("#"+c),!f||!f[0]?(f=!!a.Result.HasExternals,g=!!a.Result.HasInternals,h=j('<div id="'+c+'" />').hide(),d.isNormal(a.Result.Html)&&""!==a.Result.Html?(c=!0,h.html(a.Result.Html.toString()).addClass("b-text-part html")):d.isNormal(a.Result.Plain)&&""!==a.Result.Plain?(c=!1,h.html(a.Result.Plain.toString()).addClass("b-text-part plain")):c=!1,i.append(h),h.data("rl-is-html",c),h.data("rl-has-images",
|
|
f),k.isHtml(h.data("rl-is-html")),k.hasImages(h.data("rl-has-images")),k.body=h,g&&k.showInternalImages(!0),k.hasImages()&&this.showImages()&&k.showExternalImages(!0)):(k.isHtml(f.data("rl-is-html")),k.hasImages(f.data("rl-has-images")),k.body=f),this.messageActiveDom(k.body),this.hideMessageBodies(),k.body.show(),h&&d.initBlockquoteSwitcher(h);e.cache().initMessageFlagsFromCache(k);k.unseen()&&e.setMessageSeen(k);d.windowResize()}};S.prototype.setMessageList=function(a,b){if(a&&a.Result&&"Collection/MessageCollection"===
|
|
a.Result["@Object"]&&a.Result["@Collection"]&&d.isArray(a.Result["@Collection"])){var c=e.data(),f=e.cache(),h=null,i=0,j=0,k=0,s=0,o=[],t=c.staticMessageList,n=null,p=null,q=null,u=0,v=!1,k=d.pInt(a.Result.MessageResultCount),s=d.pInt(a.Result.Offset);d.isNonEmptyArray(a.Result.LastCollapsedThreadUids)&&(h=a.Result.LastCollapsedThreadUids);if((q=e.cache().getFolderFromCacheList(d.isNormal(a.Result.Folder)?a.Result.Folder:""))&&!b)e.cache().setFolderHash(a.Result.Folder,a.Result.FolderHash),d.isNormal(a.Result.MessageCount)&&
|
|
q.messageCountAll(a.Result.MessageCount),d.isNormal(a.Result.MessageUnseenCount)&&(d.pInt(q.messageCountUnread())!==d.pInt(a.Result.MessageUnseenCount)&&(v=!0),q.messageCountUnread(a.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(q.fullNameRaw,a.Result.UidNext,a.Result.NewMessages);v&&q&&e.cache().clearMessageFlagsFromCacheByFolder(q.fullNameRaw);i=0;for(j=a.Result["@Collection"].length;i<j;i++)if((n=a.Result["@Collection"][i])&&"Object/Message"===n["@Object"]){p=t[i];if(!p||!p.initByJson(n))p=
|
|
m.newInstanceFromJson(n);p&&(f.hasNewMessageAndRemoveFromCache(p.folderFullNameRaw,p.uid)&&5>=u&&(u++,p.newForAnimation(!0)),p.deleted(!1),b?e.cache().initMessageFlagsFromCache(p):e.cache().storeMessageFlagsToCache(p),p.lastInCollapsedThread(h&&-1<d.inArray(d.pInt(p.uid),h)?!0:!1),o.push(p))}c.messageListCount(k);c.messageListSearch(d.isNormal(a.Result.Search)?a.Result.Search:"");c.messageListEndSearch(d.isNormal(a.Result.Search)?a.Result.Search:"");c.messageListEndFolder(d.isNormal(a.Result.Folder)?
|
|
a.Result.Folder:"");c.messageListPage(Math.ceil(s/c.messagesPerPage()+1));c.messageList(o);c.messageListIsNotCompleted(!1);(p=c.message())&&c.messageList.setSelectedByUid&&c.messageList.setSelectedByUid(p.generateUid());t.length<o.length&&(c.staticMessageList=o);f.clearNewMessageCache();q&&(b||v||e.data().useThreads())&&e.folderInformation(q.fullNameRaw,o)}else e.data().messageListCount(0),e.data().messageList([]),e.data().messageListError(d.getNotification(a&&a.ErrorCode?a.ErrorCode:g.Notification.CantGetMessageList))};
|
|
aa.prototype.oRequests={};aa.prototype.defaultResponse=function(a,b,c,d,f,j){var w=function(){g.StorageResultType.Success!==c&&Qa&&(c=g.StorageResultType.Unload);if(g.StorageResultType.Success===c&&d&&!d.Result){if(d&&g.Notification.AuthError===d.ErrorCode&&Ca++,d.Logout||5<Ca)h.__rlah_clear&&h.__rlah_clear(),e.loginAndLogoutReload(!0)}else g.StorageResultType.Success===c&&(d&&d.Result)&&(Ca=0);a&&(x.runHook("ajax-default-response",[b,g.StorageResultType.Success===c?d:null,c,f,j]),a(c,g.StorageResultType.Success===
|
|
c?d:null,f,b,j))};switch(c){case "success":c=g.StorageResultType.Success;break;case "abort":c=g.StorageResultType.Abort;break;default:c=g.StorageResultType.Error}g.StorageResultType.Error===c?i.delay(w,300):w()};aa.prototype.ajaxRequest=function(a,b,c,f,g){var r=this,w=""===f,k=(new h.Date).getTime(),m=null,o="",b=b||{},c=d.isNormal(c)?c:2E4,f=d.isUnd(f)?"":d.pString(f),g=d.isArray(g)?g:[];(o=b.Action||"")&&0<g.length&&i.each(g,function(a){r.oRequests[a]&&(r.oRequests[a].__aborted=!0,r.oRequests[a].abort&&
|
|
r.oRequests[a].abort(),r.oRequests[a]=null)});w&&(b.XToken=e.settingsGet("Token"));m=j.ajax({type:w?"POST":"GET",url:e.link().ajax(f),async:!0,dataType:"json",data:w?b:{},headers:{},timeout:c,global:!0});m.always(function(c,e){var f=!1;c&&c.Time&&(f=d.pInt(c.Time)>(new h.Date).getTime()-k);o&&r.oRequests[o]&&(r.oRequests[o].__aborted&&(e="abort"),r.oRequests[o]=null);r.defaultResponse(a,o,e,c,f,b)});o&&(0<g.length&&-1<d.inArray(o,g))&&(this.oRequests[o]&&(this.oRequests[o].__aborted=!0,this.oRequests[o].abort&&
|
|
this.oRequests[o].abort(),this.oRequests[o]=null),this.oRequests[o]=m);return m};aa.prototype.defaultRequest=function(a,b,c,e,f,g){c=c||{};c.Action=b;f=d.pString(f);x.runHook("ajax-default-request",[b,c,f]);this.ajaxRequest(a,c,d.isUnd(e)?t.Defaults.DefaultAjaxTimeout:d.pInt(e),f,g)};aa.prototype.noop=function(a){this.defaultRequest(a,"Noop")};aa.prototype.jsError=function(a,b,c,d){this.defaultRequest(a,"JsError",{Message:b,FileName:c,LineNo:d})};i.extend(p.prototype,aa.prototype);p.prototype.folders=
|
|
function(a,b){var c=e.data().lastFoldersHash;(b=d.isUnd(b)?!1:!!b)&&""!==c?this.defaultRequest(a,"Folders",{},null,"Folders/"+e.data().projectHash()+"-"+c,["Folders"]):this.defaultRequest(a,"Folders",{},null,"",["Folders"])};p.prototype.login=function(a,b,c,d,e){this.defaultRequest(a,"Login",{Email:b,Login:c,Password:d,SignMe:e?"1":"0"})};p.prototype.accountAdd=function(a,b,c,d){this.defaultRequest(a,"AccountAdd",{Email:b,Login:c,Password:d})};p.prototype.accountDelete=function(a,b){this.defaultRequest(a,
|
|
"AccountDelete",{EmailToDelete:b})};p.prototype.accounts=function(a){this.defaultRequest(a,"Accounts")};p.prototype.messageList=function(a,b,c,f,g,h){var b=d.pString(b),i=e.data(),j=e.cache().getFolderHash(b),h=d.isUnd(h)?!1:!!h,c=d.isUnd(c)?0:d.pInt(c),f=d.isUnd(c)?20:d.pInt(f),g=d.pString(g);""!==j?this.defaultRequest(a,"MessageList",{},""===g?t.Defaults.DefaultAjaxTimeout:t.Defaults.SearchAjaxTimeout,"MessageList/"+ga.urlsafe_encode([b,c,f,g,i.projectHash(),j,"INBOX"===b?e.cache().getFolderUidNext(b):
|
|
"",i.threading&&i.useThreads()?"1":"0",i.threading&&b===i.messageListThreadFolder()?i.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),h?[]:["MessageList"]):this.defaultRequest(a,"MessageList",{Folder:b,Offset:c,Limit:f,Search:g,UidNext:"INBOX"===b?e.cache().getFolderUidNext(b):"",UseThreads:e.data().threading&&e.data().useThreads()?"1":"0",ExpandedThreadUid:i.threading&&b===i.messageListThreadFolder()?i.messageListThreadUids().join(","):""},""===g?t.Defaults.DefaultAjaxTimeout:
|
|
t.Defaults.SearchAjaxTimeout,"",h?[]:["MessageList"])};p.prototype.messageUploadAttachments=function(a,b){this.defaultRequest(a,"MessageUploadAttachments",{Attachments:b},999E3)};p.prototype.message=function(a,b,c){b=d.pString(b);c=d.pInt(c);return e.cache().getFolderFromCacheList(b)&&0<c?(this.defaultRequest(a,"Message",{},null,"Message/"+ga.urlsafe_encode([b,c,e.data().projectHash(),e.data().threading&&e.data().useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1};p.prototype.composeUploadExternals=
|
|
function(a,b){this.defaultRequest(a,"ComposeUploadExternals",{Externals:b},999E3)};p.prototype.folderInformation=function(a,b,c){var f=!0,g=e.cache(),h=[];d.isArray(c)&&0<c.length&&(f=!1,i.each(c,function(a){g.getMessageFlagsFromCache(a.folderFullNameRaw,a.uid)||h.push(a.uid);0<a.threads().length&&i.each(a.threads(),function(b){g.getMessageFlagsFromCache(a.folderFullNameRaw,b)||h.push(b)})}),0<h.length&&(f=!0));f?this.defaultRequest(a,"FolderInformation",{Folder:b,FlagsUids:d.isArray(h)?h.join(","):
|
|
"",UidNext:"INBOX"===b?e.cache().getFolderUidNext(b):""}):e.data().useThreads()&&e.reloadFlagsCurrentMessageListAndMessageFromCache()};p.prototype.logout=function(a){this.defaultRequest(a,"Logout")};p.prototype.messageSetFlagged=function(a,b,c,d){this.defaultRequest(a,"MessageSetFlagged",{Folder:b,Uids:c.join(","),SetAction:d?"1":"0"})};p.prototype.messageSetSeen=function(a,b,c,d){this.defaultRequest(a,"MessageSetSeen",{Folder:b,Uids:c.join(","),SetAction:d?"1":"0"})};p.prototype.messageSetSeenToAll=
|
|
function(a,b,c){this.defaultRequest(a,"MessageSetSeenToAll",{Folder:b,SetAction:c?"1":"0"})};p.prototype.saveMessage=function(a,b,c,d,e,f,g,h,i,j,m,n,p,q){this.defaultRequest(a,"SaveMessage",{MessageFolder:b,MessageUid:c,DraftFolder:d,To:e,Cc:f,Bcc:g,Subject:h,TextIsHtml:i?"1":"0",Text:j,DraftInfo:n,InReplyTo:p,References:q,Attachments:m},t.Defaults.SaveMessageAjaxTimeout)};p.prototype.sendMessage=function(a,b,c,d,e,f,g,h,i,j,m,n,p,q){this.defaultRequest(a,"SendMessage",{MessageFolder:b,MessageUid:c,
|
|
SentFolder:d,To:e,Cc:f,Bcc:g,Subject:h,TextIsHtml:i?"1":"0",Text:j,DraftInfo:n,InReplyTo:p,References:q,Attachments:m},t.Defaults.SendMessageAjaxTimeout)};p.prototype.saveSystemFolders=function(a,b){this.defaultRequest(a,"SystemFoldersUpdate",b)};p.prototype.saveSettings=function(a,b){this.defaultRequest(a,"SettingsUpdate",b)};p.prototype.changePassword=function(a,b,c){this.defaultRequest(a,"ChangePassword",{PrevPassword:b,NewPassword:c})};p.prototype.folderCreate=function(a,b,c){this.defaultRequest(a,
|
|
"FolderCreate",{Folder:b,Parent:c},null,"",["Folders"])};p.prototype.folderDelete=function(a,b){this.defaultRequest(a,"FolderDelete",{Folder:b},null,"",["Folders"])};p.prototype.folderRename=function(a,b,c){this.defaultRequest(a,"FolderRename",{Folder:b,NewFolderName:c},null,"",["Folders"])};p.prototype.folderClear=function(a,b){this.defaultRequest(a,"FolderClear",{Folder:b})};p.prototype.folderSetSubscribe=function(a,b,c){this.defaultRequest(a,"FolderSubscribe",{Folder:b,Subscribe:c?"1":"0"})};p.prototype.messagesMove=
|
|
function(a,b,c,d){this.defaultRequest(a,"MessageMove",{FromFolder:b,ToFolder:c,Uids:d.join(",")},null,"",["MessageList","Message"])};p.prototype.messagesDelete=function(a,b,c){this.defaultRequest(a,"MessageDelete",{Folder:b,Uids:c.join(",")},null,"",["MessageList","Message"])};p.prototype.appDelayStart=function(a){this.defaultRequest(a,"AppDelayStart")};p.prototype.quota=function(a){this.defaultRequest(a,"Quota")};p.prototype.contacts=function(a,b){this.defaultRequest(a,"Contacts",{Search:b},null,
|
|
"",["Contacts"])};p.prototype.contactSave=function(a,b,c,e,f,g){c=d.trim(c);this.defaultRequest(a,"ContactSave",{RequestUid:b,Uid:c,Name:e,Email:f,ImageData:g})};p.prototype.contactsDelete=function(a,b){this.defaultRequest(a,"ContactsDelete",{Uids:b.join(",")})};p.prototype.suggestions=function(a,b,c){this.defaultRequest(a,"Suggestions",{Query:b,Page:c},null,"",["Suggestions"])};p.prototype.servicesPics=function(a){this.defaultRequest(a,"ServicesPics")};p.prototype.emailsPicsHashes=function(a){this.defaultRequest(a,
|
|
"EmailsPicsHashes")};p.prototype.facebookUser=function(a){this.defaultRequest(a,"SocialFacebookUserInformation")};p.prototype.facebookDisconnect=function(a){this.defaultRequest(a,"SocialFacebookDisconnect")};p.prototype.twitterUser=function(a){this.defaultRequest(a,"SocialTwitterUserInformation")};p.prototype.twitterDisconnect=function(a){this.defaultRequest(a,"SocialTwitterDisconnect")};p.prototype.googleUser=function(a){this.defaultRequest(a,"SocialGoogleUserInformation")};p.prototype.googleDisconnect=
|
|
function(a){this.defaultRequest(a,"SocialGoogleDisconnect")};p.prototype.socialUsers=function(a){this.defaultRequest(a,"SocialUsers")};T.prototype.oEmailsPicsHashes={};T.prototype.oServices={};T.prototype.clear=function(){this.oServices={};this.oEmailsPicsHashes={}};T.prototype.getUserPic=function(a){var b="",b="",b=a.toLowerCase(),c=d.isUnd(this.oEmailsPicsHashes[a])?"":this.oEmailsPicsHashes[a];""===c?(b=b.substr(a.indexOf("@")+1),b=""!==b&&this.oServices[b]?this.oServices[b]:""):b=e.link().getUserPicUrlFromHash(c);
|
|
return b};T.prototype.setServicesData=function(a){this.oServices=a};T.prototype.setEmailsPicsHashesData=function(a){this.oEmailsPicsHashes=a};i.extend(v.prototype,T.prototype);v.prototype.oFoldersCache={};v.prototype.oFoldersNamesCache={};v.prototype.oFolderHashCache={};v.prototype.oFolderUidNextCache={};v.prototype.oMessageListHashCache={};v.prototype.oMessageFlagsCache={};v.prototype.oBodies={};v.prototype.oNewMessage={};v.prototype.oRequestedMessage={};v.prototype.clear=function(){T.prototype.clear.call(this);
|
|
this.oFoldersCache={};this.oFoldersNamesCache={};this.oFolderHashCache={};this.oFolderUidNextCache={};this.oMessageListHashCache={};this.oMessageFlagsCache={};this.oBodies={}};v.prototype.getMessageKey=function(a,b){return a+"#"+b};v.prototype.addRequestedMessage=function(a,b){this.oRequestedMessage[this.getMessageKey(a,b)]=!0};v.prototype.hasRequestedMessage=function(a,b){return!0===this.oRequestedMessage[this.getMessageKey(a,b)]};v.prototype.addNewMessageCache=function(a,b){this.oNewMessage[this.getMessageKey(a,
|
|
b)]=!0};v.prototype.hasNewMessageAndRemoveFromCache=function(a,b){return this.oNewMessage[this.getMessageKey(a,b)]?(this.oNewMessage[this.getMessageKey(a,b)]=null,!0):!1};v.prototype.clearNewMessageCache=function(){this.oNewMessage={}};v.prototype.getFolderFullNameRaw=function(a){return""!==a&&this.oFoldersNamesCache[a]?this.oFoldersNamesCache[a]:""};v.prototype.setFolderFullNameRaw=function(a,b){this.oFoldersNamesCache[a]=b};v.prototype.getFolderHash=function(a){return""!==a&&this.oFolderHashCache[a]?
|
|
this.oFolderHashCache[a]:""};v.prototype.setFolderHash=function(a,b){this.oFolderHashCache[a]=b};v.prototype.getFolderUidNext=function(a){return""!==a&&this.oFolderUidNextCache[a]?this.oFolderUidNextCache[a]:""};v.prototype.setFolderUidNext=function(a,b){this.oFolderUidNextCache[a]=b};v.prototype.getFolderFromCacheList=function(a){return""!==a&&this.oFoldersCache[a]?this.oFoldersCache[a]:null};v.prototype.setFolderToCacheList=function(a,b){this.oFoldersCache[a]=b};v.prototype.removeFolderFromCacheList=
|
|
function(a){this.setFolderToCacheList(a,null)};v.prototype.getMessageFlagsFromCache=function(a,b){return this.oMessageFlagsCache[a]&&this.oMessageFlagsCache[a][b]?this.oMessageFlagsCache[a][b]:null};v.prototype.setMessageFlagsToCache=function(a,b,c){this.oMessageFlagsCache[a]||(this.oMessageFlagsCache[a]={});this.oMessageFlagsCache[a][b]=c};v.prototype.clearMessageFlagsFromCacheByFolder=function(a){this.oMessageFlagsCache[a]={}};v.prototype.initMessageFlagsFromCache=function(a){if(a){var b=this,c=
|
|
this.getMessageFlagsFromCache(a.folderFullNameRaw,a.uid),e=null,f=null;c&&4===c.length&&(a.unseen(c[0]),a.flagged(c[1]),a.answered(c[2]),a.forwarded(c[3]));0<a.threads().length&&(e=i.find(a.threads(),function(c){return(c=b.getMessageFlagsFromCache(a.folderFullNameRaw,c))&&4===c.length&&!!c[0]}),f=i.find(a.threads(),function(c){return(c=b.getMessageFlagsFromCache(a.folderFullNameRaw,c))&&4===c.length&&!!c[1]}),a.hasUnseenSubMessage(e&&0<d.pInt(e)),a.hasFlaggedSubMessage(f&&0<d.pInt(f)))}};v.prototype.storeMessageFlagsToCache=
|
|
function(a){a&&this.setMessageFlagsToCache(a.folderFullNameRaw,a.uid,[a.unseen(),a.flagged(),a.answered(),a.forwarded()])};v.prototype.storeMessageFlagsToCacheByFolderAndUid=function(a,b,c){d.isArray(c)&&4===c.length&&this.setMessageFlagsToCache(a,b,c)};i.extend(fa.prototype,J.prototype);fa.prototype.onRoute=function(a){var b=this,c=null,g=null,h=null,r=null;if(g=i.find(Fa,function(b){return b&&b.__rlSettingsData&&a===b.__rlSettingsData.Route}))i.find(Ta,function(a){return a&&a===g})&&(g=null),g&&
|
|
i.find(Ua,function(a){return a&&a===g})&&(g=null);g&&(g.__builded&&g.__vm?c=g.__vm:(h=j("#rl-content #rl-settings-subscreen"))&&1===h.length?(c=new g,r=j("<div></div>").addClass("rl-settings-view-model").hide().attr("data-bind",'template: {name: "'+g.__rlSettingsData.Template+'"}, i18nInit: true'),r.appendTo(h),c.data=e.data(),c.viewModelDom=r,c.__rlSettingsData=g.__rlSettingsData,g.__dom=r,g.__builded=!0,g.__vm=c,f.applyBindings(c,r[0]),s.delegateRun(c,"onBuild",[r])):d.log("Cannot find sub settings view model position: SettingsSubScreen"),
|
|
c&&i.defer(function(){if(b.oCurrentSubScreen){s.delegateRun(b.oCurrentSubScreen,"onHide");b.oCurrentSubScreen.viewModelDom.hide()}b.oCurrentSubScreen=c;if(b.oCurrentSubScreen){b.oCurrentSubScreen.viewModelDom.show();s.delegateRun(b.oCurrentSubScreen,"onShow");i.each(b.menu(),function(a){a.selected(c&&c.__rlSettingsData&&a.route===c.__rlSettingsData.Route)})}d.windowResize()}))};fa.prototype.onBuild=function(){i.each(Fa,function(a){a&&(a.__rlSettingsData&&!i.find(Ta,function(b){return b&&b===a}))&&
|
|
this.menu.push({route:a.__rlSettingsData.Route,label:a.__rlSettingsData.Label,selected:f.observable(!1),disabled:!!i.find(Ua,function(b){return b&&b===a})})},this)};fa.prototype.routes=function(){var a=i.find(Fa,function(a){return a&&a.__rlSettingsData&&a.__rlSettingsData.IsDefault}),b=a?a.__rlSettingsData.Route:"general",a={subname:/^(.*)$/,normalize_:function(a,e){e.subname=d.isUnd(e.subname)?b:d.pString(e.subname);return[e.subname]}};return[["{subname}/",a],["{subname}",a],["",a]]};i.extend(Ba.prototype,
|
|
J.prototype);Ba.prototype.onShow=function(){e.setTitle(d.i18n("TITLES/LOGIN"))};i.extend(U.prototype,J.prototype);U.prototype.oLastRoute={};U.prototype.onShow=function(){var a=e.data().accountEmail();e.setTitle((""===a?"":a+" - ")+d.i18n("TITLES/MAILBOX"));this.mailBoxScreenVisibily(!0)};U.prototype.onHide=function(){this.mailBoxScreenVisibily(!1)};U.prototype.onRoute=function(a,b,c){var d=e.data(),a=e.cache().getFolderFullNameRaw(a);if(a=e.cache().getFolderFromCacheList(a))d.currentFolder(a).messageListPage(b).messageListSearch(c),
|
|
!d.usePreviewPane()&&d.message()&&d.message(null),e.reloadMessageList()};U.prototype.onStart=function(){var a=e.data(),b=function(){d.windowResize()};e.settingsGet("AllowAdditionalAccounts")&&e.accounts();i.delay(function(){e.quota()},5E3);i.delay(function(){"INBOX"!==a.currentFolderFullNameRaw()&&e.folderInformation("INBOX")},1E3);i.delay(function(){var b=e.data().spamFolder();b!==a.currentFolderFullNameRaw()&&e.folderInformation(b)},1500);i.delay(function(){var b=e.data().draftFolder();b!==a.currentFolderFullNameRaw()&&
|
|
e.folderInformation(b)},2E3);i.delay(function(){e.remote().appDelayStart(d.emptyFunction)},35E3);h.setInterval(function(){e.folderInformation("INBOX")},12E4);h.setInterval(function(){e.quota()},3E5);Z.toggleClass("rl-no-preview-pane",!a.usePreviewPane());a.folderList.subscribe(b);a.messageList.subscribe(b);a.message.subscribe(b);a.usePreviewPane.subscribe(function(b){Z.toggleClass("rl-no-preview-pane",!b);a.messageList.valueHasMutated()})};U.prototype.onBuild=function(){i.defer(i.bind(function(){d.initLayoutResizer("#rl-resizer-left",
|
|
"#rl-resizer-right","#rl-right",this.resizeTrigger)},this))};U.prototype.routes=function(){var a=function(a,c){c[0]=d.pString(c[0]);c[1]=d.pInt(c[1]);c[1]=0>=c[1]?1:c[1];c[2]=d.pString(c[2]);""===a&&(c[0]="Inbox",c[1]=1);return[decodeURI(c[0]),c[1],decodeURI(c[2])]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:a}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/?$/,{normalize_:a}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:function(a,c){c[0]=d.pString(c[0]);c[1]=d.pString(c[1]);""===a&&(c[0]=
|
|
"Inbox");return[decodeURI(c[0]),1,decodeURI(c[1])]}}],[/^([^\/]*)$/,{normalize_:a}]]};i.extend(Pa.prototype,fa.prototype);Pa.prototype.onShow=function(){e.setTitle(this.sSettingsTitle)};i.extend(I.prototype,Xa.prototype);I.prototype.oSettings=null;I.prototype.oLink=null;I.prototype.download=function(a){ha?this.iframe.attr("src",a):h.open(a)};I.prototype.link=function(){null===this.oLink&&(this.oLink=new B);return this.oLink};I.prototype.local=function(){null===this.oLocal&&(this.oLocal=new va);return this.oLocal};
|
|
I.prototype.settingsGet=function(a){null===this.oSettings&&(this.oSettings=d.isNormal(Da)?Da:{});return d.isUnd(this.oSettings[a])?null:this.oSettings[a]};I.prototype.settingsSet=function(a,b){null===this.oSettings&&(this.oSettings=d.isNormal(Da)?Da:{});this.oSettings[a]=b};I.prototype.setTitle=function(a){a=(0<a.length?a+" - ":"")+this.settingsGet("Title")||"";a!==h.document.title&&(h.document.title=a)};I.prototype.loginAndLogoutReload=function(a,b){var c=d.pString(this.settingsGet("CustomLogoutLink")),
|
|
f=!!this.settingsGet("InIframe"),a=d.isUnd(a)?!1:!!a,b=d.isUnd(b)?!1:!!b;a&&(b&&h.close)&&h.close();a&&""!==c&&h.location.href!==c?i.defer(function(){f&&h.parent?h.parent.location.href=c:h.location.href=c}):(s.routeOff(),s.setHash(e.link().root(),!0),s.routeOff(),i.defer(function(){f&&h.parent?h.parent.location.reload():h.location.reload()}))};I.prototype.getAutocomplete=function(a,b,c){c([],a)};I.prototype.bootstart=function(){d.initOnStartOrLangChange(function(){d.initNotificationLanguage()},null);
|
|
i.delay(function(){d.windowResize()},1E3)};i.extend(A.prototype,I.prototype);A.prototype.oData=null;A.prototype.oRemote=null;A.prototype.oCache=null;A.prototype.data=function(){null===this.oData&&(this.oData=new S);return this.oData};A.prototype.remote=function(){null===this.oRemote&&(this.oRemote=new p);return this.oRemote};A.prototype.cache=function(){null===this.oCache&&(this.oCache=new v);return this.oCache};A.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){var a=e.cache();
|
|
i.each(e.data().messageList(),function(b){a.initMessageFlagsFromCache(b)});a.initMessageFlagsFromCache(e.data().message())};A.prototype.reloadMessageList=function(a,b){var c=e.data(),f=(c.messageListPage()-1)*c.messagesPerPage();(d.isUnd(b)?0:b)&&e.cache().setFolderHash(c.currentFolderFullNameRaw(),"");if(d.isUnd(a)?0:a)c.messageListPage(1),f=0;c.messageListLoading(!0);e.remote().messageList(function(a,b,e){g.StorageResultType.Success===a&&b&&b.Result?(c.messageListError(""),c.messageListLoading(!1),
|
|
c.setMessageList(b,e)):g.StorageResultType.Unload===a?(c.messageListError(""),c.messageListLoading(!1)):g.StorageResultType.Abort!==a&&(c.messageList([]),c.messageListLoading(!1),c.messageListError(b&&b.ErrorCode?d.getNotification(b.ErrorCode):d.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST")))},c.currentFolderFullNameRaw(),f,c.messagesPerPage(),c.messageListSearch())};A.prototype.recacheInboxMessageList=function(){e.remote().messageList(d.emptyFunction,"INBOX",0,e.data().messagesPerPage(),"",!0)};A.prototype.folders=
|
|
function(a,b){this.data().foldersLoading(!0);this.remote().folders(i.bind(function(a,d,f){e.data().foldersLoading(!1);g.StorageResultType.Success===a?(this.data().setFolders(d,f),b&&b(!0)):b&&b(!1)},this),a)};A.prototype.accounts=function(){e.data().accountsLoading(!0);e.remote().accounts(function(a,b){e.data().accountsLoading(!1);if(g.StorageResultType.Success===a&&d.isArray(b.Result)){var c=e.settingsGet("ParentEmail"),c=""===c?e.data().accountEmail():c;e.data().accounts(i.map(b.Result,function(a){return new La(a,
|
|
a!==c)}))}})};A.prototype.quota=function(){this.remote().quota(function(a,b){g.StorageResultType.Success===a&&(b&&b.Result&&d.isArray(b.Result)&&2===b.Result.length&&d.isPosNumeric(b.Result[0],!0)&&d.isPosNumeric(b.Result[1],!0))&&(e.data().userQuota(1024*d.pInt(b.Result[1])),e.data().userUsageSize(1024*d.pInt(b.Result[0])))})};A.prototype.folderInformation=function(a,b){this.remote().folderInformation(function(a,b){if(g.StorageResultType.Success===a&&b&&b.Result&&b.Result.Hash&&b.Result.Folder){var f=
|
|
e.cache().getFolderHash(b.Result.Folder),h=e.cache().getFolderFromCacheList(b.Result.Folder),i=!1,j="",m=[],m=!1,o=null;if(h){b.Result.Hash&&e.cache().setFolderHash(b.Result.Folder,b.Result.Hash);d.isNormal(b.Result.MessageCount)&&h.messageCountAll(b.Result.MessageCount);d.isNormal(b.Result.MessageUnseenCount)&&(d.pInt(h.messageCountUnread())!==d.pInt(b.Result.MessageUnseenCount)&&(m=!0),h.messageCountUnread(b.Result.MessageUnseenCount));m&&e.cache().clearMessageFlagsFromCacheByFolder(h.fullNameRaw);
|
|
if(b.Result.Flags){for(j in b.Result.Flags)b.Result.Flags.hasOwnProperty(j)&&(i=!0,o=b.Result.Flags[j],e.cache().storeMessageFlagsToCacheByFolderAndUid(h.fullNameRaw,j.toString(),[!o.IsSeen,!!o.IsFlagged,!!o.IsAnswered,!!o.IsForwarded]));i&&e.reloadFlagsCurrentMessageListAndMessageFromCache()}e.data().initUidNextAndNewMessages(h.fullNameRaw,b.Result.UidNext,b.Result.NewMessages);b.Result.Hash!==f||""===f?h.fullNameRaw===e.data().currentFolderFullNameRaw()?e.reloadMessageList():"INBOX"===h.fullNameRaw&&
|
|
e.recacheInboxMessageList():m&&h.fullNameRaw===e.data().currentFolderFullNameRaw()&&(m=e.data().messageList(),d.isNonEmptyArray(m)&&e.folderInformation(h.fullNameRaw,m))}}},a,b)};A.prototype.setMessageSeen=function(a){if(a.unseen()){a.unseen(!1);var b=e.cache().getFolderFromCacheList(a.folderFullNameRaw);b&&b.messageCountUnread(0<=b.messageCountUnread()-1?b.messageCountUnread()-1:0);e.cache().storeMessageFlagsToCache(a);e.reloadFlagsCurrentMessageListAndMessageFromCache()}e.remote().messageSetSeen(d.emptyFunction,
|
|
a.folderFullNameRaw,[a.uid],!0)};A.prototype.googleConnect=function(){h.open(e.link().socialGoogle(),"Google","left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes")};A.prototype.twitterConnect=function(){h.open(e.link().socialTwitter(),"Twitter","left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes")};A.prototype.facebookConnect=function(){h.open(e.link().socialFacebook(),"Facebook","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes")};
|
|
A.prototype.socialUsers=function(a){var b=e.data();a&&(b.googleActions(!0),b.facebookActions(!0),b.twitterActions(!0));e.remote().socialUsers(function(a,d){if(g.StorageResultType.Success===a&&d&&d.Result){b.googleUserName(d.Result.Google||"");b.facebookUserName(d.Result.Facebook||"");b.twitterUserName(d.Result.Twitter||"")}else{b.googleUserName("");b.facebookUserName("");b.twitterUserName("")}b.googleLoggined(""!==b.googleUserName());b.facebookLoggined(""!==b.facebookUserName());b.twitterLoggined(""!==
|
|
b.twitterUserName());b.googleActions(false);b.facebookActions(false);b.twitterActions(false)})};A.prototype.googleDisconnect=function(){e.data().googleActions(!0);e.remote().googleDisconnect(function(){e.socialUsers()})};A.prototype.facebookDisconnect=function(){e.data().facebookActions(!0);e.remote().facebookDisconnect(function(){e.socialUsers()})};A.prototype.twitterDisconnect=function(){e.data().twitterActions(!0);e.remote().twitterDisconnect(function(){e.socialUsers()})};A.prototype.folderListOptionsBuilder=
|
|
function(a,b,c,f,i,j,m,k,p){var o=0,q=0,n=null,s=[],p=!d.isNormal(p)?0<a.length:p,i=!d.isNormal(i)?0:i;d.isArray(c)||(c=[]);d.isArray(f)||(f=[]);o=0;for(q=f.length;o<q;o++)s.push({id:f[o][0],name:f[o][1],disable:!1});o=0;for(q=a.length;o<q;o++)if(n=a[o],d.isNormal(m)?m.call(null,n):1)s.push({id:n.fullNameRaw,system:!0,name:d.isNormal(k)?k.call(null,n):n.name(),disable:!n.selectable||-1<d.inArray(n.fullNameRaw,c)||(d.isNormal(j)?j.call(null,n):!1)});o=0;for(q=b.length;o<q;o++){n=b[o];if(!n.isGmailFolder&&
|
|
(n.subScribed()||!n.existen))if(d.isNormal(m)?m.call(null,n):1)if(g.FolderType.User===n.type()||!p||!n.isNamespaceFolder&&0<n.subFolders().length)s.push({id:n.fullNameRaw,system:!1,name:(new h.Array(n.deep+1-i)).join("\u00a0\u00a0\u00a0\u00a0")+(d.isNormal(k)?k.call(null,n):n.name()),disable:!n.selectable||-1<d.inArray(n.fullNameRaw,c)||g.FolderType.User!==n.type()||(d.isNormal(j)?j.call(null,n):!1)});n.isUnpaddigFolder&&i++;s=s.concat(e.folderListOptionsBuilder([],n.subFolders(),c,[],i,j,m,k,p))}return s};
|
|
A.prototype.getAutocomplete=function(a,b,c){var f=[];e.remote().suggestions(function(a,b){g.StorageResultType.Success===a&&b&&b.Result&&d.isArray(b.Result.List)?(f=i.map(b.Result.List,function(a){return a&&a[0]?new F(a[0],a[1]):null}),c(i.compact(f),!!b.Result.More)):g.StorageResultType.Abort!==a&&c([],!1)},a,b)};A.prototype.emailsPicsHashes=function(){e.remote().emailsPicsHashes(function(a,b){g.StorageResultType.Success===a&&(b&&b.Result)&&e.cache().setEmailsPicsHashesData(b.Result)})};A.prototype.bootstart=
|
|
function(){I.prototype.bootstart.call(this);e.data().populateDataOnStart();var a=this.settingsGet("JsHash"),b=this.settingsGet("AllowGoogleSocial"),c=this.settingsGet("AllowFacebookSocial"),f=this.settingsGet("AllowTwitterSocial");!this.settingsGet("RemoteChangePassword")&&na&&d.removeSettingsViewModel(na);!this.settingsGet("AllowAdditionalAccounts")&&ma&&d.removeSettingsViewModel(ma);!b&&(!c&&!f&&Na)&&d.removeSettingsViewModel(Na);d.initOnStartOrLangChange(function(){j.extend(!0,j.magnificPopup.defaults,
|
|
{tClose:d.i18n("MAGNIFIC_POPUP/CLOSE"),tLoading:d.i18n("MAGNIFIC_POPUP/LOADING"),gallery:{tPrev:d.i18n("MAGNIFIC_POPUP/GALLERY_PREV"),tNext:d.i18n("MAGNIFIC_POPUP/GALLERY_NEXT"),tCounter:d.i18n("MAGNIFIC_POPUP/GALLERY_COUNTER")},image:{tError:d.i18n("MAGNIFIC_POPUP/IMAGE_ERROR")},ajax:{tError:d.i18n("MAGNIFIC_POPUP/AJAX_ERROR")}})},this);h.SimplePace&&h.SimplePace.set(70);this.settingsGet("Auth")?(this.setTitle(d.i18n("TITLES/LOADING")),this.folders(!0,i.bind(function(a){s.hideLoading();if(a){s.startScreens([U,
|
|
Pa]);Ea.on("mousedown","#rl-center a",function(a){if(a&&3!==a.which){var a=null,b=j(this).attr("href");if(b&&"mailto:"===b.toString().toLowerCase().substr(0,7)){a=new F;a.parse(h.decodeURI(b.toString().substr(7)));if(a&&a.email){s.showScreenPopup(y,[g.ComposeType.Empty,null,[a]]);return false}}}return true});(b||c||f)&&e.socialUsers(true);i.delay(function(){e.emailsPicsHashes();e.remote().servicesPics(function(a,b){g.StorageResultType.Success===a&&(b&&b.Result)&&e.cache().setServicesData(b.Result)})},
|
|
1E3);x.runHook("rl-start-user-screens")}else{s.startScreens([Ba]);x.runHook("rl-start-login-screens")}h.SimplePace&&h.SimplePace.set(100)},this))):(s.hideLoading(),s.startScreens([Ba]),x.runHook("rl-start-login-screens"),h.SimplePace&&h.SimplePace.set(100));b&&(h["rl_"+a+"_google_service"]=function(){e.data().googleActions(true);e.socialUsers()});c&&(h["rl_"+a+"_facebook_service"]=function(){e.data().facebookActions(true);e.socialUsers()});f&&(h["rl_"+a+"_twitter_service"]=function(){e.data().twitterActions(true);
|
|
e.socialUsers()});x.runHook("rl-start-screens")};e=new A;j(function(){h.setTimeout(function(){s.setBoot(e).bootstart()},10);h.setInterval(function(){xa(!xa())},6E4);i.delay(function(){h.rainloopAppData={};h.rainloopI18N={}},100)});Z.addClass(ha?"mobile":"no-mobile");N.keydown(d.killCtrlAandS).keyup(d.killCtrlAandS);N.unload(function(){Qa=!0});h.rl=h.rl||{};h.rl.addHook=x.addHook;h.rl.settingsGet=x.mainSettingsGet;h.rl.remoteRequest=x.remoteRequest;h.rl.pluginSettingsGet=x.settingsGet;h.rl.addSettingsViewModel=
|
|
d.addSettingsViewModel;h.rl.createCommand=d.createCommand;h.rl.EmailModel=F;h.rl.Enums=g;h.SimplePace&&h.SimplePace.add(10)})(window,jQuery,ko,crossroads,hasher,moment,Jua,_); |