From a112b0400e0b594977a24d1ea1852800e2735972 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Tue, 17 Dec 2013 03:31:33 +0400 Subject: [PATCH] Add ask popup (messages permanent deletion) --- dev/ViewModels/MailBoxMessageListViewModel.js | 50 ++++++++++++++----- package.json | 2 +- .../app/templates/Views/MailMessageList.html | 4 +- rainloop/v/0.0.0/langs/de.ini | 1 + rainloop/v/0.0.0/langs/en.ini | 1 + rainloop/v/0.0.0/langs/es.ini | 1 + rainloop/v/0.0.0/langs/fr.ini | 1 + rainloop/v/0.0.0/langs/is.ini | 1 + rainloop/v/0.0.0/langs/ko-kr.ini | 1 + rainloop/v/0.0.0/langs/lv.ini | 1 + rainloop/v/0.0.0/langs/nl.ini | 1 + rainloop/v/0.0.0/langs/pl.ini | 1 + rainloop/v/0.0.0/langs/pt-br.ini | 1 + rainloop/v/0.0.0/langs/pt-pt.ini | 1 + rainloop/v/0.0.0/langs/ru.ini | 1 + rainloop/v/0.0.0/langs/zh-cn.ini | 1 + rainloop/v/0.0.0/static/js/app.js | 50 ++++++++++++++----- rainloop/v/0.0.0/static/js/app.min.js | 7 +-- 18 files changed, 94 insertions(+), 32 deletions(-) diff --git a/dev/ViewModels/MailBoxMessageListViewModel.js b/dev/ViewModels/MailBoxMessageListViewModel.js index f71a1094e..9b0a9f0b7 100644 --- a/dev/ViewModels/MailBoxMessageListViewModel.js +++ b/dev/ViewModels/MailBoxMessageListViewModel.js @@ -111,6 +111,10 @@ function MailBoxMessageListViewModel() return RL.data().spamFolder() === this.messageListEndFolder(); }, this); + this.isSpamDisabled = ko.computed(function () { + return Consts.Values.UnuseOptionValue === RL.data().spamFolder(); + }, this); + this.isTrashFolder = ko.computed(function () { return RL.data().trashFolder() === this.messageListEndFolder(); }, this); @@ -187,6 +191,8 @@ function MailBoxMessageListViewModel() }, this) ; + this.moveOrDeleteResponse = _.bind(this.moveOrDeleteResponse, this); + Knoin.constructorEnd(this); } @@ -352,7 +358,7 @@ MailBoxMessageListViewModel.prototype.moveMessagesToFolder = function (sFromFold bCopy = Utils.isUnd(bCopy) ? false : !!bCopy; RL.remote()[bCopy ? 'messagesCopy' : 'messagesMove']( - _.bind(this.moveOrDeleteResponse, this), + this.moveOrDeleteResponse, oFromFolder.fullNameRaw, oToFolder.fullNameRaw, aUidForRemove @@ -392,30 +398,48 @@ MailBoxMessageListViewModel.prototype.deleteSelectedMessageFromCurrentFolder = f if (this.canBeMoved()) { bUseFolder = Utils.isUnd(bUseFolder) ? true : !!bUseFolder; - var oTrashOrSpamFolder = RL.cache().getFolderFromCacheList( - Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder()); + if (bUseFolder) + { + if ((Enums.FolderType.Spam === iType && Consts.Values.UnuseOptionValue === RL.data().spamFolder()) || + (Enums.FolderType.Trash === iType && Consts.Values.UnuseOptionValue === RL.data().trashFolder())) + { + bUseFolder = false; + } + } + + var + self = this, + aUIds = null, + sCurrentFolderFullNameRaw = RL.data().currentFolderFullNameRaw(), + oTrashOrSpamFolder = RL.cache().getFolderFromCacheList( + Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder()) + ; if (!oTrashOrSpamFolder && bUseFolder) { kn.showScreenPopup(PopupsFolderSystemViewModel, [ Enums.FolderType.Spam === iType ? Enums.SetSystemFoldersNotification.Spam : Enums.SetSystemFoldersNotification.Trash]); } - else if (!bUseFolder || (oTrashOrSpamFolder && (Consts.Values.UnuseOptionValue === oTrashOrSpamFolder.fullNameRaw || - RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw))) + else if (!bUseFolder || (oTrashOrSpamFolder && RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw)) { - RL.remote().messagesDelete( - _.bind(this.moveOrDeleteResponse, this), - RL.data().currentFolderFullNameRaw(), - RL.data().messageListCheckedOrSelectedUidsWithSubMails() - ); + aUIds = RL.data().messageListCheckedOrSelectedUidsWithSubMails(); + + kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () { - this.removeCheckedOrSelectedMessagesFromList(); + RL.remote().messagesDelete( + self.moveOrDeleteResponse, + sCurrentFolderFullNameRaw, + aUIds + ); + + self.removeCheckedOrSelectedMessagesFromList(); + }]); } else if (oTrashOrSpamFolder) { RL.remote().messagesMove( - _.bind(this.moveOrDeleteResponse, this), - RL.data().currentFolderFullNameRaw(), + this.moveOrDeleteResponse, + sCurrentFolderFullNameRaw, oTrashOrSpamFolder.fullNameRaw, RL.data().messageListCheckedOrSelectedUidsWithSubMails() ); diff --git a/package.json b/package.json index db3c7245a..b0b97107e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.5.1", - "release": "550", + "release": "553", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "Gruntfile.js", diff --git a/rainloop/v/0.0.0/app/templates/Views/MailMessageList.html b/rainloop/v/0.0.0/app/templates/Views/MailMessageList.html index 9bcaa218c..b63102798 100644 --- a/rainloop/v/0.0.0/app/templates/Views/MailMessageList.html +++ b/rainloop/v/0.0.0/app/templates/Views/MailMessageList.html @@ -26,8 +26,8 @@ -   - +   + diff --git a/rainloop/v/0.0.0/langs/de.ini b/rainloop/v/0.0.0/langs/de.ini index 033870e2a..cc594f9ca 100644 --- a/rainloop/v/0.0.0/langs/de.ini +++ b/rainloop/v/0.0.0/langs/de.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Geben Sie bitte mindestens einen Empfänger an" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/en.ini b/rainloop/v/0.0.0/langs/en.ini index 5833306dd..dedd1a0c0 100644 --- a/rainloop/v/0.0.0/langs/en.ini +++ b/rainloop/v/0.0.0/langs/en.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Please specify at least one recipient" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/es.ini b/rainloop/v/0.0.0/langs/es.ini index 6841b1a55..002d6f548 100644 --- a/rainloop/v/0.0.0/langs/es.ini +++ b/rainloop/v/0.0.0/langs/es.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Por favor especifique al menos un destinatario" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/fr.ini b/rainloop/v/0.0.0/langs/fr.ini index d02332121..3bac4c583 100644 --- a/rainloop/v/0.0.0/langs/fr.ini +++ b/rainloop/v/0.0.0/langs/fr.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "S'il vous plaît spécifier au moins un destinataire" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choisir la langue" diff --git a/rainloop/v/0.0.0/langs/is.ini b/rainloop/v/0.0.0/langs/is.ini index 918145e23..857e45da2 100644 --- a/rainloop/v/0.0.0/langs/is.ini +++ b/rainloop/v/0.0.0/langs/is.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Vinsamlegast taktu fram að minnsta kosti einn viðtakand BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/ko-kr.ini b/rainloop/v/0.0.0/langs/ko-kr.ini index 180d50674..8481bca2d 100644 --- a/rainloop/v/0.0.0/langs/ko-kr.ini +++ b/rainloop/v/0.0.0/langs/ko-kr.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "수신인을 한 명 이상 선택하세요" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "사용할 언어를 선택하세요" diff --git a/rainloop/v/0.0.0/langs/lv.ini b/rainloop/v/0.0.0/langs/lv.ini index 330468115..e5ff10b62 100644 --- a/rainloop/v/0.0.0/langs/lv.ini +++ b/rainloop/v/0.0.0/langs/lv.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Pievienojat vismaz vienu saņēmēju" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/nl.ini b/rainloop/v/0.0.0/langs/nl.ini index 2d2b8d11e..5d592719a 100644 --- a/rainloop/v/0.0.0/langs/nl.ini +++ b/rainloop/v/0.0.0/langs/nl.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Gelieve minstens 1 ontvanger aan te duiden" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Kies uw taal" diff --git a/rainloop/v/0.0.0/langs/pl.ini b/rainloop/v/0.0.0/langs/pl.ini index ce6d62391..42b26c222 100644 --- a/rainloop/v/0.0.0/langs/pl.ini +++ b/rainloop/v/0.0.0/langs/pl.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Wprowadź co najmniej jednego odbiorcę" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/pt-br.ini b/rainloop/v/0.0.0/langs/pt-br.ini index 5d91cec50..3d0ede32a 100644 --- a/rainloop/v/0.0.0/langs/pt-br.ini +++ b/rainloop/v/0.0.0/langs/pt-br.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/pt-pt.ini b/rainloop/v/0.0.0/langs/pt-pt.ini index 84fe248a5..c24076517 100644 --- a/rainloop/v/0.0.0/langs/pt-pt.ini +++ b/rainloop/v/0.0.0/langs/pt-pt.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Choose language" diff --git a/rainloop/v/0.0.0/langs/ru.ini b/rainloop/v/0.0.0/langs/ru.ini index 0e4528e14..647396b46 100644 --- a/rainloop/v/0.0.0/langs/ru.ini +++ b/rainloop/v/0.0.0/langs/ru.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Укажите как минимум одного пол BUTTON_YES = "Да" BUTTON_NO = "Нет" DESC_WANT_CLOSE_THIS_WINDOW = "Вы уверены, что хотите закрыть это окно?" +DESC_WANT_DELETE_MESSAGES = "Вы уверены, что хотите удалить сообщение(я)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "Выберите язык" diff --git a/rainloop/v/0.0.0/langs/zh-cn.ini b/rainloop/v/0.0.0/langs/zh-cn.ini index b7a10f1ec..379d92332 100644 --- a/rainloop/v/0.0.0/langs/zh-cn.ini +++ b/rainloop/v/0.0.0/langs/zh-cn.ini @@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "请至少选择一位接收人" BUTTON_YES = "Yes" BUTTON_NO = "No" DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?" +DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?" [POPUPS_LANGUAGES] TITLE_LANGUAGES = "选择语言" diff --git a/rainloop/v/0.0.0/static/js/app.js b/rainloop/v/0.0.0/static/js/app.js index d31e83345..29d229ab9 100644 --- a/rainloop/v/0.0.0/static/js/app.js +++ b/rainloop/v/0.0.0/static/js/app.js @@ -10966,6 +10966,10 @@ function MailBoxMessageListViewModel() return RL.data().spamFolder() === this.messageListEndFolder(); }, this); + this.isSpamDisabled = ko.computed(function () { + return Consts.Values.UnuseOptionValue === RL.data().spamFolder(); + }, this); + this.isTrashFolder = ko.computed(function () { return RL.data().trashFolder() === this.messageListEndFolder(); }, this); @@ -11042,6 +11046,8 @@ function MailBoxMessageListViewModel() }, this) ; + this.moveOrDeleteResponse = _.bind(this.moveOrDeleteResponse, this); + Knoin.constructorEnd(this); } @@ -11207,7 +11213,7 @@ MailBoxMessageListViewModel.prototype.moveMessagesToFolder = function (sFromFold bCopy = Utils.isUnd(bCopy) ? false : !!bCopy; RL.remote()[bCopy ? 'messagesCopy' : 'messagesMove']( - _.bind(this.moveOrDeleteResponse, this), + this.moveOrDeleteResponse, oFromFolder.fullNameRaw, oToFolder.fullNameRaw, aUidForRemove @@ -11247,30 +11253,48 @@ MailBoxMessageListViewModel.prototype.deleteSelectedMessageFromCurrentFolder = f if (this.canBeMoved()) { bUseFolder = Utils.isUnd(bUseFolder) ? true : !!bUseFolder; - var oTrashOrSpamFolder = RL.cache().getFolderFromCacheList( - Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder()); + if (bUseFolder) + { + if ((Enums.FolderType.Spam === iType && Consts.Values.UnuseOptionValue === RL.data().spamFolder()) || + (Enums.FolderType.Trash === iType && Consts.Values.UnuseOptionValue === RL.data().trashFolder())) + { + bUseFolder = false; + } + } + + var + self = this, + aUIds = null, + sCurrentFolderFullNameRaw = RL.data().currentFolderFullNameRaw(), + oTrashOrSpamFolder = RL.cache().getFolderFromCacheList( + Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder()) + ; if (!oTrashOrSpamFolder && bUseFolder) { kn.showScreenPopup(PopupsFolderSystemViewModel, [ Enums.FolderType.Spam === iType ? Enums.SetSystemFoldersNotification.Spam : Enums.SetSystemFoldersNotification.Trash]); } - else if (!bUseFolder || (oTrashOrSpamFolder && (Consts.Values.UnuseOptionValue === oTrashOrSpamFolder.fullNameRaw || - RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw))) + else if (!bUseFolder || (oTrashOrSpamFolder && RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw)) { - RL.remote().messagesDelete( - _.bind(this.moveOrDeleteResponse, this), - RL.data().currentFolderFullNameRaw(), - RL.data().messageListCheckedOrSelectedUidsWithSubMails() - ); + aUIds = RL.data().messageListCheckedOrSelectedUidsWithSubMails(); + + kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () { - this.removeCheckedOrSelectedMessagesFromList(); + RL.remote().messagesDelete( + self.moveOrDeleteResponse, + sCurrentFolderFullNameRaw, + aUIds + ); + + self.removeCheckedOrSelectedMessagesFromList(); + }]); } else if (oTrashOrSpamFolder) { RL.remote().messagesMove( - _.bind(this.moveOrDeleteResponse, this), - RL.data().currentFolderFullNameRaw(), + this.moveOrDeleteResponse, + sCurrentFolderFullNameRaw, oTrashOrSpamFolder.fullNameRaw, RL.data().messageListCheckedOrSelectedUidsWithSubMails() ); diff --git a/rainloop/v/0.0.0/static/js/app.min.js b/rainloop/v/0.0.0/static/js/app.min.js index 393bbf491..d5cfe0c48 100644 --- a/rainloop/v/0.0.0/static/js/app.min.js +++ b/rainloop/v/0.0.0/static/js/app.min.js @@ -1,8 +1,9 @@ /*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ !function(a,b,c,d,e,f,g,h){"use strict";function i(){this.sBase="#/",this.sCdnStaticDomain=Bb.settingsGet("CdnStaticDomain"),this.sVersion=Bb.settingsGet("Version"),this.sSpecSuffix=Bb.settingsGet("AuthAccountHash")||"0",this.sServer=(Bb.settingsGet("IndexFile")||"./")+"?",this.sCdnStaticDomain=""===this.sCdnStaticDomain?this.sCdnStaticDomain:"/"===this.sCdnStaticDomain.substr(-1)?this.sCdnStaticDomain:this.sCdnStaticDomain+"/"}function j(a,c,d,e){var f={DisableHtml:!1,onSwitch:!1,LangSwitcherConferm:"EDITOR_TEXT_SWITCHER_CONFIRM",LangSwitcherTextLabel:"EDITOR_SWITCHER_TEXT_LABEL",LangSwitcherHtmlLabel:"EDITOR_SWITCHER_HTML_LABEL"};this.bIe=!!/msie/.test(navigator.userAgent.toLowerCase()),e=b.extend(f,pb.isUnd(e)?{}:e),this.oOptions=e,this.bOnlyPlain=!!this.oOptions.DisableHtml,this.fOnSwitch=this.oOptions.onSwitch,this.textarea=b(a).empty().addClass("editorTextArea"),this.htmlarea=b(c).empty().addClass("editorHtmlArea").prop("contentEditable","true"),this.toolbar=b(d).empty().addClass("editorToolbar"),j.htmlInitEditor.apply(this),j.htmlInitToolbar.apply(this),j.htmlAttachEditorEvents.apply(this),this.bOnlyPlain&&this.toolbar.hide()}function k(a,b,c,d,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.oContentVisible=null,this.oContentScrollable=null,this.sItemSelector=c,this.sItemSelectedSelector=d,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=[],i=null;this.list.subscribe(function(){var a=this,b=this.list();pb.isArray(b)&&h.each(b,function(b){b.checked()&&g.push(a.getItemUid(b)),null===i&&b.selected()&&(i=a.getItemUid(b))})},this,"beforeChange"),this.list.subscribe(function(a){if(this.useItemSelectCallback=!1,this.selectedItem(null),pb.isArray(a)){var b=this,c=g.length;h.each(a,function(a){c>0&&-1b?b:a))},this),this.body=null,this.isRtl=c.observable(!1),this.isHtml=c.observable(!1),this.hasImages=c.observable(!1),this.attachments=c.observableArray([]),this.priority=c.observable(nb.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=c.observable(0),this.threads=c.observableArray([]),this.threadsLen=c.observable(0),this.hasUnseenSubMessage=c.observable(!1),this.hasFlaggedSubMessage=c.observable(!1),this.lastInCollapsedThread=c.observable(!1),this.lastInCollapsedThreadLoading=c.observable(!1),this.threadsLenResult=c.computed(function(){var a=this.threadsLen();return 0===this.parentUid()&&a>0?a+1:""},this)}function y(){this.name=c.observable(""),this.fullName="",this.fullNameRaw="",this.fullNameHash="",this.delimiter="",this.namespace="",this.deep=0,this.selectable=!1,this.existen=!0,this.isNamespaceFolder=!1,this.isGmailFolder=!1,this.isUnpaddigFolder=!1,this.interval=0,this.type=c.observable(nb.FolderType.User),this.selected=c.observable(!1),this.edited=c.observable(!1),this.collapsed=c.observable(!0),this.subScribed=c.observable(!0),this.subFolders=c.observableArray([]),this.deleteAccess=c.observable(!1),this.actionBlink=c.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=c.observable(""),this.name.subscribe(function(a){this.nameForEdit(a)},this),this.edited.subscribe(function(a){a&&this.nameForEdit(this.name())},this),this.canBeEdited=c.computed(function(){return nb.FolderType.User===this.type()},this),this.privateMessageCountAll=c.observable(0),this.privateMessageCountUnread=c.observable(0),this.collapsedPrivate=c.observable(!0)}function z(a,b){this.email=a,this.deleteAccess=c.observable(!1),this.canBeDalete=c.observable(b)}function A(a,b,d){this.id=a,this.email=c.observable(b),this.name=c.observable(""),this.replyTo=c.observable(""),this.bcc=c.observable(""),this.deleteAccess=c.observable(!1),this.canBeDalete=c.observable(d)}function B(){p.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=c.observable(null),this.clearingProcess=c.observable(!1),this.clearingError=c.observable(""),this.folderFullNameForClear=c.computed(function(){var a=this.selectedFolder();return a?a.printableFullName():""},this),this.folderNameForClear=c.computed(function(){var a=this.selectedFolder();return a?a.localName():""},this),this.dangerDescHtml=c.computed(function(){return pb.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=pb.createCommand(this,function(){var a=this,b=this.selectedFolder();b&&(Bb.data().message(null),Bb.data().messageList([]),this.clearingProcess(!0),Bb.cache().setFolderHash(b.fullNameRaw,""),Bb.remote().folderClear(function(b,c){a.clearingProcess(!1),nb.StorageResultType.Success===b&&c&&c.Result?(Bb.reloadMessageList(!0),a.cancelCommand()):c&&c.ErrorCode?a.clearingError(pb.getNotification(c.ErrorCode)):a.clearingError(pb.getNotification(nb.Notification.MailServerError))},b.fullNameRaw))},function(){var a=this.selectedFolder(),b=this.clearingProcess();return!b&&null!==a}),r.constructorEnd(this)}function C(){p.call(this,"Popups","PopupsFolderCreate"),pb.initOnStartOrLangChange(function(){this.sNoParentText=pb.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=c.observable(""),this.focusTrigger=c.observable(!1),this.selectedParentValue=c.observable(mb.Values.UnuseOptionValue),this.parentFolderSelectList=c.computed(function(){var a=Bb.data(),b=[],c=null,d=null,e=a.folderList(),f=function(a){return a?a.isSystemFolder()?a.name()+" "+a.manageFolderSystemName():a.name():""};return b.push(["",this.sNoParentText]),""!==a.namespace&&(c=function(b){return a.namespace!==b.fullNameRaw.substr(0,a.namespace.length)}),Bb.folderListOptionsBuilder([],e,[],b,null,c,d,f)},this),this.createFolder=pb.createCommand(this,function(){var a=Bb.data(),b=this.selectedParentValue();""===b&&1=a?1:a},this),this.contactsPagenator=c.computed(pb.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=c.observable(!0),this.viewClearSearch=c.observable(!1),this.viewID=c.observable(""),this.viewProperties=c.observableArray([]),this.viewPropertiesNames=this.viewProperties.filter(function(a){return-10&&b>0&&a>b},this),this.hasMessages=c.computed(function(){return 0'),e.after(f),e.remove()),f&&f[0]&&f.attr("data-href",g).attr("data-theme",a[0]).text(a[1]),d.themeTrigger(nb.SaveSettingsStep.TrueResult))}).always(function(){d.iTimer=a.setTimeout(function(){d.themeTrigger(nb.SaveSettingsStep.Idle)},1e3),d.oLastAjax=null})),Bb.remote().saveSettings(null,{Theme:c})},this)}function ab(){pb.initDataConstructorBySettings(this)}function bb(){ab.call(this);var a=function(a){return function(){var b=Bb.cache().getFolderFromCacheList(a());b&&b.type(nb.FolderType.User)}},d=function(a){return function(b){var c=Bb.cache().getFolderFromCacheList(b);c&&c.type(a)}};this.devEmail="",this.devLogin="",this.devPassword="",this.accountEmail=c.observable(""),this.accountIncLogin=c.observable(""),this.accountOutLogin=c.observable(""),this.projectHash=c.observable(""),this.threading=c.observable(!1),this.lastFoldersHash="",this.remoteSuggestions=!1,this.sentFolder=c.observable(""),this.draftFolder=c.observable(""),this.spamFolder=c.observable(""),this.trashFolder=c.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(d(nb.FolderType.SentItems),this),this.draftFolder.subscribe(d(nb.FolderType.Draft),this),this.spamFolder.subscribe(d(nb.FolderType.Spam),this),this.trashFolder.subscribe(d(nb.FolderType.Trash),this),this.draftFolderNotEnabled=c.computed(function(){return""===this.draftFolder()||mb.Values.UnuseOptionValue===this.draftFolder()},this),this.displayName=c.observable(""),this.signature=c.observable(""),this.replyTo=c.observable(""),this.accounts=c.observableArray([]),this.accountsLoading=c.observable(!1).extend({throttle:100}),this.identities=c.observableArray([]),this.identitiesLoading=c.observable(!1).extend({throttle:100}),this.namespace="",this.folderList=c.observableArray([]),this.foldersListError=c.observable(""),this.foldersLoading=c.observable(!1),this.foldersCreating=c.observable(!1),this.foldersDeleting=c.observable(!1),this.foldersRenaming=c.observable(!1),this.foldersInboxUnreadCount=c.observable(0),this.currentFolder=c.observable(null).extend({toggleSubscribe:[null,function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]}),this.currentFolderFullNameRaw=c.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this),this.currentFolderFullName=c.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this),this.currentFolderFullNameHash=c.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this),this.currentFolderName=c.computed(function(){return this.currentFolder()?this.currentFolder().name():""},this),this.folderListSystemNames=c.computed(function(){var a=["INBOX"],b=this.folderList(),c=this.sentFolder(),d=this.draftFolder(),e=this.spamFolder(),f=this.trashFolder();return pb.isArray(b)&&0=a?1:a},this),this.mainMessageListSearch=c.computed({read:this.messageListSearch,write:function(a){ub.setHash(Bb.link().mailBox(this.currentFolderFullNameHash(),1,pb.trim(a.toString())))},owner:this}),this.messageListError=c.observable(""),this.messageListLoading=c.observable(!1),this.messageListIsNotCompleted=c.observable(!1),this.messageListCompleteLoadingThrottle=c.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=c.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(h.debounce(function(a){h.each(a,function(a){a.newForAnimation()&&a.newForAnimation(!1)})},500)),this.staticMessageList=new x,this.message=c.observable(null),this.messageLoading=c.observable(!1),this.messageLoadingThrottle=c.observable(!1).extend({throttle:50}),this.messageLoading.subscribe(function(a){this.messageLoadingThrottle(a)},this),this.messageFullScreenMode=c.observable(!1),this.messageError=c.observable(""),this.messagesBodiesDom=c.observable(null),this.messagesBodiesDom.subscribe(function(a){!a||a instanceof jQuery||this.messagesBodiesDom(b(a))},this),this.messageActiveDom=c.observable(null),this.isMessageSelected=c.computed(function(){return null!==this.message()},this),this.currentMessage=c.observable(null),this.message.subscribe(function(a){null===a&&(this.currentMessage(null),this.hideMessageBodies())},this),this.messageListChecked=c.computed(function(){return h.filter(this.messageList(),function(a){return a.checked()})},this),this.messageListCheckedOrSelected=c.computed(function(){var a=this.messageListChecked(),b=this.currentMessage();return h.union(a,b?[b]:[])},this),this.messageListCheckedUids=c.computed(function(){var a=[];return h.each(this.messageListChecked(),function(b){b&&(a.push(b.uid),00?Math.ceil(b/a*100):0},this),this.useKeyboardShortcuts=c.observable(!0),this.googleActions=c.observable(!1),this.googleLoggined=c.observable(!1),this.googleUserName=c.observable(""),this.facebookActions=c.observable(!1),this.facebookLoggined=c.observable(!1),this.facebookUserName=c.observable(""),this.twitterActions=c.observable(!1),this.twitterLoggined=c.observable(!1),this.twitterUserName=c.observable(""),this.customThemeType=c.observable(nb.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=h.throttle(this.purgeMessageBodyCache,3e4)}function cb(){this.oRequests={}}function db(){cb.call(this),this.oRequests={}}function eb(){this.oEmailsPicsHashes={},this.oServices={}}function fb(){eb.call(this),this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={}}function gb(a){q.call(this,"settings",a),this.menu=c.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}function hb(){q.call(this,"login",[L])}function ib(){q.call(this,"mailbox",[N,P,Q,R]),this.oLastRoute={}}function jb(){gb.call(this,[O,S,T]),pb.initOnStartOrLangChange(function(){this.sSettingsTitle=pb.i18n("TITLES/SETTINGS")},this,function(){Bb.setTitle(this.sSettingsTitle)})}function kb(){o.call(this),this.oSettings=null,this.oPlugins=null,this.oLocal=null,this.oLink=null,this.oSubs={},this.isLocalAutocomplete=!0,this.popupVisibility=c.observable(!1),this.iframe=b('