diff --git a/.jshintrc b/.jshintrc
index 61ca358b3..d7ff8166c 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -50,6 +50,9 @@
"jquery" : true,
"globals": {
+ "module" : true,
+ "require" : true,
+ "ko" : true,
"ko" : true,
"ssm" : true,
"moment" : true,
diff --git a/dev/Admin/AdminSettingsAbout.js b/dev/Admin/AdminSettingsAbout.js
index 8a4311508..2cbd60f03 100644
--- a/dev/Admin/AdminSettingsAbout.js
+++ b/dev/Admin/AdminSettingsAbout.js
@@ -1,14 +1,10 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
- ko = require('../External/ko.js'),
- AppSettings = require('../Storages/AppSettings.js'),
- Data = require('../Storages/AdminDataStorage.js'),
- RL = require('../Boots/AdminApp.js')
+ ko = require('../External/ko.js')
;
/**
@@ -16,6 +12,11 @@
*/
function AdminSettingsAbout()
{
+ var
+ AppSettings = require('../Storages/AppSettings.js'),
+ Data = require('../Storages/AdminDataStorage.js')
+ ;
+
this.version = ko.observable(AppSettings.settingsGet('Version'));
this.access = ko.observable(!!AppSettings.settingsGet('CoreAccess'));
this.errorDesc = ko.observable('');
@@ -70,7 +71,7 @@
{
if (this.access())
{
- RL.reloadCoreData();
+ require('../Boots/AdminApp.js').reloadCoreData();
}
};
@@ -78,7 +79,7 @@
{
if (!this.coreUpdating())
{
- RL.updateCoreData();
+ require('../Boots/AdminApp.js').updateCoreData();
}
};
diff --git a/dev/Admin/AdminSettingsBranding.js b/dev/Admin/AdminSettingsBranding.js
index 21bb254e4..8cef926a0 100644
--- a/dev/Admin/AdminSettingsBranding.js
+++ b/dev/Admin/AdminSettingsBranding.js
@@ -1,18 +1,13 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
- Enums = require('../Common/Enums.js'),
- Utils = require('../Common/Utils.js'),
- AppSettings = require('..Storages/AppSettings.js'),
- Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ Utils = require('../Common/Utils.js')
;
/**
@@ -20,6 +15,11 @@
*/
function AdminSettingsBranding()
{
+ var
+ Enums = require('../Common/Enums.js'),
+ AppSettings = require('..Storages/AppSettings.js')
+ ;
+
this.title = ko.observable(AppSettings.settingsGet('Title'));
this.title.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
@@ -38,7 +38,11 @@
AdminSettingsBranding.prototype.onBuild = function ()
{
- var self = this;
+ var
+ self = this,
+ Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ ;
+
_.delay(function () {
var
diff --git a/dev/Admin/AdminSettingsContacts.js b/dev/Admin/AdminSettingsContacts.js
index ad75f4434..3ac75b6d3 100644
--- a/dev/Admin/AdminSettingsContacts.js
+++ b/dev/Admin/AdminSettingsContacts.js
@@ -1,18 +1,16 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
- AppSettings = require('../Storages/AppSettings.js'),
- Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ AppSettings = require('../Storages/AppSettings.js')
;
/**
@@ -20,6 +18,10 @@
*/
function AdminSettingsContacts()
{
+ var
+ Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ ;
+
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
this.enableContacts = ko.observable(!!AppSettings.settingsGet('ContactsEnable'));
this.contactsSharing = ko.observable(!!AppSettings.settingsGet('ContactsSharing'));
@@ -174,7 +176,11 @@
AdminSettingsContacts.prototype.onBuild = function ()
{
- var self = this;
+ var
+ self = this,
+ Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ ;
+
_.delay(function () {
var
diff --git a/dev/Admin/AdminSettingsDomains.js b/dev/Admin/AdminSettingsDomains.js
index 454f3f4f8..fca41caae 100644
--- a/dev/Admin/AdminSettingsDomains.js
+++ b/dev/Admin/AdminSettingsDomains.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
_ = require('../External/underscore.js'),
@@ -11,7 +10,7 @@
Enums = require('../Common/Enums.js'),
- RL = require('../Boots/AdminApp.js'),
+ PopupsDomainViewModel = require('../ViewModels/Popups/PopupsDomainViewModel.js'),
Data = require('../Storages/AdminDataStorage.js'),
Remote = require('../Storages/AdminAjaxRemoteStorage.js')
@@ -58,7 +57,7 @@
AdminSettingsDomains.prototype.createDomain = function ()
{
- kn.showScreenPopup(PopupsDomainViewModel);
+ require('../Knoin/Knoin.js').showScreenPopup(PopupsDomainViewModel);
};
AdminSettingsDomains.prototype.deleteDomain = function (oDomain)
@@ -86,20 +85,20 @@
})
;
- RL.reloadDomainList();
+ require('../Boots/AdminApp.js').reloadDomainList();
};
AdminSettingsDomains.prototype.onDomainLoadRequest = function (sResult, oData)
{
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
- kn.showScreenPopup(PopupsDomainViewModel, [oData.Result]);
+ require('../Knoin/Knoin.js').showScreenPopup(PopupsDomainViewModel, [oData.Result]);
}
};
AdminSettingsDomains.prototype.onDomainListChangeRequest = function ()
{
- RL.reloadDomainList();
+ require('../Boots/AdminApp.js').reloadDomainList();
};
module.exports = AdminSettingsDomains;
diff --git a/dev/Admin/AdminSettingsGeneral.js b/dev/Admin/AdminSettingsGeneral.js
index a310674b0..8cec855b1 100644
--- a/dev/Admin/AdminSettingsGeneral.js
+++ b/dev/Admin/AdminSettingsGeneral.js
@@ -1,22 +1,18 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
- kn = require('../Knoin/Knoin.js'),
-
AppSettings = require('../Storages/AppSettings.js'),
Data = require('../Storages/AdminDataStorage.js'),
- Remote = require('../Storages/AdminAjaxRemoteStorage.js'),
PopupsLanguagesViewModel = require('../ViewModels/Popups/PopupsLanguagesViewModel.js')
;
@@ -69,7 +65,11 @@
AdminSettingsGeneral.prototype.onBuild = function ()
{
- var self = this;
+ var
+ self = this,
+ Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ ;
+
_.delay(function () {
var
@@ -131,7 +131,7 @@
AdminSettingsGeneral.prototype.selectLanguage = function ()
{
- kn.showScreenPopup(PopupsLanguagesViewModel);
+ require('../Knoin/Knoin.js').showScreenPopup(PopupsLanguagesViewModel);
};
/**
diff --git a/dev/Admin/AdminSettingsLicensing.js b/dev/Admin/AdminSettingsLicensing.js
index 7fb256cc7..42d584b95 100644
--- a/dev/Admin/AdminSettingsLicensing.js
+++ b/dev/Admin/AdminSettingsLicensing.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
moment = require('../External/moment.js'),
@@ -11,9 +10,6 @@
AppSettings = require('../Storages/AppSettings.js'),
Data = require('../Storages/AdminDataStorage.js'),
- RL = require('../Boots/AdminApp.js'),
-
- kn = require('../Knoin/Knoin.js'),
PopupsActivateViewModel = require('../ViewModels/Popups/PopupsActivateViewModel.js')
;
@@ -35,7 +31,7 @@
this.licenseTrigger.subscribe(function () {
if (this.subscriptionEnabled())
{
- RL.reloadLicensing(true);
+ require('../Boots/AdminApp.js').reloadLicensing(true);
}
}, this);
}
@@ -44,7 +40,7 @@
{
if (this.subscriptionEnabled())
{
- RL.reloadLicensing(false);
+ require('../Boots/AdminApp.js').reloadLicensing(false);
}
};
@@ -55,7 +51,7 @@
AdminSettingsLicensing.prototype.showActivationForm = function ()
{
- kn.showScreenPopup(PopupsActivateViewModel);
+ require('../Knoin/Knoin.js').showScreenPopup(PopupsActivateViewModel);
};
/**
@@ -70,7 +66,7 @@
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
};
-
+
module.exports = AdminSettingsLicensing;
}(module));
\ No newline at end of file
diff --git a/dev/Admin/AdminSettingsLogin.js b/dev/Admin/AdminSettingsLogin.js
index 692844a42..f50d246ab 100644
--- a/dev/Admin/AdminSettingsLogin.js
+++ b/dev/Admin/AdminSettingsLogin.js
@@ -1,18 +1,17 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
+ _ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
AppSettings = require('../Storages/AppSettings.js'),
- Data = require('../Storages/AdminDataStorage.js'),
- Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ Data = require('../Storages/AdminDataStorage.js')
;
/**
@@ -31,7 +30,11 @@
AdminSettingsLogin.prototype.onBuild = function ()
{
- var self = this;
+ var
+ self = this,
+ Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ ;
+
_.delay(function () {
var f1 = Utils.settingsSaveHelperSimpleFunction(self.defaultDomainTrigger, self);
diff --git a/dev/Admin/AdminSettingsPackages.js b/dev/Admin/AdminSettingsPackages.js
index f7129cb62..14e8ded55 100644
--- a/dev/Admin/AdminSettingsPackages.js
+++ b/dev/Admin/AdminSettingsPackages.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
ko = require('../External/ko.js'),
@@ -11,8 +10,6 @@
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
- RL = require('../Boots/AdminApp.js'),
-
Data = require('../Storages/AdminDataStorage.js'),
Remote = require('../Storages/AdminAjaxRemoteStorage.js')
;
@@ -53,7 +50,7 @@
AdminSettingsPackages.prototype.onBuild = function ()
{
- RL.reloadPackagesList();
+ require('../Boots/AdminApp.js').reloadPackagesList();
};
AdminSettingsPackages.prototype.requestHelper = function (oPackage, bInstall)
@@ -88,7 +85,7 @@
}
else
{
- RL.reloadPackagesList();
+ require('../Boots/AdminApp.js').reloadPackagesList();
}
};
};
diff --git a/dev/Admin/AdminSettingsPlugins.js b/dev/Admin/AdminSettingsPlugins.js
index 62fcca9ab..40059a88a 100644
--- a/dev/Admin/AdminSettingsPlugins.js
+++ b/dev/Admin/AdminSettingsPlugins.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
@@ -15,8 +14,6 @@
Data = require('../Storages/AdminDataStorage.js'),
Remote = require('../Storages/AdminAjaxRemoteStorage.js'),
- RL = require('../Boots/AdminApp.js'),
-
PopupsPluginViewModel = require('../ViewModels/Popups/PopupsPluginViewModel.js')
;
@@ -82,14 +79,14 @@
AdminSettingsPlugins.prototype.onShow = function ()
{
this.pluginsError('');
- RL.reloadPluginList();
+ require('../Boots/AdminApp.js').reloadPluginList();
};
AdminSettingsPlugins.prototype.onPluginLoadRequest = function (sResult, oData)
{
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
- kn.showScreenPopup(PopupsPluginViewModel, [oData.Result]);
+ require('../Knoin/Knoin.js').showScreenPopup(PopupsPluginViewModel, [oData.Result]);
}
};
@@ -110,7 +107,7 @@
}
}
- RL.reloadPluginList();
+ require('../Boots/AdminApp.js').reloadPluginList();
};
module.exports = AdminSettingsPlugins;
diff --git a/dev/Admin/AdminSettingsSecurity.js b/dev/Admin/AdminSettingsSecurity.js
index 28dcf956c..fd1af5fed 100644
--- a/dev/Admin/AdminSettingsSecurity.js
+++ b/dev/Admin/AdminSettingsSecurity.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
@@ -94,6 +93,10 @@
AdminSettingsSecurity.prototype.onBuild = function ()
{
+ var
+ Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ ;
+
this.capaOpenPGP.subscribe(function (bValue) {
Remote.saveAdminConfig(Utils.emptyFunction, {
'CapaOpenPGP': bValue ? '1' : '0'
@@ -127,7 +130,7 @@
{
return LinkBuilder.phpInfo();
};
-
+
module.exports = AdminSettingsSecurity;
}(module));
diff --git a/dev/Admin/AdminSettingsSocial.js b/dev/Admin/AdminSettingsSocial.js
index 548b81c9d..9fabc5848 100644
--- a/dev/Admin/AdminSettingsSocial.js
+++ b/dev/Admin/AdminSettingsSocial.js
@@ -1,18 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
- Enums = require('../Common/Enums.js'),
- Utils = require('../Common/Utils.js'),
- Data = require('../Storages/AdminDataStorage.js'),
- Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ Enums = require('../Common/Enums.js'),
+ Utils = require('../Common/Utils.js')
;
/**
@@ -20,6 +16,8 @@
*/
function AdminSettingsSocial()
{
+ var Data = require('../Storages/AdminDataStorage.js');
+
this.googleEnable = Data.googleEnable;
this.googleClientID = Data.googleClientID;
this.googleApiKey = Data.googleApiKey;
@@ -48,7 +46,11 @@
AdminSettingsSocial.prototype.onBuild = function ()
{
- var self = this;
+ var
+ self = this,
+ Remote = require('../Storages/AdminAjaxRemoteStorage.js')
+ ;
+
_.delay(function () {
var
diff --git a/dev/Boots/AbstractApp.js b/dev/Boots/AbstractApp.js
index 4bf32ce70..2a8f75ec6 100644
--- a/dev/Boots/AbstractApp.js
+++ b/dev/Boots/AbstractApp.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
@@ -19,7 +18,6 @@
AppSettings = require('../Storages/AppSettings.js'),
- kn = require('../Knoin/Knoin.js'),
KnoinAbstractBoot = require('../Knoin/KnoinAbstractBoot.js')
;
@@ -143,6 +141,7 @@
AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose)
{
var
+ kn = require('../Knoin/Knoin.js'),
sCustomLogoutLink = Utils.pString(AppSettings.settingsGet('CustomLogoutLink')),
bInIframe = !!AppSettings.settingsGet('InIframe')
;
@@ -192,19 +191,10 @@
window.history.back();
};
- /**
- * @param {string} sQuery
- * @param {Function} fCallback
- */
- AbstractApp.prototype.getAutocomplete = function (sQuery, fCallback)
- {
- fCallback([], sQuery);
- };
-
AbstractApp.prototype.bootstart = function ()
{
Events.pub('rl.bootstart');
-
+
var ssm = require('../External/ssm.js');
Utils.initOnStartOrLangChange(function () {
diff --git a/dev/Boots/AdminApp.js b/dev/Boots/AdminApp.js
index f047d6a75..88378ee50 100644
--- a/dev/Boots/AdminApp.js
+++ b/dev/Boots/AdminApp.js
@@ -1,14 +1,13 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
_ = require('../External/underscore.js'),
window = require('../External/window.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
@@ -18,7 +17,7 @@
AppSettings = require('../Storages/AppSettings.js'),
Data = require('../Storages/AdminDataStorage.js'),
Remote = require('../Storages/AdminAjaxRemoteStorage.js'),
-
+
AdminSettingsScreen = require('../Screens/AdminSettingsScreen.js'),
AdminLoginScreen = require('../Screens/AdminLoginScreen.js'),
@@ -97,14 +96,14 @@
kn.addSettingsViewModel(AdminSettingsAbout,
'AdminSettingsAbout', 'About', 'about');
-
+
return true;
};
AdminApp.prototype.reloadDomainList = function ()
{
Data.domainsLoading(true);
-
+
Remote.domainList(function (sResult, oData) {
Data.domainsLoading(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
@@ -128,7 +127,7 @@
Remote.pluginList(function (sResult, oData) {
Data.pluginsLoading(false);
-
+
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
var aList = _.map(oData.Result, function (oItem) {
diff --git a/dev/Boots/Boot.js b/dev/Boots/Boot.js
index 0c763f81c..7fc5b57b4 100644
--- a/dev/Boots/Boot.js
+++ b/dev/Boots/Boot.js
@@ -1,29 +1,29 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
+ _ = require('../External/underscore.js'),
$ = require('../External/jquery.js'),
$window = require('../External/$window.js'),
$html = require('../External/$html.js'),
-
+
Globals = require('../Common/Globals.js'),
Plugins = require('../Common/Plugins.js'),
Utils = require('../Common/Utils.js')
;
- module.exports = function (RL) {
+ module.exports = function (App) {
- Globals.__RL = RL;
+ Globals.__RL = App;
- RL.setupSettings();
+ App.setupSettings();
- Plugins.__boot = RL;
- Plugins.__remote = RL.remote();
- Plugins.__data = RL.data();
+ Plugins.__boot = App;
+ Plugins.__remote = App.remote();
+ Plugins.__data = App.data();
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@@ -58,7 +58,7 @@
_.delay(function () {
- RL.bootstart();
+ App.bootstart();
$html.removeClass('no-js rl-booted-trigger').addClass('rl-booted');
}, 50);
diff --git a/dev/Boots/RainLoopApp.js b/dev/Boots/RainLoopApp.js
index a3dfc5296..1fbcfcb5e 100644
--- a/dev/Boots/RainLoopApp.js
+++ b/dev/Boots/RainLoopApp.js
@@ -1,15 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
moment = require('../External/moment.js'),
-
+
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
Consts = require('../Common/Consts.js'),
@@ -26,11 +25,13 @@
Cache = require('../Storages/WebMailCacheStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
+ EmailModel = require('../Models/EmailModel.js'),
FolderModel = require('../Models/FolderModel.js'),
MessageModel = require('../Models/MessageModel.js'),
AccountModel = require('../Models/AccountModel.js'),
- IdentityModel = require('../Models/IdentityModel.js'),
-
+ IdentityModel = require('../Models/IdentityModel.js'),
+ OpenPgpKeyModel = require('../Models/OpenPgpKeyModel.js'),
+
PopupsFolderSystemViewModel = require('../ViewModels/Popups/PopupsAskViewModel.js'),
PopupsAskViewModel = require('../ViewModels/Popups/PopupsAskViewModel.js'),
PopupsComposeViewModel = require('../ViewModels/Popups/PopupsComposeViewModel.js'),
@@ -90,6 +91,7 @@
}, 60000 * 5);
$.wakeUp(function () {
+
Remote.jsVersion(function (sResult, oData) {
if (Enums.StorageResultType.Success === sResult && oData && !oData.Result)
{
@@ -103,6 +105,7 @@
}
}
}, self.settingsGet('Version'));
+
}, {}, 60 * 60 * 1000);
@@ -176,9 +179,9 @@
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
}
- if (!AppSettings.settingsGet('AllowGoogleSocial') &&
- !AppSettings.settingsGet('AllowFacebookSocial') &&
- !AppSettings.settingsGet('AllowTwitterSocial'))
+ if (AppSettings.settingsGet('AllowGoogleSocial') ||
+ AppSettings.settingsGet('AllowFacebookSocial') ||
+ AppSettings.settingsGet('AllowTwitterSocial'))
{
kn.addSettingsViewModel(SettingsSocial,
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
@@ -204,7 +207,7 @@
kn.addSettingsViewModel(SettingsOpenPGP,
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
}
-
+
return true;
};
@@ -272,7 +275,7 @@
RainLoopApp.prototype.reloadMessageListHelper = function (bEmptyList)
{
- self.reloadMessageList(bEmptyList);
+ this.reloadMessageList(bEmptyList);
};
/**
@@ -1081,6 +1084,7 @@
RainLoopApp.prototype.folderResponseParseRec = function (sNamespace, aFolders)
{
var
+ self = this,
iIndex = 0,
iLen = 0,
oFolder = null,
@@ -1110,10 +1114,7 @@
if (oCacheFolder)
{
- if (Globals.__RL)
- {
- oCacheFolder.collapsed(!Globals.__RL.isFolderExpanded(oCacheFolder.fullNameHash));
- }
+ oCacheFolder.collapsed(!self.isFolderExpanded(oCacheFolder.fullNameHash));
if (oFolder.Extended)
{
diff --git a/dev/Common/Base64.js b/dev/Common/Base64.js
index 1dc53472e..b0bc13778 100644
--- a/dev/Common/Base64.js
+++ b/dev/Common/Base64.js
@@ -1,10 +1,9 @@
// Base64 encode / decode
// http://www.webtoolkit.info/
+'use strict';
(function (module) {
- 'use strict';
-
/*jslint bitwise: true*/
var Base64 = {
diff --git a/dev/Common/Consts.js b/dev/Common/Consts.js
index aceeef5cb..34f53537b 100644
--- a/dev/Common/Consts.js
+++ b/dev/Common/Consts.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var Consts = {};
Consts.Values = {};
diff --git a/dev/Common/Enums.js b/dev/Common/Enums.js
index 5aa65f60c..31ae4415f 100644
--- a/dev/Common/Enums.js
+++ b/dev/Common/Enums.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var Enums = {};
/**
diff --git a/dev/Common/Events.js b/dev/Common/Events.js
index 224b1a832..182b261d6 100644
--- a/dev/Common/Events.js
+++ b/dev/Common/Events.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
-
+
Utils = require('./Utils.js'),
Plugins = require('./Plugins.js')
;
-
+
/**
* @constructor
*/
@@ -47,7 +46,7 @@
Events.prototype.pub = function (sName, aArgs)
{
Plugins.runHook('rl-pub', [sName, aArgs]);
-
+
if (!Utils.isUnd(this.oSubs[sName]))
{
_.each(this.oSubs[sName], function (aItem) {
diff --git a/dev/Common/Globals.js b/dev/Common/Globals.js
index 45b1645d7..0da028165 100644
--- a/dev/Common/Globals.js
+++ b/dev/Common/Globals.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
Globals = {},
window = require('../External/window.js'),
ko = require('../External/ko.js'),
key = require('../External/key.js'),
$html = require('../External/$html.js'),
-
+
Enums = require('../Common/Enums.js')
;
@@ -108,7 +107,7 @@
* @type {string}
*/
Globals.sAnimationType = '';
-
+
/**
* @type {*}
*/
@@ -181,11 +180,11 @@
}
Globals.oI18N = window['rainloopI18N'] || {};
-
+
Globals.oNotificationI18N = {};
-
+
Globals.aBootstrapDropdowns = [];
-
+
Globals.aViewModels = {
'settings': [],
'settings-removed': [],
@@ -270,7 +269,7 @@
Globals.keyScope(Globals.keyScopeFake());
}
});
-
+
module.exports = Globals;
}(module));
\ No newline at end of file
diff --git a/dev/Common/LinkBuilder.js b/dev/Common/LinkBuilder.js
index d2b15ab46..b118354ac 100644
--- a/dev/Common/LinkBuilder.js
+++ b/dev/Common/LinkBuilder.js
@@ -1,20 +1,20 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
- Utils = require('./Utils.js'),
- AppSettings = require('../Storages/AppSettings.js')
+ Utils = require('./Utils.js')
;
-
+
/**
* @constructor
*/
function LinkBuilder()
{
+ var AppSettings = require('../Storages/AppSettings.js');
+
this.sBase = '#/';
this.sServer = './?';
this.sVersion = AppSettings.settingsGet('Version');
diff --git a/dev/Common/NewHtmlEditorWrapper.js b/dev/Common/NewHtmlEditorWrapper.js
index ffa89bb5b..be6216310 100644
--- a/dev/Common/NewHtmlEditorWrapper.js
+++ b/dev/Common/NewHtmlEditorWrapper.js
@@ -1,15 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
+ _ = require('../External/underscore.js'),
Globals = require('./Globals.js'),
AppSettings = require('../Storages/AppSettings.js')
;
-
+
/**
* @constructor
* @param {Object} oElement
@@ -19,18 +19,17 @@
*/
function NewHtmlEditorWrapper(oElement, fOnBlur, fOnReady, fOnModeChange)
{
- var self = this;
- self.editor = null;
- self.iBlurTimer = 0;
- self.fOnBlur = fOnBlur || null;
- self.fOnReady = fOnReady || null;
- self.fOnModeChange = fOnModeChange || null;
+ this.editor = null;
+ this.iBlurTimer = 0;
+ this.fOnBlur = fOnBlur || null;
+ this.fOnReady = fOnReady || null;
+ this.fOnModeChange = fOnModeChange || null;
- self.$element = $(oElement);
+ this.$element = $(oElement);
- self.resize = _.throttle(_.bind(self.resize, self), 100);
+ this.resize = _.throttle(_.bind(this.resize, this), 100);
- self.init();
+ this.init();
}
NewHtmlEditorWrapper.prototype.blurTrigger = function ()
@@ -38,8 +37,8 @@
if (this.fOnBlur)
{
var self = this;
- window.clearTimeout(self.iBlurTimer);
- self.iBlurTimer = window.setTimeout(function () {
+ window.clearTimeout(this.iBlurTimer);
+ this.iBlurTimer = window.setTimeout(function () {
self.fOnBlur();
}, 200);
}
diff --git a/dev/Common/Plugins.js b/dev/Common/Plugins.js
index b69e45424..dd8b97a37 100644
--- a/dev/Common/Plugins.js
+++ b/dev/Common/Plugins.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
Plugins = {
__boot: null,
diff --git a/dev/Common/Selector.js b/dev/Common/Selector.js
index cf8b2435c..7a1c20c8c 100644
--- a/dev/Common/Selector.js
+++ b/dev/Common/Selector.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js
index 49889fa91..c67904a62 100644
--- a/dev/Common/Utils.js
+++ b/dev/Common/Utils.js
@@ -1,18 +1,18 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
-
- 'use strict';
var
Utils = {},
-
+
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
window = require('../External/window.js'),
$window = require('../External/$window.js'),
$html = require('../External/$html.js'),
+ $div = require('../External/$div.js'),
$doc = require('../External/$doc.js'),
NotificationClass = require('../External/NotificationClass.js'),
@@ -419,15 +419,15 @@
if (window['rainloopI18N'])
{
Globals.oI18N = window['rainloopI18N'] || {};
-
+
Utils.i18nToNode($doc);
-
+
Globals.langChangeTrigger(!Globals.langChangeTrigger());
}
window['rainloopI18N'] = null;
};
-
+
/**
* @param {Function} fCallback
* @param {Object} oScope
@@ -462,14 +462,14 @@
*/
Utils.inFocus = function ()
{
- if (document.activeElement)
+ if (window.document.activeElement)
{
- if (Utils.isUnd(document.activeElement.__inFocusCache))
+ if (Utils.isUnd(window.document.activeElement.__inFocusCache))
{
- document.activeElement.__inFocusCache = $(document.activeElement).is('input,textarea,iframe,.cke_editable');
+ window.document.activeElement.__inFocusCache = $(window.document.activeElement).is('input,textarea,iframe,.cke_editable');
}
- return !!document.activeElement.__inFocusCache;
+ return !!window.document.activeElement.__inFocusCache;
}
return false;
@@ -477,12 +477,12 @@
Utils.removeInFocus = function ()
{
- if (document && document.activeElement && document.activeElement.blur)
+ if (window.document && window.document.activeElement && window.document.activeElement.blur)
{
- var oA = $(document.activeElement);
+ var oA = $(window.document.activeElement);
if (oA.is('input,textarea'))
{
- document.activeElement.blur();
+ window.document.activeElement.blur();
}
}
};
@@ -497,9 +497,9 @@
oSel.removeAllRanges();
}
}
- else if (document && document.selection && document.selection.empty)
+ else if (window.document && window.document.selection && window.document.selection.empty)
{
- document.selection.empty();
+ window.document.selection.empty();
}
};
@@ -919,11 +919,14 @@
{
var
fResult = fExecute ? function () {
- if (fResult.canExecute && fResult.canExecute())
+
+ if (fResult && fResult.canExecute && fResult.canExecute())
{
fExecute.apply(oContext, Array.prototype.slice.call(arguments));
}
+
return false;
+
} : function () {}
;
@@ -1466,8 +1469,6 @@
return Utils.settingsSaveHelperFunction(null, koTrigger, oContext, 1000);
};
- Utils.$div = $('
');
-
/**
* @param {string} sHtml
* @return {string}
@@ -1576,7 +1577,7 @@
.replace(/<[^>]*>/gm, '')
;
- sText = Utils.$div.html(sText).text();
+ sText = $div.html(sText).text();
sText = sText
.replace(/\n[ \t]+/gm, '\n')
@@ -1713,7 +1714,7 @@
{
if ($.fn && $.fn.linkify)
{
- sHtml = Utils.$div.html(sHtml.replace(/&/ig, 'amp_amp_12345_amp_amp'))
+ sHtml = $div.html(sHtml.replace(/&/ig, 'amp_amp_12345_amp_amp'))
.linkify()
.find('.linkified').removeClass('linkified').end()
.html()
@@ -1731,7 +1732,7 @@
var
aDiff = [0, 0],
- oCanvas = document.createElement('canvas'),
+ oCanvas = window.document.createElement('canvas'),
oCtx = oCanvas.getContext('2d')
;
diff --git a/dev/External/$div.js b/dev/External/$div.js
index b0b64c43f..fee8b7c33 100644
--- a/dev/External/$div.js
+++ b/dev/External/$div.js
@@ -1,5 +1,4 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')('');
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
+
+module.exports = require('./jquery.js')('');
\ No newline at end of file
diff --git a/dev/External/$doc.js b/dev/External/$doc.js
index c598629de..4509b03dd 100644
--- a/dev/External/$doc.js
+++ b/dev/External/$doc.js
@@ -1,5 +1,4 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')(window.document);
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
+
+module.exports = require('./jquery.js')(window.document);
\ No newline at end of file
diff --git a/dev/External/$html.js b/dev/External/$html.js
index 8ebaa01bf..c761d5bb4 100644
--- a/dev/External/$html.js
+++ b/dev/External/$html.js
@@ -1,5 +1,4 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')('html');
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
+
+module.exports = require('./jquery.js')('html');
\ No newline at end of file
diff --git a/dev/External/$window.js b/dev/External/$window.js
index 2d1d5bae7..8effe09c2 100644
--- a/dev/External/$window.js
+++ b/dev/External/$window.js
@@ -1,5 +1,4 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')(window);
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
+
+module.exports = require('./jquery.js')(window);
\ No newline at end of file
diff --git a/dev/External/AppData.js b/dev/External/AppData.js
index f1e359be3..8d947c9d2 100644
--- a/dev/External/AppData.js
+++ b/dev/External/AppData.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = require('./window.js')['rainloopAppData'] || {};
\ No newline at end of file
diff --git a/dev/External/JSON.js b/dev/External/JSON.js
index 24da22fae..7e5dfcebc 100644
--- a/dev/External/JSON.js
+++ b/dev/External/JSON.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = JSON;
\ No newline at end of file
diff --git a/dev/External/Jua.js b/dev/External/Jua.js
index 1edcac5f1..cbd0f1083 100644
--- a/dev/External/Jua.js
+++ b/dev/External/Jua.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = Jua;
\ No newline at end of file
diff --git a/dev/External/NotificationClass.js b/dev/External/NotificationClass.js
index fa9c34f3b..18bdb0449 100644
--- a/dev/External/NotificationClass.js
+++ b/dev/External/NotificationClass.js
@@ -1,6 +1,5 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-var window = require('./window.js');
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
+
+var window = require('./window.js');
module.exports = window.Notification && window.Notification.requestPermission ? window.Notification : null;
\ No newline at end of file
diff --git a/dev/External/crossroads.js b/dev/External/crossroads.js
index 2b2e8b73a..257256e45 100644
--- a/dev/External/crossroads.js
+++ b/dev/External/crossroads.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = crossroads;
\ No newline at end of file
diff --git a/dev/External/hasher.js b/dev/External/hasher.js
index b729b4298..c7c4ac5a1 100644
--- a/dev/External/hasher.js
+++ b/dev/External/hasher.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = hasher;
\ No newline at end of file
diff --git a/dev/External/ifvisible.js b/dev/External/ifvisible.js
index fc4ae3a18..db1ac0e75 100644
--- a/dev/External/ifvisible.js
+++ b/dev/External/ifvisible.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = ifvisible;
\ No newline at end of file
diff --git a/dev/External/jquery.js b/dev/External/jquery.js
index fc7053940..849e3d81b 100644
--- a/dev/External/jquery.js
+++ b/dev/External/jquery.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = $;
\ No newline at end of file
diff --git a/dev/External/key.js b/dev/External/key.js
index b6dc467e9..957a8b2ef 100644
--- a/dev/External/key.js
+++ b/dev/External/key.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = key;
\ No newline at end of file
diff --git a/dev/External/ko.js b/dev/External/ko.js
index 821f2911c..444d4ac95 100644
--- a/dev/External/ko.js
+++ b/dev/External/ko.js
@@ -1,8 +1,7 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
-(function (module) {
-
- 'use strict';
+(function (module, ko) {
var
window = require('./window.js'),
@@ -55,10 +54,10 @@
ko.bindingHandlers.tooltip2 = {
'init': function (oElement, fValueAccessor) {
var
+ Globals = require('../Common/Globals.js'),
$oEl = $(oElement),
sClass = $oEl.data('tooltip-class') || '',
- sPlacement = $oEl.data('tooltip-placement') || 'top',
- Globals = require('../Common/Globals.js')
+ sPlacement = $oEl.data('tooltip-placement') || 'top'
;
$oEl.tooltip({
@@ -122,11 +121,7 @@
ko.bindingHandlers.registrateBootstrapDropdown = {
'init': function (oElement) {
-
- var
- Globals = require('../Common/Globals.js')
- ;
-
+ var Globals = require('../Common/Globals.js');
Globals.aBootstrapDropdowns.push($(oElement));
}
};
@@ -139,7 +134,7 @@
$el = $(oElement),
Utils = require('../Common/Utils.js')
;
-
+
if (!$el.hasClass('open'))
{
$el.find('.dropdown-toggle').dropdown('toggle');
@@ -167,11 +162,7 @@
ko.bindingHandlers.csstext = {
'init': function (oElement, fValueAccessor) {
-
- var
- Utils = require('../Common/Utils.js')
- ;
-
+ var Utils = require('../Common/Utils.js');
if (oElement && oElement.styleSheet && !Utils.isUnd(oElement.styleSheet.cssText))
{
oElement.styleSheet.cssText = ko.utils.unwrapObservable(fValueAccessor());
@@ -182,11 +173,7 @@
}
},
'update': function (oElement, fValueAccessor) {
-
- var
- Utils = require('../Common/Utils.js')
- ;
-
+ var Utils = require('../Common/Utils.js');
if (oElement && oElement.styleSheet && !Utils.isUnd(oElement.styleSheet.cssText))
{
oElement.styleSheet.cssText = ko.utils.unwrapObservable(fValueAccessor());
@@ -268,6 +255,7 @@
.find('.close').click(function () {
fValueAccessor()(false);
});
+
},
'update': function (oElement, fValueAccessor) {
$(oElement).modal(ko.utils.unwrapObservable(fValueAccessor()) ? 'show' : 'hide');
@@ -276,18 +264,14 @@
ko.bindingHandlers.i18nInit = {
'init': function (oElement) {
- var
- Utils = require('../Common/Utils.js')
- ;
+ var Utils = require('../Common/Utils.js');
Utils.i18nToNode(oElement);
}
};
ko.bindingHandlers.i18nUpdate = {
'update': function (oElement, fValueAccessor) {
- var
- Utils = require('../Common/Utils.js')
- ;
+ var Utils = require('../Common/Utils.js');
ko.utils.unwrapObservable(fValueAccessor());
Utils.i18nToNode(oElement);
}
@@ -326,6 +310,7 @@
});
},
'update': function (oElement, fValueAccessor) {
+
var
Utils = require('../Common/Utils.js'),
aValues = ko.utils.unwrapObservable(fValueAccessor()),
@@ -360,12 +345,10 @@
ko.bindingHandlers.draggable = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor) {
-
var
Globals = require('../Common/Globals.js'),
Utils = require('../Common/Utils.js')
;
-
if (!Globals.bMobileDevice)
{
var
@@ -446,11 +429,7 @@
ko.bindingHandlers.droppable = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor) {
-
- var
- Globals = require('../Common/Globals.js')
- ;
-
+ var Globals = require('../Common/Globals.js');
if (!Globals.bMobileDevice)
{
var
@@ -492,11 +471,7 @@
ko.bindingHandlers.nano = {
'init': function (oElement) {
-
- var
- Globals = require('../Common/Globals.js')
- ;
-
+ var Globals = require('../Common/Globals.js');
if (!Globals.bDisableNanoScroll)
{
$(oElement)
@@ -591,9 +566,11 @@
ko.bindingHandlers.emailsTags = {
'init': function(oElement, fValueAccessor, fAllBindingsAccessor) {
-
+
var
Utils = require('../Common/Utils.js'),
+ EmailModel = require('../Models/EmailModel.js'),
+
$oEl = $(oElement),
fValue = fValueAccessor(),
fAllBindings = fAllBindingsAccessor(),
@@ -662,10 +639,12 @@
};
ko.bindingHandlers.contactTags = {
- 'init': function(oElement, fValueAccessor) {
-
+ 'init': function(oElement, fValueAccessor, fAllBindingsAccessor) {
+
var
Utils = require('../Common/Utils.js'),
+ ContactTagModel = require('../Models/ContactTagModel.js'),
+
$oEl = $(oElement),
fValue = fValueAccessor(),
fAllBindings = fAllBindingsAccessor(),
@@ -777,7 +756,7 @@
ko.extenders.trimmer = function (oTarget)
{
- var
+ var
Utils = require('../Common/Utils.js'),
oResult = ko.computed({
'read': oTarget,
@@ -794,7 +773,7 @@
ko.extenders.posInterer = function (oTarget, iDefault)
{
- var
+ var
Utils = require('../Common/Utils.js'),
oResult = ko.computed({
'read': oTarget,
@@ -852,7 +831,7 @@
ko.extenders.falseTimeout = function (oTarget, iOption)
{
var Utils = require('../Common/Utils.js');
-
+
oTarget.iTimeout = 0;
oTarget.subscribe(function (bValue) {
if (bValue)
@@ -877,6 +856,7 @@
ko.observable.fn.validateEmail = function ()
{
var Utils = require('../Common/Utils.js');
+
this.hasError = ko.observable(false);
this.subscribe(function (sValue) {
@@ -906,6 +886,7 @@
ko.observable.fn.validateFunc = function (fFunc)
{
var Utils = require('../Common/Utils.js');
+
this.hasFuncError = ko.observable(false);
if (Utils.isFunc(fFunc))
@@ -922,4 +903,4 @@
module.exports = ko;
-}(module));
+}(module, ko));
diff --git a/dev/External/moment.js b/dev/External/moment.js
index 55751d793..2eee45592 100644
--- a/dev/External/moment.js
+++ b/dev/External/moment.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = moment;
\ No newline at end of file
diff --git a/dev/External/ssm.js b/dev/External/ssm.js
index 762f091a4..57db98522 100644
--- a/dev/External/ssm.js
+++ b/dev/External/ssm.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = ssm;
\ No newline at end of file
diff --git a/dev/External/underscore.js b/dev/External/underscore.js
index 45e71558c..fd33cd754 100644
--- a/dev/External/underscore.js
+++ b/dev/External/underscore.js
@@ -1,5 +1,4 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
'use strict';
module.exports = _;
\ No newline at end of file
diff --git a/dev/External/window.js b/dev/External/window.js
index 921d4c754..8a031a9ed 100644
--- a/dev/External/window.js
+++ b/dev/External/window.js
@@ -1,5 +1,4 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = window;
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
+
+module.exports = window;
\ No newline at end of file
diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js
index 617367ee3..e9460e651 100644
--- a/dev/Knoin/Knoin.js
+++ b/dev/Knoin/Knoin.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
diff --git a/dev/Knoin/KnoinAbstractBoot.js b/dev/Knoin/KnoinAbstractBoot.js
index 56fad3644..013ee39a4 100644
--- a/dev/Knoin/KnoinAbstractBoot.js
+++ b/dev/Knoin/KnoinAbstractBoot.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
/**
* @constructor
*/
diff --git a/dev/Knoin/KnoinAbstractScreen.js b/dev/Knoin/KnoinAbstractScreen.js
index 19f29cc47..ae72ad9d1 100644
--- a/dev/Knoin/KnoinAbstractScreen.js
+++ b/dev/Knoin/KnoinAbstractScreen.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
crossroads = require('../External/crossroads.js'),
Utils = require('../Common/Utils.js')
diff --git a/dev/Knoin/KnoinAbstractViewModel.js b/dev/Knoin/KnoinAbstractViewModel.js
index 5c35cbc0a..a473a3322 100644
--- a/dev/Knoin/KnoinAbstractViewModel.js
+++ b/dev/Knoin/KnoinAbstractViewModel.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
$window = require('../External/$window.js'),
-
- Utils = require('../Common/Utils.js'),
+
Enums = require('../Common/Enums.js'),
- Globals = require('../Common/Globals.js')
+ Globals = require('../Common/Globals.js'),
+ Utils = require('../Common/Utils.js')
;
/**
@@ -87,6 +86,7 @@
KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
{
var self = this;
+
$window.on('keydown', function (oEvent) {
if (oEvent && self.modalVisibility && self.modalVisibility())
{
diff --git a/dev/Models/AccountModel.js b/dev/Models/AccountModel.js
index 84491f7dd..4fc07108a 100644
--- a/dev/Models/AccountModel.js
+++ b/dev/Models/AccountModel.js
@@ -1,12 +1,10 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
- ko = require('../External/ko.js'),
- LinkBuilder = require('../Common/LinkBuilder.js')
+ ko = require('../External/ko.js')
;
/**
@@ -28,7 +26,7 @@
*/
AccountModel.prototype.changeAccountLink = function ()
{
- return LinkBuilder.change(this.email);
+ return require('../Common/LinkBuilder.js').change(this.email);
};
module.exports = AccountModel;
diff --git a/dev/Models/AttachmentModel.js b/dev/Models/AttachmentModel.js
index 2da3fc21c..9f090c2b6 100644
--- a/dev/Models/AttachmentModel.js
+++ b/dev/Models/AttachmentModel.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
Globals = require('../Common/Globals.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js')
;
-
+
/**
* @constructor
*/
diff --git a/dev/Models/ComposeAttachmentModel.js b/dev/Models/ComposeAttachmentModel.js
index 6489c9c15..d37446043 100644
--- a/dev/Models/ComposeAttachmentModel.js
+++ b/dev/Models/ComposeAttachmentModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
Utils = require('../Common/Utils.js')
diff --git a/dev/Models/ContactModel.js b/dev/Models/ContactModel.js
index 5d307d60d..8d8646c24 100644
--- a/dev/Models/ContactModel.js
+++ b/dev/Models/ContactModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
@@ -11,7 +10,7 @@
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js')
;
-
+
/**
* @constructor
*/
diff --git a/dev/Models/ContactPropertyModel.js b/dev/Models/ContactPropertyModel.js
index ce629e292..2043a36fb 100644
--- a/dev/Models/ContactPropertyModel.js
+++ b/dev/Models/ContactPropertyModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
Enums = require('../Common/Enums.js'),
diff --git a/dev/Models/ContactTagModel.js b/dev/Models/ContactTagModel.js
index 2af2c8022..eef67af4a 100644
--- a/dev/Models/ContactTagModel.js
+++ b/dev/Models/ContactTagModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
Utils = require('../Common/Utils.js')
diff --git a/dev/Models/EmailModel.js b/dev/Models/EmailModel.js
index 7e15f2f0a..956278c3b 100644
--- a/dev/Models/EmailModel.js
+++ b/dev/Models/EmailModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js')
diff --git a/dev/Models/FilterConditionModel.js b/dev/Models/FilterConditionModel.js
index 2e62ce492..6477be478 100644
--- a/dev/Models/FilterConditionModel.js
+++ b/dev/Models/FilterConditionModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
Enums = require('../Common/Enums.js')
diff --git a/dev/Models/FilterModel.js b/dev/Models/FilterModel.js
index 03e2654ec..eb47948f6 100644
--- a/dev/Models/FilterModel.js
+++ b/dev/Models/FilterModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
Enums = require('../Common/Enums.js'),
diff --git a/dev/Models/FolderModel.js b/dev/Models/FolderModel.js
index e721f4296..e3bc36780 100644
--- a/dev/Models/FolderModel.js
+++ b/dev/Models/FolderModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
@@ -44,7 +43,7 @@
this.actionBlink = ko.observable(false).extend({'falseTimeout': 1000});
this.nameForEdit = ko.observable('');
-
+
this.privateMessageCountAll = ko.observable(0);
this.privateMessageCountUnread = ko.observable(0);
diff --git a/dev/Models/IdentityModel.js b/dev/Models/IdentityModel.js
index 011a5d76e..cd2fbf055 100644
--- a/dev/Models/IdentityModel.js
+++ b/dev/Models/IdentityModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
Utils = require('../Common/Utils.js')
diff --git a/dev/Models/MessageModel.js b/dev/Models/MessageModel.js
index 1e1e49a49..589270d65 100644
--- a/dev/Models/MessageModel.js
+++ b/dev/Models/MessageModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
$ = require('../External/jquery.js'),
@@ -1081,6 +1080,7 @@
this.body.data('rl-plain-raw', this.plainRaw);
+ var Data = require('../Storages/WebMailDataStorage.js');
if (Data.capaOpenPGP())
{
this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned());
@@ -1093,37 +1093,39 @@
MessageModel.prototype.storePgpVerifyDataToDom = function ()
{
- if (this.body && Data.capaOpenPGP())
- {
- this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
- this.body.data('rl-pgp-verify-user', this.pgpSignedVerifyUser());
- }
+ var Data = require('../Storages/WebMailDataStorage.js');
+ if (this.body && Data.capaOpenPGP())
+ {
+ this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
+ this.body.data('rl-pgp-verify-user', this.pgpSignedVerifyUser());
+ }
};
MessageModel.prototype.fetchDataToDom = function ()
{
- if (this.body)
- {
- this.isHtml(!!this.body.data('rl-is-html'));
- this.hasImages(!!this.body.data('rl-has-images'));
+ if (this.body)
+ {
+ this.isHtml(!!this.body.data('rl-is-html'));
+ this.hasImages(!!this.body.data('rl-has-images'));
- this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
+ this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
- if (Data.capaOpenPGP())
- {
- this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
- this.isPgpEncrypted(!!this.body.data('rl-plain-pgp-encrypted'));
- this.pgpSignedVerifyStatus(this.body.data('rl-pgp-verify-status'));
- this.pgpSignedVerifyUser(this.body.data('rl-pgp-verify-user'));
- }
- else
- {
- this.isPgpSigned(false);
- this.isPgpEncrypted(false);
- this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None);
- this.pgpSignedVerifyUser('');
- }
- }
+ var Data = require('../Storages/WebMailDataStorage.js');
+ if (Data.capaOpenPGP())
+ {
+ this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
+ this.isPgpEncrypted(!!this.body.data('rl-plain-pgp-encrypted'));
+ this.pgpSignedVerifyStatus(this.body.data('rl-pgp-verify-status'));
+ this.pgpSignedVerifyUser(this.body.data('rl-pgp-verify-user'));
+ }
+ else
+ {
+ this.isPgpSigned(false);
+ this.isPgpEncrypted(false);
+ this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None);
+ this.pgpSignedVerifyUser('');
+ }
+ }
};
MessageModel.prototype.verifyPgpSignedClearMessage = function ()
@@ -1133,6 +1135,7 @@
var
aRes = [],
mPgpMessage = null,
+ Data = require('../Storages/WebMailDataStorage.js'),
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
aPublicKeys = Data.findPublicKeysByEmail(sFrom),
oValidKey = null,
@@ -1196,6 +1199,7 @@
aRes = [],
mPgpMessage = null,
mPgpMessageDecrypted = null,
+ Data = require('../Storages/WebMailDataStorage.js'),
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
aPublicKey = Data.findPublicKeysByEmail(sFrom),
oPrivateKey = Data.findSelfPrivateKey(sPassword),
diff --git a/dev/Models/OpenPgpKeyModel.js b/dev/Models/OpenPgpKeyModel.js
index 8acd51938..9b97d8e7d 100644
--- a/dev/Models/OpenPgpKeyModel.js
+++ b/dev/Models/OpenPgpKeyModel.js
@@ -1,11 +1,10 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
- ko = require('../Externalko.js')
+ ko = require('../External/ko.js')
;
/**
diff --git a/dev/Screens/AbstractSettings.js b/dev/Screens/AbstractSettings.js
index 727594e4f..ef25cff5c 100644
--- a/dev/Screens/AbstractSettings.js
+++ b/dev/Screens/AbstractSettings.js
@@ -1,14 +1,13 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Globals = require('../Common/Globals.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
diff --git a/dev/Screens/AdminLoginScreen.js b/dev/Screens/AdminLoginScreen.js
index 3e963565b..2dc87abe4 100644
--- a/dev/Screens/AdminLoginScreen.js
+++ b/dev/Screens/AdminLoginScreen.js
@@ -1,14 +1,13 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
KnoinAbstractScreen = require('../Knoin/KnoinAbstractScreen.js')
;
-
+
/**
* @constructor
* @extends KnoinAbstractScreen
diff --git a/dev/Screens/AdminSettingsScreen.js b/dev/Screens/AdminSettingsScreen.js
index bde152f97..16b24eef1 100644
--- a/dev/Screens/AdminSettingsScreen.js
+++ b/dev/Screens/AdminSettingsScreen.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
AbstractSettings = require('./AbstractSettings.js')
@@ -19,7 +18,7 @@
AdminMenuViewModel = require('../ViewModels/AdminMenuViewModel.js'),
AdminPaneViewModel = require('../ViewModels/AdminPaneViewModel.js')
;
-
+
AbstractSettings.call(this, [
AdminMenuViewModel,
AdminPaneViewModel
diff --git a/dev/Screens/LoginScreen.js b/dev/Screens/LoginScreen.js
index 17b30a3d8..9e0436057 100644
--- a/dev/Screens/LoginScreen.js
+++ b/dev/Screens/LoginScreen.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
KnoinAbstractScreen = require('../Knoin/KnoinAbstractScreen.js')
diff --git a/dev/Screens/MailBoxScreen.js b/dev/Screens/MailBoxScreen.js
index db09d22db..4668dfbed 100644
--- a/dev/Screens/MailBoxScreen.js
+++ b/dev/Screens/MailBoxScreen.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
$html = require('../External/$html.js'),
-
+
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
Utils = require('../Common/Utils.js'),
@@ -58,7 +57,7 @@
sEmail = Data.accountEmail(),
nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount()
;
-
+
RL.setTitle(('' === sEmail ? '' :
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX'));
};
@@ -150,7 +149,7 @@
});
Events.sub('mailbox.inbox-unread-count', function (nCount) {
- Data.foldersInboxUnreadCount(nCount)
+ Data.foldersInboxUnreadCount(nCount);
});
Data.foldersInboxUnreadCount.subscribe(function () {
diff --git a/dev/Screens/SettingsScreen.js b/dev/Screens/SettingsScreen.js
index dccdcd99e..cc77d9a57 100644
--- a/dev/Screens/SettingsScreen.js
+++ b/dev/Screens/SettingsScreen.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
Globals = require('../Common/Globals.js'),
@@ -22,7 +21,7 @@
{
var
RL = require('../Boots/RainLoopApp.js'),
-
+
SettingsSystemDropDownViewModel = require('../ViewModels/SettingsSystemDropDownViewModel.js'),
SettingsMenuViewModel = require('../ViewModels/SettingsMenuViewModel.js'),
SettingsPaneViewModel = require('../ViewModels/SettingsPaneViewModel.js')
@@ -46,7 +45,7 @@
SettingsScreen.prototype.onShow = function ()
{
var RL = require('../Boots/RainLoopApp.js');
-
+
RL.setTitle(this.sSettingsTitle);
Globals.keyScope(Enums.KeyState.Settings);
};
diff --git a/dev/Settings/SettingsAccounts.js b/dev/Settings/SettingsAccounts.js
index 636574ba0..157cca7a2 100644
--- a/dev/Settings/SettingsAccounts.js
+++ b/dev/Settings/SettingsAccounts.js
@@ -1,14 +1,13 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
diff --git a/dev/Settings/SettingsChangePassword.js b/dev/Settings/SettingsChangePassword.js
index 06c41ffaf..01e7d51d6 100644
--- a/dev/Settings/SettingsChangePassword.js
+++ b/dev/Settings/SettingsChangePassword.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
diff --git a/dev/Settings/SettingsContacts.js b/dev/Settings/SettingsContacts.js
index 8f0a327ae..85bf56c9c 100644
--- a/dev/Settings/SettingsContacts.js
+++ b/dev/Settings/SettingsContacts.js
@@ -1,16 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
-
- Utils = require('../Common/Utils.js'),
-
- Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
+ Utils = require('../Common/Utils.js'),
+
+ Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
Data = require('../Storages/WebMailDataStorage.js')
;
diff --git a/dev/Settings/SettingsFilters.js b/dev/Settings/SettingsFilters.js
index 92cf2f966..6bd81cbd2 100644
--- a/dev/Settings/SettingsFilters.js
+++ b/dev/Settings/SettingsFilters.js
@@ -1,14 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
- Utils = require('../Common/Utils.js'),
- kn = require('../Knoin/Knoin.js'),
- PopupsFilterViewModel = require('../ViewModels/Popups/PopupsFilterViewModel.js')
+ Utils = require('../Common/Utils.js')
;
/**
@@ -31,6 +28,12 @@
SettingsFilters.prototype.addFilter = function ()
{
+ var
+ kn = require('../Knoin/Knoin.js'),
+ FilterModel = require('../Models/FilterModel.js'),
+ PopupsFilterViewModel = require('../ViewModels/Popups/PopupsFilterViewModel.js')
+ ;
+
kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]);
};
diff --git a/dev/Settings/SettingsFolders.js b/dev/Settings/SettingsFolders.js
index 4261d7449..62845c149 100644
--- a/dev/Settings/SettingsFolders.js
+++ b/dev/Settings/SettingsFolders.js
@@ -1,11 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
@@ -17,8 +17,6 @@
Cache = require('../Storages/WebMailCacheStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsFolderCreateViewModel = require('../ViewModels/Popups/PopupsFolderCreateViewModel.js'),
PopupsFolderSystemViewModel = require('../ViewModels/Popups/PopupsFolderSystemViewModel.js')
;
@@ -98,7 +96,11 @@
SettingsFolders.prototype.folderEditOnEnter = function (oFolder)
{
- var sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : '';
+ var
+ RL = require('../Boots/RainLoopApp.js'),
+ sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
+ ;
+
if ('' !== sEditName && oFolder.name() !== sEditName)
{
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, '');
@@ -156,6 +158,7 @@
this.folderForDeletion(null);
var
+ RL = require('../Boots/RainLoopApp.js'),
fRemoveFolder = function (oFolder) {
if (oFolderToRemove === oFolder)
diff --git a/dev/Settings/SettingsGeneral.js b/dev/Settings/SettingsGeneral.js
index 7581efda8..67f576915 100644
--- a/dev/Settings/SettingsGeneral.js
+++ b/dev/Settings/SettingsGeneral.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../External/jquery.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Consts = require('../Common/Consts.js'),
Globals = require('../Common/Globals.js'),
@@ -175,7 +174,7 @@
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
-
+
module.exports = SettingsGeneral;
}(module));
\ No newline at end of file
diff --git a/dev/Settings/SettingsIdentities.js b/dev/Settings/SettingsIdentities.js
index 0f0950b59..6c6be0f1d 100644
--- a/dev/Settings/SettingsIdentities.js
+++ b/dev/Settings/SettingsIdentities.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
NewHtmlEditorWrapper = require('../Common/NewHtmlEditorWrapper.js'),
@@ -14,8 +13,6 @@
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
kn = require('../Knoin/Knoin.js'),
PopupsIdentityViewModel = require('../ViewModels/Popups/PopupsIdentityViewModel.js')
;
@@ -135,6 +132,7 @@
this.identityForDeletion(null);
var
+ RL = require('../Boots/RainLoopApp.js'),
fRemoveFolder = function (oIdentity) {
return oIdentityToRemove === oIdentity;
}
diff --git a/dev/Settings/SettingsIdentity.js b/dev/Settings/SettingsIdentity.js
index 89945017e..709a1a656 100644
--- a/dev/Settings/SettingsIdentity.js
+++ b/dev/Settings/SettingsIdentity.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
NewHtmlEditorWrapper = require('../Common/NewHtmlEditorWrapper.js'),
diff --git a/dev/Settings/SettingsOpenPGP.js b/dev/Settings/SettingsOpenPGP.js
index 858c686c2..a3fdaaea1 100644
--- a/dev/Settings/SettingsOpenPGP.js
+++ b/dev/Settings/SettingsOpenPGP.js
@@ -1,18 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
-
+
kn = require('../Knoin/Knoin.js'),
Data = require('../Storages/WebMailDataStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsAddOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js'),
PopupsGenerateNewOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js'),
PopupsViewOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js')
@@ -80,6 +77,7 @@
Data.openpgpKeyring.store();
+ var RL = require('../Boots/RainLoopApp.js');
RL.reloadOpenPgpKeys();
}
}
diff --git a/dev/Settings/SettingsSecurity.js b/dev/Settings/SettingsSecurity.js
index a9167ee2e..8a99aae3c 100644
--- a/dev/Settings/SettingsSecurity.js
+++ b/dev/Settings/SettingsSecurity.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
Utils = require('../Common/Utils.js'),
-
+
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
kn = require('../Knoin/Knoin.js'),
diff --git a/dev/Settings/SettingsSocial.js b/dev/Settings/SettingsSocial.js
index b76f40de6..4d230b8bb 100644
--- a/dev/Settings/SettingsSocial.js
+++ b/dev/Settings/SettingsSocial.js
@@ -1,22 +1,19 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
- var
- Utils = require('../Common/Utils.js'),
-
- Data = require('../Storages/WebMailDataStorage.js'),
-
- RL = require('../Boots/RainLoopApp.js')
- ;
-
/**
* @constructor
*/
function SettingsSocial()
{
+ var
+ Utils = require('../Common/Utils.js'),
+ RL = require('../Boots/RainLoopApp.js'),
+ Data = require('../Storages/WebMailDataStorage.js')
+ ;
+
this.googleEnable = Data.googleEnable;
this.googleActions = Data.googleActions;
diff --git a/dev/Settings/SettingsThemes.js b/dev/Settings/SettingsThemes.js
index 40f3842b4..c0688e17b 100644
--- a/dev/Settings/SettingsThemes.js
+++ b/dev/Settings/SettingsThemes.js
@@ -1,14 +1,13 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
$ = require('../External/jquery.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
@@ -71,7 +70,7 @@
'url': sUrl,
'dataType': 'json'
}).done(function(aData) {
-
+
if (aData && Utils.isArray(aData) && 2 === aData.length)
{
if (oThemeLink && oThemeLink[0] && (!oThemeStyle || !oThemeStyle[0]))
diff --git a/dev/Storages/AbstractAjaxRemoteStorage.js b/dev/Storages/AbstractAjaxRemoteStorage.js
index cf077a932..2f6e4175a 100644
--- a/dev/Storages/AbstractAjaxRemoteStorage.js
+++ b/dev/Storages/AbstractAjaxRemoteStorage.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
$ = require('../External/jquery.js'),
diff --git a/dev/Storages/AbstractData.js b/dev/Storages/AbstractData.js
index f80538657..068c4fc63 100644
--- a/dev/Storages/AbstractData.js
+++ b/dev/Storages/AbstractData.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
-
+
AppSettings = require('./AppSettings.js')
;
-
+
/**
* @constructor
*/
diff --git a/dev/Storages/AdminAjaxRemoteStorage.js b/dev/Storages/AdminAjaxRemoteStorage.js
index d5d147d52..66604ed66 100644
--- a/dev/Storages/AdminAjaxRemoteStorage.js
+++ b/dev/Storages/AdminAjaxRemoteStorage.js
@@ -1,15 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
-
+
AbstractAjaxRemoteStorage = require('./AbstractAjaxRemoteStorage.js')
;
-
+
/**
* @constructor
* @extends AbstractAjaxRemoteStorage
diff --git a/dev/Storages/AdminDataStorage.js b/dev/Storages/AdminDataStorage.js
index 4e94e2c5e..097df307e 100644
--- a/dev/Storages/AdminDataStorage.js
+++ b/dev/Storages/AdminDataStorage.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
AbstractData = require('./AbstractData.js')
;
diff --git a/dev/Storages/AppSettings.js b/dev/Storages/AppSettings.js
index 2c6e64ddf..b976bc612 100644
--- a/dev/Storages/AppSettings.js
+++ b/dev/Storages/AppSettings.js
@@ -1,64 +1,63 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-(function (module) {
-
- 'use strict';
-
- var
- AppData = require('../External/AppData.js'),
-
- Utils = require('../Common/Utils.js')
- ;
-
- /**
- * @constructor
- */
- function AppSettings()
- {
- this.oSettings = null;
- }
-
- AppSettings.prototype.oSettings = null;
-
- /**
- * @param {string} sName
- * @return {?}
- */
- AppSettings.prototype.settingsGet = function (sName)
- {
- if (null === this.oSettings)
- {
- this.oSettings = Utils.isNormal(AppData) ? AppData : {};
- }
-
- return Utils.isUnd(this.oSettings[sName]) ? null : this.oSettings[sName];
- };
-
- /**
- * @param {string} sName
- * @param {?} mValue
- */
- AppSettings.prototype.settingsSet = function (sName, mValue)
- {
- if (null === this.oSettings)
- {
- this.oSettings = Utils.isNormal(AppData) ? AppData : {};
- }
-
- this.oSettings[sName] = mValue;
- };
-
- /**
- * @param {string} sName
- * @return {boolean}
- */
- AppSettings.prototype.capa = function (sName)
- {
- var mCapa = this.settingsGet('Capa');
- return Utils.isArray(mCapa) && Utils.isNormal(sName) && -1 < Utils.inArray(sName, mCapa);
- };
-
-
- module.exports = new AppSettings();
-
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
+
+(function (module) {
+
+ var
+ AppData = require('../External/AppData.js'),
+
+ Utils = require('../Common/Utils.js')
+ ;
+
+ /**
+ * @constructor
+ */
+ function AppSettings()
+ {
+ this.oSettings = null;
+ }
+
+ AppSettings.prototype.oSettings = null;
+
+ /**
+ * @param {string} sName
+ * @return {?}
+ */
+ AppSettings.prototype.settingsGet = function (sName)
+ {
+ if (null === this.oSettings)
+ {
+ this.oSettings = Utils.isNormal(AppData) ? AppData : {};
+ }
+
+ return Utils.isUnd(this.oSettings[sName]) ? null : this.oSettings[sName];
+ };
+
+ /**
+ * @param {string} sName
+ * @param {?} mValue
+ */
+ AppSettings.prototype.settingsSet = function (sName, mValue)
+ {
+ if (null === this.oSettings)
+ {
+ this.oSettings = Utils.isNormal(AppData) ? AppData : {};
+ }
+
+ this.oSettings[sName] = mValue;
+ };
+
+ /**
+ * @param {string} sName
+ * @return {boolean}
+ */
+ AppSettings.prototype.capa = function (sName)
+ {
+ var mCapa = this.settingsGet('Capa');
+ return Utils.isArray(mCapa) && Utils.isNormal(sName) && -1 < Utils.inArray(sName, mCapa);
+ };
+
+
+ module.exports = new AppSettings();
+
}(module));
\ No newline at end of file
diff --git a/dev/Storages/LocalStorage.js b/dev/Storages/LocalStorage.js
index b2c082270..15ca7035f 100644
--- a/dev/Storages/LocalStorage.js
+++ b/dev/Storages/LocalStorage.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
-
+
CookieDriver = require('./LocalStorages/CookieDriver.js'),
LocalStorageDriver = require('./LocalStorages/LocalStorageDriver.js')
;
diff --git a/dev/Storages/LocalStorages/CookieDriver.js b/dev/Storages/LocalStorages/CookieDriver.js
index c7076328b..c1a02a8d9 100644
--- a/dev/Storages/LocalStorages/CookieDriver.js
+++ b/dev/Storages/LocalStorages/CookieDriver.js
@@ -1,12 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../../External/jquery.js'),
JSON = require('../../External/JSON.js'),
+
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js')
;
diff --git a/dev/Storages/LocalStorages/LocalStorageDriver.js b/dev/Storages/LocalStorages/LocalStorageDriver.js
index f5538c40d..f7ee66f0c 100644
--- a/dev/Storages/LocalStorages/LocalStorageDriver.js
+++ b/dev/Storages/LocalStorages/LocalStorageDriver.js
@@ -1,12 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../../External/window.js'),
JSON = require('../../External/JSON.js'),
+
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js')
;
@@ -81,7 +81,7 @@
return mResult;
};
-
+
module.exports = LocalStorageDriver;
}(module));
\ No newline at end of file
diff --git a/dev/Storages/WebMailAjaxRemoteStorage.js b/dev/Storages/WebMailAjaxRemoteStorage.js
index c8437969d..ee7097234 100644
--- a/dev/Storages/WebMailAjaxRemoteStorage.js
+++ b/dev/Storages/WebMailAjaxRemoteStorage.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
@@ -15,7 +14,7 @@
AppSettings = require('./AppSettings.js'),
Cache = require('./WebMailCacheStorage.js'),
Data = require('./WebMailDataStorage.js'),
-
+
AbstractAjaxRemoteStorage = require('./AbstractAjaxRemoteStorage.js')
;
diff --git a/dev/Storages/WebMailCacheStorage.js b/dev/Storages/WebMailCacheStorage.js
index af88cf025..de1282f0b 100644
--- a/dev/Storages/WebMailCacheStorage.js
+++ b/dev/Storages/WebMailCacheStorage.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
diff --git a/dev/Storages/WebMailDataStorage.js b/dev/Storages/WebMailDataStorage.js
index ecbdaa68c..51efee8ff 100644
--- a/dev/Storages/WebMailDataStorage.js
+++ b/dev/Storages/WebMailDataStorage.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
$ = require('../External/jquery.js'),
@@ -12,7 +11,7 @@
moment = require('../External/moment.js'),
$div = require('../External/$div.js'),
NotificationClass = require('../External/NotificationClass.js'),
-
+
Consts = require('../Common/Consts.js'),
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
@@ -21,9 +20,9 @@
AppSettings = require('./AppSettings.js'),
Cache = require('./WebMailCacheStorage.js'),
-
+
kn = require('../Knoin/Knoin.js'),
-
+
MessageModel = require('../Models/MessageModel.js'),
LocalStorage = require('./LocalStorage.js'),
@@ -325,7 +324,10 @@
if (Enums.Layout.NoPreview === this.layout() &&
-1 < window.location.hash.indexOf('message-preview'))
{
- RL.historyBack(); // TODO cjs
+ if (Globals.__RL)
+ {
+ Globals.__RL.historyBack();
+ }
}
}
else if (Enums.Layout.NoPreview === this.layout())
@@ -922,7 +924,10 @@
Cache.initMessageFlagsFromCache(oMessage);
if (oMessage.unseen())
{
- RL.setMessageSeen(oMessage);
+ if (Globals.__RL)
+ {
+ Globals.__RL.setMessageSeen(oMessage);
+ }
}
Utils.windowResize();
diff --git a/dev/ViewModels/AbstractSystemDropDownViewModel.js b/dev/ViewModels/AbstractSystemDropDownViewModel.js
index adf1e2283..799cb8a15 100644
--- a/dev/ViewModels/AbstractSystemDropDownViewModel.js
+++ b/dev/ViewModels/AbstractSystemDropDownViewModel.js
@@ -1,15 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
window = require('../External/window.js'),
key = require('../External/key.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
@@ -18,8 +17,6 @@
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsKeyboardShortcutsHelpViewModel = require('../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js'),
PopupsAddAccountViewModel = require('../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js'),
@@ -91,6 +88,7 @@
AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
{
+ var RL = require('../Boots/RainLoopApp.js');
Remote.logout(function () {
if (window.__rlah_clear)
{
diff --git a/dev/ViewModels/AdminLoginViewModel.js b/dev/ViewModels/AdminLoginViewModel.js
index b5d759c5d..ab95524af 100644
--- a/dev/ViewModels/AdminLoginViewModel.js
+++ b/dev/ViewModels/AdminLoginViewModel.js
@@ -1,20 +1,17 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
Remote = require('../Storages/AdminAjaxRemoteStorage.js'),
- RL = require('../Boots/AdminApp.js'),
-
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js')
;
@@ -66,6 +63,7 @@
{
if (oData.Result)
{
+ var RL = require('../Boots/AdminApp.js');
RL.loginAndLogoutReload();
}
else if (oData.ErrorCode)
diff --git a/dev/ViewModels/AdminMenuViewModel.js b/dev/ViewModels/AdminMenuViewModel.js
index 888ddfb85..284552d8a 100644
--- a/dev/ViewModels/AdminMenuViewModel.js
+++ b/dev/ViewModels/AdminMenuViewModel.js
@@ -1,15 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
kn = require('../Knoin/Knoin.js'),
Globals = require('../Common/Globals.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js')
;
-
+
/**
* @param {?} oScreen
*
diff --git a/dev/ViewModels/AdminPaneViewModel.js b/dev/ViewModels/AdminPaneViewModel.js
index 7066c5685..dfaf7bab6 100644
--- a/dev/ViewModels/AdminPaneViewModel.js
+++ b/dev/ViewModels/AdminPaneViewModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../External/ko.js'),
@@ -11,8 +10,6 @@
Data = require('../Storages/AdminDataStorage.js'),
Remote = require('../Storages/AdminAjaxRemoteStorage.js'),
- RL = require('../Boots/AdminApp.js'),
-
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js')
;
@@ -38,6 +35,7 @@
AdminPaneViewModel.prototype.logoutClick = function ()
{
Remote.adminLogout(function () {
+ var RL = require('../Boots/AdminApp.js');
RL.loginAndLogoutReload();
});
};
diff --git a/dev/ViewModels/LoginViewModel.js b/dev/ViewModels/LoginViewModel.js
index 8f0971a35..21a1244ad 100644
--- a/dev/ViewModels/LoginViewModel.js
+++ b/dev/ViewModels/LoginViewModel.js
@@ -1,15 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Utils = require('../Common/Utils.js'),
Enums = require('../Common/Enums.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
@@ -18,8 +17,6 @@
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js'),
@@ -135,6 +132,7 @@
}
else
{
+ var RL = require('../Boots/RainLoopApp.js');
RL.loginAndLogoutReload();
}
}
@@ -233,6 +231,7 @@
window.open(LinkBuilder.socialTwitter(), 'Twitter',
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
+
return true;
}, function () {
@@ -293,6 +292,8 @@
if (0 === iErrorCode)
{
self.submitRequest(true);
+
+ var RL = require('../Boots/RainLoopApp.js');
RL.loginAndLogoutReload();
}
else
diff --git a/dev/ViewModels/MailBoxFolderListViewModel.js b/dev/ViewModels/MailBoxFolderListViewModel.js
index 31aaaa73a..f71a7632d 100644
--- a/dev/ViewModels/MailBoxFolderListViewModel.js
+++ b/dev/ViewModels/MailBoxFolderListViewModel.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../External/window.js'),
$ = require('../External/jquery.js'),
ko = require('../External/ko.js'),
key = require('../External/key.js'),
$html = require('../External/$html.js'),
-
+
Utils = require('../Common/Utils.js'),
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
@@ -20,8 +19,6 @@
Cache = require('../Storages/WebMailCacheStorage.js'),
Data = require('../Storages/WebMailDataStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js'),
PopupsFolderCreateViewModel = require('./Popups/PopupsFolderCreateViewModel.js'),
PopupsContactsViewModel = require('./Popups/PopupsContactsViewModel.js'),
@@ -62,7 +59,10 @@
this.oContentVisible = $('.b-content', oDom);
this.oContentScrollable = $('.content', this.oContentVisible);
- var self = this;
+ var
+ self = this,
+ RL = require('../Boots/RainLoopApp.js')
+ ;
oDom
.on('click', '.b-folders .e-item .e-link .e-collapsed-sign', function (oEvent) {
@@ -185,6 +185,7 @@
window.clearTimeout(this.iDropOverTimer);
if (oFolder && oFolder.collapsed())
{
+ var RL = require('../Boots/RainLoopApp.js');
this.iDropOverTimer = window.setTimeout(function () {
oFolder.collapsed(false);
RL.setExpandedFolder(oFolder.fullNameHash, true);
@@ -240,6 +241,7 @@
if (oToFolder && oUi && oUi.helper)
{
var
+ RL = require('../Boots/RainLoopApp.js'),
sFromFolderFullNameRaw = oUi.helper.data('rl-folder'),
bCopy = $html.hasClass('rl-ctrl-key-pressed'),
aUids = oUi.helper.data('rl-uids')
diff --git a/dev/ViewModels/MailBoxMessageListViewModel.js b/dev/ViewModels/MailBoxMessageListViewModel.js
index 1659737d1..1911bfe72 100644
--- a/dev/ViewModels/MailBoxMessageListViewModel.js
+++ b/dev/ViewModels/MailBoxMessageListViewModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
@@ -11,11 +10,11 @@
key = require('../External/key.js'),
ifvisible = require('../External/ifvisible.js'),
Jua = require('../External/Jua.js'),
-
- Utils = require('../Common/Utils.js'),
+
Enums = require('../Common/Enums.js'),
Consts = require('../Common/Consts.js'),
Globals = require('../Common/Globals.js'),
+ Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
Events = require('../Common/Events.js'),
Selector = require('../Common/Selector.js'),
@@ -25,12 +24,12 @@
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js'),
- PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js')
+ PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js'),
+ PopupsAdvancedSearchViewModel = require('./Popups/PopupsAdvancedSearchViewModel.js'),
+ PopupsFolderClearViewModel = require('./Popups/PopupsFolderClearViewModel.js')
;
/**
@@ -39,6 +38,8 @@
*/
function MailBoxMessageListViewModel()
{
+ var RL = require('../Boots/RainLoopApp.js');
+
KnoinAbstractViewModel.call(this, 'Right', 'MailMessageList');
this.sLastUid = null;
@@ -305,6 +306,7 @@
{
if (this.canBeMoved())
{
+ var RL = require('../Boots/RainLoopApp.js');
RL.moveMessagesToFolder(
Data.currentFolderFullNameRaw(),
Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy);
@@ -392,7 +394,8 @@
var
aUids = [],
oFolder = null,
- iAlreadyUnread = 0
+ iAlreadyUnread = 0,
+ RL = require('../Boots/RainLoopApp.js')
;
if (Utils.isUnd(aMessages))
@@ -472,7 +475,8 @@
{
var
oFolder = null,
- aMessages = Data.messageList()
+ aMessages = Data.messageList(),
+ RL = require('../Boots/RainLoopApp.js')
;
if ('' !== sFolderFullNameRaw)
@@ -625,7 +629,8 @@
MailBoxMessageListViewModel.prototype.onBuild = function (oDom)
{
var
- self = this
+ self = this,
+ RL = require('../Boots/RainLoopApp.js')
;
this.oContentVisible = $('.b-content', oDom);
@@ -656,6 +661,7 @@
oMessage.lastInCollapsedThreadLoading(true);
oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread());
+
RL.reloadMessageList();
}
@@ -886,20 +892,23 @@
return false;
}
- var oJua = new Jua({
- 'action': LinkBuilder.append(),
- 'name': 'AppendFile',
- 'queueSize': 1,
- 'multipleSizeLimit': 1,
- 'disableFolderDragAndDrop': true,
- 'hidden': {
- 'Folder': function () {
- return Data.currentFolderFullNameRaw();
- }
- },
- 'dragAndDropElement': this.dragOverArea(),
- 'dragAndDropBodyElement': this.dragOverBodyArea()
- });
+ var
+ RL = require('../Boots/RainLoopApp.js'),
+ oJua = new Jua({
+ 'action': LinkBuilder.append(),
+ 'name': 'AppendFile',
+ 'queueSize': 1,
+ 'multipleSizeLimit': 1,
+ 'disableFolderDragAndDrop': true,
+ 'hidden': {
+ 'Folder': function () {
+ return Data.currentFolderFullNameRaw();
+ }
+ },
+ 'dragAndDropElement': this.dragOverArea(),
+ 'dragAndDropBodyElement': this.dragOverBodyArea()
+ })
+ ;
oJua
.on('onDragEnter', _.bind(function () {
diff --git a/dev/ViewModels/MailBoxMessageViewViewModel.js b/dev/ViewModels/MailBoxMessageViewViewModel.js
index f4a979461..6e6b985da 100644
--- a/dev/ViewModels/MailBoxMessageViewViewModel.js
+++ b/dev/ViewModels/MailBoxMessageViewViewModel.js
@@ -1,15 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
$ = require('../External/jquery.js'),
ko = require('../External/ko.js'),
key = require('../External/key.js'),
$html = require('../External/$html.js'),
-
+
Consts = require('../Common/Consts.js'),
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
@@ -20,8 +19,8 @@
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
+ PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js'),
+
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js')
;
@@ -37,6 +36,7 @@
var
self = this,
sLastEmail = '',
+ RL = require('../Boots/RainLoopApp.js'),
createCommandHelper = function (sType) {
return Utils.createCommand(self, function () {
this.replyOrforward(sType);
@@ -341,7 +341,8 @@
MailBoxMessageViewViewModel.prototype.onBuild = function (oDom)
{
var
- self = this
+ self = this,
+ RL = require('../Boots/RainLoopApp.js')
;
this.fullScreenMode.subscribe(function (bValue) {
@@ -710,6 +711,8 @@
oMessage.isReadReceipt(true);
Cache.storeMessageFlagsToCache(oMessage);
+
+ var RL = require('../Boots/RainLoopApp.js');
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};
diff --git a/dev/ViewModels/MailBoxSystemDropDownViewModel.js b/dev/ViewModels/MailBoxSystemDropDownViewModel.js
index f520a7fa8..8aee646b5 100644
--- a/dev/ViewModels/MailBoxSystemDropDownViewModel.js
+++ b/dev/ViewModels/MailBoxSystemDropDownViewModel.js
@@ -1,11 +1,9 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
- Utils = require('../Common/Utils.js'),
kn = require('../Knoin/Knoin.js'),
AbstractSystemDropDownViewModel = require('./AbstractSystemDropDownViewModel.js')
;
diff --git a/dev/ViewModels/Popups/PopupsActivateViewModel.js b/dev/ViewModels/Popups/PopupsActivateViewModel.js
index 3af9e3cca..d366fb44a 100644
--- a/dev/ViewModels/Popups/PopupsActivateViewModel.js
+++ b/dev/ViewModels/Popups/PopupsActivateViewModel.js
@@ -1,18 +1,18 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
AppSettings = require('../../Storages/AppSettings.js'),
Data = require('../../Storages/AdminDataStorage.js'),
Remote = require('../../Storages/AdminAjaxRemoteStorage.js'),
-
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -133,7 +133,7 @@
var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
};
-
+
module.exports = PopupsActivateViewModel;
}(module));
\ No newline at end of file
diff --git a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js b/dev/ViewModels/Popups/PopupsAddAccountViewModel.js
index 6409e1994..c8c77dda3 100644
--- a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js
+++ b/dev/ViewModels/Popups/PopupsAddAccountViewModel.js
@@ -1,19 +1,17 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
+ _ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -26,6 +24,8 @@
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddAccount');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.email = ko.observable('');
this.password = ko.observable('');
diff --git a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js
index dd73efddc..8f5b60b43 100644
--- a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js
+++ b/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js
@@ -1,22 +1,19 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
-
+
Utils = require('../../Common/Utils.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
-
+
/**
* @constructor
* @extends KnoinAbstractViewModel
@@ -25,6 +22,8 @@
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddOpenPgpKey');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.key = ko.observable('');
this.key.error = ko.observable(false);
this.key.focus = ko.observable(false);
diff --git a/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js b/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js
index 7f86adae4..0f9fafcc4 100644
--- a/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js
+++ b/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
moment = require('../../External/moment.js'),
-
+
Utils = require('../../Common/Utils.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
diff --git a/dev/ViewModels/Popups/PopupsAskViewModel.js b/dev/ViewModels/Popups/PopupsAskViewModel.js
index 02a5f4452..7d26e7de9 100644
--- a/dev/ViewModels/Popups/PopupsAskViewModel.js
+++ b/dev/ViewModels/Popups/PopupsAskViewModel.js
@@ -1,14 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
key = require('../../External/key.js'),
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
diff --git a/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js b/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js
index 92efc90a0..fd9003181 100644
--- a/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js
+++ b/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js
@@ -1,23 +1,25 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../../External/window.js'),
+ _ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
key = require('../../External/key.js'),
-
+
Utils = require('../../Common/Utils.js'),
Enums = require('../../Common/Enums.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
+ EmailModel = require('../../Models/EmailModel.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
-
+
/**
* @constructor
* @extends KnoinAbstractViewModel
diff --git a/dev/ViewModels/Popups/PopupsComposeViewModel.js b/dev/ViewModels/Popups/PopupsComposeViewModel.js
index b5d1393ee..9d3be30af 100644
--- a/dev/ViewModels/Popups/PopupsComposeViewModel.js
+++ b/dev/ViewModels/Popups/PopupsComposeViewModel.js
@@ -1,16 +1,17 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../../External/window.js'),
$ = require('../../External/jquery.js'),
_ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
moment = require('../../External/moment.js'),
-
+ $window = require('../../External/$window.js'),
+ JSON = require('../../External/JSON.js'),
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
@@ -24,9 +25,11 @@
Cache = require('../../Storages/WebMailCacheStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
+ ComposeAttachmentModel = require('../../Models/ComposeAttachmentModel.js'),
PopupsComposeOpenPgpViewModel = require('./PopupsComposeOpenPgpViewModel.js'),
+ PopupsFolderSystemViewModel = require('./PopupsFolderSystemViewModel.js'),
+ PopupsAskViewModel = require('./PopupsAskViewModel.js'),
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
@@ -40,6 +43,8 @@
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsCompose');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.oEditor = null;
this.aDraftInfo = null;
this.sInReplyTo = '';
@@ -408,6 +413,7 @@
PopupsComposeViewModel.prototype.emailsSource = function (oData, fResponse)
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.getAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oEmailItem) {
return oEmailItem.toLine(false);
@@ -437,7 +443,11 @@
PopupsComposeViewModel.prototype.reloadDraftFolder = function ()
{
- var sDraftFolder = Data.draftFolder();
+ var
+ RL = require('../../Boots/RainLoopApp.js'),
+ sDraftFolder = Data.draftFolder()
+ ;
+
if ('' !== sDraftFolder)
{
Cache.setFolderHash(sDraftFolder, '');
@@ -1054,12 +1064,12 @@
if (this.dropboxEnabled())
{
- oScript = document.createElement('script');
+ oScript = window.document.createElement('script');
oScript.type = 'text/javascript';
oScript.src = 'https://www.dropbox.com/static/api/1/dropins.js';
$(oScript).attr('id', 'dropboxjs').attr('data-app-key', AppSettings.settingsGet('DropboxApiKey'));
- document.body.appendChild(oScript);
+ window.document.body.appendChild(oScript);
}
if (this.driveEnabled())
@@ -1296,7 +1306,7 @@
if (oItem)
{
- oItem.progress(' - ' + Math.floor(iLoaded / iTotal * 100) + '%');
+ oItem.progress(' - ' + window.Math.floor(iLoaded / iTotal * 100) + '%');
}
}, this))
diff --git a/dev/ViewModels/Popups/PopupsContactsViewModel.js b/dev/ViewModels/Popups/PopupsContactsViewModel.js
index a825a6e91..c2cff6a10 100644
--- a/dev/ViewModels/Popups/PopupsContactsViewModel.js
+++ b/dev/ViewModels/Popups/PopupsContactsViewModel.js
@@ -1,16 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../../External/window.js'),
$ = require('../../External/jquery.js'),
_ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
key = require('../../External/key.js'),
-
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Globals = require('../../Common/Globals.js'),
@@ -21,7 +20,12 @@
Data = require('../../Storages/WebMailDataStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
+ EmailModel = require('../../Models/EmailModel.js'),
+ ContactModel = require('../../Models/ContactModel.js'),
+ ContactTagModel = require('../../Models/ContactTagModel.js'),
+ ContactPropertyModel = require('../../Models/ContactPropertyModel.js'),
+
+ PopupsComposeViewModel = require('./PopupsComposeViewModel.js'),
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
@@ -346,7 +350,11 @@
this.syncCommand = Utils.createCommand(this, function () {
- var self = this;
+ var
+ self = this,
+ RL = require('../../Boots/RainLoopApp.js')
+ ;
+
RL.contactsSync(function (sResult, oData) {
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
{
@@ -392,6 +400,7 @@
PopupsContactsViewModel.prototype.contactTagsSource = function (oData, fResponse)
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.getContactTagsAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oTagItem) {
return oTagItem.toLine(false);
@@ -475,17 +484,15 @@
this.addNewOrFocusProperty(Enums.ContactPropertyType.Birthday);
};
- //PopupsContactsViewModel.prototype.addNewAddress = function ()
- //{
- //};
-
PopupsContactsViewModel.prototype.exportVcf = function ()
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.download(LinkBuilder.exportContactsVcf());
};
PopupsContactsViewModel.prototype.exportCsv = function ()
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.download(LinkBuilder.exportContactsCsv());
};
diff --git a/dev/ViewModels/Popups/PopupsDomainViewModel.js b/dev/ViewModels/Popups/PopupsDomainViewModel.js
index 2274c781c..119c2c128 100644
--- a/dev/ViewModels/Popups/PopupsDomainViewModel.js
+++ b/dev/ViewModels/Popups/PopupsDomainViewModel.js
@@ -1,20 +1,17 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
Remote = require('../../Storages/AdminAjaxRemoteStorage.js'),
-
- RL = require('../../Boots/AdminApp.js'),
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
@@ -237,7 +234,9 @@
{
if (oData.Result)
{
+ var RL = require('../../Boots/AdminApp.js');
RL.reloadDomainList();
+
this.closeCommand();
}
else if (Enums.Notification.DomainAlreadyExists === oData.ErrorCode)
diff --git a/dev/ViewModels/Popups/PopupsFilterViewModel.js b/dev/ViewModels/Popups/PopupsFilterViewModel.js
index 66d39647a..a23efb2f7 100644
--- a/dev/ViewModels/Popups/PopupsFilterViewModel.js
+++ b/dev/ViewModels/Popups/PopupsFilterViewModel.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
-
+
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
@@ -43,7 +42,7 @@
PopupsFilterViewModel.prototype.onShow = function (oFilter)
{
this.clearPopup();
-
+
this.filter(oFilter);
};
diff --git a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js b/dev/ViewModels/Popups/PopupsFolderClearViewModel.js
index a3e4d38b6..c05e312a3 100644
--- a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js
+++ b/dev/ViewModels/Popups/PopupsFolderClearViewModel.js
@@ -1,22 +1,18 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
-
Data = require('../../Storages/WebMailDataStorage.js'),
Cache = require('../../Storages/WebMailCacheStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -29,6 +25,8 @@
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderClear');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.selectedFolder = ko.observable(null);
this.clearingProcess = ko.observable(false);
this.clearingError = ko.observable('');
diff --git a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js b/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js
index e0192ec35..194981887 100644
--- a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js
+++ b/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
@@ -14,8 +13,6 @@
Data = require('../../Storages/WebMailDataStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -66,7 +63,11 @@
// commands
this.createFolder = Utils.createCommand(this, function () {
- var sParentFolderName = this.selectedParentValue();
+ var
+ RL = require('../../Boots/RainLoopApp.js'),
+ sParentFolderName = this.selectedParentValue()
+ ;
+
if ('' === sParentFolderName && 1 < Data.namespace.length)
{
sParentFolderName = Data.namespace.substr(0, Data.namespace.length - 1);
diff --git a/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js b/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js
index 81997cdac..4585afbcc 100644
--- a/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js
+++ b/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
@@ -15,8 +14,6 @@
Data = require('../../Storages/WebMailDataStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
diff --git a/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js
index b6b5f1b12..36ad9c617 100644
--- a/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js
+++ b/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js
@@ -1,19 +1,17 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
window = require('../../External/window.js'),
+ _ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
-
+
Utils = require('../../Common/Utils.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -26,6 +24,8 @@
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsGenerateNewOpenPgpKey');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.email = ko.observable('');
this.email.focus = ko.observable('');
this.email.error = ko.observable(false);
diff --git a/dev/ViewModels/Popups/PopupsIdentityViewModel.js b/dev/ViewModels/Popups/PopupsIdentityViewModel.js
index 3eeb1f51e..e791ec934 100644
--- a/dev/ViewModels/Popups/PopupsIdentityViewModel.js
+++ b/dev/ViewModels/Popups/PopupsIdentityViewModel.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
kn = require('../../Knoin/Knoin.js'),
@@ -14,8 +13,6 @@
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -27,6 +24,8 @@
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsIdentity');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.id = '';
this.edit = ko.observable(false);
this.owner = ko.observable(false);
diff --git a/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js b/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js
index f6e52ae92..cb13e9786 100644
--- a/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js
+++ b/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js
@@ -1,14 +1,14 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../../External/underscore.js'),
key = require('../../External/key.js'),
+
Enums = require('../../Common/Enums.js'),
- Utils = require('../../Common/Utils.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
diff --git a/dev/ViewModels/Popups/PopupsLanguagesViewModel.js b/dev/ViewModels/Popups/PopupsLanguagesViewModel.js
index 973d7fcb9..1fce93198 100644
--- a/dev/ViewModels/Popups/PopupsLanguagesViewModel.js
+++ b/dev/ViewModels/Popups/PopupsLanguagesViewModel.js
@@ -1,13 +1,12 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
-
+
Utils = require('../../Common/Utils.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
diff --git a/dev/ViewModels/Popups/PopupsPluginViewModel.js b/dev/ViewModels/Popups/PopupsPluginViewModel.js
index 8c3f49a6f..9c24d3cfa 100644
--- a/dev/ViewModels/Popups/PopupsPluginViewModel.js
+++ b/dev/ViewModels/Popups/PopupsPluginViewModel.js
@@ -1,19 +1,20 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
_ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
key = require('../../External/key.js'),
-
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
Remote = require('../../Storages/AdminAjaxRemoteStorage.js'),
+ PopupsAskViewModel = require('./PopupsAskViewModel.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
diff --git a/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js b/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js
index 5317d02be..d4f3c8477 100644
--- a/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js
+++ b/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js
@@ -1,12 +1,11 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
@@ -15,7 +14,7 @@
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
-
+
/**
* @constructor
* @extends KnoinAbstractViewModel
diff --git a/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js
index 03928e4bd..72a3ea774 100644
--- a/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js
+++ b/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js
@@ -1,12 +1,13 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
ko = require('../../External/ko.js'),
+
Utils = require('../../Common/Utils.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
diff --git a/dev/ViewModels/SettingsMenuViewModel.js b/dev/ViewModels/SettingsMenuViewModel.js
index 4a2acd660..6d003ab11 100644
--- a/dev/ViewModels/SettingsMenuViewModel.js
+++ b/dev/ViewModels/SettingsMenuViewModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
LinkBuilder = require('../Common/LinkBuilder.js'),
Globals = require('../Common/Globals.js'),
diff --git a/dev/ViewModels/SettingsPaneViewModel.js b/dev/ViewModels/SettingsPaneViewModel.js
index 776342e4a..c1f1432a6 100644
--- a/dev/ViewModels/SettingsPaneViewModel.js
+++ b/dev/ViewModels/SettingsPaneViewModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
key = require('../External/key.js'),
@@ -11,7 +10,7 @@
LinkBuilder = require('../Common/LinkBuilder.js'),
Data = require('../Storages/WebMailDataStorage.js'),
-
+
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js')
;
diff --git a/dev/ViewModels/SettingsSystemDropDownViewModel.js b/dev/ViewModels/SettingsSystemDropDownViewModel.js
index cac6272bc..e9cf5f069 100644
--- a/dev/ViewModels/SettingsSystemDropDownViewModel.js
+++ b/dev/ViewModels/SettingsSystemDropDownViewModel.js
@@ -1,9 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+'use strict';
(function (module) {
- 'use strict';
-
var
kn = require('../Knoin/Knoin.js'),
AbstractSystemDropDownViewModel = require('./AbstractSystemDropDownViewModel.js')
diff --git a/dev/_AdminBoot.js b/dev/_AdminBoot.js
index 1ad4116c7..7740c2669 100644
--- a/dev/_AdminBoot.js
+++ b/dev/_AdminBoot.js
@@ -1,6 +1,10 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-var boot = require('./Boots/Boot.js');
-boot(require('./Boots/AdminApp.js'));
\ No newline at end of file
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function () {
+
+ 'use strict';
+
+ var boot = require('./Boots/Boot.js');
+ boot(require('./Boots/AdminApp.js'));
+
+}());
\ No newline at end of file
diff --git a/dev/_RainLoopBoot.js b/dev/_RainLoopBoot.js
index 1aa2712be..eeda2785f 100644
--- a/dev/_RainLoopBoot.js
+++ b/dev/_RainLoopBoot.js
@@ -1,6 +1,10 @@
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-var boot = require('./Boots/Boot.js');
-boot(require('./Boots/RainLoopApp.js'));
\ No newline at end of file
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function () {
+
+ 'use strict';
+
+ var boot = require('./Boots/Boot.js');
+ boot(require('./Boots/RainLoopApp.js'));
+
+}());
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
index 95563275b..be879646b 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,4 +1,4 @@
-
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
'use strict';
var
@@ -622,9 +622,22 @@ gulp.task('bro', function() {
.add('./_RainLoopBoot.js')
.bundle()
.pipe(source('app.js'))
+
+ .pipe(streamify(jshint('.jshintrc')))
+ .pipe(jshint.reporter('jshint-summary', cfg.summary))
+ .pipe(jshint.reporter('fail'))
+
// .pipe(rename('app.min.js'))
// .pipe(streamify(uglify(cfg.uglify)))
- .pipe(gulp.dest(cfg.paths.staticJS));
+ .pipe(gulp.dest(cfg.paths.staticJS))
+ .on('error', gutil.log);
+});
+
+gulp.task('lint', function() {
+ return gulp.src('./dev/**/*.js')
+ .pipe(jshint('.jshintrc'))
+ .pipe(jshint.reporter('jshint-summary', cfg.summary))
+ .pipe(jshint.reporter('fail'));
});
gulp.task('ww', ['bro'], function() {
diff --git a/rainloop/v/0.0.0/static/js/app.js b/rainloop/v/0.0.0/static/js/app.js
index 01b564d4b..6d72c5117 100644
--- a/rainloop/v/0.0.0/static/js/app.js
+++ b/rainloop/v/0.0.0/static/js/app.js
@@ -1,9 +1,9 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o');
-
/**
* @param {string} sHtml
* @return {string}
@@ -6069,7 +6071,7 @@ boot(require('./Boots/RainLoopApp.js'));
.replace(/<[^>]*>/gm, '')
;
- sText = Utils.$div.html(sText).text();
+ sText = $div.html(sText).text();
sText = sText
.replace(/\n[ \t]+/gm, '\n')
@@ -6206,7 +6208,7 @@ boot(require('./Boots/RainLoopApp.js'));
{
if ($.fn && $.fn.linkify)
{
- sHtml = Utils.$div.html(sHtml.replace(/&/ig, 'amp_amp_12345_amp_amp'))
+ sHtml = $div.html(sHtml.replace(/&/ig, 'amp_amp_12345_amp_amp'))
.linkify()
.find('.linkified').removeClass('linkified').end()
.html()
@@ -6224,7 +6226,7 @@ boot(require('./Boots/RainLoopApp.js'));
var
aDiff = [0, 0],
- oCanvas = document.createElement('canvas'),
+ oCanvas = window.document.createElement('canvas'),
oCtx = oCanvas.getContext('2d')
;
@@ -6538,33 +6540,33 @@ boot(require('./Boots/RainLoopApp.js'));
module.exports = Utils;
}(module));
-},{"../External/$doc.js":16,"../External/$html.js":17,"../External/$window.js":18,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"./Consts.js":6,"./Enums.js":7,"./Globals.js":9}],15:[function(require,module,exports){
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')('');
+},{"../External/$div.js":15,"../External/$doc.js":16,"../External/$html.js":17,"../External/$window.js":18,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"./Consts.js":6,"./Enums.js":7,"./Globals.js":9}],15:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+'use strict';
+
+module.exports = require('./jquery.js')('');
},{"./jquery.js":26}],16:[function(require,module,exports){
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')(window.document);
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+'use strict';
+
+module.exports = require('./jquery.js')(window.document);
},{"./jquery.js":26}],17:[function(require,module,exports){
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')('html');
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+'use strict';
+
+module.exports = require('./jquery.js')('html');
},{"./jquery.js":26}],18:[function(require,module,exports){
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = require('./jquery.js')(window);
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+'use strict';
+
+module.exports = require('./jquery.js')(window);
},{"./jquery.js":26}],19:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
@@ -6585,11 +6587,11 @@ module.exports = JSON;
module.exports = Jua;
},{}],22:[function(require,module,exports){
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-var window = require('./window.js');
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+'use strict';
+
+var window = require('./window.js');
module.exports = window.Notification && window.Notification.requestPermission ? window.Notification : null;
},{"./window.js":32}],23:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
@@ -6624,7 +6626,7 @@ module.exports = key;
},{}],28:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-(function (module) {
+(function (module, ko) {
'use strict';
@@ -6679,10 +6681,10 @@ module.exports = key;
ko.bindingHandlers.tooltip2 = {
'init': function (oElement, fValueAccessor) {
var
+ Globals = require('../Common/Globals.js'),
$oEl = $(oElement),
sClass = $oEl.data('tooltip-class') || '',
- sPlacement = $oEl.data('tooltip-placement') || 'top',
- Globals = require('../Common/Globals.js')
+ sPlacement = $oEl.data('tooltip-placement') || 'top'
;
$oEl.tooltip({
@@ -6746,11 +6748,7 @@ module.exports = key;
ko.bindingHandlers.registrateBootstrapDropdown = {
'init': function (oElement) {
-
- var
- Globals = require('../Common/Globals.js')
- ;
-
+ var Globals = require('../Common/Globals.js');
Globals.aBootstrapDropdowns.push($(oElement));
}
};
@@ -6763,7 +6761,7 @@ module.exports = key;
$el = $(oElement),
Utils = require('../Common/Utils.js')
;
-
+
if (!$el.hasClass('open'))
{
$el.find('.dropdown-toggle').dropdown('toggle');
@@ -6791,11 +6789,7 @@ module.exports = key;
ko.bindingHandlers.csstext = {
'init': function (oElement, fValueAccessor) {
-
- var
- Utils = require('../Common/Utils.js')
- ;
-
+ var Utils = require('../Common/Utils.js');
if (oElement && oElement.styleSheet && !Utils.isUnd(oElement.styleSheet.cssText))
{
oElement.styleSheet.cssText = ko.utils.unwrapObservable(fValueAccessor());
@@ -6806,11 +6800,7 @@ module.exports = key;
}
},
'update': function (oElement, fValueAccessor) {
-
- var
- Utils = require('../Common/Utils.js')
- ;
-
+ var Utils = require('../Common/Utils.js');
if (oElement && oElement.styleSheet && !Utils.isUnd(oElement.styleSheet.cssText))
{
oElement.styleSheet.cssText = ko.utils.unwrapObservable(fValueAccessor());
@@ -6892,6 +6882,7 @@ module.exports = key;
.find('.close').click(function () {
fValueAccessor()(false);
});
+
},
'update': function (oElement, fValueAccessor) {
$(oElement).modal(ko.utils.unwrapObservable(fValueAccessor()) ? 'show' : 'hide');
@@ -6900,18 +6891,14 @@ module.exports = key;
ko.bindingHandlers.i18nInit = {
'init': function (oElement) {
- var
- Utils = require('../Common/Utils.js')
- ;
+ var Utils = require('../Common/Utils.js');
Utils.i18nToNode(oElement);
}
};
ko.bindingHandlers.i18nUpdate = {
'update': function (oElement, fValueAccessor) {
- var
- Utils = require('../Common/Utils.js')
- ;
+ var Utils = require('../Common/Utils.js');
ko.utils.unwrapObservable(fValueAccessor());
Utils.i18nToNode(oElement);
}
@@ -6950,6 +6937,7 @@ module.exports = key;
});
},
'update': function (oElement, fValueAccessor) {
+
var
Utils = require('../Common/Utils.js'),
aValues = ko.utils.unwrapObservable(fValueAccessor()),
@@ -6984,12 +6972,10 @@ module.exports = key;
ko.bindingHandlers.draggable = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor) {
-
var
Globals = require('../Common/Globals.js'),
Utils = require('../Common/Utils.js')
;
-
if (!Globals.bMobileDevice)
{
var
@@ -7070,11 +7056,7 @@ module.exports = key;
ko.bindingHandlers.droppable = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor) {
-
- var
- Globals = require('../Common/Globals.js')
- ;
-
+ var Globals = require('../Common/Globals.js');
if (!Globals.bMobileDevice)
{
var
@@ -7116,11 +7098,7 @@ module.exports = key;
ko.bindingHandlers.nano = {
'init': function (oElement) {
-
- var
- Globals = require('../Common/Globals.js')
- ;
-
+ var Globals = require('../Common/Globals.js');
if (!Globals.bDisableNanoScroll)
{
$(oElement)
@@ -7215,9 +7193,11 @@ module.exports = key;
ko.bindingHandlers.emailsTags = {
'init': function(oElement, fValueAccessor, fAllBindingsAccessor) {
-
+
var
Utils = require('../Common/Utils.js'),
+ EmailModel = require('../Models/EmailModel.js'),
+
$oEl = $(oElement),
fValue = fValueAccessor(),
fAllBindings = fAllBindingsAccessor(),
@@ -7286,10 +7266,12 @@ module.exports = key;
};
ko.bindingHandlers.contactTags = {
- 'init': function(oElement, fValueAccessor) {
-
+ 'init': function(oElement, fValueAccessor, fAllBindingsAccessor) {
+
var
Utils = require('../Common/Utils.js'),
+ ContactTagModel = require('../Models/ContactTagModel.js'),
+
$oEl = $(oElement),
fValue = fValueAccessor(),
fAllBindings = fAllBindingsAccessor(),
@@ -7401,7 +7383,7 @@ module.exports = key;
ko.extenders.trimmer = function (oTarget)
{
- var
+ var
Utils = require('../Common/Utils.js'),
oResult = ko.computed({
'read': oTarget,
@@ -7418,7 +7400,7 @@ module.exports = key;
ko.extenders.posInterer = function (oTarget, iDefault)
{
- var
+ var
Utils = require('../Common/Utils.js'),
oResult = ko.computed({
'read': oTarget,
@@ -7476,7 +7458,7 @@ module.exports = key;
ko.extenders.falseTimeout = function (oTarget, iOption)
{
var Utils = require('../Common/Utils.js');
-
+
oTarget.iTimeout = 0;
oTarget.subscribe(function (bValue) {
if (bValue)
@@ -7501,6 +7483,7 @@ module.exports = key;
ko.observable.fn.validateEmail = function ()
{
var Utils = require('../Common/Utils.js');
+
this.hasError = ko.observable(false);
this.subscribe(function (sValue) {
@@ -7530,6 +7513,7 @@ module.exports = key;
ko.observable.fn.validateFunc = function (fFunc)
{
var Utils = require('../Common/Utils.js');
+
this.hasFuncError = ko.observable(false);
if (Utils.isFunc(fFunc))
@@ -7546,9 +7530,9 @@ module.exports = key;
module.exports = ko;
-}(module));
+}(module, ko));
-},{"../Common/Globals.js":9,"../Common/Utils.js":14,"./$doc.js":16,"./$window.js":18,"./jquery.js":26,"./underscore.js":31,"./window.js":32}],29:[function(require,module,exports){
+},{"../Common/Globals.js":9,"../Common/Utils.js":14,"../Models/ContactTagModel.js":42,"../Models/EmailModel.js":43,"./$doc.js":16,"./$window.js":18,"./jquery.js":26,"./underscore.js":31,"./window.js":32}],29:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
'use strict';
@@ -7567,11 +7551,11 @@ module.exports = ssm;
module.exports = _;
},{}],32:[function(require,module,exports){
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-'use strict';
-
-module.exports = window;
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+'use strict';
+
+module.exports = window;
},{}],33:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
@@ -8148,10 +8132,10 @@ module.exports = window;
var
ko = require('../External/ko.js'),
$window = require('../External/$window.js'),
-
- Utils = require('../Common/Utils.js'),
+
Enums = require('../Common/Enums.js'),
- Globals = require('../Common/Globals.js')
+ Globals = require('../Common/Globals.js'),
+ Utils = require('../Common/Utils.js')
;
/**
@@ -8228,6 +8212,7 @@ module.exports = window;
KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
{
var self = this;
+
$window.on('keydown', function (oEvent) {
if (oEvent && self.modalVisibility && self.modalVisibility())
{
@@ -8257,8 +8242,7 @@ module.exports = window;
'use strict';
var
- ko = require('../External/ko.js'),
- LinkBuilder = require('../Common/LinkBuilder.js')
+ ko = require('../External/ko.js')
;
/**
@@ -8280,7 +8264,7 @@ module.exports = window;
*/
AccountModel.prototype.changeAccountLink = function ()
{
- return LinkBuilder.change(this.email);
+ return require('../Common/LinkBuilder.js').change(this.email);
};
module.exports = AccountModel;
@@ -8542,6 +8526,328 @@ module.exports = window;
},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/window.js":32}],39:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../External/ko.js'),
+ Utils = require('../Common/Utils.js')
+ ;
+
+ /**
+ * @constructor
+ * @param {string} sId
+ * @param {string} sFileName
+ * @param {?number=} nSize
+ * @param {boolean=} bInline
+ * @param {boolean=} bLinked
+ * @param {string=} sCID
+ * @param {string=} sContentLocation
+ */
+ function ComposeAttachmentModel(sId, sFileName, nSize, bInline, bLinked, sCID, sContentLocation)
+ {
+ this.id = sId;
+ this.isInline = Utils.isUnd(bInline) ? false : !!bInline;
+ this.isLinked = Utils.isUnd(bLinked) ? false : !!bLinked;
+ this.CID = Utils.isUnd(sCID) ? '' : sCID;
+ this.contentLocation = Utils.isUnd(sContentLocation) ? '' : sContentLocation;
+ this.fromMessage = false;
+
+ this.fileName = ko.observable(sFileName);
+ this.size = ko.observable(Utils.isUnd(nSize) ? null : nSize);
+ this.tempName = ko.observable('');
+
+ this.progress = ko.observable('');
+ this.error = ko.observable('');
+ this.waiting = ko.observable(true);
+ this.uploading = ko.observable(false);
+ this.enabled = ko.observable(true);
+
+ this.friendlySize = ko.computed(function () {
+ var mSize = this.size();
+ return null === mSize ? '' : Utils.friendlySize(this.size());
+ }, this);
+ }
+
+ ComposeAttachmentModel.prototype.id = '';
+ ComposeAttachmentModel.prototype.isInline = false;
+ ComposeAttachmentModel.prototype.isLinked = false;
+ ComposeAttachmentModel.prototype.CID = '';
+ ComposeAttachmentModel.prototype.contentLocation = '';
+ ComposeAttachmentModel.prototype.fromMessage = false;
+ ComposeAttachmentModel.prototype.cancel = Utils.emptyFunction;
+
+ /**
+ * @param {AjaxJsonComposeAttachment} oJsonAttachment
+ */
+ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
+ {
+ var bResult = false;
+ if (oJsonAttachment)
+ {
+ this.fileName(oJsonAttachment.Name);
+ this.size(Utils.isUnd(oJsonAttachment.Size) ? 0 : Utils.pInt(oJsonAttachment.Size));
+ this.tempName(Utils.isUnd(oJsonAttachment.TempName) ? '' : oJsonAttachment.TempName);
+ this.isInline = false;
+
+ bResult = true;
+ }
+
+ return bResult;
+ };
+
+ module.exports = ComposeAttachmentModel;
+
+}(module));
+},{"../Common/Utils.js":14,"../External/ko.js":28}],40:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ _ = require('../External/underscore.js'),
+ ko = require('../External/ko.js'),
+ Enums = require('../Common/Enums.js'),
+ Utils = require('../Common/Utils.js'),
+ LinkBuilder = require('../Common/LinkBuilder.js')
+ ;
+
+ /**
+ * @constructor
+ */
+ function ContactModel()
+ {
+ this.idContact = 0;
+ this.display = '';
+ this.properties = [];
+ this.tags = '';
+ this.readOnly = false;
+
+ this.focused = ko.observable(false);
+ this.selected = ko.observable(false);
+ this.checked = ko.observable(false);
+ this.deleted = ko.observable(false);
+ }
+
+ /**
+ * @return {Array|null}
+ */
+ ContactModel.prototype.getNameAndEmailHelper = function ()
+ {
+ var
+ sName = '',
+ sEmail = ''
+ ;
+
+ if (Utils.isNonEmptyArray(this.properties))
+ {
+ _.each(this.properties, function (aProperty) {
+ if (aProperty)
+ {
+ if (Enums.ContactPropertyType.FirstName === aProperty[0])
+ {
+ sName = Utils.trim(aProperty[1] + ' ' + sName);
+ }
+ else if (Enums.ContactPropertyType.LastName === aProperty[0])
+ {
+ sName = Utils.trim(sName + ' ' + aProperty[1]);
+ }
+ else if ('' === sEmail && Enums.ContactPropertyType.Email === aProperty[0])
+ {
+ sEmail = aProperty[1];
+ }
+ }
+ }, this);
+ }
+
+ return '' === sEmail ? null : [sEmail, sName];
+ };
+
+ ContactModel.prototype.parse = function (oItem)
+ {
+ var bResult = false;
+ if (oItem && 'Object/Contact' === oItem['@Object'])
+ {
+ this.idContact = Utils.pInt(oItem['IdContact']);
+ this.display = Utils.pString(oItem['Display']);
+ this.readOnly = !!oItem['ReadOnly'];
+ this.tags = '';
+
+ if (Utils.isNonEmptyArray(oItem['Properties']))
+ {
+ _.each(oItem['Properties'], function (oProperty) {
+ if (oProperty && oProperty['Type'] && Utils.isNormal(oProperty['Value']) && Utils.isNormal(oProperty['TypeStr']))
+ {
+ this.properties.push([Utils.pInt(oProperty['Type']), Utils.pString(oProperty['Value']), Utils.pString(oProperty['TypeStr'])]);
+ }
+ }, this);
+ }
+
+ if (Utils.isNonEmptyArray(oItem['Tags']))
+ {
+ this.tags = oItem['Tags'].join(',');
+ }
+
+ bResult = true;
+ }
+
+ return bResult;
+ };
+
+ /**
+ * @return {string}
+ */
+ ContactModel.prototype.srcAttr = function ()
+ {
+ return LinkBuilder.emptyContactPic();
+ };
+
+ /**
+ * @return {string}
+ */
+ ContactModel.prototype.generateUid = function ()
+ {
+ return '' + this.idContact;
+ };
+
+ /**
+ * @return string
+ */
+ ContactModel.prototype.lineAsCcc = function ()
+ {
+ var aResult = [];
+ if (this.deleted())
+ {
+ aResult.push('deleted');
+ }
+ if (this.selected())
+ {
+ aResult.push('selected');
+ }
+ if (this.checked())
+ {
+ aResult.push('checked');
+ }
+ if (this.focused())
+ {
+ aResult.push('focused');
+ }
+
+ return aResult.join(' ');
+ };
+
+ module.exports = ContactModel;
+
+}(module));
+},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31}],41:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../External/ko.js'),
+ Enums = require('../Common/Enums.js'),
+ Utils = require('../Common/Utils.js')
+ ;
+
+ /**
+ * @param {number=} iType = Enums.ContactPropertyType.Unknown
+ * @param {string=} sTypeStr = ''
+ * @param {string=} sValue = ''
+ * @param {boolean=} bFocused = false
+ * @param {string=} sPlaceholder = ''
+ *
+ * @constructor
+ */
+ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
+ {
+ this.type = ko.observable(Utils.isUnd(iType) ? Enums.ContactPropertyType.Unknown : iType);
+ this.typeStr = ko.observable(Utils.isUnd(sTypeStr) ? '' : sTypeStr);
+ this.focused = ko.observable(Utils.isUnd(bFocused) ? false : !!bFocused);
+ this.value = ko.observable(Utils.pString(sValue));
+
+ this.placeholder = ko.observable(sPlaceholder || '');
+
+ this.placeholderValue = ko.computed(function () {
+ var sPlaceholder = this.placeholder();
+ return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
+ }, this);
+
+ this.largeValue = ko.computed(function () {
+ return Enums.ContactPropertyType.Note === this.type();
+ }, this);
+ }
+
+ module.exports = ContactPropertyModel;
+
+}(module));
+},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28}],42:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../External/ko.js'),
+ Utils = require('../Common/Utils.js')
+ ;
+
+ /**
+ * @constructor
+ */
+ function ContactTagModel()
+ {
+ this.idContactTag = 0;
+ this.name = ko.observable('');
+ this.readOnly = false;
+ }
+
+ ContactTagModel.prototype.parse = function (oItem)
+ {
+ var bResult = false;
+ if (oItem && 'Object/Tag' === oItem['@Object'])
+ {
+ this.idContact = Utils.pInt(oItem['IdContactTag']);
+ this.name(Utils.pString(oItem['Name']));
+ this.readOnly = !!oItem['ReadOnly'];
+
+ bResult = true;
+ }
+
+ return bResult;
+ };
+
+ /**
+ * @param {string} sSearch
+ * @return {boolean}
+ */
+ ContactTagModel.prototype.filterHelper = function (sSearch)
+ {
+ return this.name().toLowerCase().indexOf(sSearch.toLowerCase()) !== -1;
+ };
+
+ /**
+ * @param {boolean=} bEncodeHtml = false
+ * @return {string}
+ */
+ ContactTagModel.prototype.toLine = function (bEncodeHtml)
+ {
+ return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
+ Utils.encodeHtml(this.name()) : this.name();
+ };
+
+ module.exports = ContactTagModel;
+
+}(module));
+},{"../Common/Utils.js":14,"../External/ko.js":28}],43:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
(function (module) {
'use strict';
@@ -8918,7 +9224,165 @@ module.exports = window;
module.exports = EmailModel;
}(module));
-},{"../Common/Enums.js":7,"../Common/Utils.js":14}],40:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/Utils.js":14}],44:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../External/ko.js'),
+ Enums = require('../Common/Enums.js')
+ ;
+
+ /**
+ * @param {*} oKoList
+ * @constructor
+ */
+ function FilterConditionModel(oKoList)
+ {
+ this.parentList = oKoList;
+
+ this.field = ko.observable(Enums.FilterConditionField.From);
+
+ this.fieldOptions = [ // TODO i18n
+ {'id': Enums.FilterConditionField.From, 'name': 'From'},
+ {'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
+ {'id': Enums.FilterConditionField.To, 'name': 'To'},
+ {'id': Enums.FilterConditionField.Subject, 'name': 'Subject'}
+ ];
+
+ this.type = ko.observable(Enums.FilterConditionType.EqualTo);
+
+ this.typeOptions = [ // TODO i18n
+ {'id': Enums.FilterConditionType.EqualTo, 'name': 'Equal To'},
+ {'id': Enums.FilterConditionType.NotEqualTo, 'name': 'Not Equal To'},
+ {'id': Enums.FilterConditionType.Contains, 'name': 'Contains'},
+ {'id': Enums.FilterConditionType.NotContains, 'name': 'Not Contains'}
+ ];
+
+ this.value = ko.observable('');
+
+ this.template = ko.computed(function () {
+
+ var sTemplate = '';
+ switch (this.type())
+ {
+ default:
+ sTemplate = 'SettingsFiltersConditionDefault';
+ break;
+ }
+
+ return sTemplate;
+
+ }, this);
+ }
+
+ FilterConditionModel.prototype.removeSelf = function ()
+ {
+ this.parentList.remove(this);
+ };
+
+ module.exports = FilterConditionModel;
+
+}(module));
+},{"../Common/Enums.js":7,"../External/ko.js":28}],45:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../External/ko.js'),
+ Enums = require('../Common/Enums.js'),
+ Utils = require('../Common/Utils.js'),
+ FilterConditionModel = require('./FilterConditionModel.js')
+ ;
+
+ /**
+ * @constructor
+ */
+ function FilterModel()
+ {
+ this.new = ko.observable(true);
+ this.enabled = ko.observable(true);
+
+ this.name = ko.observable('');
+
+ this.conditionsType = ko.observable(Enums.FilterRulesType.And);
+
+ this.conditions = ko.observableArray([]);
+
+ this.conditions.subscribe(function () {
+ Utils.windowResize();
+ });
+
+ // Actions
+ this.actionMarkAsRead = ko.observable(false);
+ this.actionSkipOtherFilters = ko.observable(true);
+ this.actionValue = ko.observable('');
+
+ this.actionType = ko.observable(Enums.FiltersAction.Move);
+ this.actionTypeOptions = [ // TODO i18n
+ {'id': Enums.FiltersAction.None, 'name': 'Action - None'},
+ {'id': Enums.FiltersAction.Move, 'name': 'Action - Move to'},
+ // {'id': Enums.FiltersAction.Forward, 'name': 'Action - Forward to'},
+ {'id': Enums.FiltersAction.Discard, 'name': 'Action - Discard'}
+ ];
+
+ this.actionMarkAsReadVisiblity = ko.computed(function () {
+ return -1 < Utils.inArray(this.actionType(), [
+ Enums.FiltersAction.None, Enums.FiltersAction.Forward, Enums.FiltersAction.Move
+ ]);
+ }, this);
+
+ this.actionTemplate = ko.computed(function () {
+
+ var sTemplate = '';
+ switch (this.actionType())
+ {
+ default:
+ case Enums.FiltersAction.Move:
+ sTemplate = 'SettingsFiltersActionValueAsFolders';
+ break;
+ case Enums.FiltersAction.Forward:
+ sTemplate = 'SettingsFiltersActionWithValue';
+ break;
+ case Enums.FiltersAction.None:
+ case Enums.FiltersAction.Discard:
+ sTemplate = 'SettingsFiltersActionNoValue';
+ break;
+ }
+
+ return sTemplate;
+
+ }, this);
+ }
+
+ FilterModel.prototype.addCondition = function ()
+ {
+ this.conditions.push(new FilterConditionModel(this.conditions));
+ };
+
+ FilterModel.prototype.parse = function (oItem)
+ {
+ var bResult = false;
+ if (oItem && 'Object/Filter' === oItem['@Object'])
+ {
+ this.name(Utils.pString(oItem['Name']));
+
+ bResult = true;
+ }
+
+ return bResult;
+ };
+
+ module.exports = FilterModel;
+
+}(module));
+},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"./FilterConditionModel.js":44}],46:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -9274,7 +9738,7 @@ module.exports = window;
module.exports = FolderModel;
}(module));
-},{"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$window.js":18,"../External/ko.js":28,"../External/underscore.js":31}],41:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$window.js":18,"../External/ko.js":28,"../External/underscore.js":31}],47:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -9325,7 +9789,7 @@ module.exports = window;
module.exports = IdentityModel;
}(module));
-},{"../Common/Utils.js":14,"../External/ko.js":28}],42:[function(require,module,exports){
+},{"../Common/Utils.js":14,"../External/ko.js":28}],48:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -10409,6 +10873,7 @@ module.exports = window;
this.body.data('rl-plain-raw', this.plainRaw);
+ var Data = require('../Storages/WebMailDataStorage.js');
if (Data.capaOpenPGP())
{
this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned());
@@ -10421,37 +10886,39 @@ module.exports = window;
MessageModel.prototype.storePgpVerifyDataToDom = function ()
{
- if (this.body && Data.capaOpenPGP())
- {
- this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
- this.body.data('rl-pgp-verify-user', this.pgpSignedVerifyUser());
- }
+ var Data = require('../Storages/WebMailDataStorage.js');
+ if (this.body && Data.capaOpenPGP())
+ {
+ this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
+ this.body.data('rl-pgp-verify-user', this.pgpSignedVerifyUser());
+ }
};
MessageModel.prototype.fetchDataToDom = function ()
{
- if (this.body)
- {
- this.isHtml(!!this.body.data('rl-is-html'));
- this.hasImages(!!this.body.data('rl-has-images'));
+ if (this.body)
+ {
+ this.isHtml(!!this.body.data('rl-is-html'));
+ this.hasImages(!!this.body.data('rl-has-images'));
- this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
+ this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
- if (Data.capaOpenPGP())
- {
- this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
- this.isPgpEncrypted(!!this.body.data('rl-plain-pgp-encrypted'));
- this.pgpSignedVerifyStatus(this.body.data('rl-pgp-verify-status'));
- this.pgpSignedVerifyUser(this.body.data('rl-pgp-verify-user'));
- }
- else
- {
- this.isPgpSigned(false);
- this.isPgpEncrypted(false);
- this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None);
- this.pgpSignedVerifyUser('');
- }
- }
+ var Data = require('../Storages/WebMailDataStorage.js');
+ if (Data.capaOpenPGP())
+ {
+ this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
+ this.isPgpEncrypted(!!this.body.data('rl-plain-pgp-encrypted'));
+ this.pgpSignedVerifyStatus(this.body.data('rl-pgp-verify-status'));
+ this.pgpSignedVerifyUser(this.body.data('rl-pgp-verify-user'));
+ }
+ else
+ {
+ this.isPgpSigned(false);
+ this.isPgpEncrypted(false);
+ this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None);
+ this.pgpSignedVerifyUser('');
+ }
+ }
};
MessageModel.prototype.verifyPgpSignedClearMessage = function ()
@@ -10461,6 +10928,7 @@ module.exports = window;
var
aRes = [],
mPgpMessage = null,
+ Data = require('../Storages/WebMailDataStorage.js'),
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
aPublicKeys = Data.findPublicKeysByEmail(sFrom),
oValidKey = null,
@@ -10524,6 +10992,7 @@ module.exports = window;
aRes = [],
mPgpMessage = null,
mPgpMessageDecrypted = null,
+ Data = require('../Storages/WebMailDataStorage.js'),
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
aPublicKey = Data.findPublicKeysByEmail(sFrom),
oPrivateKey = Data.findSelfPrivateKey(sPassword),
@@ -10608,7 +11077,52 @@ module.exports = window;
module.exports = MessageModel;
}(module));
-},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/$window.js":18,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Storages/WebMailDataStorage.js":67,"./AttachmentModel.js":38,"./EmailModel.js":39}],43:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/$window.js":18,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Storages/WebMailDataStorage.js":74,"./AttachmentModel.js":38,"./EmailModel.js":43}],49:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../External/ko.js')
+ ;
+
+ /**
+ * @param {string} iIndex
+ * @param {string} sGuID
+ * @param {string} sID
+ * @param {string} sUserID
+ * @param {string} sEmail
+ * @param {boolean} bIsPrivate
+ * @param {string} sArmor
+ * @constructor
+ */
+ function OpenPgpKeyModel(iIndex, sGuID, sID, sUserID, sEmail, bIsPrivate, sArmor)
+ {
+ this.index = iIndex;
+ this.id = sID;
+ this.guid = sGuID;
+ this.user = sUserID;
+ this.email = sEmail;
+ this.armor = sArmor;
+ this.isPrivate = !!bIsPrivate;
+
+ this.deleteAccess = ko.observable(false);
+ }
+
+ OpenPgpKeyModel.prototype.index = 0;
+ OpenPgpKeyModel.prototype.id = '';
+ OpenPgpKeyModel.prototype.guid = '';
+ OpenPgpKeyModel.prototype.user = '';
+ OpenPgpKeyModel.prototype.email = '';
+ OpenPgpKeyModel.prototype.armor = '';
+ OpenPgpKeyModel.prototype.isPrivate = false;
+
+ module.exports = OpenPgpKeyModel;
+
+}(module));
+},{"../External/ko.js":28}],50:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -10810,7 +11324,7 @@ module.exports = window;
module.exports = AbstractSettings;
}(module));
-},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractScreen.js":35}],44:[function(require,module,exports){
+},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractScreen.js":35}],51:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -10843,7 +11357,7 @@ module.exports = window;
module.exports = LoginScreen;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../ViewModels/LoginViewModel.js":69}],45:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../ViewModels/LoginViewModel.js":76}],52:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11052,7 +11566,7 @@ module.exports = window;
module.exports = MailBoxScreen;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../Storages/AppSettings.js":61,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailCacheStorage.js":66,"../Storages/WebMailDataStorage.js":67,"../ViewModels/MailBoxFolderListViewModel.js":70,"../ViewModels/MailBoxMessageListViewModel.js":71,"../ViewModels/MailBoxMessageViewViewModel.js":72,"../ViewModels/MailBoxSystemDropDownViewModel.js":73}],46:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/MailBoxFolderListViewModel.js":77,"../ViewModels/MailBoxMessageListViewModel.js":78,"../ViewModels/MailBoxMessageViewViewModel.js":79,"../ViewModels/MailBoxSystemDropDownViewModel.js":80}],53:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11109,7 +11623,7 @@ module.exports = window;
module.exports = SettingsScreen;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"../ViewModels/SettingsMenuViewModel.js":89,"../ViewModels/SettingsPaneViewModel.js":90,"../ViewModels/SettingsSystemDropDownViewModel.js":91,"./AbstractSettings.js":43}],47:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"../ViewModels/SettingsMenuViewModel.js":98,"../ViewModels/SettingsPaneViewModel.js":99,"../ViewModels/SettingsSystemDropDownViewModel.js":100,"./AbstractSettings.js":50}],54:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11213,7 +11727,7 @@ module.exports = window;
module.exports = SettingsAccounts;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67,"../ViewModels/Popups/PopupsAddAccountViewModel.js":74}],48:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddAccountViewModel.js":81}],55:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11336,7 +11850,7 @@ module.exports = window;
module.exports = SettingsChangePassword;
}(module));
-},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../Storages/WebMailAjaxRemoteStorage.js":65}],49:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../Storages/WebMailAjaxRemoteStorage.js":72}],56:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11345,11 +11859,10 @@ module.exports = window;
var
ko = require('../External/ko.js'),
-
- Utils = require('../Common/Utils.js'),
-
- Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
+ Utils = require('../Common/Utils.js'),
+
+ Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
Data = require('../Storages/WebMailDataStorage.js')
;
@@ -11397,7 +11910,7 @@ module.exports = window;
module.exports = SettingsContacts;
}(module));
-},{"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67}],50:[function(require,module,exports){
+},{"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],57:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11406,9 +11919,7 @@ module.exports = window;
var
ko = require('../External/ko.js'),
- Utils = require('../Common/Utils.js'),
- kn = require('../Knoin/Knoin.js'),
- PopupsFilterViewModel = require('../ViewModels/Popups/PopupsFilterViewModel.js')
+ Utils = require('../Common/Utils.js')
;
/**
@@ -11431,13 +11942,19 @@ module.exports = window;
SettingsFilters.prototype.addFilter = function ()
{
+ var
+ kn = require('../Knoin/Knoin.js'),
+ FilterModel = require('../Models/FilterModel.js'),
+ PopupsFilterViewModel = require('../ViewModels/Popups/PopupsFilterViewModel.js')
+ ;
+
kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]);
};
module.exports = SettingsFilters;
}(module));
-},{"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../ViewModels/Popups/PopupsFilterViewModel.js":80}],51:[function(require,module,exports){
+},{"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Models/FilterModel.js":45,"../ViewModels/Popups/PopupsFilterViewModel.js":88}],58:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11446,6 +11963,7 @@ module.exports = window;
var
ko = require('../External/ko.js'),
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
@@ -11457,8 +11975,6 @@ module.exports = window;
Cache = require('../Storages/WebMailCacheStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsFolderCreateViewModel = require('../ViewModels/Popups/PopupsFolderCreateViewModel.js'),
PopupsFolderSystemViewModel = require('../ViewModels/Popups/PopupsFolderSystemViewModel.js')
;
@@ -11538,7 +12054,11 @@ module.exports = window;
SettingsFolders.prototype.folderEditOnEnter = function (oFolder)
{
- var sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : '';
+ var
+ RL = require('../Boots/RainLoopApp.js'),
+ sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
+ ;
+
if ('' !== sEditName && oFolder.name() !== sEditName)
{
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, '');
@@ -11596,6 +12116,7 @@ module.exports = window;
this.folderForDeletion(null);
var
+ RL = require('../Boots/RainLoopApp.js'),
fRemoveFolder = function (oFolder) {
if (oFolderToRemove === oFolder)
@@ -11656,7 +12177,7 @@ module.exports = window;
module.exports = SettingsFolders;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/AppSettings.js":61,"../Storages/LocalStorage.js":62,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailCacheStorage.js":66,"../Storages/WebMailDataStorage.js":67,"../ViewModels/Popups/PopupsFolderCreateViewModel.js":81,"../ViewModels/Popups/PopupsFolderSystemViewModel.js":82}],52:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/AppSettings.js":68,"../Storages/LocalStorage.js":69,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsFolderCreateViewModel.js":90,"../ViewModels/Popups/PopupsFolderSystemViewModel.js":91}],59:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11838,7 +12359,7 @@ module.exports = window;
module.exports = SettingsGeneral;
}(module));
-},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67,"../ViewModels/Popups/PopupsLanguagesViewModel.js":86}],53:[function(require,module,exports){
+},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsLanguagesViewModel.js":95}],60:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -11847,7 +12368,7 @@ module.exports = window;
var
ko = require('../External/ko.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
NewHtmlEditorWrapper = require('../Common/NewHtmlEditorWrapper.js'),
@@ -11855,8 +12376,6 @@ module.exports = window;
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
kn = require('../Knoin/Knoin.js'),
PopupsIdentityViewModel = require('../ViewModels/Popups/PopupsIdentityViewModel.js')
;
@@ -11976,6 +12495,7 @@ module.exports = window;
this.identityForDeletion(null);
var
+ RL = require('../Boots/RainLoopApp.js'),
fRemoveFolder = function (oIdentity) {
return oIdentityToRemove === oIdentity;
}
@@ -12077,7 +12597,7 @@ module.exports = window;
module.exports = SettingsIdentities;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67,"../ViewModels/Popups/PopupsIdentityViewModel.js":84}],54:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsIdentityViewModel.js":93}],61:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -12181,7 +12701,7 @@ module.exports = window;
module.exports = SettingsIdentity;
}(module));
-},{"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67}],55:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],62:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -12190,13 +12710,11 @@ module.exports = window;
var
ko = require('../External/ko.js'),
-
+
kn = require('../Knoin/Knoin.js'),
Data = require('../Storages/WebMailDataStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsAddOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js'),
PopupsGenerateNewOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js'),
PopupsViewOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js')
@@ -12264,6 +12782,7 @@ module.exports = window;
Data.openpgpKeyring.store();
+ var RL = require('../Boots/RainLoopApp.js');
RL.reloadOpenPgpKeys();
}
}
@@ -12272,7 +12791,7 @@ module.exports = window;
module.exports = SettingsOpenPGP;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailDataStorage.js":67,"../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js":75,"../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js":83,"../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js":88}],56:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js":82,"../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js":92,"../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js":97}],63:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -12443,26 +12962,24 @@ module.exports = window;
module.exports = SettingsSecurity;
}(module));
-},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":65,"../ViewModels/Popups/PopupsTwoFactorTestViewModel.js":87}],57:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../ViewModels/Popups/PopupsTwoFactorTestViewModel.js":96}],64:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
'use strict';
- var
- Utils = require('../Common/Utils.js'),
-
- Data = require('../Storages/WebMailDataStorage.js'),
-
- RL = require('../Boots/RainLoopApp.js')
- ;
-
/**
* @constructor
*/
function SettingsSocial()
{
+ var
+ Utils = require('../Common/Utils.js'),
+ RL = require('../Boots/RainLoopApp.js'),
+ Data = require('../Storages/WebMailDataStorage.js')
+ ;
+
this.googleEnable = Data.googleEnable;
this.googleActions = Data.googleActions;
@@ -12524,7 +13041,7 @@ module.exports = window;
module.exports = SettingsSocial;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Utils.js":14,"../Storages/WebMailDataStorage.js":67}],58:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Utils.js":14,"../Storages/WebMailDataStorage.js":74}],65:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -12657,7 +13174,7 @@ module.exports = window;
module.exports = SettingsThemes;
}(module));
-},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/window.js":32,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67}],59:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/window.js":32,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],66:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -12969,7 +13486,7 @@ module.exports = window;
module.exports = AbstractAjaxRemoteStorage;
}(module));
-},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/window.js":32,"./AppSettings.js":61}],60:[function(require,module,exports){
+},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/window.js":32,"./AppSettings.js":68}],67:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -13063,72 +13580,72 @@ module.exports = window;
module.exports = AbstractData;
}(module));
-},{"../Common/Enums.js":7,"../Common/Utils.js":14,"./AppSettings.js":61}],61:[function(require,module,exports){
-/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-
-(function (module) {
-
- 'use strict';
-
- var
- AppData = require('../External/AppData.js'),
-
- Utils = require('../Common/Utils.js')
- ;
-
- /**
- * @constructor
- */
- function AppSettings()
- {
- this.oSettings = null;
- }
-
- AppSettings.prototype.oSettings = null;
-
- /**
- * @param {string} sName
- * @return {?}
- */
- AppSettings.prototype.settingsGet = function (sName)
- {
- if (null === this.oSettings)
- {
- this.oSettings = Utils.isNormal(AppData) ? AppData : {};
- }
-
- return Utils.isUnd(this.oSettings[sName]) ? null : this.oSettings[sName];
- };
-
- /**
- * @param {string} sName
- * @param {?} mValue
- */
- AppSettings.prototype.settingsSet = function (sName, mValue)
- {
- if (null === this.oSettings)
- {
- this.oSettings = Utils.isNormal(AppData) ? AppData : {};
- }
-
- this.oSettings[sName] = mValue;
- };
-
- /**
- * @param {string} sName
- * @return {boolean}
- */
- AppSettings.prototype.capa = function (sName)
- {
- var mCapa = this.settingsGet('Capa');
- return Utils.isArray(mCapa) && Utils.isNormal(sName) && -1 < Utils.inArray(sName, mCapa);
- };
-
-
- module.exports = new AppSettings();
-
+},{"../Common/Enums.js":7,"../Common/Utils.js":14,"./AppSettings.js":68}],68:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ AppData = require('../External/AppData.js'),
+
+ Utils = require('../Common/Utils.js')
+ ;
+
+ /**
+ * @constructor
+ */
+ function AppSettings()
+ {
+ this.oSettings = null;
+ }
+
+ AppSettings.prototype.oSettings = null;
+
+ /**
+ * @param {string} sName
+ * @return {?}
+ */
+ AppSettings.prototype.settingsGet = function (sName)
+ {
+ if (null === this.oSettings)
+ {
+ this.oSettings = Utils.isNormal(AppData) ? AppData : {};
+ }
+
+ return Utils.isUnd(this.oSettings[sName]) ? null : this.oSettings[sName];
+ };
+
+ /**
+ * @param {string} sName
+ * @param {?} mValue
+ */
+ AppSettings.prototype.settingsSet = function (sName, mValue)
+ {
+ if (null === this.oSettings)
+ {
+ this.oSettings = Utils.isNormal(AppData) ? AppData : {};
+ }
+
+ this.oSettings[sName] = mValue;
+ };
+
+ /**
+ * @param {string} sName
+ * @return {boolean}
+ */
+ AppSettings.prototype.capa = function (sName)
+ {
+ var mCapa = this.settingsGet('Capa');
+ return Utils.isArray(mCapa) && Utils.isNormal(sName) && -1 < Utils.inArray(sName, mCapa);
+ };
+
+
+ module.exports = new AppSettings();
+
}(module));
-},{"../Common/Utils.js":14,"../External/AppData.js":19}],62:[function(require,module,exports){
+},{"../Common/Utils.js":14,"../External/AppData.js":19}],69:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -13184,7 +13701,7 @@ module.exports = window;
module.exports = new LocalStorage();
}(module));
-},{"../External/underscore.js":31,"./LocalStorages/CookieDriver.js":63,"./LocalStorages/LocalStorageDriver.js":64}],63:[function(require,module,exports){
+},{"../External/underscore.js":31,"./LocalStorages/CookieDriver.js":70,"./LocalStorages/LocalStorageDriver.js":71}],70:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -13194,6 +13711,7 @@ module.exports = window;
var
$ = require('../../External/jquery.js'),
JSON = require('../../External/JSON.js'),
+
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js')
;
@@ -13275,7 +13793,7 @@ module.exports = window;
module.exports = CookieDriver;
}(module));
-},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/JSON.js":20,"../../External/jquery.js":26}],64:[function(require,module,exports){
+},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/JSON.js":20,"../../External/jquery.js":26}],71:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -13285,6 +13803,7 @@ module.exports = window;
var
window = require('../../External/window.js'),
JSON = require('../../External/JSON.js'),
+
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js')
;
@@ -13359,11 +13878,11 @@ module.exports = window;
return mResult;
};
-
+
module.exports = LocalStorageDriver;
}(module));
-},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/JSON.js":20,"../../External/window.js":32}],65:[function(require,module,exports){
+},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/JSON.js":20,"../../External/window.js":32}],72:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -14178,7 +14697,7 @@ module.exports = window;
module.exports = new WebMailAjaxRemoteStorage();
}(module));
-},{"../Common/Base64.js":5,"../Common/Consts.js":6,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"./AbstractAjaxRemoteStorage.js":59,"./AppSettings.js":61,"./WebMailCacheStorage.js":66,"./WebMailDataStorage.js":67}],66:[function(require,module,exports){
+},{"../Common/Base64.js":5,"../Common/Consts.js":6,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"./AbstractAjaxRemoteStorage.js":66,"./AppSettings.js":68,"./WebMailCacheStorage.js":73,"./WebMailDataStorage.js":74}],73:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -14528,7 +15047,7 @@ module.exports = window;
module.exports = new WebMailCacheStorage();
}(module));
-},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/underscore.js":31,"./AppSettings.js":61}],67:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/underscore.js":31,"./AppSettings.js":68}],74:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -14543,7 +15062,7 @@ module.exports = window;
moment = require('../External/moment.js'),
$div = require('../External/$div.js'),
NotificationClass = require('../External/NotificationClass.js'),
-
+
Consts = require('../Common/Consts.js'),
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
@@ -14552,9 +15071,9 @@ module.exports = window;
AppSettings = require('./AppSettings.js'),
Cache = require('./WebMailCacheStorage.js'),
-
+
kn = require('../Knoin/Knoin.js'),
-
+
MessageModel = require('../Models/MessageModel.js'),
LocalStorage = require('./LocalStorage.js'),
@@ -14856,7 +15375,10 @@ module.exports = window;
if (Enums.Layout.NoPreview === this.layout() &&
-1 < window.location.hash.indexOf('message-preview'))
{
- RL.historyBack(); // TODO cjs
+ if (Globals.__RL)
+ {
+ Globals.__RL.historyBack();
+ }
}
}
else if (Enums.Layout.NoPreview === this.layout())
@@ -15453,7 +15975,10 @@ module.exports = window;
Cache.initMessageFlagsFromCache(oMessage);
if (oMessage.unseen())
{
- RL.setMessageSeen(oMessage);
+ if (Globals.__RL)
+ {
+ Globals.__RL.setMessageSeen(oMessage);
+ }
}
Utils.windowResize();
@@ -15552,7 +16077,7 @@ module.exports = window;
}(module));
-},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Models/MessageModel.js":42,"./AbstractData.js":60,"./AppSettings.js":61,"./LocalStorage.js":62,"./WebMailCacheStorage.js":66}],68:[function(require,module,exports){
+},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Models/MessageModel.js":48,"./AbstractData.js":67,"./AppSettings.js":68,"./LocalStorage.js":69,"./WebMailCacheStorage.js":73}],75:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -15564,7 +16089,7 @@ module.exports = window;
ko = require('../External/ko.js'),
window = require('../External/window.js'),
key = require('../External/key.js'),
-
+
Enums = require('../Common/Enums.js'),
Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
@@ -15573,8 +16098,6 @@ module.exports = window;
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsKeyboardShortcutsHelpViewModel = require('../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js'),
PopupsAddAccountViewModel = require('../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js'),
@@ -15646,6 +16169,7 @@ module.exports = window;
AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
{
+ var RL = require('../Boots/RainLoopApp.js');
Remote.logout(function () {
if (window.__rlah_clear)
{
@@ -15679,7 +16203,7 @@ module.exports = window;
module.exports = AbstractSystemDropDownViewModel;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":61,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67,"../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js":85}],69:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js":94}],76:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -15691,7 +16215,7 @@ module.exports = window;
$ = require('../External/jquery.js'),
_ = require('../External/underscore.js'),
ko = require('../External/ko.js'),
-
+
Utils = require('../Common/Utils.js'),
Enums = require('../Common/Enums.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
@@ -15700,8 +16224,6 @@ module.exports = window;
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js'),
@@ -15817,6 +16339,7 @@ module.exports = window;
}
else
{
+ var RL = require('../Boots/RainLoopApp.js');
RL.loginAndLogoutReload();
}
}
@@ -15915,6 +16438,7 @@ module.exports = window;
window.open(LinkBuilder.socialTwitter(), 'Twitter',
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
+
return true;
}, function () {
@@ -15975,6 +16499,8 @@ module.exports = window;
if (0 === iErrorCode)
{
self.submitRequest(true);
+
+ var RL = require('../Boots/RainLoopApp.js');
RL.loginAndLogoutReload();
}
else
@@ -16053,7 +16579,7 @@ module.exports = window;
module.exports = LoginViewModel;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":61,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailDataStorage.js":67,"../ViewModels/Popups/PopupsLanguagesViewModel.js":86}],70:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsLanguagesViewModel.js":95}],77:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -16066,7 +16592,7 @@ module.exports = window;
ko = require('../External/ko.js'),
key = require('../External/key.js'),
$html = require('../External/$html.js'),
-
+
Utils = require('../Common/Utils.js'),
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
@@ -16076,8 +16602,6 @@ module.exports = window;
Cache = require('../Storages/WebMailCacheStorage.js'),
Data = require('../Storages/WebMailDataStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js'),
PopupsFolderCreateViewModel = require('./Popups/PopupsFolderCreateViewModel.js'),
PopupsContactsViewModel = require('./Popups/PopupsContactsViewModel.js'),
@@ -16118,7 +16642,10 @@ module.exports = window;
this.oContentVisible = $('.b-content', oDom);
this.oContentScrollable = $('.content', this.oContentVisible);
- var self = this;
+ var
+ self = this,
+ RL = require('../Boots/RainLoopApp.js')
+ ;
oDom
.on('click', '.b-folders .e-item .e-link .e-collapsed-sign', function (oEvent) {
@@ -16241,6 +16768,7 @@ module.exports = window;
window.clearTimeout(this.iDropOverTimer);
if (oFolder && oFolder.collapsed())
{
+ var RL = require('../Boots/RainLoopApp.js');
this.iDropOverTimer = window.setTimeout(function () {
oFolder.collapsed(false);
RL.setExpandedFolder(oFolder.fullNameHash, true);
@@ -16296,6 +16824,7 @@ module.exports = window;
if (oToFolder && oUi && oUi.helper)
{
var
+ RL = require('../Boots/RainLoopApp.js'),
sFromFolderFullNameRaw = oUi.helper.data('rl-folder'),
bCopy = $html.hasClass('rl-ctrl-key-pressed'),
aUids = oUi.helper.data('rl-uids')
@@ -16335,7 +16864,7 @@ module.exports = window;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":61,"../Storages/WebMailCacheStorage.js":66,"../Storages/WebMailDataStorage.js":67,"./Popups/PopupsComposeViewModel.js":78,"./Popups/PopupsContactsViewModel.js":79,"./Popups/PopupsFolderCreateViewModel.js":81}],71:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86,"./Popups/PopupsContactsViewModel.js":87,"./Popups/PopupsFolderCreateViewModel.js":90}],78:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -16349,11 +16878,11 @@ module.exports = window;
key = require('../External/key.js'),
ifvisible = require('../External/ifvisible.js'),
Jua = require('../External/Jua.js'),
-
- Utils = require('../Common/Utils.js'),
+
Enums = require('../Common/Enums.js'),
Consts = require('../Common/Consts.js'),
Globals = require('../Common/Globals.js'),
+ Utils = require('../Common/Utils.js'),
LinkBuilder = require('../Common/LinkBuilder.js'),
Events = require('../Common/Events.js'),
Selector = require('../Common/Selector.js'),
@@ -16363,12 +16892,12 @@ module.exports = window;
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js'),
- PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js')
+ PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js'),
+ PopupsAdvancedSearchViewModel = require('./Popups/PopupsAdvancedSearchViewModel.js'),
+ PopupsFolderClearViewModel = require('./Popups/PopupsFolderClearViewModel.js')
;
/**
@@ -16377,6 +16906,8 @@ module.exports = window;
*/
function MailBoxMessageListViewModel()
{
+ var RL = require('../Boots/RainLoopApp.js');
+
KnoinAbstractViewModel.call(this, 'Right', 'MailMessageList');
this.sLastUid = null;
@@ -17273,7 +17804,7 @@ module.exports = window;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Selector.js":13,"../Common/Utils.js":14,"../External/Jua.js":21,"../External/ifvisible.js":25,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":61,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailCacheStorage.js":66,"../Storages/WebMailDataStorage.js":67,"./Popups/PopupsComposeViewModel.js":78}],72:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Selector.js":13,"../Common/Utils.js":14,"../External/Jua.js":21,"../External/ifvisible.js":25,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsAdvancedSearchViewModel.js":83,"./Popups/PopupsComposeViewModel.js":86,"./Popups/PopupsFolderClearViewModel.js":89}],79:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -17285,7 +17816,7 @@ module.exports = window;
ko = require('../External/ko.js'),
key = require('../External/key.js'),
$html = require('../External/$html.js'),
-
+
Consts = require('../Common/Consts.js'),
Enums = require('../Common/Enums.js'),
Globals = require('../Common/Globals.js'),
@@ -17296,8 +17827,8 @@ module.exports = window;
Data = require('../Storages/WebMailDataStorage.js'),
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../Boots/RainLoopApp.js'),
-
+ PopupsComposeViewModel = require('./Popups/PopupsComposeViewModel.js'),
+
kn = require('../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js')
;
@@ -17313,6 +17844,7 @@ module.exports = window;
var
self = this,
sLastEmail = '',
+ RL = require('../Boots/RainLoopApp.js'),
createCommandHelper = function (sType) {
return Utils.createCommand(self, function () {
this.replyOrforward(sType);
@@ -17617,7 +18149,8 @@ module.exports = window;
MailBoxMessageViewViewModel.prototype.onBuild = function (oDom)
{
var
- self = this
+ self = this,
+ RL = require('../Boots/RainLoopApp.js')
;
this.fullScreenMode.subscribe(function (bValue) {
@@ -17986,6 +18519,8 @@ module.exports = window;
oMessage.isReadReceipt(true);
Cache.storeMessageFlagsToCache(oMessage);
+
+ var RL = require('../Boots/RainLoopApp.js');
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};
@@ -17993,7 +18528,7 @@ module.exports = window;
module.exports = MailBoxMessageViewViewModel;
}(module));
-},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailAjaxRemoteStorage.js":65,"../Storages/WebMailCacheStorage.js":66,"../Storages/WebMailDataStorage.js":67}],73:[function(require,module,exports){
+},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86}],80:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -18001,7 +18536,6 @@ module.exports = window;
'use strict';
var
- Utils = require('../Common/Utils.js'),
kn = require('../Knoin/Knoin.js'),
AbstractSystemDropDownViewModel = require('./AbstractSystemDropDownViewModel.js')
;
@@ -18022,7 +18556,7 @@ module.exports = window;
}(module));
-},{"../Common/Utils.js":14,"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":68}],74:[function(require,module,exports){
+},{"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":75}],81:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -18030,15 +18564,14 @@ module.exports = window;
'use strict';
var
+ _ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -18051,6 +18584,8 @@ module.exports = window;
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddAccount');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.email = ko.observable('');
this.password = ko.observable('');
@@ -18140,7 +18675,7 @@ module.exports = window;
module.exports = PopupsAddAccountViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":65}],75:[function(require,module,exports){
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72}],82:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -18149,17 +18684,15 @@ module.exports = window;
var
ko = require('../../External/ko.js'),
-
+
Utils = require('../../Common/Utils.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
-
+
/**
* @constructor
* @extends KnoinAbstractViewModel
@@ -18168,6 +18701,8 @@ module.exports = window;
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddOpenPgpKey');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.key = ko.observable('');
this.key.error = ko.observable(false);
this.key.focus = ko.observable(false);
@@ -18252,7 +18787,165 @@ module.exports = window;
module.exports = PopupsAddOpenPgpKeyViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":67}],76:[function(require,module,exports){
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],83:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../../External/ko.js'),
+ moment = require('../../External/moment.js'),
+
+ Utils = require('../../Common/Utils.js'),
+
+ Data = require('../../Storages/WebMailDataStorage.js'),
+
+ kn = require('../../Knoin/Knoin.js'),
+ KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
+ ;
+
+ /**
+ * @constructor
+ * @extends KnoinAbstractViewModel
+ */
+ function PopupsAdvancedSearchViewModel()
+ {
+ KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAdvancedSearch');
+
+ this.fromFocus = ko.observable(false);
+
+ this.from = ko.observable('');
+ this.to = ko.observable('');
+ this.subject = ko.observable('');
+ this.text = ko.observable('');
+ this.selectedDateValue = ko.observable(-1);
+
+ this.hasAttachment = ko.observable(false);
+ this.starred = ko.observable(false);
+ this.unseen = ko.observable(false);
+
+ this.searchCommand = Utils.createCommand(this, function () {
+
+ var sSearch = this.buildSearchString();
+ if ('' !== sSearch)
+ {
+ Data.mainMessageListSearch(sSearch);
+ }
+
+ this.cancelCommand();
+ });
+
+ kn.constructorEnd(this);
+ }
+
+ kn.extendAsViewModel('PopupsAdvancedSearchViewModel', PopupsAdvancedSearchViewModel);
+
+ PopupsAdvancedSearchViewModel.prototype.buildSearchStringValue = function (sValue)
+ {
+ if (-1 < sValue.indexOf(' '))
+ {
+ sValue = '"' + sValue + '"';
+ }
+
+ return sValue;
+ };
+
+ PopupsAdvancedSearchViewModel.prototype.buildSearchString = function ()
+ {
+ var
+ aResult = [],
+ sFrom = Utils.trim(this.from()),
+ sTo = Utils.trim(this.to()),
+ sSubject = Utils.trim(this.subject()),
+ sText = Utils.trim(this.text()),
+ aIs = [],
+ aHas = []
+ ;
+
+ if (sFrom && '' !== sFrom)
+ {
+ aResult.push('from:' + this.buildSearchStringValue(sFrom));
+ }
+
+ if (sTo && '' !== sTo)
+ {
+ aResult.push('to:' + this.buildSearchStringValue(sTo));
+ }
+
+ if (sSubject && '' !== sSubject)
+ {
+ aResult.push('subject:' + this.buildSearchStringValue(sSubject));
+ }
+
+ if (this.hasAttachment())
+ {
+ aHas.push('attachment');
+ }
+
+ if (this.unseen())
+ {
+ aIs.push('unseen');
+ }
+
+ if (this.starred())
+ {
+ aIs.push('flagged');
+ }
+
+ if (0 < aHas.length)
+ {
+ aResult.push('has:' + aHas.join(','));
+ }
+
+ if (0 < aIs.length)
+ {
+ aResult.push('is:' + aIs.join(','));
+ }
+
+ if (-1 < this.selectedDateValue())
+ {
+ aResult.push('date:' + moment().subtract('days', this.selectedDateValue()).format('YYYY.MM.DD') + '/');
+ }
+
+ if (sText && '' !== sText)
+ {
+ aResult.push('text:' + this.buildSearchStringValue(sText));
+ }
+
+ return Utils.trim(aResult.join(' '));
+ };
+
+ PopupsAdvancedSearchViewModel.prototype.clearPopup = function ()
+ {
+ this.from('');
+ this.to('');
+ this.subject('');
+ this.text('');
+
+ this.selectedDateValue(-1);
+ this.hasAttachment(false);
+ this.starred(false);
+ this.unseen(false);
+
+ this.fromFocus(true);
+ };
+
+ PopupsAdvancedSearchViewModel.prototype.onShow = function ()
+ {
+ this.clearPopup();
+ };
+
+ PopupsAdvancedSearchViewModel.prototype.onFocus = function ()
+ {
+ this.fromFocus(true);
+ };
+
+ module.exports = PopupsAdvancedSearchViewModel;
+
+}(module));
+},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/moment.js":29,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],84:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -18262,8 +18955,10 @@ module.exports = window;
var
ko = require('../../External/ko.js'),
key = require('../../External/key.js'),
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -18381,7 +19076,7 @@ module.exports = window;
module.exports = PopupsAskViewModel;
}(module));
-},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],77:[function(require,module,exports){
+},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],85:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -18390,18 +19085,21 @@ module.exports = window;
var
window = require('../../External/window.js'),
+ _ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
key = require('../../External/key.js'),
-
+
Utils = require('../../Common/Utils.js'),
Enums = require('../../Common/Enums.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
+ EmailModel = require('../../Models/EmailModel.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
-
+
/**
* @constructor
* @extends KnoinAbstractViewModel
@@ -18644,7 +19342,7 @@ module.exports = window;
module.exports = PopupsComposeOpenPgpViewModel;
}(module));
-},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/ko.js":28,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":67}],78:[function(require,module,exports){
+},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/EmailModel.js":43,"../../Storages/WebMailDataStorage.js":74}],86:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -18657,7 +19355,9 @@ module.exports = window;
_ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
moment = require('../../External/moment.js'),
-
+ $window = require('../../External/$window.js'),
+ JSON = require('../../External/JSON.js'),
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
@@ -18671,9 +19371,11 @@ module.exports = window;
Cache = require('../../Storages/WebMailCacheStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
+ ComposeAttachmentModel = require('../../Models/ComposeAttachmentModel.js'),
PopupsComposeOpenPgpViewModel = require('./PopupsComposeOpenPgpViewModel.js'),
+ PopupsFolderSystemViewModel = require('./PopupsFolderSystemViewModel.js'),
+ PopupsAskViewModel = require('./PopupsAskViewModel.js'),
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
@@ -18687,6 +19389,8 @@ module.exports = window;
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsCompose');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.oEditor = null;
this.aDraftInfo = null;
this.sInReplyTo = '';
@@ -19055,6 +19759,7 @@ module.exports = window;
PopupsComposeViewModel.prototype.emailsSource = function (oData, fResponse)
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.getAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oEmailItem) {
return oEmailItem.toLine(false);
@@ -19084,7 +19789,11 @@ module.exports = window;
PopupsComposeViewModel.prototype.reloadDraftFolder = function ()
{
- var sDraftFolder = Data.draftFolder();
+ var
+ RL = require('../../Boots/RainLoopApp.js'),
+ sDraftFolder = Data.draftFolder()
+ ;
+
if ('' !== sDraftFolder)
{
Cache.setFolderHash(sDraftFolder, '');
@@ -19701,12 +20410,12 @@ module.exports = window;
if (this.dropboxEnabled())
{
- oScript = document.createElement('script');
+ oScript = window.document.createElement('script');
oScript.type = 'text/javascript';
oScript.src = 'https://www.dropbox.com/static/api/1/dropins.js';
$(oScript).attr('id', 'dropboxjs').attr('data-app-key', AppSettings.settingsGet('DropboxApiKey'));
- document.body.appendChild(oScript);
+ window.document.body.appendChild(oScript);
}
if (this.driveEnabled())
@@ -19943,7 +20652,7 @@ module.exports = window;
if (oItem)
{
- oItem.progress(' - ' + Math.floor(iLoaded / iTotal * 100) + '%');
+ oItem.progress(' - ' + window.Math.floor(iLoaded / iTotal * 100) + '%');
}
}, this))
@@ -20421,7 +21130,7 @@ module.exports = window;
module.exports = PopupsComposeViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Events.js":8,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/NewHtmlEditorWrapper.js":11,"../../Common/Utils.js":14,"../../External/jquery.js":26,"../../External/ko.js":28,"../../External/moment.js":29,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/AppSettings.js":61,"../../Storages/WebMailAjaxRemoteStorage.js":65,"../../Storages/WebMailCacheStorage.js":66,"../../Storages/WebMailDataStorage.js":67,"./PopupsComposeOpenPgpViewModel.js":77}],79:[function(require,module,exports){
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Events.js":8,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/NewHtmlEditorWrapper.js":11,"../../Common/Utils.js":14,"../../External/$window.js":18,"../../External/JSON.js":20,"../../External/jquery.js":26,"../../External/ko.js":28,"../../External/moment.js":29,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ComposeAttachmentModel.js":39,"../../Storages/AppSettings.js":68,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74,"./PopupsAskViewModel.js":84,"./PopupsComposeOpenPgpViewModel.js":85,"./PopupsFolderSystemViewModel.js":91}],87:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -20434,7 +21143,7 @@ module.exports = window;
_ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
key = require('../../External/key.js'),
-
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Globals = require('../../Common/Globals.js'),
@@ -20445,7 +21154,12 @@ module.exports = window;
Data = require('../../Storages/WebMailDataStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
+ EmailModel = require('../../Models/EmailModel.js'),
+ ContactModel = require('../../Models/ContactModel.js'),
+ ContactTagModel = require('../../Models/ContactTagModel.js'),
+ ContactPropertyModel = require('../../Models/ContactPropertyModel.js'),
+
+ PopupsComposeViewModel = require('./PopupsComposeViewModel.js'),
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
@@ -20770,7 +21484,11 @@ module.exports = window;
this.syncCommand = Utils.createCommand(this, function () {
- var self = this;
+ var
+ self = this,
+ RL = require('../../Boots/RainLoopApp.js')
+ ;
+
RL.contactsSync(function (sResult, oData) {
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
{
@@ -20816,6 +21534,7 @@ module.exports = window;
PopupsContactsViewModel.prototype.contactTagsSource = function (oData, fResponse)
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.getContactTagsAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oTagItem) {
return oTagItem.toLine(false);
@@ -20899,17 +21618,15 @@ module.exports = window;
this.addNewOrFocusProperty(Enums.ContactPropertyType.Birthday);
};
- //PopupsContactsViewModel.prototype.addNewAddress = function ()
- //{
- //};
-
PopupsContactsViewModel.prototype.exportVcf = function ()
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.download(LinkBuilder.exportContactsVcf());
};
PopupsContactsViewModel.prototype.exportCsv = function ()
{
+ var RL = require('../../Boots/RainLoopApp.js');
RL.download(LinkBuilder.exportContactsCsv());
};
@@ -21204,7 +21921,7 @@ module.exports = window;
module.exports = PopupsContactsViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/Selector.js":13,"../../Common/Utils.js":14,"../../External/jquery.js":26,"../../External/key.js":27,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":65,"../../Storages/WebMailDataStorage.js":67}],80:[function(require,module,exports){
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/Selector.js":13,"../../Common/Utils.js":14,"../../External/jquery.js":26,"../../External/key.js":27,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ContactModel.js":40,"../../Models/ContactPropertyModel.js":41,"../../Models/ContactTagModel.js":42,"../../Models/EmailModel.js":43,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74,"./PopupsComposeViewModel.js":86}],88:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -21257,7 +21974,7 @@ module.exports = window;
module.exports = PopupsFilterViewModel;
}(module));
-},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":67}],81:[function(require,module,exports){
+},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],89:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -21266,7 +21983,130 @@ module.exports = window;
var
ko = require('../../External/ko.js'),
-
+
+ Enums = require('../../Common/Enums.js'),
+ Utils = require('../../Common/Utils.js'),
+
+ Data = require('../../Storages/WebMailDataStorage.js'),
+ Cache = require('../../Storages/WebMailCacheStorage.js'),
+ Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
+
+ kn = require('../../Knoin/Knoin.js'),
+ KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
+ ;
+
+ /**
+ * @constructor
+ * @extends KnoinAbstractViewModel
+ */
+ function PopupsFolderClearViewModel()
+ {
+ KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderClear');
+
+ var RL = require('../../Boots/RainLoopApp.js');
+
+ this.selectedFolder = ko.observable(null);
+ this.clearingProcess = ko.observable(false);
+ this.clearingError = ko.observable('');
+
+ this.folderFullNameForClear = ko.computed(function () {
+ var oFolder = this.selectedFolder();
+ return oFolder ? oFolder.printableFullName() : '';
+ }, this);
+
+ this.folderNameForClear = ko.computed(function () {
+ var oFolder = this.selectedFolder();
+ return oFolder ? oFolder.localName() : '';
+ }, this);
+
+ this.dangerDescHtml = ko.computed(function () {
+ return Utils.i18n('POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1', {
+ 'FOLDER': this.folderNameForClear()
+ });
+ }, this);
+
+ this.clearCommand = Utils.createCommand(this, function () {
+
+ var
+ self = this,
+ oFolderToClear = this.selectedFolder()
+ ;
+
+ if (oFolderToClear)
+ {
+ Data.message(null);
+ Data.messageList([]);
+
+ this.clearingProcess(true);
+
+ Cache.setFolderHash(oFolderToClear.fullNameRaw, '');
+ Remote.folderClear(function (sResult, oData) {
+
+ self.clearingProcess(false);
+ if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
+ {
+ RL.reloadMessageList(true);
+ self.cancelCommand();
+ }
+ else
+ {
+ if (oData && oData.ErrorCode)
+ {
+ self.clearingError(Utils.getNotification(oData.ErrorCode));
+ }
+ else
+ {
+ self.clearingError(Utils.getNotification(Enums.Notification.MailServerError));
+ }
+ }
+ }, oFolderToClear.fullNameRaw);
+ }
+
+ }, function () {
+
+ var
+ oFolder = this.selectedFolder(),
+ bIsClearing = this.clearingProcess()
+ ;
+
+ return !bIsClearing && null !== oFolder;
+
+ });
+
+ kn.constructorEnd(this);
+ }
+
+ kn.extendAsViewModel('PopupsFolderClearViewModel', PopupsFolderClearViewModel);
+
+ PopupsFolderClearViewModel.prototype.clearPopup = function ()
+ {
+ this.clearingProcess(false);
+ this.selectedFolder(null);
+ };
+
+ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
+ {
+ this.clearPopup();
+ if (oFolder)
+ {
+ this.selectedFolder(oFolder);
+ }
+ };
+
+ module.exports = PopupsFolderClearViewModel;
+
+}(module));
+
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74}],90:[function(require,module,exports){
+/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
+
+(function (module) {
+
+ 'use strict';
+
+ var
+ ko = require('../../External/ko.js'),
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
@@ -21274,8 +22114,6 @@ module.exports = window;
Data = require('../../Storages/WebMailDataStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -21326,7 +22164,11 @@ module.exports = window;
// commands
this.createFolder = Utils.createCommand(this, function () {
- var sParentFolderName = this.selectedParentValue();
+ var
+ RL = require('../../Boots/RainLoopApp.js'),
+ sParentFolderName = this.selectedParentValue()
+ ;
+
if ('' === sParentFolderName && 1 < Data.namespace.length)
{
sParentFolderName = Data.namespace.substr(0, Data.namespace.length - 1);
@@ -21388,7 +22230,7 @@ module.exports = window;
module.exports = PopupsFolderCreateViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":65,"../../Storages/WebMailDataStorage.js":67}],82:[function(require,module,exports){
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],91:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -21397,7 +22239,7 @@ module.exports = window;
var
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Consts = require('../../Common/Consts.js'),
Utils = require('../../Common/Utils.js'),
@@ -21406,8 +22248,6 @@ module.exports = window;
Data = require('../../Storages/WebMailDataStorage.js'),
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -21526,7 +22366,7 @@ module.exports = window;
module.exports = PopupsFolderSystemViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/AppSettings.js":61,"../../Storages/WebMailAjaxRemoteStorage.js":65,"../../Storages/WebMailDataStorage.js":67}],83:[function(require,module,exports){
+},{"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/AppSettings.js":68,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],92:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -21535,14 +22375,13 @@ module.exports = window;
var
window = require('../../External/window.js'),
+ _ = require('../../External/underscore.js'),
ko = require('../../External/ko.js'),
-
+
Utils = require('../../Common/Utils.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -21555,6 +22394,8 @@ module.exports = window;
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsGenerateNewOpenPgpKey');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.email = ko.observable('');
this.email.focus = ko.observable('');
this.email.error = ko.observable(false);
@@ -21644,7 +22485,7 @@ module.exports = window;
module.exports = PopupsGenerateNewOpenPgpKeyViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":67}],84:[function(require,module,exports){
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],93:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -21653,7 +22494,7 @@ module.exports = window;
var
ko = require('../../External/ko.js'),
-
+
Enums = require('../../Common/Enums.js'),
Utils = require('../../Common/Utils.js'),
kn = require('../../Knoin/Knoin.js'),
@@ -21661,8 +22502,6 @@ module.exports = window;
Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'),
Data = require('../../Storages/WebMailDataStorage.js'),
- RL = require('../../Boots/RainLoopApp.js'),
-
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -21674,6 +22513,8 @@ module.exports = window;
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsIdentity');
+ var RL = require('../../Boots/RainLoopApp.js');
+
this.id = '';
this.edit = ko.observable(false);
this.owner = ko.observable(false);
@@ -21817,7 +22658,7 @@ module.exports = window;
module.exports = PopupsIdentityViewModel;
}(module));
-},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":65,"../../Storages/WebMailDataStorage.js":67}],85:[function(require,module,exports){
+},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],94:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -21827,8 +22668,9 @@ module.exports = window;
var
_ = require('../../External/underscore.js'),
key = require('../../External/key.js'),
+
Enums = require('../../Common/Enums.js'),
- Utils = require('../../Common/Utils.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -21881,7 +22723,7 @@ module.exports = window;
module.exports = PopupsKeyboardShortcutsHelpViewModel;
}(module));
-},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],86:[function(require,module,exports){
+},{"../../Common/Enums.js":7,"../../External/key.js":27,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],95:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -21963,7 +22805,7 @@ module.exports = window;
module.exports = PopupsLanguagesViewModel;
}(module));
-},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":67}],87:[function(require,module,exports){
+},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],96:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -22039,7 +22881,7 @@ module.exports = window;
module.exports = PopupsTwoFactorTestViewModel;
}(module));
-},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":65}],88:[function(require,module,exports){
+},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72}],97:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -22048,7 +22890,9 @@ module.exports = window;
var
ko = require('../../External/ko.js'),
+
Utils = require('../../Common/Utils.js'),
+
kn = require('../../Knoin/Knoin.js'),
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
;
@@ -22096,7 +22940,7 @@ module.exports = window;
module.exports = PopupsViewOpenPgpKeyViewModel;
}(module));
-},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],89:[function(require,module,exports){
+},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],98:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -22143,7 +22987,7 @@ module.exports = window;
module.exports = SettingsMenuViewModel;
}(module));
-},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36}],90:[function(require,module,exports){
+},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36}],99:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -22196,7 +23040,7 @@ module.exports = window;
module.exports = SettingsPaneViewModel;
}(module));
-},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../External/key.js":27,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailDataStorage.js":67}],91:[function(require,module,exports){
+},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../External/key.js":27,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailDataStorage.js":74}],100:[function(require,module,exports){
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
@@ -22223,4 +23067,4 @@ module.exports = window;
module.exports = SettingsSystemDropDownViewModel;
}(module));
-},{"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":68}]},{},[1]);
+},{"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":75}]},{},[1]);
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 6694ef538..1685f3504 100644
--- a/rainloop/v/0.0.0/static/js/app.min.js
+++ b/rainloop/v/0.0.0/static/js/app.min.js
@@ -1,10 +1,11 @@
-!function e(t,s,o){function i(r,a){if(!s[r]){if(!t[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(n)return n(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var u=s[r]={exports:{}};t[r][0].call(u.exports,function(e){var s=t[r][1][e];return i(s?s:e)},u,u.exports,e,t,s,o)}return s[r].exports}for(var n="function"==typeof require&&require,r=0;r').appendTo("body"),a.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===u.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(u.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",r.attr("class"),u.microtime()-c.now)}),l.on("keydown",function(e){e&&e.ctrlKey&&r.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&r.removeClass("rl-ctrl-key-pressed")})}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/window.js"),r=e("../External/$html.js"),a=e("../External/$window.js"),l=e("../External/$doc.js"),c=e("../Common/Globals.js"),u=e("../Common/Utils.js"),d=e("../Common/LinkBuilder.js"),p=e("../Common/Events.js"),h=e("../Storages/AppSettings.js"),m=e("../Knoin/Knoin.js"),g=e("../Knoin/KnoinAbstractBoot.js");i.extend(s.prototype,g.prototype),s.prototype.remote=function(){return null},s.prototype.data=function(){return null},s.prototype.setupSettings=function(){return!0},s.prototype.download=function(e){var t=null,s=null,o=n.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(s=n.document.createElement("a"),s.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&s.dispatchEvent))?(t.initEvent("click",!0,!0),s.dispatchEvent(t),!0):(c.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},s.prototype.setTitle=function(e){e=(u.isNormal(e)&&0=5?r:20,r=320>=r?r:320,o.setInterval(function(){e.contactsSync()},6e4*r+5e3),n.delay(function(){e.contactsSync()},5e3),n.delay(function(){e.folderInformationMultiply(!0)},500),u.runHook("rl-start-user-screens"),h.pub("rl.bootstart-user-screens"),g.settingsGet("AccountSignMe")&&o.navigator.registerProtocolHandler&&n.delay(function(){try{o.navigator.registerProtocolHandler("mailto",o.location.protocol+"//"+o.location.host+o.location.pathname+"?mailto&to=%s",""+(g.settingsGet("Title")||"RainLoop"))}catch(t){}g.settingsGet("MailToEmail")&&e.mailToHelper(g.settingsGet("MailToEmail"))},500)):(m.startScreens([A]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens")),o.SimplePace&&o.SimplePace.set(100),l.bMobileDevice||n.defer(function(){d.initLayoutResizer("#rl-left","#rl-right",a.ClientSideKeyName.FolderListSize)})},this))):(t=d.pString(g.settingsGet("CustomLoginLink")),t?(m.routeOff(),m.setHash(p.root(),!0),m.routeOff(),n.defer(function(){o.location.href=t})):(m.hideLoading(),m.startScreens([A]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"),o.SimplePace&&o.SimplePace.set(100))),c&&(o["rl_"+s+"_google_service"]=function(){f.googleActions(!0),e.socialUsers()}),b&&(o["rl_"+s+"_facebook_service"]=function(){f.facebookActions(!0),e.socialUsers()}),S&&(o["rl_"+s+"_twitter_service"]=function(){f.twitterActions(!0),e.socialUsers()}),h.sub("interval.1m",function(){l.momentTrigger(!l.momentTrigger())}),u.runHook("rl-start-screens"),h.pub("rl.bootstart-end")},t.exports=new s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Screens/LoginScreen.js":42,"../Screens/MailBoxScreen.js":43,"../Screens/SettingsScreen.js":44,"../Settings/SettingsAccounts.js":45,"../Settings/SettingsChangePassword.js":46,"../Settings/SettingsContacts.js":47,"../Settings/SettingsFilters.js":48,"../Settings/SettingsFolders.js":49,"../Settings/SettingsGeneral.js":50,"../Settings/SettingsIdentities.js":51,"../Settings/SettingsIdentity.js":52,"../Settings/SettingsOpenPGP.js":53,"../Settings/SettingsSecurity.js":54,"../Settings/SettingsSocial.js":55,"../Settings/SettingsThemes.js":56,"../Storages/AppSettings.js":59,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailCacheStorage.js":64,"../Storages/WebMailDataStorage.js":65,"../ViewModels/Popups/PopupsAskViewModel.js":74,"../ViewModels/Popups/PopupsComposeViewModel.js":75,"./AbstractApp.js":2}],5:[function(e,t){!function(e){"use strict";var t={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return t.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var s,o,i,n,r,a,l,c="",u=0;for(e=t._utf8_encode(e);u>2,r=(3&s)<<4|o>>4,a=(15&o)<<2|i>>6,l=63&i,isNaN(o)?a=l=64:isNaN(i)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(r)+this._keyStr.charAt(a)+this._keyStr.charAt(l);return c},decode:function(e){var s,o,i,n,r,a,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,o=(15&r)<<4|a>>2,i=(3&a)<<6|l,c+=String.fromCharCode(s),64!==a&&(c+=String.fromCharCode(o)),64!==l&&(c+=String.fromCharCode(i));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",s=0,o=e.length,i=0;o>s;s++)i=e.charCodeAt(s),128>i?t+=String.fromCharCode(i):i>127&&2048>i?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128));return t},_utf8_decode:function(e){for(var t="",s=0,o=0,i=0,n=0;so?(t+=String.fromCharCode(o),s++):o>191&&224>o?(i=e.charCodeAt(s+1),t+=String.fromCharCode((31&o)<<6|63&i),s+=2):(i=e.charCodeAt(s+1),n=e.charCodeAt(s+2),t+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&n),s+=3);return t}};e.exports=t}(t)},{}],6:[function(e,t){!function(e){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideCookieIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(t)},{}],7:[function(e,t){!function(e){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={Prem:"PREM",TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",Filters:"FILTERS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.EmailType={Defailt:0,Facebook:1,Google:2},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,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,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t}(t)},{}],8:[function(e,t){!function(t){"use strict";function s(){this.oSubs={}}var o=e("../External/underscore.js"),i=e("./Utils.js"),n=e("./Plugins.js");s.prototype.oSubs={},s.prototype.sub=function(e,t,s){return i.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,s]),this},s.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),i.isUnd(this.oSubs[e])||o.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},t.exports=new s}(t)},{"../External/underscore.js":31,"./Plugins.js":12,"./Utils.js":14}],9:[function(e,t){!function(t){"use strict";var s={},o=e("../External/window.js"),i=e("../External/ko.js"),n=e("../External/key.js"),r=e("../External/$html.js"),a=e("../Common/Enums.js"),l=e("../Common/Events.js");s.now=(new o.Date).getTime(),s.momentTrigger=i.observable(!0),s.dropdownVisibility=i.observable(!1).extend({rateLimit:0}),s.tooltipTrigger=i.observable(!1).extend({rateLimit:0}),s.langChangeTrigger=i.observable(!0),s.useKeyboardShortcuts=i.observable(!0),s.iAjaxErrorCount=0,s.iTokenErrorCount=0,s.iMessageBodyCacheCount=0,s.bUnload=!1,s.sUserAgent=(o.navigator.userAgent||"").toLowerCase(),s.bIsiOSDevice=-11&&(o=o.replace(/[\/]+$/,""),o+="/p"+t),""!==s&&(o=o.replace(/[\/]+$/,""),o+="/"+encodeURI(s)),o},s.prototype.phpInfo=function(){return this.sServer+"Info"},s.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},s.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},s.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},s.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},s.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},s.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},s.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},s.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},s.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},t.exports=new s}(t)},{"../External/window.js":32,"../Storages/AppSettings.js":59,"./Utils.js":14}],11:[function(e,t){!function(t){"use strict";function s(e,t,s,o){var i=this;i.editor=null,i.iBlurTimer=0,i.fOnBlur=t||null,i.fOnReady=s||null,i.fOnModeChange=o||null,i.$element=$(e),i.resize=_.throttle(_.bind(i.resize,i),100),i.init()}var o=e("../External/window.js"),i=e("./Globals.js"),n=e("../Storages/AppSettings.js");s.prototype.blurTrigger=function(){if(this.fOnBlur){var e=this;o.clearTimeout(e.iBlurTimer),e.iBlurTimer=o.setTimeout(function(){e.fOnBlur()},200)}},s.prototype.focusTrigger=function(){this.fOnBlur&&o.clearTimeout(this.iBlurTimer)},s.prototype.isHtml=function(){return this.editor?"wysiwyg"===this.editor.mode:!1},s.prototype.checkDirty=function(){return this.editor?this.editor.checkDirty():!1},s.prototype.resetDirty=function(){this.editor&&this.editor.resetDirty()},s.prototype.getData=function(e){return this.editor?"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain?this.editor.__plain.getRawData():e?''+this.editor.getData()+"
":this.editor.getData():""},s.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},s.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},s.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},s.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=i.oHtmlEditorDefaultConfig,s=n.settingsGet("Language"),r=!!n.settingsGet("AllowHtmlEditorSourceButton");r&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=o.CKEDITOR.ENTER_BR,t.shiftEnterMode=o.CKEDITOR.ENTER_BR,t.language=i.oHtmlEditorLangsMap[s]||"en",o.CKEDITOR.env&&(o.CKEDITOR.env.isCompatible=!0),e.editor=o.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(o.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};o.CKEDITOR?t():o.__initEditor=t}},s.prototype.focus=function(){this.editor&&this.editor.focus()},s.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},s.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},s.prototype.clear=function(e){this.setHtml("",e)},t.exports=s}(t)},{"../External/window.js":32,"../Storages/AppSettings.js":59,"./Globals.js":9}],12:[function(e,t){!function(t){"use strict";var s={__boot:null,__remote:null,__data:null},o=e("../External/underscore.js"),i=e("./Utils.js");s.oViewModelsHooks={},s.oSimpleHooks={},s.regViewModelHook=function(e,t){t&&(t.__hookName=e)},s.addHook=function(e,t){i.isFunc(t)&&(i.isArray(s.oSimpleHooks[e])||(s.oSimpleHooks[e]=[]),s.oSimpleHooks[e].push(t))},s.runHook=function(e,t){i.isArray(s.oSimpleHooks[e])&&(t=t||[],o.each(s.oSimpleHooks[e],function(e){e.apply(null,t)}))},s.mainSettingsGet=function(e){return s.__boot?s.__boot.settingsGet(e):null},s.remoteRequest=function(e,t,o,i,n,r){s.__remote&&s.__remote.defaultRequest(e,t,o,i,n,r)},s.settingsGet=function(e,t){var o=s.mainSettingsGet("Plugins");return o=o&&i.isUnd(o[e])?null:o[e],o?i.isUnd(o[t])?null:o[t]:null},t.exports=s}(t)},{"../External/underscore.js":31,"./Utils.js":14}],13:[function(e,t){!function(t){"use strict";function s(e,t,s,o,r,a){this.list=e,this.listChecked=n.computed(function(){return i.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=n.computed(function(){return 00&&-10)return i.newSelectPosition(s,r.shift),!1}})}},s.prototype.autoSelect=function(e){this.bAutoSelect=!!e},s.prototype.getItemUid=function(e){var t="",s=this.oCallbacks.onItemGetUid||null;return s&&e&&(t=s(e)),t.toString()},s.prototype.newSelectPosition=function(e,t,s){var o=0,n=10,r=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(a.EventKeyCode.Down===e||a.EventKeyCode.Up===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)i.each(u,function(t){if(!l)switch(e){case a.EventKeyCode.Up:p===t?l=!0:c=t;break;case a.EventKeyCode.Down:case a.EventKeyCode.Insert:r?(c=t,l=!0):p===t&&(r=!0)}});else if(a.EventKeyCode.Home===e||a.EventKeyCode.End===e)a.EventKeyCode.Home===e?c=u[0]:a.EventKeyCode.End===e&&(c=u[u.length-1]);else if(a.EventKeyCode.PageDown===e){for(;d>o;o++)if(p===u[o]){o+=n,o=o>d-1?d-1:o,c=u[o];break}}else if(a.EventKeyCode.PageUp===e)for(o=d;o>=0;o--)if(p===u[o]){o-=n,o=0>o?0:o,c=u[o];break}}else a.EventKeyCode.Down===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e||a.EventKeyCode.Home===e||a.EventKeyCode.PageUp===e?c=u[0]:(a.EventKeyCode.Up===e||a.EventKeyCode.End===e||a.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(a.EventKeyCode.Up===e||a.EventKeyCode.Down===e)&&p.checked(!p.checked()):(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!s||this.isListChecked()||a.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||a.EventKeyCode.Up!==e&&a.EventKeyCode.Down!==e?(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},s.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=o(this.sItemFocusedSelector,this.oContentScrollable),s=t.position(),i=this.oContentVisible.height(),n=t.outerHeight();return s&&(s.top<0||s.top+n>i)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-i+n+e),!0):!1},s.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},s.prototype.eventClickFunction=function(e,t){var s=this.getItemUid(e),o=0,i=0,n=null,r="",a=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==s&&""!==this.sLastUid&&s!==this.sLastUid)for(c=this.list(),u=e.checked(),o=0,i=c.length;i>o;o++)n=c[o],r=this.getItemUid(n),a=!1,(r===this.sLastUid||r===s)&&(a=!0),a&&(l=!l),(l||a)&&n.checked(u);this.sLastUid=""===s?"":s},s.prototype.actionClick=function(e,t){if(e){var s=!0,o=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(s=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(s=!1,""===this.sLastUid&&(this.sLastUid=o),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),s&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},s.prototype.on=function(e,t){this.oCallbacks[e]=t},t.exports=s}(t)},{"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"./Enums.js":7,"./Utils.js":14}],14:[function(e,t){!function(t){"use strict";var s={},o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/window.js"),a=e("../External/$window.js"),l=e("../External/$html.js"),c=e("../External/$doc.js"),u=e("../External/NotificationClass.js"),d=e("../Storages/LocalStorage.js"),p=e("../Knoin/Knoin.js"),h=e("./Enums.js"),m=e("./Consts.js"),g=e("./Globals.js"),f=e("./Events.js");s.trim=o.trim,s.inArray=o.inArray,s.isArray=i.isArray,s.isFunc=i.isFunction,s.isUnd=i.isUndefined,s.isNull=i.isNull,s.emptyFunction=function(){},s.isNormal=function(e){return!s.isUnd(e)&&!s.isNull(e)},s.windowResize=i.debounce(function(e){s.isUnd(e)?a.resize():r.setTimeout(function(){a.resize()},e)},50),s.isPosNumeric=function(e,t){return s.isNormal(e)?(s.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},s.pInt=function(e,t){var o=s.isNormal(e)&&""!==e?r.parseInt(e,10):t||0;return r.isNaN(o)?t||0:o},s.pString=function(e){return s.isNormal(e)?""+e:""},s.isNonEmptyArray=function(e){return s.isArray(e)&&0i;i++)o=s[i].split("="),t[r.decodeURIComponent(o[0])]=r.decodeURIComponent(o[1]);return t},s.rsaEncode=function(e,t,o,i){if(r.crypto&&r.crypto.getRandomValues&&r.RSAKey&&t&&o&&i){var n=new r.RSAKey;if(n.setPublic(i,o),e=n.encrypt(s.fakeMd5()+":"+e+":"+s.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},s.rsaEncode.supported=!!(r.crypto&&r.crypto.getRandomValues&&r.RSAKey),s.exportPath=function(e,t,o){for(var i=null,n=e.split("."),a=o||r;n.length&&(i=n.shift());)n.length||s.isUnd(t)?a=a[i]?a[i]:a[i]={}:a[i]=t},s.pImport=function(e,t,s){e[t]=s},s.pExport=function(e,t,o){return s.isUnd(e[t])?o:e[t]},s.encodeHtml=function(e){return s.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},s.splitPlainText=function(e,t){var o="",i="",n=e,r=0,a=0;for(t=s.isUnd(t)?100:t;n.length>t;)i=n.substring(0,t),r=i.lastIndexOf(" "),a=i.lastIndexOf("\n"),-1!==a&&(r=a),-1===r&&(r=t),o+=i.substring(0,r)+"\n",n=n.substring(r+1);return o+n},s.timeOutAction=function(){var e={};return function(t,o,i){s.isUnd(e[t])&&(e[t]=0),r.clearTimeout(e[t]),e[t]=r.setTimeout(o,i)}}(),s.timeOutActionSecond=function(){var e={};return function(t,s,o){e[t]||(e[t]=r.setTimeout(function(){s(),e[t]=0},o))}}(),s.audio=function(){var e=!1;return function(t,s){if(!1===e)if(g.bIsiOSDevice)e=null;else{var o=!1,i=!1,n=r.Audio?new r.Audio:null;n&&n.canPlayType&&n.play?(o=""!==n.canPlayType('audio/mpeg; codecs="mp3"'),o||(i=""!==n.canPlayType('audio/ogg; codecs="vorbis"')),o||i?(e=n,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:s):e=null):e=null}return e}}(),s.hos=function(e,t){return e&&r.Object&&r.Object.hasOwnProperty?r.Object.hasOwnProperty.call(e,t):!1},s.i18n=function(e,t,o){var i="",n=s.isUnd(g.oI18N[e])?s.isUnd(o)?e:o:g.oI18N[e];if(!s.isUnd(t)&&!s.isNull(t))for(i in t)s.hos(t,i)&&(n=n.replace("%"+i+"%",t[i]));return n},s.i18nToNode=function(e){i.defer(function(){o(".i18n",e).each(function(){var e=o(this),t="";t=e.data("i18n-text"),t?e.text(s.i18n(t)):(t=e.data("i18n-html"),t&&e.html(s.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",s.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",s.i18n(t)))})})},s.i18nReload=function(){r.rainloopI18N&&(g.oI18N=r.rainloopI18N||{},s.i18nToNode(c),g.langChangeTrigger(!g.langChangeTrigger())),r.rainloopI18N=null},s.initOnStartOrLangChange=function(e,t,s){e&&e.call(t),s?g.langChangeTrigger.subscribe(function(){e&&e.call(t),s.call(t)}):e&&g.langChangeTrigger.subscribe(e,t)},s.inFocus=function(){return document.activeElement?(s.isUnd(document.activeElement.__inFocusCache)&&(document.activeElement.__inFocusCache=o(document.activeElement).is("input,textarea,iframe,.cke_editable")),!!document.activeElement.__inFocusCache):!1},s.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var e=o(document.activeElement);e.is("input,textarea")&&document.activeElement.blur()}},s.removeSelection=function(){if(r&&r.getSelection){var e=r.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else document&&document.selection&&document.selection.empty&&document.selection.empty()},s.replySubjectAdd=function(e,t){e=s.trim(e.toUpperCase()),t=s.trim(t.replace(/[\s]+/," "));var o=0,i="",n=!1,r="",a=[],l=[],c="RE"===e,u="FWD"===e,d=!u;if(""!==t){for(n=!1,l=t.split(":"),o=0;o0);return e.replace(/[\s]+/," ")},s._replySubjectAdd_=function(e,t,o){var i=null,n=s.trim(t);return n=null===(i=new r.RegExp("^"+e+"[\\s]?\\:(.*)$","gi").exec(t))||s.isUnd(i[1])?null===(i=new r.RegExp("^("+e+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(t))||s.isUnd(i[1])||s.isUnd(i[2])||s.isUnd(i[3])?e+": "+t:i[1]+(s.pInt(i[2])+1)+i[3]:e+"[2]: "+i[1],n=n.replace(/[\s]+/g," "),n=(s.isUnd(o)?!0:o)?s.fixLongSubject(n):n},s._fixLongSubject_=function(e){var t=0,o=null;e=s.trim(e.replace(/[\s]+/," "));do o=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!o||s.isUnd(o[0]))&&(o=null),o&&(t=0,t+=s.isUnd(o[2])?1:0+s.pInt(o[2]),t+=s.isUnd(o[4])?1:0+s.pInt(o[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(o);return e=e.replace(/[\s]+/," ")},s.roundNumber=function(e,t){return r.Math.round(e*r.Math.pow(10,t))/r.Math.pow(10,t)},s.friendlySize=function(e){return e=s.pInt(e),e>=1073741824?s.roundNumber(e/1073741824,1)+"GB":e>=1048576?s.roundNumber(e/1048576,1)+"MB":e>=1024?s.roundNumber(e/1024,0)+"KB":e+"B"},s.log=function(e){r.console&&r.console.log&&r.console.log(e)},s.getNotification=function(e,t){return e=s.pInt(e),h.Notification.ClientViewError===e&&t?t:s.isUnd(g.oNotificationI18N[e])?"":g.oNotificationI18N[e]},s.initNotificationLanguage=function(){var e=g.oNotificationI18N||{};e[h.Notification.InvalidToken]=s.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[h.Notification.AuthError]=s.i18n("NOTIFICATIONS/AUTH_ERROR"),e[h.Notification.AccessError]=s.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[h.Notification.ConnectionError]=s.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[h.Notification.CaptchaError]=s.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[h.Notification.SocialFacebookLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[h.Notification.SocialTwitterLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[h.Notification.SocialGoogleLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[h.Notification.DomainNotAllowed]=s.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[h.Notification.AccountNotAllowed]=s.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[h.Notification.AccountTwoFactorAuthRequired]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[h.Notification.AccountTwoFactorAuthError]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[h.Notification.CouldNotSaveNewPassword]=s.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[h.Notification.CurrentPasswordIncorrect]=s.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[h.Notification.NewPasswordShort]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[h.Notification.NewPasswordWeak]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[h.Notification.NewPasswordForbidden]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[h.Notification.ContactsSyncError]=s.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[h.Notification.CantGetMessageList]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[h.Notification.CantGetMessage]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[h.Notification.CantDeleteMessage]=s.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[h.Notification.CantMoveMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[h.Notification.CantCopyMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[h.Notification.CantSaveMessage]=s.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[h.Notification.CantSendMessage]=s.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[h.Notification.InvalidRecipients]=s.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[h.Notification.CantCreateFolder]=s.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[h.Notification.CantRenameFolder]=s.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[h.Notification.CantDeleteFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[h.Notification.CantDeleteNonEmptyFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[h.Notification.CantSubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[h.Notification.CantUnsubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[h.Notification.CantSaveSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[h.Notification.CantSavePluginSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[h.Notification.DomainAlreadyExists]=s.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[h.Notification.CantInstallPackage]=s.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[h.Notification.CantDeletePackage]=s.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[h.Notification.InvalidPluginPackage]=s.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[h.Notification.UnsupportedPluginPackage]=s.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[h.Notification.LicensingServerIsUnavailable]=s.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[h.Notification.LicensingExpired]=s.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[h.Notification.LicensingBanned]=s.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[h.Notification.DemoSendMessageError]=s.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[h.Notification.AccountAlreadyExists]=s.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[h.Notification.MailServerError]=s.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[h.Notification.InvalidInputArgument]=s.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[h.Notification.UnknownNotification]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[h.Notification.UnknownError]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},s.getUploadErrorDescByCode=function(e){var t="";switch(s.pInt(e)){case h.UploadErrorCode.FileIsTooBig:t=s.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case h.UploadErrorCode.FilePartiallyUploaded:t=s.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case h.UploadErrorCode.FileNoUploaded:t=s.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case h.UploadErrorCode.MissingTempFolder:t=s.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case h.UploadErrorCode.FileOnSaveingError:t=s.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case h.UploadErrorCode.FileType:t=s.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=s.i18n("UPLOAD/ERROR_UNKNOWN")}return t},s.delegateRun=function(e,t,o,n){e&&e[t]&&(n=s.pInt(n),0>=n?e[t].apply(e,s.isArray(o)?o:[]):i.delay(function(){e[t].apply(e,s.isArray(o)?o:[])},n))},s.killCtrlAandS=function(e){if(e=e||r.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,s=e.keyCode||e.which;if(s===h.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;s===h.EventKeyCode.A&&(r.getSelection?r.getSelection().removeAllRanges():r.document.selection&&r.document.selection.clear&&r.document.selection.clear(),e.preventDefault())}},s.createCommand=function(e,t,o){var i=t?function(){return i.canExecute&&i.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return i.enabled=n.observable(!0),o=s.isUnd(o)?!0:o,i.canExecute=n.computed(s.isFunc(o)?function(){return i.enabled()&&o.call(e)}:function(){return i.enabled()&&!!o}),i},s.initDataConstructorBySettings=function(e){e.editorDefaultType=n.observable(h.EditorDefaultType.Html),e.showImages=n.observable(!1),e.interfaceAnimation=n.observable(h.InterfaceAnimation.Full),e.contactsAutosave=n.observable(!1),g.sAnimationType=h.InterfaceAnimation.Full,e.capaThemes=n.observable(!1),e.allowLanguagesOnSettings=n.observable(!0),e.allowLanguagesOnLogin=n.observable(!0),e.useLocalProxyForExternalImages=n.observable(!1),e.desktopNotifications=n.observable(!1),e.useThreads=n.observable(!0),e.replySameFolder=n.observable(!0),e.useCheckboxesInList=n.observable(!0),e.layout=n.observable(h.Layout.SidePreview),e.usePreviewPane=n.computed(function(){return h.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(g.bMobileDevice||e===h.InterfaceAnimation.None)l.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),g.sAnimationType=h.InterfaceAnimation.None;else switch(e){case h.InterfaceAnimation.Full:l.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),g.sAnimationType=e;break;case h.InterfaceAnimation.Normal:l.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),g.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=n.computed(function(){e.desktopNotifications();var t=h.DesktopNotifications.NotSupported;if(u&&u.permission)switch(u.permission.toLowerCase()){case"granted":t=h.DesktopNotifications.Allowed;break;case"denied":t=h.DesktopNotifications.Denied;break;case"default":t=h.DesktopNotifications.NotAllowed}else r.webkitNotifications&&r.webkitNotifications.checkPermission&&(t=r.webkitNotifications.checkPermission());return t}),e.useDesktopNotifications=n.computed({read:function(){return e.desktopNotifications()&&h.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var s=e.desktopNotificationsPermisions();h.DesktopNotifications.Allowed===s?e.desktopNotifications(!0):h.DesktopNotifications.NotAllowed===s?u.requestPermission(function(){e.desktopNotifications.valueHasMutated(),h.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated()}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=n.observable(""),e.languages=n.observableArray([]),e.mainLanguage=n.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(o,"hours")?i:t.format("L")===o.format("L")?s.i18n("MESSAGE_LIST/TODAY_AT",{TIME:o.format("LT")}):t.clone().subtract("days",1).format("L")===o.format("L")?s.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:o.format("LT")}):o.format(t.year()===o.year()?"D MMM.":"LL")},e)},s.isFolderExpanded=function(e){var t=d.get(h.ClientSideKeyName.ExpandedFolders);return i.isArray(t)&&-1!==i.indexOf(t,e)},s.setExpandedFolder=function(e,t){var s=d.get(h.ClientSideKeyName.ExpandedFolders);i.isArray(s)||(s=[]),t?(s.push(e),s=i.uniq(s)):s=i.without(s,e),d.set(h.ClientSideKeyName.ExpandedFolders,s)},s.initLayoutResizer=function(e,t,i){var n=60,r=155,a=o(e),l=o(t),c=d.get(i)||null,u=function(e){e&&(a.css({width:""+e+"px"}),l.css({left:""+e+"px"}))},p=function(e){if(e)a.resizable("disable"),u(n);else{a.resizable("enable");var t=s.pInt(d.get(i))||r;u(t>r?t:r)}},h=function(e,t){t&&t.size&&t.size.width&&(d.set(i,t.size.width),l.css({left:""+t.size.width+"px"}))};null!==c&&u(c>r?c:r),a.resizable({helper:"ui-resizable-helper",minWidth:r,maxWidth:350,handles:"e",stop:h}),f.sub("left-panel.off",function(){p(!0)}),f.sub("left-panel.on",function(){p(!1)})},s.initBlockquoteSwitcher=function(e){if(e){var t=o("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===o(this).parent().closest("blockquote",e).length});t&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),o('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),s.windowResize()}).after("
").before("
"))})}},s.removeBlockquoteSwitcher=function(e){e&&(o(e).find("blockquote.rl-bq-switcher").each(function(){o(this).removeClass("rl-bq-switcher hidden-bq")}),o(e).find(".rlBlockquoteSwitcher").each(function(){o(this).remove()}))},s.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},s.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=s.trim(e.substring(0,e.length-7))),s.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},s.quoteName=function(e){return e.replace(/["]/g,'\\"')},s.microtime=function(){return(new Date).getTime()},s.convertLangName=function(e,t){return s.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},s.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=s.isUnd(e)?32:s.pInt(e);t.length>>32-t}function s(e,t){var s,o,i,n,r;return i=2147483648&e,n=2147483648&t,s=1073741824&e,o=1073741824&t,r=(1073741823&e)+(1073741823&t),s&o?2147483648^r^i^n:s|o?1073741824&r?3221225472^r^i^n:1073741824^r^i^n:r^i^n}function o(e,t,s){return e&t|~e&s}function i(e,t,s){return e&s|t&~s}function n(e,t,s){return e^t^s}function r(e,t,s){return t^(e|~s)}function a(e,i,n,r,a,l,c){return e=s(e,s(s(o(i,n,r),a),c)),s(t(e,l),i)}function l(e,o,n,r,a,l,c){return e=s(e,s(s(i(o,n,r),a),c)),s(t(e,l),o)}function c(e,o,i,r,a,l,c){return e=s(e,s(s(n(o,i,r),a),c)),s(t(e,l),o)}function u(e,o,i,n,a,l,c){return e=s(e,s(s(r(o,i,n),a),c)),s(t(e,l),o)}function d(e){for(var t,s=e.length,o=s+8,i=(o-o%64)/64,n=16*(i+1),r=Array(n-1),a=0,l=0;s>l;)t=(l-l%4)/4,a=l%4*8,r[t]=r[t]|e.charCodeAt(l)<>>29,r}function p(e){var t,s,o="",i="";for(s=0;3>=s;s++)t=e>>>8*s&255,i="0"+t.toString(16),o+=i.substr(i.length-2,2);return o}function h(e){e=e.replace(/rn/g,"n");for(var t="",s=0;so?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128))}return t}var m,g,f,b,S,y,C,v,w,E=Array(),A=7,F=12,T=17,j=22,M=5,R=9,N=14,L=20,I=4,P=11,x=16,k=23,D=6,U=10,O=15,_=21;for(e=h(e),E=d(e),y=1732584193,C=4023233417,v=2562383102,w=271733878,m=0;m/g,">").replace(/")},s.draggeblePlace=function(){return o('
').appendTo("#rl-hidden")},s.defautOptionsAfterRender=function(e,t){t&&!s.isUnd(t.disabled)&&e&&o(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},s.windowPopupKnockout=function(e,t,i,n){var a=null,l=r.open(""),c="__OpenerApplyBindingsUid"+s.fakeMd5()+"__",u=o("#"+t);r[c]=function(){if(l&&l.document.body&&u&&u[0]){var t=o(l.document.body);o("#rl-content",t).html(u.html()),o("html",l.document).addClass("external "+o("html").attr("class")),s.i18nToNode(t),p.applyExternal(e,o("#rl-content",t)[0]),r[c]=null,n(l)}},l.document.open(),l.document.write(''+s.encodeHtml(i)+''),l.document.close(),a=l.document.createElement("script"),a.type="text/javascript",a.innerHTML="if(window&&window.opener&&window.opener['"+c+"']){window.opener['"+c+"']();window.opener['"+c+"']=null}",l.document.getElementsByTagName("head")[0].appendChild(a)},s.settingsSaveHelperFunction=function(e,t,o,n){return o=o||null,n=s.isUnd(n)?1e3:s.pInt(n),function(s,r,a,l,c){t.call(o,r&&r.Result?h.SaveSettingsStep.TrueResult:h.SaveSettingsStep.FalseResult),e&&e.call(o,s,r,a,l,c),i.delay(function(){t.call(o,h.SaveSettingsStep.Idle)},n)}},s.settingsSaveHelperSimpleFunction=function(e,t){return s.settingsSaveHelperFunction(null,e,t,1e3)},s.$div=o(""),s.htmlToPlain=function(e){var t=0,i=0,n=0,r=0,a=0,l="",c=function(e){for(var t=100,s="",o="",i=e,n=0,r=0;i.length>t;)o=i.substring(0,t),n=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(n=r),-1===n&&(n=t),s+=o.substring(0,n)+"\n",i=i.substring(n+1);return s+i},u=function(e){return e=c(o.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+o.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},h=function(){return arguments&&1/g,">"):""},m=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/
]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/
]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/
]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,m).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),l=s.$div.html(l).text(),l=l.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=l.indexOf("__bq__start__",t),i>-1);)n=l.indexOf("__bq__start__",i+5),r=l.indexOf("__bq__end__",i+5),(-1===n||n>r)&&r>i?(l=l.substring(0,i)+u(l.substring(i+13,r))+l.substring(r+11),t=0):t=n>-1&&r>n?n-1:0;return l=l.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var o=!1,i=!0,n=!0,r=[],a="",l=0,c=e.split("\n");do{for(i=!1,r=[],l=0;l"===a.substr(0,1),n&&!o?(i=!0,o=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&o?(o=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(n&&o?a.substr(1):a);o&&(o=!1,r.push("~~~/blockquote~~~")),c=r}while(i);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"
").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t?s.linkify(e):e},r.rainloop_Utils_htmlToPlain=s.htmlToPlain,r.rainloop_Utils_plainToHtml=s.plainToHtml,s.linkify=function(e){return o.fn&&o.fn.linkify&&(e=s.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},s.resizeAndCrop=function(e,t,s){var o=new r.Image;o.onload=function(){var e=[0,0],o=document.createElement("canvas"),i=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],i.fillStyle="#fff",i.fillRect(0,0,t,t),i.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),s(o.toDataURL("image/jpeg"))},o.src=e},s.folderListOptionsBuilder=function(e,t,o,i,n,a,l,c,u,d){var p=null,m=!1,g=0,f=0,b="Â Â Â ",S=[];for(u=s.isNormal(u)?u:0
g;g++)S.push({id:i[g][0],name:i[g][1],system:!1,seporator:!1,disabled:!1});for(m=!0,g=0,f=e.length;f>g;g++)p=e[g],(l?l.call(null,p):!0)&&(m&&0g;g++)p=t[g],(p.subScribed()||!p.existen)&&(l?l.call(null,p):!0)&&(h.FolderType.User===p.type()||!u||01||c>0&&l>c){for(l>c?(u(c),o=c,i=c):((3>=l||l>=c-2)&&(n+=2),u(l),o=l,i=l);n>0;)if(o-=1,i+=1,o>0&&(u(o,!1),n--),c>=i)u(i,!0),n--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(r.Math.round((o-1)/2),!1,"..."),c-2===i?u(c-1,!0):c-2>i&&u(r.Math.round((c+i)/2),!0,"..."),o>1&&u(1,!1),c>i&&u(c,!0)}return a}},s.selectElement=function(e){if(r.getSelection){var t=r.getSelection();t.removeAllRanges();var s=r.document.createRange();s.selectNodeContents(e),t.addRange(s)}else if(r.document.selection){var o=r.document.body.createTextRange();o.moveToElementText(e),o.select()}},s.detectDropdownVisibility=i.debounce(function(){g.dropdownVisibility(!!i.find(g.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){o(".checkAutocomplete").trigger("change")};e?i.delay(t,100):t()},t.exports=s}(t)},{"../External/$doc.js":16,"../External/$html.js":17,"../External/$window.js":18,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Storages/LocalStorage.js":60,"./Consts.js":6,"./Enums.js":7,"./Events.js":8,"./Globals.js":9}],15:[function(e,t){"use strict";t.exports=e("./jquery.js")("")},{"./jquery.js":26}],16:[function(e,t){"use strict";t.exports=e("./jquery.js")(window.document)},{"./jquery.js":26}],17:[function(e,t){"use strict";t.exports=e("./jquery.js")("html")},{"./jquery.js":26}],18:[function(e,t){"use strict";t.exports=e("./jquery.js")(window)},{"./jquery.js":26}],19:[function(e,t){"use strict";t.exports=e("./window.js").rainloopAppData||{}},{"./window.js":32}],20:[function(e,t){"use strict";t.exports=JSON},{}],21:[function(e,t){"use strict";t.exports=Jua},{}],22:[function(e,t){"use strict";var s=e("./window.js");t.exports=s.Notification&&s.Notification.requestPermission?s.Notification:null},{"./window.js":32}],23:[function(e,t){"use strict";t.exports=crossroads},{}],24:[function(e,t){"use strict";t.exports=hasher},{}],25:[function(e,t){"use strict";t.exports=ifvisible},{}],26:[function(e,t){"use strict";t.exports=$},{}],27:[function(e,t){"use strict";t.exports=key},{}],28:[function(e,t){!function(t){"use strict";var s=e("./window.js"),o=e("./underscore.js"),i=e("./jquery.js"),n=e("./$window.js"),r=e("./$doc.js");ko.bindingHandlers.tooltip={init:function(t,s){var o=e("../Common/Globals.js"),n=e("../Common/Utils.js");if(!o.bMobileDevice){var r=i(t),a=r.data("tooltip-class")||"",l=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:l,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":''+n.i18n(ko.utils.unwrapObservable(s()))+""}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},ko.bindingHandlers.tooltip2={init:function(t,s){var o=i(t),n=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top",a=e("../Common/Globals.js");o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||a.dropdownVisibility()?"":''+s()()+""}}).click(function(){o.tooltip("hide")}),a.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},ko.bindingHandlers.tooltip3={init:function(t){var s=i(t),o=e("../Common/Globals.js");s.tooltip({container:"body",trigger:"hover manual",title:function(){return s.data("tooltip3-data")||""}}),r.click(function(){s.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){s.tooltip("hide")})},update:function(e,t){var s=ko.utils.unwrapObservable(t());""===s?i(e).data("tooltip3-data","").tooltip("hide"):i(e).data("tooltip3-data",s).tooltip("show")}},ko.bindingHandlers.registrateBootstrapDropdown={init:function(t){var s=e("../Common/Globals.js");s.aBootstrapDropdowns.push(i(t))}},ko.bindingHandlers.openDropdownTrigger={update:function(t,s){if(ko.utils.unwrapObservable(s())){var o=i(t),n=e("../Common/Utils.js");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),n.detectDropdownVisibility()),s()(!1)}}},ko.bindingHandlers.dropdownCloser={init:function(e){i(e).closest(".dropdown").on("click",".e-item",function(){i(e).dropdown("toggle")})}},ko.bindingHandlers.popover={init:function(e,t){i(e).popover(ko.utils.unwrapObservable(t()))}},ko.bindingHandlers.csstext={init:function(t,s){var o=e("../Common/Utils.js");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=ko.utils.unwrapObservable(s()):i(t).text(ko.utils.unwrapObservable(s()))},update:function(t,s){var o=e("../Common/Utils.js");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=ko.utils.unwrapObservable(s()):i(t).text(ko.utils.unwrapObservable(s()))}},ko.bindingHandlers.resizecrop={init:function(e){i(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),i(e).resizecrop({width:"100",height:"100"})}},ko.bindingHandlers.onEnter={init:function(e,t,o,n){i(e).on("keypress",function(o){o&&13===s.parseInt(o.keyCode,10)&&(i(e).trigger("change"),t().call(n))})}},ko.bindingHandlers.onEsc={init:function(e,t,o,n){i(e).on("keypress",function(o){o&&27===s.parseInt(o.keyCode,10)&&(i(e).trigger("change"),t().call(n))})}},ko.bindingHandlers.clickOnTrue={update:function(e,t){ko.utils.unwrapObservable(t())&&i(e).click()}},ko.bindingHandlers.modal={init:function(t,s){var o=e("../Common/Globals.js"),n=e("../Common/Utils.js");i(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:ko.utils.unwrapObservable(s())}).on("shown",function(){n.windowResize()}).find(".close").click(function(){s()(!1)})},update:function(e,t){i(e).modal(ko.utils.unwrapObservable(t())?"show":"hide")}},ko.bindingHandlers.i18nInit={init:function(t){var s=e("../Common/Utils.js");s.i18nToNode(t)}},ko.bindingHandlers.i18nUpdate={update:function(t,s){var o=e("../Common/Utils.js");ko.utils.unwrapObservable(s()),o.i18nToNode(t)}},ko.bindingHandlers.link={update:function(e,t){i(e).attr("href",ko.utils.unwrapObservable(t()))}},ko.bindingHandlers.title={update:function(e,t){i(e).attr("title",ko.utils.unwrapObservable(t()))}},ko.bindingHandlers.textF={init:function(e,t){i(e).text(ko.utils.unwrapObservable(t()))}},ko.bindingHandlers.initDom={init:function(e,t){t()(e)}},ko.bindingHandlers.initResizeTrigger={init:function(e,t){var s=ko.utils.unwrapObservable(t());i(e).css({height:s[1],"min-height":s[1]})},update:function(t,s){var o=e("../Common/Utils.js"),r=ko.utils.unwrapObservable(s()),a=o.pInt(r[1]),l=0,c=i(t).offset().top;c>0&&(c+=o.pInt(r[2]),l=n.height()-c,l>a&&(a=l),i(t).css({height:a,"min-height":a}))}},ko.bindingHandlers.appendDom={update:function(e,t){i(e).hide().empty().append(ko.utils.unwrapObservable(t())).show()}},ko.bindingHandlers.draggable={init:function(t,o,n){var r=e("../Common/Globals.js"),a=e("../Common/Utils.js");if(!r.bMobileDevice){var l=100,c=3,u=n(),d=u&&u.droppableSelector?u.droppableSelector:"",p={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};d&&(p.drag=function(e){i(d).each(function(){var t=null,o=null,n=i(this),r=n.offset(),u=r.top+n.height();s.clearInterval(n.data("timerScroll")),n.data("timerScroll",!1),e.pageX>=r.left&&e.pageX<=r.left+n.width()&&(e.pageY>=u-l&&e.pageY<=u&&(t=function(){n.scrollTop(n.scrollTop()+c),a.windowResize()},n.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+l&&(o=function(){n.scrollTop(n.scrollTop()-c),a.windowResize()},n.data("timerScroll",s.setInterval(o,10)),o()))})},p.stop=function(){i(d).each(function(){s.clearInterval(i(this).data("timerScroll")),i(this).data("timerScroll",!1)})}),p.helper=function(e){return o()(e&&e.target?ko.dataFor(e.target):null)},i(t).draggable(p).on("mousedown",function(){a.removeInFocus()})}}},ko.bindingHandlers.droppable={init:function(t,s,o){var n=e("../Common/Globals.js");if(!n.bMobileDevice){var r=s(),a=o(),l=a&&a.droppableOver?a.droppableOver:null,c=a&&a.droppableOut?a.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};r&&(u.drop=function(e,t){r(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),i(t).droppable(u))}}},ko.bindingHandlers.nano={init:function(t){var s=e("../Common/Globals.js");s.bDisableNanoScroll||i(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},ko.bindingHandlers.saveTrigger={init:function(e){var t=i(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append(' ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var s=ko.utils.unwrapObservable(t()),o=i(e);if("custom"===o.data("save-trigger-type"))switch(s.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},ko.bindingHandlers.emailsTags={init:function(t,s){var n=e("../Common/Utils.js"),r=i(t),a=s(),l=function(e){a&&a.focusTrigger&&a.focusTrigger(e)};r.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:l,inputDelimiters:[",",";"],autoCompleteSource:function(e,t){RL.getAutocomplete(e.term,function(e){t(o.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return o.map(e,function(e){var t=n.trim(e),s=null;return""!==t?(s=new EmailModel,s.mailsoParse(t),s.clearDuplicateName(),[s.toLine(!1),s]):[t,null]})},change:o.bind(function(e){r.data("EmailsTagsValue",e.target.value),a(e.target.value)},this)})},update:function(e,t,s){var o=i(e),n=s(),r=n.emailsTagsFilter||null,a=ko.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==a&&(o.val(a),o.data("EmailsTagsValue",a),o.inputosaurus("refresh")),r&&ko.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},ko.bindingHandlers.contactTags={init:function(t,s){var n=e("../Common/Utils.js"),r=i(t),a=s(),l=function(e){a&&a.focusTrigger&&a.focusTrigger(e)};r.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:l,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:function(e,t){RL.getContactTagsAutocomplete(e.term,function(e){t(o.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return o.map(e,function(e){var t=n.trim(e),s=null;return""!==t?(s=new ContactTagModel,s.name(t),[s.toLine(!1),s]):[t,null]})},change:o.bind(function(e){r.data("ContactTagsValue",e.target.value),a(e.target.value)},this)})},update:function(e,t,s){var o=i(e),n=s(),r=n.contactTagsFilter||null,a=ko.utils.unwrapObservable(t());o.data("ContactTagsValue")!==a&&(o.val(a),o.data("ContactTagsValue",a),o.inputosaurus("refresh")),r&&ko.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},ko.bindingHandlers.command={init:function(e,t,s,o){var n=i(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");n.addClass("command"),ko.bindingHandlers[n.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var s=!0,o=i(e),n=t();s=n.enabled(),o.toggleClass("command-not-enabled",!s),s&&(s=n.canExecute(),o.toggleClass("command-can-not-be-execute",!s)),o.toggleClass("command-disabled disable disabled",!s).toggleClass("no-disabled",!!s),(o.is("input")||o.is("button"))&&o.prop("disabled",!s)}},ko.extenders.trimmer=function(t){var s=e("../Common/Utils.js"),o=ko.computed({read:t,write:function(e){t(s.trim(e.toString()))},owner:this});return o(t()),o},ko.extenders.posInterer=function(t,s){var o=e("../Common/Utils.js"),i=ko.computed({read:t,write:function(e){var i=o.pInt(e.toString(),s);0>=i&&(i=s),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return i(t()),i},ko.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},ko.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},ko.extenders.falseTimeout=function(t,o){var i=e("../Common/Utils.js");return t.iTimeout=0,t.subscribe(function(e){e&&(s.clearTimeout(t.iTimeout),t.iTimeout=s.setTimeout(function(){t(!1),t.iTimeout=0},i.pInt(o)))}),t},ko.observable.fn.validateNone=function(){return this.hasError=ko.observable(!1),this},ko.observable.fn.validateEmail=function(){var t=e("../Common/Utils.js");return this.hasError=ko.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},ko.observable.fn.validateSimpleEmail=function(){var t=e("../Common/Utils.js");return this.hasError=ko.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},ko.observable.fn.validateFunc=function(t){var s=e("../Common/Utils.js");return this.hasFuncError=ko.observable(!1),s.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=ko}(t)},{"../Common/Globals.js":9,"../Common/Utils.js":14,"./$doc.js":16,"./$window.js":18,"./jquery.js":26,"./underscore.js":31,"./window.js":32}],29:[function(e,t){"use strict";t.exports=moment},{}],30:[function(e,t){"use strict";t.exports=ssm},{}],31:[function(e,t){"use strict";t.exports=_},{}],32:[function(e,t){"use strict";t.exports=window},{}],33:[function(e,t){!function(t){"use strict";function s(){this.sDefaultScreenName="",this.oScreens={},this.oCurrentScreen=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/hasher.js"),a=e("../External/crossroads.js"),l=e("../External/$html.js"),c=e("../Common/Globals.js"),u=e("../Common/Plugins.js"),d=e("../Common/Utils.js"),p=e("../Knoin/KnoinAbstractViewModel.js");s.prototype.sDefaultScreenName="",s.prototype.oScreens={},s.prototype.oCurrentScreen=null,s.prototype.hideLoading=function(){o("#rl-loading").hide()},s.prototype.constructorEnd=function(e){d.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},s.prototype.extendAsViewModel=function(e,t,s){t&&(s||(s=p),t.__name=e,u.regViewModelHook(e,t),i.extend(t.prototype,s.prototype))},s.prototype.addSettingsViewModel=function(e,t,s,o,i){e.__rlSettingsData={Label:s,Template:t,Route:o,IsDefault:!!i},c.aViewModels.settings.push(e)},s.prototype.removeSettingsViewModel=function(e){c.aViewModels["settings-removed"].push(e)},s.prototype.disableSettingsViewModel=function(e){c.aViewModels["settings-disabled"].push(e)},s.prototype.routeOff=function(){r.changed.active=!1},s.prototype.routeOn=function(){r.changed.active=!0},s.prototype.screen=function(e){return""===e||d.isUnd(this.oScreens[e])?null:this.oScreens[e]},s.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var s=this,r=new e(t),a=r.viewModelPosition(),l=o("#rl-content #rl-"+a.toLowerCase()),p=null;e.__builded=!0,e.__vm=r,r.viewModelName=e.__name,l&&1===l.length?(p=o("").addClass("rl-view-model").addClass("RL-"+r.viewModelTemplate()).hide(),p.appendTo(l),r.viewModelDom=p,e.__dom=p,"Popups"===a&&(r.cancelCommand=r.closeCommand=d.createCommand(r,function(){s.hideScreenPopup(e)}),r.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),c.popupVisibilityNames.push(this.viewModelName),r.viewModelDom.css("z-index",3e3+c.popupVisibilityNames().length+10),d.delegateRun(this,"onFocus",[],500)):(d.delegateRun(this,"onHide"),this.restoreKeyScope(),c.popupVisibilityNames.remove(this.viewModelName),r.viewModelDom.css("z-index",2e3),c.tooltipTrigger(!c.tooltipTrigger()),i.delay(function(){t.viewModelDom.hide()},300))},r)),u.runHook("view-model-pre-build",[e.__name,r,p]),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:r.viewModelTemplate()}}},r),d.delegateRun(r,"onBuild",[p]),r&&"Popups"===a&&r.registerPopupKeyDown(),u.runHook("view-model-post-build",[e.__name,r,p])):d.log("Cannot find view model position: "+a)}return e?e.__vm:null},s.prototype.applyExternal=function(e,t){e&&t&&n.applyBindings(e,t)},s.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),u.runHook("view-model-on-hide",[e.__name,e.__vm]))},s.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),d.delegateRun(e.__vm,"onShow",t||[]),u.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},s.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},s.prototype.screenOnRoute=function(e,t){var s=this,o=null,n=null;""===d.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,d.isNonEmptyArray(o.viewModels())&&i.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),d.delegateRun(o,"onBuild")),i.defer(function(){s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onHide"),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),d.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=o,s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onShow"),u.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),d.delegateRun(e.__vm,"onShow"),d.delegateRun(e.__vm,"onFocus",[],200),u.runHook("view-model-on-show",[e.__name,e.__vm]))},s)),n=o.__cross(),n&&n.parse(t)})))},s.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),i.each(e,function(e){var t=new e,s=t?t.screenName():"";t&&""!==s&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=s),this.oScreens[s]=t)
-},this),i.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),u.runHook("screen-pre-start",[e.screenName(),e]),d.delegateRun(e,"onStart"),u.runHook("screen-post-start",[e.screenName(),e]))},this);var t=a.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),i.delay(function(){l.removeClass("rl-started-trigger").addClass("rl-started")},50)},s.prototype.setHash=function(e,t,s){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,s=d.isUnd(s)?!1:!!s,(d.isUnd(t)?1:!t)?(r.changed.active=!0,r[s?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[s?"replaceHash":"setHash"](e),r.changed.active=!0)},t.exports=new s}(t)},{"../Common/Globals.js":9,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/$html.js":17,"../External/crossroads.js":23,"../External/hasher.js":24,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/KnoinAbstractViewModel.js":36}],34:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t)},{}],35:[function(e,t){!function(t){"use strict";function s(e,t){this.sScreenName=e,this.aViewModels=i.isArray(t)?t:[]}var o=e("../External/crossroads.js"),i=e("../Common/Utils.js");s.prototype.oCross=null,s.prototype.sScreenName="",s.prototype.aViewModels=[],s.prototype.viewModels=function(){return this.aViewModels},s.prototype.screenName=function(){return this.sScreenName},s.prototype.routes=function(){return null},s.prototype.__cross=function(){return this.oCross},s.prototype.__start=function(){var e=this.routes(),t=null,s=null;i.isNonEmptyArray(e)&&(s=_.bind(this.onRoute||i.emptyFunction,this),t=o.create(),_.each(e,function(e){t.addRoute(e[0],s).rules=e[1]}),this.oCross=t)},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/crossroads.js":23}],36:[function(e,t){!function(t){"use strict";function s(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=n.pString(e),this.sTemplate=n.pString(t),this.sDefaultKeyScope=r.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=o.observable(!1),this.modalVisibility=o.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}var o=e("../External/ko.js"),i=e("../External/$window.js"),n=e("../Common/Utils.js"),r=e("../Common/Enums.js"),a=e("../Common/Globals.js");s.prototype.sPosition="",s.prototype.sTemplate="",s.prototype.viewModelName="",s.prototype.viewModelDom=null,s.prototype.viewModelTemplate=function(){return this.sTemplate},s.prototype.viewModelPosition=function(){return this.sPosition},s.prototype.cancelCommand=s.prototype.closeCommand=function(){},s.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},s.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},s.prototype.registerPopupKeyDown=function(){var e=this;i.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&r.EventKeyCode.Esc===t.keyCode)return n.delegateRun(e,"cancelCommand"),!1;if(r.EventKeyCode.Backspace===t.keyCode&&!n.inFocus())return!1}return!0})},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$window.js":18,"../External/ko.js":28}],37:[function(e,t){!function(t){"use strict";function s(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var o=e("../External/window.js"),i=e("../Common/Globals.js"),n=e("../Common/Utils.js"),r=e("../Common/LinkBuilder.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.prototype.mimeType="",s.prototype.fileName="",s.prototype.estimatedSize=0,s.prototype.friendlySize="",s.prototype.isInline=!1,s.prototype.isLinked=!1,s.prototype.cid="",s.prototype.cidWithOutTags="",s.prototype.contentLocation="",s.prototype.download="",s.prototype.folder="",s.prototype.uid="",s.prototype.mimeIndex="",s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},s.prototype.isImage=function(){return-1,]+)>?,? ?/g,s=t.exec(e);s?(this.name=s[1]||"",this.email=s[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=i.trim(e.Name),this.email=i.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},s.prototype.toLine=function(e,t,s){var o="";return""!==this.email&&(t=i.isUnd(t)?!1:!!t,s=i.isUnd(s)?!1:!!s,e&&""!==this.name?o=t?'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(this.name)+"":s?i.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=i.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(o)+""+i.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",s&&(o=i.encodeHtml(o))):t&&(o=''+i.encodeHtml(this.email)+""))),o},s.prototype.mailsoParse=function(e){if(e=i.trim(e),""===e)return!1;for(var t=function(e,t,s){e+="";var o=e.length;return 0>t&&(t+=o),o="undefined"==typeof s?o:0>s?s+o:s+t,t>=e.length||0>t||t>o?!1:e.slice(t,o)},s=function(e,t,s,o){return 0>s&&(s+=e.length),o=void 0!==o?o:e.length,0>o&&(o=o+e.length-s),e.slice(0,s)+t.substr(0,o)+t.slice(o)+e.slice(s+o)},o="",n="",r="",a=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===o.length&&(o=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":a||l||c||(c=!0,d=h);break;case")":c&&(p=h,r=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===r.length&&(o=e.replace(n,"")),n=i.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=i.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=i.trim(r).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/,"$1"),r=r.replace(/\\\\(.)/,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},s.prototype.inputoTagLine=function(){return 00){if(r.FolderType.Draft===s)return""+e;if(t>0&&r.FolderType.Trash!==s&&r.FolderType.Archive!==s&&r.FolderType.SentItems!==s)return""+t}return""},this),this.canBeDeleted=i.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=i.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){l.timeOutAction("folder-list-folder-visibility-change",function(){n.trigger("folder-list-folder-visibility-change")},100)}),this.localName=i.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case r.FolderType.Inbox:t=l.i18n("FOLDER_LIST/INBOX_NAME");break;case r.FolderType.SentItems:t=l.i18n("FOLDER_LIST/SENT_NAME");break;case r.FolderType.Draft:t=l.i18n("FOLDER_LIST/DRAFTS_NAME");break;case r.FolderType.Spam:t=l.i18n("FOLDER_LIST/SPAM_NAME");break;case r.FolderType.Trash:t=l.i18n("FOLDER_LIST/TRASH_NAME");break;case r.FolderType.Archive:t=l.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=i.computed(function(){a.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case r.FolderType.Inbox:e="("+l.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case r.FolderType.SentItems:e="("+l.i18n("FOLDER_LIST/SENT_NAME")+")";break;case r.FolderType.Draft:e="("+l.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case r.FolderType.Spam:e="("+l.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case r.FolderType.Trash:e="("+l.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case r.FolderType.Archive:e="("+l.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+s+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=i.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=i.computed(function(){return 0t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=r.observable(!1),this.hasImages=r.observable(!1),this.attachments=r.observableArray([]),this.isPgpSigned=r.observable(!1),this.isPgpEncrypted=r.observable(!1),this.pgpSignedVerifyStatus=r.observable(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser=r.observable(""),this.priority=r.observable(u.MessagePriority.Normal),this.readReceipt=r.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=r.observable(0),this.threads=r.observableArray([]),this.threadsLen=r.observable(0),this.hasUnseenSubMessage=r.observable(!1),this.hasFlaggedSubMessage=r.observable(!1),this.lastInCollapsedThread=r.observable(!1),this.lastInCollapsedThreadLoading=r.observable(!1),this.threadsLenResult=r.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$window.js"),c=e("../External/$div.js"),u=e("../Common/Enums.js"),d=e("../Common/Utils.js"),p=e("../Common/LinkBuilder.js"),h=e("../Storages/WebMailDataStorage.js"),m=e("./EmailModel.js"),g=e("./AttachmentModel.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.calculateFullFromatDateValue=function(e){return e>0?a.unix(e).format("LLL"):""},s.emailsToLine=function(e,t,s){var o=[],i=0,n=0;if(d.isNonEmptyArray(e))for(i=0,n=e.length;n>i;i++)o.push(e[i].toLine(t,s));return o.join(", ")},s.emailsToLineClear=function(e){var t=[],s=0,o=0;if(d.isNonEmptyArray(e))for(s=0,o=e.length;o>s;s++)e[s]&&e[s].email&&""!==e[s].name&&t.push(e[s].email);return t.join(", ")},s.initEmailsFromJson=function(e){var t=0,s=0,o=null,i=[];if(d.isNonEmptyArray(e))for(t=0,s=e.length;s>t;t++)o=m.newInstanceFromJson(e[t]),o&&i.push(o);return i},s.replyHelper=function(e,t,s){if(e&&0o;o++)d.isUnd(t[e[o].email])&&(t[e[o].email]=!0,s.push(e[o]))},s.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(u.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},s.prototype.computeSenderEmail=function(){var e=h.sentFolder(),t=h.draftFolder();this.senderEmailsString(this.folderFullNameRaw===e||this.folderFullNameRaw===t?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===e||this.folderFullNameRaw===t?this.toClearEmailsString():this.fromClearEmailString())},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(d.pInt(e.Size)),this.from=s.initEmailsFromJson(e.From),this.to=s.initEmailsFromJson(e.To),this.cc=s.initEmailsFromJson(e.Cc),this.bcc=s.initEmailsFromJson(e.Bcc),this.replyTo=s.initEmailsFromJson(e.ReplyTo),this.deliveredTo=s.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),d.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(d.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(s.emailsToLine(this.from,!0)),this.fromClearEmailString(s.emailsToLineClear(this.from)),this.toEmailsString(s.emailsToLine(this.to,!0)),this.toClearEmailsString(s.emailsToLineClear(this.to)),this.parentUid(d.pInt(e.ParentThread)),this.threads(d.isArray(e.Threads)?e.Threads:[]),this.threadsLen(d.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},s.prototype.initUpdateByMessageJson=function(e){var t=!1,s=u.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(s=d.pInt(e.Priority),this.priority(-1t;t++)o=g.newInstanceFromJson(e["@Collection"][t]),o&&(""!==o.cidWithOutTags&&0+$/,""),t=n.find(s,function(t){return e===t.cidWithOutTags})),t||null},s.prototype.findAttachmentByContentLocation=function(e){var t=null,s=this.attachments();return d.isNonEmptyArray(s)&&(t=n.find(s,function(t){return e===t.contentLocation})),t||null},s.prototype.messageId=function(){return this.sMessageId},s.prototype.inReplyTo=function(){return this.sInReplyTo},s.prototype.references=function(){return this.sReferences},s.prototype.fromAsSingleEmail=function(){return d.isArray(this.from)&&this.from[0]?this.from[0].email:""},s.prototype.viewLink=function(){return p.messageViewLink(this.requestHash)},s.prototype.downloadLink=function(){return p.messageDownloadLink(this.requestHash)},s.prototype.replyEmails=function(e){var t=[],o=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,o,t),0===t.length&&s.replyHelper(this.from,o,t),t},s.prototype.replyAllEmails=function(e){var t=[],o=[],i=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,i,t),0===t.length&&s.replyHelper(this.from,i,t),s.replyHelper(this.to,i,t),s.replyHelper(this.cc,i,o),[t,o]},s.prototype.textBodyToString=function(){return this.body?this.body.html():""},s.prototype.attachmentsToStringLine=function(){var e=n.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&o&&!n&&s.attr("src",o)}),e&&o.setTimeout(function(){t.print()},100))})},s.prototype.printMessage=function(){this.viewPopupMessage(!0)},s.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},s.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(u.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},s.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=d.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",i("["+t+"]",this.body).each(function(){e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",i(this).attr(t)).removeAttr(t):i(this).attr("src",i(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",i("["+t+"]",this.body).each(function(){var e=d.trim(i(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+i(this).attr(t)).removeAttr(t)}),e&&(i("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:i(".RL-MailMessageView .messageView .messageItem .content")[0]}),l.resize()),d.windowResize(500)}},s.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=d.isUnd(e)?!1:e;var t=this;i("[data-x-src-cid]",this.body).each(function(){var s=t.findAttachmentByCid(i(this).attr("data-x-src-cid"));s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-src-location]",this.body).each(function(){var s=t.findAttachmentByContentLocation(i(this).attr("data-x-src-location"));s||(s=t.findAttachmentByCid(i(this).attr("data-x-src-location"))),s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-style-cid]",this.body).each(function(){var e="",s="",o=t.findAttachmentByCid(i(this).attr("data-x-style-cid"));o&&o.linkPreview&&(s=i(this).attr("data-x-style-cid-name"),""!==s&&(e=d.trim(i(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+s+": url('"+o.linkPreview()+"')")))}),e&&!function(e,t){n.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(i("img.lazy",t.body),i(".RL-MailMessageView .messageView .messageItem .content")[0]),d.windowResize(500)}},s.prototype.storeDataToDom=function(){this.body&&(this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw),h.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser())))
-},s.prototype.storePgpVerifyDataToDom=function(){this.body&&h.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},s.prototype.fetchDataToDom=function(){this.body&&(this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=d.pString(this.body.data("rl-plain-raw")),h.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser("")))},s.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],t=null,s=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",r=h.findPublicKeysByEmail(s),a=null,l=null,d="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{t=o.openpgp.cleartext.readArmored(this.plainRaw),t&&t.getText&&(this.pgpSignedVerifyStatus(r.length?u.SignedVerifyStatus.Unverified:u.SignedVerifyStatus.UnknownPublicKeys),e=t.verify(r),e&&0').text(d)).html(),c.empty(),this.replacePlaneTextBody(d)))))}catch(p){}this.storePgpVerifyDataToDom()}},s.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var t=[],s=null,r=null,a=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",l=h.findPublicKeysByEmail(a),d=h.findSelfPrivateKey(e),p=null,m=null,g="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),d||this.pgpSignedVerifyStatus(u.SignedVerifyStatus.UnknownPrivateKey);try{s=o.openpgp.message.readArmored(this.plainRaw),s&&d&&s.decrypt&&(this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Unverified),r=s.decrypt(d),r&&(t=r.verify(l),t&&0').text(g)).html(),c.empty(),this.replacePlaneTextBody(g)))}catch(f){}this.storePgpVerifyDataToDom()}},s.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},s.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/$window.js":18,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Storages/WebMailDataStorage.js":65,"./AttachmentModel.js":37,"./EmailModel.js":38}],41:[function(e,t){!function(t){"use strict";function s(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Knoin/Knoin.js"),u=e("../Knoin/KnoinAbstractScreen.js");i.extend(s.prototype,u.prototype),s.prototype.onRoute=function(e){var t=this,s=null,u=null,d=null,p=null;u=i.find(r.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(i.find(r.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&i.find(r.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?s=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(u=u,s=new u,p=o("").addClass("rl-settings-view-model").hide(),p.appendTo(d),s.viewModelDom=p,s.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=s,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},s),a.delegateRun(s,"onBuild",[p])):a.log("Cannot find sub settings view model position: SettingsSubScreen")),s&&i.defer(function(){t.oCurrentSubScreen&&(a.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=s,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),a.delegateRun(t.oCurrentSubScreen,"onShow"),a.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),i.each(t.menu(),function(e){e.selected(s&&s.__rlSettingsData&&e.route===s.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),a.windowResize()})):c.setHash(l.settings(),!1,!0)},s.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(a.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},s.prototype.onBuild=function(){i.each(r.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!i.find(r.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!i.find(r.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},s.prototype.routes=function(){var e=i.find(r.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",s={subname:/^(.*)$/,normalize_:function(e,s){return s.subname=a.isUnd(s.subname)?t:a.pString(s.subname),[s.subname]}};return[["{subname}/",s],["{subname}",s],["",s]]},t.exports=s}(t)},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractScreen.js":35}],42:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/LoginViewModel.js");n.call(this,"login",[t])}var o=e("../External/underscore.js"),i=e("../Boots/RainLoopApp.js"),n=e("../Knoin/KnoinAbstractScreen.js");o.extend(s.prototype,n.prototype),s.prototype.onShow=function(){i.setTitle("")},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../ViewModels/LoginViewModel.js":67}],43:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/MailBoxSystemDropDownViewModel.js"),s=e("../ViewModels/MailBoxFolderListViewModel.js"),o=e("../ViewModels/MailBoxMessageListViewModel.js"),i=e("../ViewModels/MailBoxMessageViewViewModel.js");l.call(this,"mailbox",[t,s,o,i]),this.oLastRoute={}}var o=e("../External/underscore.js"),i=e("../External/$html.js"),n=e("../Common/Enums.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Knoin/KnoinAbstractScreen.js"),c=e("../Storages/AppSettings.js"),u=e("../Storages/WebMailDataStorage.js"),d=e("../Storages/WebMailCacheStorage.js"),p=e("../Storages/WebMailAjaxRemoteStorage.js"),h=e("../Boots/RainLoopApp.js");o.extend(s.prototype,l.prototype),s.prototype.oLastRoute={},s.prototype.setNewTitle=function(){var e=u.accountEmail(),t=u.foldersInboxUnreadCount();h.setTitle((""===e?"":(t>0?"("+t+") ":" ")+e+" - ")+a.i18n("TITLES/MAILBOX"))},s.prototype.onShow=function(){this.setNewTitle(),r.keyScope(n.KeyState.MessageList)},s.prototype.onRoute=function(e,t,s,o){if(a.isUnd(o)?1:!o){var i=d.getFolderFullNameRaw(e),r=d.getFolderFromCacheList(i);r&&(u.currentFolder(r).messageListPage(t).messageListSearch(s),n.Layout.NoPreview===u.layout()&&u.message()&&u.message(null),h.reloadMessageList())}else n.Layout.NoPreview!==u.layout()||u.message()||h.historyBack()},s.prototype.onStart=function(){var e=function(){a.windowResize()};(c.capa(n.Capa.AdditionalAccounts)||c.capa(n.Capa.AdditionalIdentities))&&h.accountsAndIdentities(),o.delay(function(){"INBOX"!==u.currentFolderFullNameRaw()&&h.folderInformation("INBOX")},1e3),o.delay(function(){h.quota()},5e3),o.delay(function(){p.appDelayStart(a.emptyFunction)},35e3),i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===u.layout()),u.folderList.subscribe(e),u.messageList.subscribe(e),u.message.subscribe(e),u.layout.subscribe(function(e){i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===e)}),u.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},s.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},s=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:s}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../Storages/AppSettings.js":59,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailCacheStorage.js":64,"../Storages/WebMailDataStorage.js":65,"../ViewModels/MailBoxFolderListViewModel.js":68,"../ViewModels/MailBoxMessageListViewModel.js":69,"../ViewModels/MailBoxMessageViewViewModel.js":70,"../ViewModels/MailBoxSystemDropDownViewModel.js":71}],44:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/SettingsSystemDropDownViewModel.js"),s=e("../ViewModels/SettingsMenuViewModel.js"),o=e("../ViewModels/SettingsPaneViewModel.js");l.call(this,[t,s,o]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){a.setTitle(this.sSettingsTitle)})}var o=e("../External/underscore.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/Globals.js"),a=e("../Boots/RainLoopApp.js"),l=e("./AbstractSettings.js");o.extend(s.prototype,l.prototype),s.prototype.onShow=function(){a.setTitle(this.sSettingsTitle),r.keyScope(i.KeyState.Settings)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"../ViewModels/SettingsMenuViewModel.js":85,"../ViewModels/SettingsPaneViewModel.js":86,"../ViewModels/SettingsSystemDropDownViewModel.js":87,"./AbstractSettings.js":41}],45:[function(e,t){!function(t){"use strict";function s(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?a.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/window.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js"),d=e("../Boots/RainLoopApp.js"),p=e("../Knoin/Knoin.js"),h=e("../ViewModels/Popups/PopupsAddAccountViewModel.js");s.prototype.addNewAccount=function(){p.showScreenPopup(h)},s.prototype.deleteAccount=function(e){if(e&&e.deleteAccess()){this.accountForDeletion(null);var t=function(t){return e===t};e&&(this.accounts.remove(t),u.accountDelete(function(e,t){r.StorageResultType.Success===e&&t&&t.Result&&t.Reload?(p.routeOff(),p.setHash(l.root(),!0),p.routeOff(),i.defer(function(){o.location.reload()})):d.accountsAndIdentities()},e.email))}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailDataStorage.js":65,"../ViewModels/Popups/PopupsAddAccountViewModel.js":72}],46:[function(e,t){!function(t){"use strict";function s(){this.changeProcess=i.observable(!1),this.errorDescription=i.observable(""),this.passwordMismatch=i.observable(!1),this.passwordUpdateError=i.observable(!1),this.passwordUpdateSuccess=i.observable(!1),this.currentPassword=i.observable(""),this.currentPassword.error=i.observable(!1),this.newPassword=i.observable(""),this.newPassword2=i.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=r.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(r.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),a.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=o.bind(this.onChangePasswordResponse,this)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../Common/Enums.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},s.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(r.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../Storages/WebMailAjaxRemoteStorage.js":63}],47:[function(e,t){!function(t){"use strict";function s(){this.contactsAutosave=r.contactsAutosave,this.allowContactsSync=r.allowContactsSync,this.enableContactsSync=r.enableContactsSync,this.contactsSyncUrl=r.contactsSyncUrl,this.contactsSyncUser=r.contactsSyncUser,this.contactsSyncPass=r.contactsSyncPass,this.saveTrigger=o.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var o=e("../External/ko.js"),i=e("../Common/Utils.js"),n=e("../Storages/WebMailAjaxRemoteStorage.js"),r=e("../Storages/WebMailDataStorage.js");s.prototype.onBuild=function(){r.contactsAutosave.subscribe(function(e){n.saveSettings(i.emptyFunction,{ContactsAutosave:e?"1":"0"})})},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailDataStorage.js":65}],48:[function(e,t){!function(t){"use strict";function s(){this.filters=o.observableArray([]),this.filters.loading=o.observable(!1),this.filters.subscribe(function(){i.windowResize()})}var o=e("../External/ko.js"),i=e("../Common/Utils.js"),n=e("../Knoin/Knoin.js"),r=e("../ViewModels/Popups/PopupsFilterViewModel.js");s.prototype.deleteFilter=function(e){this.filters.remove(e)},s.prototype.addFilter=function(){n.showScreenPopup(r,[new FilterModel])},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../ViewModels/Popups/PopupsFilterViewModel.js":76}],49:[function(e,t){!function(t){"use strict";function s(){this.foldersListError=c.foldersListError,this.folderList=c.folderList,this.processText=o.computed(function(){var e=c.foldersLoading(),t=c.foldersCreating(),s=c.foldersDeleting(),o=c.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):o?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=o.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=o.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Knoin/Knoin.js"),a=e("../Storages/AppSettings.js"),l=e("../Storages/LocalStorage.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailCacheStorage.js"),d=e("../Storages/WebMailAjaxRemoteStorage.js"),p=e("../Boots/RainLoopApp.js"),h=e("../ViewModels/Popups/PopupsFolderCreateViewModel.js"),m=e("../ViewModels/Popups/PopupsFolderSystemViewModel.js");s.prototype.folderEditOnEnter=function(e){var t=e?n.trim(e.nameForEdit()):"";""!==t&&e.name()!==t&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.foldersRenaming(!0),d.folderRename(function(e,t){c.foldersRenaming(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),p.folders()},e.fullNameRaw,t),u.removeFolderFromCacheList(e.fullNameRaw),e.name(t)),e.edited(!1)},s.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},s.prototype.onShow=function(){c.foldersListError("")},s.prototype.createFolder=function(){r.showScreenPopup(h)},s.prototype.systemFolder=function(){r.showScreenPopup(m)},s.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var t=function(s){return e===s?!0:(s.subFolders.remove(t),!1)};e&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.folderList.remove(t),c.foldersDeleting(!0),d.folderDelete(function(e,t){c.foldersDeleting(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),p.folders()},e.fullNameRaw),u.removeFolderFromCacheList(e.fullNameRaw))}else 0"},s.prototype.addNewIdentity=function(){u.showScreenPopup(d)},s.prototype.editIdentity=function(e){u.showScreenPopup(d,[e])},s.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var t=function(t){return e===t};e&&(this.identities.remove(t),l.identityDelete(function(){c.accountsAndIdentities()},e.id))}},s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=o.dataFor(this);e&&t.editIdentity(e)}),_.delay(function(){var e=n.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),s=n.settingsSaveHelperSimpleFunction(t.replyTrigger,t),o=n.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),i=n.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);a.defaultIdentityID.subscribe(function(e){l.saveSettings(i,{DefaultIdentityID:e})}),a.displayName.subscribe(function(t){l.saveSettings(e,{DisplayName:t})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailDataStorage.js":65,"../ViewModels/Popups/PopupsIdentityViewModel.js":80}],52:[function(e,t){!function(t){"use strict";function s(){this.editor=null,this.displayName=a.displayName,this.signature=a.signature,this.signatureToAll=a.signatureToAll,this.replyTo=a.replyTo,this.signatureDom=o.observable(null),this.displayNameTrigger=o.observable(i.SaveSettingsStep.Idle),this.replyTrigger=o.observable(i.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(i.SaveSettingsStep.Idle)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/NewHtmlEditorWrapper.js"),a=e("../Storages/WebMailDataStorage.js"),l=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(){var e=this;_.delay(function(){var t=n.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),s=n.settingsSaveHelperSimpleFunction(e.replyTrigger,e),o=n.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);a.displayName.subscribe(function(e){l.saveSettings(t,{DisplayName:e})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailDataStorage.js":65}],53:[function(e,t){!function(t){"use strict";function s(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/ko.js"),i=e("../Knoin/Knoin.js"),n=e("../Storages/WebMailDataStorage.js"),r=e("../Boots/RainLoopApp.js"),a=e("../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js"),l=e("../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js"),c=e("../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js");s.prototype.addOpenPgpKey=function(){i.showScreenPopup(a)},s.prototype.generateOpenPgpKey=function(){i.showScreenPopup(l)},s.prototype.viewOpenPgpKey=function(e){e&&i.showScreenPopup(c,[e])},s.prototype.deleteOpenPgpKey=function(e){e&&e.deleteAccess()&&(this.openPgpKeyForDeletion(null),e&&n.openpgpKeyring&&(this.openpgpkeys.remove(function(t){return e===t}),n.openpgpKeyring[e.isPrivate?"privateKeys":"publicKeys"].removeForId(e.guid),n.openpgpKeyring.store(),r.reloadOpenPgpKeys()))},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailDataStorage.js":65,"../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js":73,"../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js":79,"../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js":84}],54:[function(e,t){!function(t){"use strict";function s(){this.processing=o.observable(!1),this.clearing=o.observable(!1),this.secreting=o.observable(!1),this.viewUser=o.observable(""),this.viewEnable=o.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=o.observable(!1),this.viewSecret=o.observable(""),this.viewBackupCodes=o.observable(""),this.viewUrl=o.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=o.computed(function(){return n.langChangeTrigger(),r.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var o=e("../External/ko.js"),i=e("../Common/Utils.js"),n=e("../Common/Globals.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js"),l=e("../Knoin/Knoin.js"),c=e("../ViewModels/Popups/PopupsTwoFactorTestViewModel.js");s.prototype.showSecret=function(){this.secreting(!0),a.showTwoFactorSecret(this.onSecretResult)},s.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")
-},s.prototype.createTwoFactor=function(){this.processing(!0),a.createTwoFactor(this.onResult)},s.prototype.enableTwoFactor=function(){this.processing(!0),a.enableTwoFactor(this.onResult,this.viewEnable())},s.prototype.testTwoFactor=function(){l.showScreenPopup(c)},s.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),a.clearTwoFactor(this.onResult)},s.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(r.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(r.pString(t.Result.Secret)),this.viewBackupCodes(r.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(r.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var s=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&a.enableTwoFactor(function(e,t){i.StorageResultType.Success===e&&t&&t.Result||(s.viewEnable.subs=!1,s.viewEnable(!1),s.viewEnable.subs=!0)},e)},this)}},s.prototype.onSecretResult=function(e,t){this.secreting(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(r.pString(t.Result.Secret)),this.viewUrl(r.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},s.prototype.onBuild=function(){this.processing(!0),a.getTwoFactor(this.onResult)},t.exports=s}(t)},{"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":63,"../ViewModels/Popups/PopupsTwoFactorTestViewModel.js":83}],55:[function(e,t){!function(t){"use strict";function s(){this.googleEnable=i.googleEnable,this.googleActions=i.googleActions,this.googleLoggined=i.googleLoggined,this.googleUserName=i.googleUserName,this.facebookEnable=i.facebookEnable,this.facebookActions=i.facebookActions,this.facebookLoggined=i.facebookLoggined,this.facebookUserName=i.facebookUserName,this.twitterEnable=i.twitterEnable,this.twitterActions=i.twitterActions,this.twitterLoggined=i.twitterLoggined,this.twitterUserName=i.twitterUserName,this.connectGoogle=o.createCommand(this,function(){this.googleLoggined()||n.googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=o.createCommand(this,function(){n.googleDisconnect()}),this.connectFacebook=o.createCommand(this,function(){this.facebookLoggined()||n.facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=o.createCommand(this,function(){n.facebookDisconnect()}),this.connectTwitter=o.createCommand(this,function(){this.twitterLoggined()||n.twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=o.createCommand(this,function(){n.twitterDisconnect()})}var o=e("../Common/Utils.js"),i=e("../Storages/WebMailDataStorage.js"),n=e("../Boots/RainLoopApp.js");t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Utils.js":14,"../Storages/WebMailDataStorage.js":65}],56:[function(e,t){!function(t){"use strict";function s(){var e=this;this.mainTheme=c.mainTheme,this.themesObjects=n.observableArray([]),this.themeTrigger=n.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,c.theme.subscribe(function(t){_.each(this.themesObjects(),function(e){e.selected(t===e.name)});var s=i("#rlThemeLink"),n=i("#rlThemeStyle"),l=s.attr("href");l||(l=n.attr("data-href")),l&&(l=l.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),l=l.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==l.substring(l.length-5,l.length)&&(l+="Json/"),o.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=i.ajax({url:l,dataType:"json"}).done(function(t){t&&a.isArray(t)&&2===t.length&&(!s||!s[0]||n&&n[0]||(n=i(''),s.after(n),s.remove()),n&&n[0]&&(n.attr("data-href",l).attr("data-theme",t[0]),n&&n[0]&&n[0].styleSheet&&!a.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=t[1]:n.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=o.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),u.saveSettings(null,{Theme:t})},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onBuild=function(){var e=c.theme();this.themesObjects(_.map(c.themes(),function(t){return{name:t,nameDisplay:a.convertThemeName(t),selected:n.observable(t===e),themePreviewSrc:l.themePreviewLink(t)}}))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/window.js":32,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailDataStorage.js":65}],57:[function(e,t){!function(t){"use strict";function s(){this.oRequests={}}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../Common/Consts.js"),r=e("../Common/Enums.js"),a=e("../Common/Globals.js"),l=e("../Common/Utils.js"),c=e("../Common/Plugins.js"),u=e("../Common/LinkBuilder.js"),d=e("./AppSettings.js");s.prototype.oRequests={},s.prototype.defaultResponse=function(e,t,s,i,u,d){var p=function(){r.StorageResultType.Success!==s&&a.bUnload&&(s=r.StorageResultType.Unload),r.StorageResultType.Success===s&&i&&!i.Result?(i&&-1(new o.Date).getTime()-h),g&&a.oRequests[g]&&(a.oRequests[g].__aborted&&(i="abort"),a.oRequests[g]=null),a.defaultResponse(e,g,i,s,n,t)}),g&&00?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,s,c.projectHash(),c.threading()&&c.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},s.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},s.prototype.composeUploadDrive=function(e,t,s){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:s,Url:t},999e3)},s.prototype.folderInformation=function(e,t,s){var n=!0,r=[];i.isArray(s)&&0=e?1:e},this),this.mainMessageListSearch=r.computed({read:this.messageListSearch,write:function(e){y.setHash(m.mailBox(this.currentFolderFullNameHash(),1,h.trim(e.toString())))
-},owner:this}),this.messageListError=r.observable(""),this.messageListLoading=r.observable(!1),this.messageListIsNotCompleted=r.observable(!1),this.messageListCompleteLoadingThrottle=r.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=r.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(n.debounce(function(e){n.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new C,this.message=r.observable(null),this.messageLoading=r.observable(!1),this.messageLoadingThrottle=r.observable(!1).extend({throttle:50}),this.message.focused=r.observable(!1),this.message.subscribe(function(e){e?d.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),d.Layout.NoPreview===b.layout()&&-10?o.Math.ceil(t/e*100):0},this),this.capaOpenPGP=r.observable(!1),this.openpgpkeys=r.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=r.observable(!1),this.googleLoggined=r.observable(!1),this.googleUserName=r.observable(""),this.facebookActions=r.observable(!1),this.facebookLoggined=r.observable(!1),this.facebookUserName=r.observable(""),this.twitterActions=r.observable(!1),this.twitterLoggined=r.observable(!1),this.twitterUserName=r.observable(""),this.customThemeType=r.observable(d.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=n.throttle(this.purgeMessageBodyCache,3e4)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$div.js"),c=e("../External/NotificationClass.js"),u=e("../Common/Consts.js"),d=e("../Common/Enums.js"),p=e("../Common/Globals.js"),h=e("../Common/Utils.js"),m=e("../Common/LinkBuilder.js"),g=e("./AppSettings.js"),f=e("./WebMailCacheStorage.js"),b=e("./WebMailDataStorage.js"),S=e("./WebMailAjaxRemoteStorage.js"),y=e("../Knoin/Knoin.js"),C=e("../Models/MessageModel.js"),v=e("../Models/FolderModel.js"),w=e("./LocalStorage.js"),E=e("./AbstractData.js");n.extend(s.prototype,E.prototype),s.prototype.purgeMessageBodyCache=function(){var e=0,t=null,s=p.iMessageBodyCacheCount-u.Values.MessageBodyCacheLimit;s>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=i(this);s>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&n.delay(function(){t.find(".rl-cache-purge").remove()},300)))},s.prototype.populateDataOnStart=function(){E.prototype.populateDataOnStart.call(this),this.accountEmail(g.settingsGet("Email")),this.accountIncLogin(g.settingsGet("IncLogin")),this.accountOutLogin(g.settingsGet("OutLogin")),this.projectHash(g.settingsGet("ProjectHash")),this.defaultIdentityID(g.settingsGet("DefaultIdentityID")),this.displayName(g.settingsGet("DisplayName")),this.replyTo(g.settingsGet("ReplyTo")),this.signature(g.settingsGet("Signature")),this.signatureToAll(!!g.settingsGet("SignatureToAll")),this.enableTwoFactor(!!g.settingsGet("EnableTwoFactor")),this.lastFoldersHash=w.get(d.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!g.settingsGet("RemoteSuggestions"),this.devEmail=g.settingsGet("DevEmail"),this.devPassword=g.settingsGet("DevPassword")},s.prototype.initUidNextAndNewMessages=function(e,t,s){if("INBOX"===e&&h.isNormal(t)&&""!==t){if(h.isArray(s)&&03)a(m.notificationMailIcon(),b.accountEmail(),h.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>i;i++)a(m.notificationMailIcon(),C.emailsToLine(C.initEmailsFromJson(s[i].From),!1),s[i].Subject)}f.setFolderUidNext(e,t)}},s.prototype.folderResponseParseRec=function(e,t){var s=0,o=0,i=null,n=null,r="",a=[],l=[];for(s=0,o=t.length;o>s;s++)i=t[s],i&&(r=i.FullNameRaw,n=f.getFolderFromCacheList(r),n||(n=v.newInstanceFromJson(i),n&&(f.setFolderToCacheList(r,n),f.setFolderFullNameRaw(n.fullNameHash,r))),n&&(n.collapsed(!h.isFolderExpanded(n.fullNameHash)),i.Extended&&(i.Extended.Hash&&f.setFolderHash(n.fullNameRaw,i.Extended.Hash),h.isNormal(i.Extended.MessageCount)&&n.messageCountAll(i.Extended.MessageCount),h.isNormal(i.Extended.MessageUnseenCount)&&n.messageCountUnread(i.Extended.MessageUnseenCount)),a=i.SubFolders,a&&"Collection/FolderCollection"===a["@Object"]&&a["@Collection"]&&h.isArray(a["@Collection"])&&n.subFolders(this.folderResponseParseRec(e,a["@Collection"])),l.push(n)));return l},s.prototype.setFolders=function(e){var t=[],s=!1,o=function(e){return""===e||u.Values.UnuseOptionValue===e||null!==f.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])&&(h.isUnd(e.Result.Namespace)||(b.namespace=e.Result.Namespace),this.threading(!!g.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(b.namespace,e.Result["@Collection"]),b.folderList(t),e.Result.SystemFolders&&""==""+g.settingsGet("SentFolder")+g.settingsGet("DraftFolder")+g.settingsGet("SpamFolder")+g.settingsGet("TrashFolder")+g.settingsGet("ArchiveFolder")+g.settingsGet("NullFolder")&&(g.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),g.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),g.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),g.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),g.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),s=!0),b.sentFolder(o(g.settingsGet("SentFolder"))),b.draftFolder(o(g.settingsGet("DraftFolder"))),b.spamFolder(o(g.settingsGet("SpamFolder"))),b.trashFolder(o(g.settingsGet("TrashFolder"))),b.archiveFolder(o(g.settingsGet("ArchiveFolder"))),s&&S.saveSystemFolders(h.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),w.set(d.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},s.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},s.prototype.getNextFolderNames=function(e){e=h.isUnd(e)?!1:!!e;var t=[],s=10,o=a().unix(),i=o-300,r=[],l=function(t){n.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&i>t.interval&&(!e||t.subScribed())&&r.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),n.find(r,function(e){var i=f.getFolderFromCacheList(e[1]);return i&&(i.interval=o,t.push(e[1])),s<=t.length}),n.uniq(t)},s.prototype.removeMessagesFromList=function(e,t,s,o){s=h.isNormal(s)?s:"",o=h.isUnd(o)?!1:!!o,t=n.map(t,function(e){return h.pInt(e)});var i=0,r=b.messageList(),a=f.getFolderFromCacheList(e),l=""===s?null:f.getFolderFromCacheList(s||""),c=b.currentFolderFullNameRaw(),u=b.message(),d=c===e?n.filter(r,function(e){return e&&-10&&a.messageCountUnread(0<=a.messageCountUnread()-i?a.messageCountUnread()-i:0)),l&&(l.messageCountAll(l.messageCountAll()+t.length),i>0&&l.messageCountUnread(l.messageCountUnread()+i),l.actionBlink(!0)),0').hide().addClass("rl-cache-class"),r.data("rl-cache-count",++p.iMessageBodyCacheCount),h.isNormal(e.Result.Html)&&""!==e.Result.Html?(s=!0,u=e.Result.Html.toString()):h.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(s=!1,u=h.plainToHtml(e.Result.Plain.toString(),!1),(y.isPgpSigned()||y.isPgpEncrypted())&&b.capaOpenPGP()&&(y.plainRaw=h.pString(e.Result.Plain),g=/---BEGIN PGP MESSAGE---/.test(y.plainRaw),g||(m=/-----BEGIN PGP SIGNED MESSAGE-----/.test(y.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(y.plainRaw)),l.empty(),m&&y.isPgpSigned()?u=l.append(i('').text(y.plainRaw)).html():g&&y.isPgpEncrypted()&&(u=l.append(i('').text(y.plainRaw)).html()),l.empty(),y.isPgpSigned(m),y.isPgpEncrypted(g))):s=!1,r.html(h.linkify(u)).addClass("b-text-part "+(s?"html":"plain")),y.isHtml(!!s),y.hasImages(!!o),y.pgpSignedVerifyStatus(d.SignedVerifyStatus.None),y.pgpSignedVerifyUser(""),y.body=r,y.body&&S.append(y.body),y.storeDataToDom(),n&&y.showInternalImages(!0),y.hasImages()&&this.showImages()&&y.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(y.body),this.hideMessageBodies(),y.body.show(),r&&h.initBlockquoteSwitcher(r)),f.initMessageFlagsFromCache(y),y.unseen()&&RL.setMessageSeen(y),h.windowResize())},s.prototype.calculateMessageListHash=function(e){return n.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},s.prototype.setMessageList=function(e,t){if(e&&e.Result&&"Collection/MessageCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])){var s=null,i=0,n=0,r=0,l=0,c=[],u=a().unix(),p=b.staticMessageList,m=null,g=null,S=null,y=0,v=!1;for(r=h.pInt(e.Result.MessageResultCount),l=h.pInt(e.Result.Offset),h.isNonEmptyArray(e.Result.LastCollapsedThreadUids)&&(s=e.Result.LastCollapsedThreadUids),S=f.getFolderFromCacheList(h.isNormal(e.Result.Folder)?e.Result.Folder:""),S&&!t&&(S.interval=u,f.setFolderHash(e.Result.Folder,e.Result.FolderHash),h.isNormal(e.Result.MessageCount)&&S.messageCountAll(e.Result.MessageCount),h.isNormal(e.Result.MessageUnseenCount)&&(h.pInt(S.messageCountUnread())!==h.pInt(e.Result.MessageUnseenCount)&&(v=!0),S.messageCountUnread(e.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(S.fullNameRaw,e.Result.UidNext,e.Result.NewMessages)),v&&S&&f.clearMessageFlagsFromCacheByFolder(S.fullNameRaw),i=0,n=e.Result["@Collection"].length;n>i;i++)m=e.Result["@Collection"][i],m&&"Object/Message"===m["@Object"]&&(g=p[i],g&&g.initByJson(m)||(g=C.newInstanceFromJson(m)),g&&(f.hasNewMessageAndRemoveFromCache(g.folderFullNameRaw,g.uid)&&5>=y&&(y++,g.newForAnimation(!0)),g.deleted(!1),t?f.initMessageFlagsFromCache(g):f.storeMessageFlagsToCache(g),g.lastInCollapsedThread(s&&-1-1&&a.eq(n).removeClass("focused"),38===r&&n>0?n--:40===r&&no)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-o+n+e),!0):!1},s.prototype.messagesDrop=function(e,t){if(e&&t&&t.helper){var s=t.helper.data("rl-folder"),o=a.hasClass("rl-ctrl-key-pressed"),i=t.helper.data("rl-uids");l.isNormal(s)&&""!==s&&l.isArray(i)&&g.moveMessagesToFolder(s,i,e.fullNameRaw,o)}},s.prototype.composeClick=function(){f.showScreenPopup(PopupsComposeViewModel)},s.prototype.createFolder=function(){f.showScreenPopup(PopupsFolderCreateViewModel)},s.prototype.configureFolders=function(){f.setHash(d.settings("folders"))},s.prototype.contactsClick=function(){this.allowContacts&&f.showScreenPopup(PopupsContactsViewModel)},t.exports=new s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":59,"../Storages/WebMailCacheStorage.js":64,"../Storages/WebMailDataStorage.js":65}],69:[function(e,t){!function(t){"use strict";function s(){w.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=p.popupVisibility,this.message=S.message,this.messageList=S.messageList,this.folderList=S.folderList,this.currentMessage=S.currentMessage,this.isMessageSelected=S.isMessageSelected,this.messageListSearch=S.messageListSearch,this.messageListError=S.messageListError,this.folderMenuForMove=S.folderMenuForMove,this.useCheckboxesInList=S.useCheckboxesInList,this.mainMessageListSearch=S.mainMessageListSearch,this.messageListEndFolder=S.messageListEndFolder,this.messageListChecked=S.messageListChecked,this.messageListCheckedOrSelected=S.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=S.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=S.messageListCompleteLoadingThrottle,c.initOnStartOrLangChange(function(){this.emptySubjectValue=c.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=S.userQuota,this.userUsageSize=S.userUsageSize,this.userUsageProc=S.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return u.Layout.NoPreview!==S.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=S.messageListEndSearch();return""===e?"":c.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(c.computedPagenatorHelper(S.messageListPage,S.messageListPageCount)),this.checkAll=n.computed({read:function(){return 00&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 01?" ("+(100>e?e:"99+")+")":""},s.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},s.prototype.moveSelectedMessagesToFolder=function(e,t){return this.canBeMoved()&&C.moveMessagesToFolder(S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),e,t),!1},s.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=c.draggeblePlace(),s=S.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",S.currentFolderFullNameRaw()),t.data("rl-uids",s),t.find(".text").text(""+s.length),i.defer(function(){var e=S.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},s.prototype.onMessageResponse=function(e,t,s){S.hideMessageBodies(),S.messageLoading(!1),u.StorageResultType.Success===e&&t&&t.Result?S.setMessage(t,s):u.StorageResultType.Unload===e?(S.message(null),S.messageError("")):u.StorageResultType.Abort!==e&&(S.message(null),S.messageError(c.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.UnknownError)))},s.prototype.populateMessageBody=function(e){e&&(y.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?S.messageLoading(!0):c.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},s.prototype.setAction=function(e,t,s){var o=[],n=null,r=0;if(c.isUnd(s)&&(s=S.messageListChecked()),o=i.map(s,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},s.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},s.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},s.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(m.sendReadReceiptMessage(u.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),e.isReadReceipt(!0),p.storeMessageFlagsToCache(e),g.reloadFlagsCurrentMessageListAndMessageFromCache())},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailAjaxRemoteStorage.js":63,"../Storages/WebMailCacheStorage.js":64,"../Storages/WebMailDataStorage.js":65}],71:[function(e,t){!function(t){"use strict";function s(){i.call(this),o.constructorEnd(this)}var o=(e("../Common/Utils.js"),e("../Knoin/Knoin.js")),i=e("./AbstractSystemDropDownViewModel.js");o.extendAsViewModel("MailBoxSystemDropDownViewModel",s,i),t.exports=s}(t)},{"../Common/Utils.js":14,"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":66}],72:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsAddAccount"),this.email=o.observable(""),this.password=o.observable(""),this.emailError=o.observable(!1),this.passwordError=o.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.emailFocus=o.observable(!1),this.addAccountCommand=n.createCommand(this,function(){return this.emailError(""===n.trim(this.email())),this.passwordError(""===n.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),r.accountAdd(_.bind(function(e,t){this.submitRequest(!1),i.StorageResultType.Success===e&&t&&"AccountAdd"===t.Action?t.Result?(a.accountsAndIdentities(),this.cancelCommand()):t.ErrorCode&&this.submitError(n.getNotification(t.ErrorCode)):this.submitError(n.getNotification(i.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailAjaxRemoteStorage.js"),a=e("../../Boots/RainLoopApp.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsAddAccountViewModel",s),s.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.emailFocus(!0)},t.exports=new s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":63}],73:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsAddOpenPgpKey"),this.key=o.observable(""),this.key.error=o.observable(!1),this.key.focus=o.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=i.createCommand(this,function(){var e=30,t=null,s=i.trim(this.key()),o=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,a=n.openpgpKeyring;if(s=s.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===s),!a||this.key.error())return!1;for(;;){if(t=o.exec(s),!t||0>e)break;t[0]&&t[1]&&t[2]&&t[1]===t[2]&&("PRIVATE"===t[1]?a.privateKeys.importKey(t[0]):"PUBLIC"===t[1]&&a.publicKeys.importKey(t[0])),e--}return a.store(),r.reloadOpenPgpKeys(),i.delegateRun(this,"cancelCommand"),!0}),a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Utils.js"),n=e("../../Storages/WebMailDataStorage.js"),r=e("../../Boots/RainLoopApp.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsAddOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.key.focus(!0)},t.exports=new s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":65}],74:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsAsk"),this.askDesc=o.observable(""),this.yesButton=o.observable(""),this.noButton=o.observable(""),this.yesFocus=o.observable(!1),this.noFocus=o.observable(!1),this.fYesAction=null,this.fNoAction=null,this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=n.KeyState.PopupAsk,a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../External/key.js"),n=e("../../Common/Enums.js"),r=e("../../Common/Utils.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsAskViewModel",s),s.prototype.clearPopup=function(){this.askDesc(""),this.yesButton(r.i18n("POPUPS_ASK/BUTTON_YES")),this.noButton(r.i18n("POPUPS_ASK/BUTTON_NO")),this.yesFocus(!1),this.noFocus(!1),this.fYesAction=null,this.fNoAction=null},s.prototype.yesClick=function(){this.cancelCommand(),r.isFunc(this.fYesAction)&&this.fYesAction.call(null)},s.prototype.noClick=function(){this.cancelCommand(),r.isFunc(this.fNoAction)&&this.fNoAction.call(null)},s.prototype.onShow=function(e,t,s,o,i){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=s||null,this.askDesc(e||""),o&&this.yesButton(o),o&&this.yesButton(i)},s.prototype.onFocus=function(){this.yesFocus(!0)},s.prototype.onBuild=function(){i("tab, shift+tab, right, left",n.KeyState.PopupAsk,_.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),i("esc",n.KeyState.PopupAsk,_.bind(function(){return this.noClick(),!1},this))},t.exports=new s}(t)},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],75:[function(e,t){!function(t){"use strict";
-function s(){y.call(this,"Popups","PopupsCompose"),this.oEditor=null,this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.bSkipNext=!1,this.sReferences="",this.bCapaAdditionalIdentities=h.capa(a.Capa.AdditionalIdentities);var e=this,t=function(t){!1===e.showCcAndBcc()&&0"},s.prototype.sendMessageResponse=function(e,t){var s=!1,o="";this.sending(!1),a.StorageResultType.Success===e&&t&&t.Result&&(s=!0,this.modalVisibility()&&c.delegateRun(this,"closeCommand")),this.modalVisibility()&&!s&&(t&&a.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),window.alert(c.trim(c.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=c.getNotification(t&&t.ErrorCode?t.ErrorCode:a.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),window.alert(o||c.getNotification(a.Notification.CantSendMessage)))),this.reloadDraftFolder()},s.prototype.saveMessageResponse=function(e,t){var s=!1,o=null;this.saving(!1),a.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(o=m.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&m.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(window.Math.round((new window.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
"+s}return e},s.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?i.delay(function(){t.oEditor=new p(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},s.prototype.onShow=function(e,t,s,n,r){S.routeOff();var l=this,u="",d="",p="",h="",g="",b=null,y=null,C="",v="",w=[],E={},A=m.accountEmail(),F=m.signature(),T=m.signatureToAll(),j=[],M=null,R=null,N=e||a.ComposeType.Empty,L=function(e,t){for(var s=0,o=e.length,i=[];o>s;s++)i.push(e[s].toLine(!!t));return i.join(", ")};if(t=t||null,t&&c.isNormal(t)&&(R=c.isArray(t)&&1===t.length?t[0]:c.isArray(t)?null:t),null!==A&&(E[A]=!0),this.currentIdentityID(this.findIdentityIdByMessage(N,R)),this.reset(),c.isNonEmptyArray(s)&&this.to(L(s)),""!==N&&R){switch(h=R.fullFormatDateValue(),g=R.subject(),M=R.aDraftInfo,b=o(R.body).clone(),c.removeBlockquoteSwitcher(b),y=b.find("[data-html-editor-font-wrapper=true]"),C=y&&y[0]?y.html():b.html(),N){case a.ComposeType.Empty:break;case a.ComposeType.Reply:this.to(L(R.replyEmails(E))),this.subject(c.replySubjectAdd("Re",g)),this.prepearMessageAttachments(R,N),this.aDraftInfo=["reply",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=c.trim(this.sInReplyTo+" "+R.sReferences);break;case a.ComposeType.ReplyAll:w=R.replyAllEmails(E),this.to(L(w[0])),this.cc(L(w[1])),this.subject(c.replySubjectAdd("Re",g)),this.prepearMessageAttachments(R,N),this.aDraftInfo=["reply",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=c.trim(this.sInReplyTo+" "+R.references());break;case a.ComposeType.Forward:this.subject(c.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(R,N),this.aDraftInfo=["forward",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=c.trim(this.sInReplyTo+" "+R.sReferences);break;case a.ComposeType.ForwardAsAttachment:this.subject(c.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(R,N),this.aDraftInfo=["forward",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=c.trim(this.sInReplyTo+" "+R.sReferences);break;case a.ComposeType.Draft:this.to(L(R.to)),this.cc(L(R.cc)),this.bcc(L(R.bcc)),this.bFromDraft=!0,this.draftFolder(R.folderFullNameRaw),this.draftUid(R.uid),this.subject(g),this.prepearMessageAttachments(R,N),this.aDraftInfo=c.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=R.sInReplyTo,this.sReferences=R.sReferences;break;case a.ComposeType.EditAsNew:this.to(L(R.to)),this.cc(L(R.cc)),this.bcc(L(R.bcc)),this.subject(g),this.prepearMessageAttachments(R,N),this.aDraftInfo=c.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=R.sInReplyTo,this.sReferences=R.sReferences}switch(N){case a.ComposeType.Reply:case a.ComposeType.ReplyAll:u=R.fromToLine(!1,!0),v=c.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:u}),C="
"+v+":"+C+"
";break;case a.ComposeType.Forward:u=R.fromToLine(!1,!0),d=R.toToLine(!1,!0),p=R.ccToLine(!1,!0),C="
"+c.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+c.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+u+"
"+c.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+d+(0"+c.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+p:"")+"
"+c.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+c.encodeHtml(h)+"
"+c.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+c.encodeHtml(g)+"
"+C;break;case a.ComposeType.ForwardAsAttachment:C=""}T&&""!==F&&a.ComposeType.EditAsNew!==N&&a.ComposeType.Draft!==N&&(C=this.convertSignature(F,L(R.from,!0),C,N)),this.editor(function(e){e.setHtml(C,!1),R.isHtml()||e.modeToggle(!1)})}else a.ComposeType.Empty===N?(this.subject(c.isNormal(n)?""+n:""),C=c.isNormal(r)?""+r:"",T&&""!==F&&(C=this.convertSignature(F,"",c.convertPlainTextToHtml(C),N)),this.editor(function(e){e.setHtml(C,!1),a.EditorDefaultType.Html!==m.editorDefaultType()&&e.modeToggle(!1)})):c.isNonEmptyArray(t)&&i.each(t,function(e){l.addMessageAsAttachment(e)});j=this.getAttachmentsDownloadsForUpload(),c.isNonEmptyArray(j)&&f.messageUploadAttachments(function(e,t){if(a.StorageResultType.Success===e&&t&&t.Result){var s=null,o="";if(!l.viewModelVisibility())for(o in t.Result)t.Result.hasOwnProperty(o)&&(s=l.getAttachmentById(t.Result[o]),s&&s.tempName(o))}else l.setMessageAttachmentFailedDowbloadText()},j),this.triggerForResize()},s.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},s.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},s.prototype.tryToClosePopup=function(){var e=this;S.isPopupVisible(PopupsAskViewModel)||S.showScreenPopup(PopupsAskViewModel,[c.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&c.delegateRun(e,"closeCommand")}])},s.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",a.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",a.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",a.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",a.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),$window.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",o(t).attr("id","dropboxjs").attr("data-app-key",h.settingsGet("DropboxApiKey")),document.body.appendChild(t)),this.driveEnabled()&&o.getScript("https://apis.google.com/js/api.js",function(){window.gapi&&e.driveVisible(!0)})},s.prototype.driveCallback=function(e,t){if(t&&window.XMLHttpRequest&&window.google&&t[window.google.picker.Response.ACTION]===window.google.picker.Action.PICKED&&t[window.google.picker.Response.DOCUMENTS]&&t[window.google.picker.Response.DOCUMENTS][0]&&t[window.google.picker.Response.DOCUMENTS][0].id){var s=this,o=new window.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[window.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=JSON.parse(o.responseText),i=function(e,t,s){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+s,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":i(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":i(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":i(t,"image/png","png");break;case"application/vnd.google-apps.presentation":i(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:i(t,"application/pdf","pdf")}t&&t.downloadUrl&&s.addDriveAttachment(t,e)}}),o.send()}},s.prototype.driveCreatePiker=function(e){if(window.gapi&&e&&e.access_token){var t=this;window.gapi.load("picker",{callback:function(){if(window.google&&window.google.picker){var s=(new window.google.picker.PickerBuilder).addView((new window.google.picker.DocsView).setIncludeFolders(!0)).setAppId(h.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(i.bind(t.driveCallback,t,e.access_token)).enableFeature(window.google.picker.Feature.NAV_HIDDEN).build();s.setVisible(!0)}}})}},s.prototype.driveOpenPopup=function(){if(window.gapi){var e=this;window.gapi.load("auth",{callback:function(){var t=window.gapi.auth.getToken();t?e.driveCreatePiker(t):window.gapi.auth.authorize({client_id:h.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var s=window.gapi.auth.getToken();s&&e.driveCreatePiker(s)}else window.gapi.auth.authorize({client_id:h.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var s=window.gapi.auth.getToken();s&&e.driveCreatePiker(s)}})})}})}},s.prototype.getAttachmentById=function(e){for(var t=this.attachments(),s=0,o=t.length;o>s;s++)if(t[s]&&e===t[s].id)return t[s];return null},s.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=c.pInt(h.settingsGet("AttachmentLimit")),s=new Jua({action:u.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.on("onDragEnter",i.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",i.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",i.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",i.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",i.bind(function(t,s,o){var i=null;c.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&i.progress(" - "+Math.floor(s/o*100)+"%")},this)).on("onSelect",i.bind(function(e,o){this.dragAndDropOver(!1);var i=this,n=c.isUnd(o.FileName)?"":o.FileName.toString(),r=c.isNormal(o.Size)?c.pInt(o.Size):null,a=new ComposeAttachmentModel(e,n,r);return a.cancel=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e}),s&&s.cancel(e)}}(e),this.attachments.push(a),r>0&&t>0&&r>t?(a.error(c.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",i.bind(function(t){var s=null;c.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&(s.waiting(!1),s.uploading(!0))},this)).on("onComplete",i.bind(function(t,s,o){var i="",n=null,r=null,a=this.getAttachmentById(t);r=s&&o&&o.Result&&o.Result.Attachment?o.Result.Attachment:null,n=o&&o.Result&&o.Result.ErrorCode?o.Result.ErrorCode:null,null!==n?i=c.getUploadErrorDescByCode(n):r||(i=c.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==i&&00&&i>0&&n>i?(s.uploading(!1),s.error(c.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(f.composeUploadExternals(function(e,t){var o=!1;s.uploading(!1),a.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(o=!0,s.tempName(t.Result[s.id])),o||s.error(c.getUploadErrorDescByCode(a.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},s.prototype.addDriveAttachment=function(e,t){var s=this,o=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}},i=c.pInt(h.settingsGet("AttachmentLimit")),n=null,r=e.fileSize?c.pInt(e.fileSize):0;return n=new ComposeAttachmentModel(e.downloadUrl,e.title,r),n.fromMessage=!1,n.cancel=o(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),r>0&&i>0&&r>i?(n.uploading(!1),n.error(c.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(f.composeUploadDrive(function(e,t){var s=!1;n.uploading(!1),a.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(s=!0,n.tempName(t.Result[n.id][0]),n.size(c.pInt(t.Result[n.id][1]))),s||n.error(c.getUploadErrorDescByCode(a.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},s.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,o=c.isNonEmptyArray(e.attachments())?e.attachments():[],i=0,n=o.length,r=null,l=null,u=!1,d=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}};if(a.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>i;i++){switch(l=o[i],u=!1,t){case a.ComposeType.Reply:case a.ComposeType.ReplyAll:u=l.isLinked;break;case a.ComposeType.Forward:case a.ComposeType.Draft:case a.ComposeType.EditAsNew:u=!0}u&&(r=new ComposeAttachmentModel(l.download,l.fileName,l.estimatedSize,l.isInline,l.isLinked,l.cid,l.contentLocation),r.fromMessage=!0,r.cancel=d(l.download),r.waiting(!1).uploading(!0),this.attachments.push(r))}}},s.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},s.prototype.setMessageAttachmentFailedDowbloadText=function(){i.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(c.getUploadErrorDescByCode(a.UploadErrorCode.FileNoUploaded))},this)},s.prototype.isEmptyForm=function(e){e=c.isUnd(e)?!0:!!e;var t=e?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&&t&&(!this.oEditor||""===this.oEditor.getData())},s.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!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(!1)},s.prototype.getAttachmentsDownloadsForUpload=function(){return i.map(i.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},s.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},t.exports=new s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Events.js":8,"../../Common/LinkBuilder.js":10,"../../Common/NewHtmlEditorWrapper.js":11,"../../Common/Utils.js":14,"../../External/jquery.js":26,"../../External/ko.js":28,"../../External/moment.js":29,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/AppSettings.js":59,"../../Storages/WebMailAjaxRemoteStorage.js":63,"../../Storages/WebMailCacheStorage.js":64,"../../Storages/WebMailDataStorage.js":65}],76:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsFilter"),this.filter=o.observable(null),this.selectedFolderValue=o.observable(i.Values.UnuseOptionValue),this.folderSelectList=r.folderMenuForMove,this.defautOptionsAfterRender=n.defautOptionsAfterRender,a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Consts.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsFilterViewModel",s),s.prototype.clearPopup=function(){},s.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},t.exports=new s}(t)},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":65}],77:[function(e,t){!function(t){"use strict";function s(){d.call(this,"Popups","PopupsFolderCreate"),r.initOnStartOrLangChange(function(){this.sNoParentText=r.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(n.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,s=null,o=a.folderList(),i=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==a.namespace&&(t=function(e){return a.namespace!==e.fullNameRaw.substr(0,a.namespace.length)}),r.folderListOptionsBuilder([],o,[],e,null,t,s,i)},this),this.createFolder=r.createCommand(this,function(){var e=this.selectedParentValue();""===e&&1"),this.submitRequest(!0),_.delay(function(){s=o.openpgp.generateKeyPair({userId:t,numBits:n.pInt(e.keyBitLength()),passphrase:n.trim(e.password())}),s&&s.privateKeyArmored&&(i.privateKeys.importKey(s.privateKeyArmored),i.publicKeys.importKey(s.publicKeyArmored),i.store(),a.reloadOpenPgpKeys(),n.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var o=e("../../External/window.js"),i=e("../../External/ko.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Boots/RainLoopApp.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsGenerateNewOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.email.focus(!0)},t.exports=new s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":65}],80:[function(e,t){!function(t){"use strict";function s(){u.call(this,"Popups","PopupsIdentity"),this.id="",this.edit=o.observable(!1),this.owner=o.observable(!1),this.email=o.observable("").validateEmail(),this.email.focused=o.observable(!1),this.name=o.observable(""),this.name.focused=o.observable(!1),this.replyTo=o.observable("").validateSimpleEmail(),this.replyTo.focused=o.observable(!1),this.bcc=o.observable("").validateSimpleEmail(),this.bcc.focused=o.observable(!1),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.addOrEditIdentityCommand=n.createCommand(this,function(){return this.email.hasError()||this.email.hasError(""===n.trim(this.email())),this.email.hasError()?(this.owner()||this.email.focused(!0),!1):this.replyTo.hasError()?(this.replyTo.focused(!0),!1):this.bcc.hasError()?(this.bcc.focused(!0),!1):(this.submitRequest(!0),a.identityUpdate(_.bind(function(e,t){this.submitRequest(!1),i.StorageResultType.Success===e&&t?t.Result?(c.accountsAndIdentities(),this.cancelCommand()):t.ErrorCode&&this.submitError(n.getNotification(t.ErrorCode)):this.submitError(n.getNotification(i.Notification.UnknownError))},this),this.id,this.email(),this.name(),this.replyTo(),this.bcc()),!0)},function(){return!this.submitRequest()}),this.label=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"TITLE_UPDATE_IDENTITY":"TITLE_ADD_IDENTITY"))},this),this.button=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"BUTTON_UPDATE_IDENTITY":"BUTTON_ADD_IDENTITY"))},this),r.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Storages/WebMailAjaxRemoteStorage.js"),l=e("../../Storages/WebMailDataStorage.js"),c=e("../../Boots/RainLoopApp.js"),u=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsIdentityViewModel",s),s.prototype.clearPopup=function(){this.id="",this.edit(!1),this.owner(!1),this.name(""),this.email(""),this.replyTo(""),this.bcc(""),this.email.hasError(!1),this.replyTo.hasError(!1),this.bcc.hasError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(e){this.clearPopup(),e&&(this.edit(!0),this.id=e.id,this.name(e.name()),this.email(e.email()),this.replyTo(e.replyTo()),this.bcc(e.bcc()),this.owner(this.id===l.accountEmail()))},s.prototype.onFocus=function(){this.owner()||this.email.focused(!0)},t.exports=new s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":63,"../../Storages/WebMailDataStorage.js":65}],81:[function(e,t){!function(t){"use strict";function s(){a.call(this,"Popups","PopupsKeyboardShortcutsHelp"),this.sDefaultKeyScope=n.KeyState.PopupKeyboardShortcutsHelp,r.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/key.js"),n=e("../../Common/Enums.js"),r=(e("../../Common/Utils.js"),e("../../Knoin/Knoin.js")),a=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsKeyboardShortcutsHelpViewModel",s),s.prototype.onBuild=function(e){i("tab, shift+tab, left, right",n.KeyState.PopupKeyboardShortcutsHelp,o.bind(function(t,s){if(t&&s){var o=e.find(".nav.nav-tabs > li"),i=s&&("tab"===s.shortcut||"right"===s.shortcut),n=o.index(o.filter(".active"));return!i&&n>0?n--:i&&n').appendTo("body"),a.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===u.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(u.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",r.attr("class"),u.microtime()-c.now)}),l.on("keydown",function(e){e&&e.ctrlKey&&r.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&r.removeClass("rl-ctrl-key-pressed")})}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/window.js"),r=e("../External/$html.js"),a=e("../External/$window.js"),l=e("../External/$doc.js"),c=e("../Common/Globals.js"),u=e("../Common/Utils.js"),d=e("../Common/LinkBuilder.js"),p=e("../Common/Events.js"),h=e("../Storages/AppSettings.js"),m=e("../Knoin/KnoinAbstractBoot.js");i.extend(s.prototype,m.prototype),s.prototype.remote=function(){return null},s.prototype.data=function(){return null},s.prototype.setupSettings=function(){return!0},s.prototype.download=function(e){var t=null,s=null,o=n.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(s=n.document.createElement("a"),s.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&s.dispatchEvent))?(t.initEvent("click",!0,!0),s.dispatchEvent(t),!0):(c.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},s.prototype.setTitle=function(e){e=(u.isNormal(e)&&0i;i++)m=e.Result["@Collection"][i],m&&"Object/Message"===m["@Object"]&&(g=h[i],g&&g.initByJson(m)||(g=w.newInstanceFromJson(m)),g&&(S.hasNewMessageAndRemoveFromCache(g.folderFullNameRaw,g.uid)&&5>=y&&(y++,g.newForAnimation(!0)),g.deleted(!1),t?S.initMessageFlagsFromCache(g):S.storeMessageFlagsToCache(g),g.lastInCollapsedThread(s&&-1o;o++)n=t[o],n&&(a=n.FullNameRaw,r=S.getFolderFromCacheList(a),r||(r=C.newInstanceFromJson(n),r&&(S.setFolderToCacheList(a,r),S.setFolderFullNameRaw(r.fullNameHash,a))),r&&(r.collapsed(!s.isFolderExpanded(r.fullNameHash)),n.Extended&&(n.Extended.Hash&&S.setFolderHash(r.fullNameRaw,n.Extended.Hash),d.isNormal(n.Extended.MessageCount)&&r.messageCountAll(n.Extended.MessageCount),d.isNormal(n.Extended.MessageUnseenCount)&&r.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&d.isArray(l["@Collection"])&&r.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(r)));return c},s.prototype.setFolders=function(e){var t=[],s=!1,o=function(e){return""===e||c.Values.UnuseOptionValue===e||null!==S.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])&&(d.isUnd(e.Result.Namespace)||(b.namespace=e.Result.Namespace),b.threading(!!f.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(b.namespace,e.Result["@Collection"]),b.folderList(t),e.Result.SystemFolders&&""==""+f.settingsGet("SentFolder")+f.settingsGet("DraftFolder")+f.settingsGet("SpamFolder")+f.settingsGet("TrashFolder")+f.settingsGet("ArchiveFolder")+f.settingsGet("NullFolder")&&(f.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),f.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),f.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),f.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),f.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),s=!0),b.sentFolder(o(f.settingsGet("SentFolder"))),b.draftFolder(o(f.settingsGet("DraftFolder"))),b.spamFolder(o(f.settingsGet("SpamFolder"))),b.trashFolder(o(f.settingsGet("TrashFolder"))),b.archiveFolder(o(f.settingsGet("ArchiveFolder"))),s&&y.saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),g.set(a.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},s.prototype.isFolderExpanded=function(e){var t=g.get(a.ClientSideKeyName.ExpandedFolders);return n.isArray(t)&&-1!==n.indexOf(t,e)},s.prototype.setExpandedFolder=function(e,t){var s=g.get(a.ClientSideKeyName.ExpandedFolders);n.isArray(s)||(s=[]),t?(s.push(e),s=n.uniq(s)):s=n.without(s,e),g.set(a.ClientSideKeyName.ExpandedFolders,s)},s.prototype.initLayoutResizer=function(e,t,s){var o=60,n=155,r=i(e),a=i(t),l=g.get(s)||null,c=function(e){e&&(r.css({width:""+e+"px"}),a.css({left:""+e+"px"}))},u=function(e){if(e)r.resizable("disable"),c(o);else{r.resizable("enable");var t=d.pInt(g.get(s))||n;c(t>n?t:n)}},p=function(e,t){t&&t.size&&t.size.width&&(g.set(s,t.size.width),a.css({left:""+t.size.width+"px"}))};null!==l&&c(l>n?l:n),r.resizable({helper:"ui-resizable-helper",minWidth:n,maxWidth:350,handles:"e",stop:p}),h.sub("left-panel.off",function(){u(!0)}),h.sub("left-panel.on",function(){u(!1)})},s.prototype.mailToHelper=function(e){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var t={},s=null,i=e.replace(/\?.+$/,""),n=e.replace(/^[^\?]*\?/,"");return s=new v,s.parse(o.decodeURIComponent(i)),s&&s.email&&(t=d.simpleQueryParser(n),m.showScreenPopup(M,[a.ComposeType.Empty,null,[s],d.isUnd(t.subject)?null:d.pString(t.subject),d.isUnd(t.body)?null:d.plainToHtml(d.pString(t.body))])),!0}return!1},s.prototype.bootstart=function(){P.prototype.bootstart.call(this),b.populateDataOnStart();var e=this,t="",s=f.settingsGet("JsHash"),r=d.pInt(f.settingsGet("ContactsSyncInterval")),c=f.settingsGet("AllowGoogleSocial"),g=f.settingsGet("AllowFacebookSocial"),S=f.settingsGet("AllowTwitterSocial");d.initOnStartOrLangChange(function(){i.extend(!0,i.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),o.SimplePace&&(o.SimplePace.set(70),o.SimplePace.sleep()),l.leftPanelDisabled.subscribe(function(e){h.pub("left-panel."+(e?"off":"on"))}),f.settingsGet("Auth")?(this.setTitle(d.i18n("TITLES/LOADING")),this.folders(n.bind(function(t){m.hideLoading(),t?(o.$LAB&&o.crypto&&o.crypto.getRandomValues&&f.capa(a.Capa.OpenPGP)?o.$LAB.script(o.openpgp?"":p.openPgpJs()).wait(function(){o.openpgp&&(b.openpgpKeyring=new o.openpgp.Keyring,b.capaOpenPGP(!0),h.pub("openpgp.init"),e.reloadOpenPgpKeys())}):b.capaOpenPGP(!1),m.startScreens([N,R]),(c||g||S)&&e.socialUsers(!0),h.sub("interval.2m",function(){e.folderInformation("INBOX")}),h.sub("interval.2m",function(){var t=b.currentFolderFullNameRaw();"INBOX"!==t&&e.folderInformation(t)}),h.sub("interval.3m",function(){e.folderInformationMultiply()}),h.sub("interval.5m",function(){e.quota()}),h.sub("interval.10m",function(){e.folders()}),r=r>=5?r:20,r=320>=r?r:320,o.setInterval(function(){e.contactsSync()},6e4*r+5e3),n.delay(function(){e.contactsSync()},5e3),n.delay(function(){e.folderInformationMultiply(!0)},500),u.runHook("rl-start-user-screens"),h.pub("rl.bootstart-user-screens"),f.settingsGet("AccountSignMe")&&o.navigator.registerProtocolHandler&&n.delay(function(){try{o.navigator.registerProtocolHandler("mailto",o.location.protocol+"//"+o.location.host+o.location.pathname+"?mailto&to=%s",""+(f.settingsGet("Title")||"RainLoop"))}catch(t){}f.settingsGet("MailToEmail")&&e.mailToHelper(f.settingsGet("MailToEmail"))},500)):(m.startScreens([L]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens")),o.SimplePace&&o.SimplePace.set(100),l.bMobileDevice||n.defer(function(){e.initLayoutResizer("#rl-left","#rl-right",a.ClientSideKeyName.FolderListSize)})},this))):(t=d.pString(f.settingsGet("CustomLoginLink")),t?(m.routeOff(),m.setHash(p.root(),!0),m.routeOff(),n.defer(function(){o.location.href=t})):(m.hideLoading(),m.startScreens([L]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"),o.SimplePace&&o.SimplePace.set(100))),c&&(o["rl_"+s+"_google_service"]=function(){b.googleActions(!0),e.socialUsers()}),g&&(o["rl_"+s+"_facebook_service"]=function(){b.facebookActions(!0),e.socialUsers()}),S&&(o["rl_"+s+"_twitter_service"]=function(){b.twitterActions(!0),e.socialUsers()}),h.sub("interval.1m",function(){l.momentTrigger(!l.momentTrigger())}),u.runHook("rl-start-screens"),h.pub("rl.bootstart-end")},t.exports=new s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Models/AccountModel.js":37,"../Models/EmailModel.js":43,"../Models/FolderModel.js":46,"../Models/IdentityModel.js":47,"../Models/MessageModel.js":48,"../Models/OpenPgpKeyModel.js":49,"../Screens/LoginScreen.js":51,"../Screens/MailBoxScreen.js":52,"../Screens/SettingsScreen.js":53,"../Settings/SettingsAccounts.js":54,"../Settings/SettingsChangePassword.js":55,"../Settings/SettingsContacts.js":56,"../Settings/SettingsFilters.js":57,"../Settings/SettingsFolders.js":58,"../Settings/SettingsGeneral.js":59,"../Settings/SettingsIdentities.js":60,"../Settings/SettingsIdentity.js":61,"../Settings/SettingsOpenPGP.js":62,"../Settings/SettingsSecurity.js":63,"../Settings/SettingsSocial.js":64,"../Settings/SettingsThemes.js":65,"../Storages/AppSettings.js":68,"../Storages/LocalStorage.js":69,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAskViewModel.js":84,"../ViewModels/Popups/PopupsComposeViewModel.js":86,"./AbstractApp.js":2}],5:[function(e,t){!function(e){"use strict";var t={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return t.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var s,o,i,n,r,a,l,c="",u=0;for(e=t._utf8_encode(e);u>2,r=(3&s)<<4|o>>4,a=(15&o)<<2|i>>6,l=63&i,isNaN(o)?a=l=64:isNaN(i)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(r)+this._keyStr.charAt(a)+this._keyStr.charAt(l);return c},decode:function(e){var s,o,i,n,r,a,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,o=(15&r)<<4|a>>2,i=(3&a)<<6|l,c+=String.fromCharCode(s),64!==a&&(c+=String.fromCharCode(o)),64!==l&&(c+=String.fromCharCode(i));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",s=0,o=e.length,i=0;o>s;s++)i=e.charCodeAt(s),128>i?t+=String.fromCharCode(i):i>127&&2048>i?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128));return t},_utf8_decode:function(e){for(var t="",s=0,o=0,i=0,n=0;so?(t+=String.fromCharCode(o),s++):o>191&&224>o?(i=e.charCodeAt(s+1),t+=String.fromCharCode((31&o)<<6|63&i),s+=2):(i=e.charCodeAt(s+1),n=e.charCodeAt(s+2),t+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&n),s+=3);return t}};e.exports=t}(t)},{}],6:[function(e,t){!function(e){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideCookieIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t
+}(t)},{}],7:[function(e,t){!function(e){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={Prem:"PREM",TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",Filters:"FILTERS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.EmailType={Defailt:0,Facebook:1,Google:2},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,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,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t}(t)},{}],8:[function(e,t){!function(t){"use strict";function s(){this.oSubs={}}var o=e("../External/underscore.js"),i=e("./Utils.js"),n=e("./Plugins.js");s.prototype.oSubs={},s.prototype.sub=function(e,t,s){return i.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,s]),this},s.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),i.isUnd(this.oSubs[e])||o.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},t.exports=new s}(t)},{"../External/underscore.js":31,"./Plugins.js":12,"./Utils.js":14}],9:[function(e,t){!function(t){"use strict";var s={},o=e("../External/window.js"),i=e("../External/ko.js"),n=e("../External/key.js"),r=e("../External/$html.js"),a=e("../Common/Enums.js");s.now=(new o.Date).getTime(),s.momentTrigger=i.observable(!0),s.dropdownVisibility=i.observable(!1).extend({rateLimit:0}),s.tooltipTrigger=i.observable(!1).extend({rateLimit:0}),s.langChangeTrigger=i.observable(!0),s.useKeyboardShortcuts=i.observable(!0),s.iAjaxErrorCount=0,s.iTokenErrorCount=0,s.iMessageBodyCacheCount=0,s.bUnload=!1,s.sUserAgent=(o.navigator.userAgent||"").toLowerCase(),s.bIsiOSDevice=-11&&(o=o.replace(/[\/]+$/,""),o+="/p"+t),""!==s&&(o=o.replace(/[\/]+$/,""),o+="/"+encodeURI(s)),o},s.prototype.phpInfo=function(){return this.sServer+"Info"},s.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},s.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},s.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},s.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},s.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},s.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},s.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},s.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},s.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},t.exports=new s}(t)},{"../External/window.js":32,"../Storages/AppSettings.js":68,"./Utils.js":14}],11:[function(e,t){!function(t){"use strict";function s(e,t,s,o){this.editor=null,this.iBlurTimer=0,this.fOnBlur=t||null,this.fOnReady=s||null,this.fOnModeChange=o||null,this.$element=$(e),this.resize=i.throttle(i.bind(this.resize,this),100),this.init()}var o=e("../External/window.js"),i=e("../External/underscore.js"),n=e("./Globals.js"),r=e("../Storages/AppSettings.js");s.prototype.blurTrigger=function(){if(this.fOnBlur){var e=this;o.clearTimeout(this.iBlurTimer),this.iBlurTimer=o.setTimeout(function(){e.fOnBlur()},200)}},s.prototype.focusTrigger=function(){this.fOnBlur&&o.clearTimeout(this.iBlurTimer)},s.prototype.isHtml=function(){return this.editor?"wysiwyg"===this.editor.mode:!1},s.prototype.checkDirty=function(){return this.editor?this.editor.checkDirty():!1},s.prototype.resetDirty=function(){this.editor&&this.editor.resetDirty()},s.prototype.getData=function(e){return this.editor?"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain?this.editor.__plain.getRawData():e?''+this.editor.getData()+"
":this.editor.getData():""},s.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},s.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},s.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},s.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,s=r.settingsGet("Language"),i=!!r.settingsGet("AllowHtmlEditorSourceButton");i&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=o.CKEDITOR.ENTER_BR,t.shiftEnterMode=o.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[s]||"en",o.CKEDITOR.env&&(o.CKEDITOR.env.isCompatible=!0),e.editor=o.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(o.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};o.CKEDITOR?t():o.__initEditor=t}},s.prototype.focus=function(){this.editor&&this.editor.focus()},s.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},s.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},s.prototype.clear=function(e){this.setHtml("",e)},t.exports=s}(t)},{"../External/underscore.js":31,"../External/window.js":32,"../Storages/AppSettings.js":68,"./Globals.js":9}],12:[function(e,t){!function(t){"use strict";var s={__boot:null,__remote:null,__data:null},o=e("../External/underscore.js"),i=e("./Utils.js");s.oViewModelsHooks={},s.oSimpleHooks={},s.regViewModelHook=function(e,t){t&&(t.__hookName=e)},s.addHook=function(e,t){i.isFunc(t)&&(i.isArray(s.oSimpleHooks[e])||(s.oSimpleHooks[e]=[]),s.oSimpleHooks[e].push(t))},s.runHook=function(e,t){i.isArray(s.oSimpleHooks[e])&&(t=t||[],o.each(s.oSimpleHooks[e],function(e){e.apply(null,t)}))},s.mainSettingsGet=function(e){return s.__boot?s.__boot.settingsGet(e):null},s.remoteRequest=function(e,t,o,i,n,r){s.__remote&&s.__remote.defaultRequest(e,t,o,i,n,r)},s.settingsGet=function(e,t){var o=s.mainSettingsGet("Plugins");return o=o&&i.isUnd(o[e])?null:o[e],o?i.isUnd(o[t])?null:o[t]:null},t.exports=s}(t)},{"../External/underscore.js":31,"./Utils.js":14}],13:[function(e,t){!function(t){"use strict";function s(e,t,s,o,r,a){this.list=e,this.listChecked=n.computed(function(){return i.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=n.computed(function(){return 00&&-10)return i.newSelectPosition(s,r.shift),!1}})}},s.prototype.autoSelect=function(e){this.bAutoSelect=!!e},s.prototype.getItemUid=function(e){var t="",s=this.oCallbacks.onItemGetUid||null;return s&&e&&(t=s(e)),t.toString()},s.prototype.newSelectPosition=function(e,t,s){var o=0,n=10,r=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(a.EventKeyCode.Down===e||a.EventKeyCode.Up===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)i.each(u,function(t){if(!l)switch(e){case a.EventKeyCode.Up:p===t?l=!0:c=t;break;case a.EventKeyCode.Down:case a.EventKeyCode.Insert:r?(c=t,l=!0):p===t&&(r=!0)}});else if(a.EventKeyCode.Home===e||a.EventKeyCode.End===e)a.EventKeyCode.Home===e?c=u[0]:a.EventKeyCode.End===e&&(c=u[u.length-1]);else if(a.EventKeyCode.PageDown===e){for(;d>o;o++)if(p===u[o]){o+=n,o=o>d-1?d-1:o,c=u[o];break}}else if(a.EventKeyCode.PageUp===e)for(o=d;o>=0;o--)if(p===u[o]){o-=n,o=0>o?0:o,c=u[o];break}}else a.EventKeyCode.Down===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e||a.EventKeyCode.Home===e||a.EventKeyCode.PageUp===e?c=u[0]:(a.EventKeyCode.Up===e||a.EventKeyCode.End===e||a.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(a.EventKeyCode.Up===e||a.EventKeyCode.Down===e)&&p.checked(!p.checked()):(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!s||this.isListChecked()||a.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||a.EventKeyCode.Up!==e&&a.EventKeyCode.Down!==e?(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},s.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=o(this.sItemFocusedSelector,this.oContentScrollable),s=t.position(),i=this.oContentVisible.height(),n=t.outerHeight();return s&&(s.top<0||s.top+n>i)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-i+n+e),!0):!1},s.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},s.prototype.eventClickFunction=function(e,t){var s=this.getItemUid(e),o=0,i=0,n=null,r="",a=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==s&&""!==this.sLastUid&&s!==this.sLastUid)for(c=this.list(),u=e.checked(),o=0,i=c.length;i>o;o++)n=c[o],r=this.getItemUid(n),a=!1,(r===this.sLastUid||r===s)&&(a=!0),a&&(l=!l),(l||a)&&n.checked(u);this.sLastUid=""===s?"":s},s.prototype.actionClick=function(e,t){if(e){var s=!0,o=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(s=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(s=!1,""===this.sLastUid&&(this.sLastUid=o),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),s&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},s.prototype.on=function(e,t){this.oCallbacks[e]=t},t.exports=s}(t)},{"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"./Enums.js":7,"./Utils.js":14}],14:[function(e,t){!function(t){"use strict";var s={},o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/window.js"),a=e("../External/$window.js"),l=e("../External/$html.js"),c=e("../External/$div.js"),u=e("../External/$doc.js"),d=e("../External/NotificationClass.js"),p=e("./Enums.js"),h=e("./Consts.js"),m=e("./Globals.js");s.trim=o.trim,s.inArray=o.inArray,s.isArray=i.isArray,s.isFunc=i.isFunction,s.isUnd=i.isUndefined,s.isNull=i.isNull,s.emptyFunction=function(){},s.isNormal=function(e){return!s.isUnd(e)&&!s.isNull(e)},s.windowResize=i.debounce(function(e){s.isUnd(e)?a.resize():r.setTimeout(function(){a.resize()},e)},50),s.isPosNumeric=function(e,t){return s.isNormal(e)?(s.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},s.pInt=function(e,t){var o=s.isNormal(e)&&""!==e?r.parseInt(e,10):t||0;return r.isNaN(o)?t||0:o},s.pString=function(e){return s.isNormal(e)?""+e:""},s.isNonEmptyArray=function(e){return s.isArray(e)&&0i;i++)o=s[i].split("="),t[r.decodeURIComponent(o[0])]=r.decodeURIComponent(o[1]);return t},s.rsaEncode=function(e,t,o,i){if(r.crypto&&r.crypto.getRandomValues&&r.RSAKey&&t&&o&&i){var n=new r.RSAKey;if(n.setPublic(i,o),e=n.encrypt(s.fakeMd5()+":"+e+":"+s.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},s.rsaEncode.supported=!!(r.crypto&&r.crypto.getRandomValues&&r.RSAKey),s.exportPath=function(e,t,o){for(var i=null,n=e.split("."),a=o||r;n.length&&(i=n.shift());)n.length||s.isUnd(t)?a=a[i]?a[i]:a[i]={}:a[i]=t},s.pImport=function(e,t,s){e[t]=s},s.pExport=function(e,t,o){return s.isUnd(e[t])?o:e[t]},s.encodeHtml=function(e){return s.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},s.splitPlainText=function(e,t){var o="",i="",n=e,r=0,a=0;for(t=s.isUnd(t)?100:t;n.length>t;)i=n.substring(0,t),r=i.lastIndexOf(" "),a=i.lastIndexOf("\n"),-1!==a&&(r=a),-1===r&&(r=t),o+=i.substring(0,r)+"\n",n=n.substring(r+1);return o+n},s.timeOutAction=function(){var e={};return function(t,o,i){s.isUnd(e[t])&&(e[t]=0),r.clearTimeout(e[t]),e[t]=r.setTimeout(o,i)}}(),s.timeOutActionSecond=function(){var e={};return function(t,s,o){e[t]||(e[t]=r.setTimeout(function(){s(),e[t]=0},o))}}(),s.audio=function(){var e=!1;return function(t,s){if(!1===e)if(m.bIsiOSDevice)e=null;else{var o=!1,i=!1,n=r.Audio?new r.Audio:null;n&&n.canPlayType&&n.play?(o=""!==n.canPlayType('audio/mpeg; codecs="mp3"'),o||(i=""!==n.canPlayType('audio/ogg; codecs="vorbis"')),o||i?(e=n,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:s):e=null):e=null}return e}}(),s.hos=function(e,t){return e&&r.Object&&r.Object.hasOwnProperty?r.Object.hasOwnProperty.call(e,t):!1},s.i18n=function(e,t,o){var i="",n=s.isUnd(m.oI18N[e])?s.isUnd(o)?e:o:m.oI18N[e];if(!s.isUnd(t)&&!s.isNull(t))for(i in t)s.hos(t,i)&&(n=n.replace("%"+i+"%",t[i]));return n},s.i18nToNode=function(e){i.defer(function(){o(".i18n",e).each(function(){var e=o(this),t="";t=e.data("i18n-text"),t?e.text(s.i18n(t)):(t=e.data("i18n-html"),t&&e.html(s.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",s.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",s.i18n(t)))})})},s.i18nReload=function(){r.rainloopI18N&&(m.oI18N=r.rainloopI18N||{},s.i18nToNode(u),m.langChangeTrigger(!m.langChangeTrigger())),r.rainloopI18N=null},s.initOnStartOrLangChange=function(e,t,s){e&&e.call(t),s?m.langChangeTrigger.subscribe(function(){e&&e.call(t),s.call(t)}):e&&m.langChangeTrigger.subscribe(e,t)},s.inFocus=function(){return r.document.activeElement?(s.isUnd(r.document.activeElement.__inFocusCache)&&(r.document.activeElement.__inFocusCache=o(r.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!r.document.activeElement.__inFocusCache):!1},s.removeInFocus=function(){if(r.document&&r.document.activeElement&&r.document.activeElement.blur){var e=o(r.document.activeElement);e.is("input,textarea")&&r.document.activeElement.blur()}},s.removeSelection=function(){if(r&&r.getSelection){var e=r.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else r.document&&r.document.selection&&r.document.selection.empty&&r.document.selection.empty()},s.replySubjectAdd=function(e,t){e=s.trim(e.toUpperCase()),t=s.trim(t.replace(/[\s]+/," "));var o=0,i="",n=!1,r="",a=[],l=[],c="RE"===e,u="FWD"===e,d=!u;if(""!==t){for(n=!1,l=t.split(":"),o=0;o0);return e.replace(/[\s]+/," ")},s._replySubjectAdd_=function(e,t,o){var i=null,n=s.trim(t);return n=null===(i=new r.RegExp("^"+e+"[\\s]?\\:(.*)$","gi").exec(t))||s.isUnd(i[1])?null===(i=new r.RegExp("^("+e+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(t))||s.isUnd(i[1])||s.isUnd(i[2])||s.isUnd(i[3])?e+": "+t:i[1]+(s.pInt(i[2])+1)+i[3]:e+"[2]: "+i[1],n=n.replace(/[\s]+/g," "),n=(s.isUnd(o)?!0:o)?s.fixLongSubject(n):n},s._fixLongSubject_=function(e){var t=0,o=null;e=s.trim(e.replace(/[\s]+/," "));do o=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!o||s.isUnd(o[0]))&&(o=null),o&&(t=0,t+=s.isUnd(o[2])?1:0+s.pInt(o[2]),t+=s.isUnd(o[4])?1:0+s.pInt(o[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(o);return e=e.replace(/[\s]+/," ")},s.roundNumber=function(e,t){return r.Math.round(e*r.Math.pow(10,t))/r.Math.pow(10,t)},s.friendlySize=function(e){return e=s.pInt(e),e>=1073741824?s.roundNumber(e/1073741824,1)+"GB":e>=1048576?s.roundNumber(e/1048576,1)+"MB":e>=1024?s.roundNumber(e/1024,0)+"KB":e+"B"},s.log=function(e){r.console&&r.console.log&&r.console.log(e)},s.getNotification=function(e,t){return e=s.pInt(e),p.Notification.ClientViewError===e&&t?t:s.isUnd(m.oNotificationI18N[e])?"":m.oNotificationI18N[e]},s.initNotificationLanguage=function(){var e=m.oNotificationI18N||{};e[p.Notification.InvalidToken]=s.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[p.Notification.AuthError]=s.i18n("NOTIFICATIONS/AUTH_ERROR"),e[p.Notification.AccessError]=s.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[p.Notification.ConnectionError]=s.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[p.Notification.CaptchaError]=s.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[p.Notification.SocialFacebookLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[p.Notification.SocialTwitterLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[p.Notification.SocialGoogleLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[p.Notification.DomainNotAllowed]=s.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[p.Notification.AccountNotAllowed]=s.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[p.Notification.AccountTwoFactorAuthRequired]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[p.Notification.AccountTwoFactorAuthError]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[p.Notification.CouldNotSaveNewPassword]=s.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[p.Notification.CurrentPasswordIncorrect]=s.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[p.Notification.NewPasswordShort]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[p.Notification.NewPasswordWeak]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[p.Notification.NewPasswordForbidden]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[p.Notification.ContactsSyncError]=s.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[p.Notification.CantGetMessageList]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[p.Notification.CantGetMessage]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[p.Notification.CantDeleteMessage]=s.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[p.Notification.CantMoveMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[p.Notification.CantCopyMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[p.Notification.CantSaveMessage]=s.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[p.Notification.CantSendMessage]=s.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[p.Notification.InvalidRecipients]=s.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[p.Notification.CantCreateFolder]=s.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[p.Notification.CantRenameFolder]=s.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[p.Notification.CantDeleteFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[p.Notification.CantDeleteNonEmptyFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[p.Notification.CantSubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[p.Notification.CantUnsubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[p.Notification.CantSaveSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[p.Notification.CantSavePluginSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[p.Notification.DomainAlreadyExists]=s.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[p.Notification.CantInstallPackage]=s.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[p.Notification.CantDeletePackage]=s.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[p.Notification.InvalidPluginPackage]=s.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[p.Notification.UnsupportedPluginPackage]=s.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[p.Notification.LicensingServerIsUnavailable]=s.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[p.Notification.LicensingExpired]=s.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[p.Notification.LicensingBanned]=s.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[p.Notification.DemoSendMessageError]=s.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[p.Notification.AccountAlreadyExists]=s.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[p.Notification.MailServerError]=s.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[p.Notification.InvalidInputArgument]=s.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[p.Notification.UnknownNotification]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[p.Notification.UnknownError]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR")
+},s.getUploadErrorDescByCode=function(e){var t="";switch(s.pInt(e)){case p.UploadErrorCode.FileIsTooBig:t=s.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case p.UploadErrorCode.FilePartiallyUploaded:t=s.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case p.UploadErrorCode.FileNoUploaded:t=s.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case p.UploadErrorCode.MissingTempFolder:t=s.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case p.UploadErrorCode.FileOnSaveingError:t=s.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case p.UploadErrorCode.FileType:t=s.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=s.i18n("UPLOAD/ERROR_UNKNOWN")}return t},s.delegateRun=function(e,t,o,n){e&&e[t]&&(n=s.pInt(n),0>=n?e[t].apply(e,s.isArray(o)?o:[]):i.delay(function(){e[t].apply(e,s.isArray(o)?o:[])},n))},s.killCtrlAandS=function(e){if(e=e||r.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,s=e.keyCode||e.which;if(s===p.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;s===p.EventKeyCode.A&&(r.getSelection?r.getSelection().removeAllRanges():r.document.selection&&r.document.selection.clear&&r.document.selection.clear(),e.preventDefault())}},s.createCommand=function(e,t,o){var i=t?function(){return i&&i.canExecute&&i.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return i.enabled=n.observable(!0),o=s.isUnd(o)?!0:o,i.canExecute=n.computed(s.isFunc(o)?function(){return i.enabled()&&o.call(e)}:function(){return i.enabled()&&!!o}),i},s.initDataConstructorBySettings=function(e){e.editorDefaultType=n.observable(p.EditorDefaultType.Html),e.showImages=n.observable(!1),e.interfaceAnimation=n.observable(p.InterfaceAnimation.Full),e.contactsAutosave=n.observable(!1),m.sAnimationType=p.InterfaceAnimation.Full,e.capaThemes=n.observable(!1),e.allowLanguagesOnSettings=n.observable(!0),e.allowLanguagesOnLogin=n.observable(!0),e.useLocalProxyForExternalImages=n.observable(!1),e.desktopNotifications=n.observable(!1),e.useThreads=n.observable(!0),e.replySameFolder=n.observable(!0),e.useCheckboxesInList=n.observable(!0),e.layout=n.observable(p.Layout.SidePreview),e.usePreviewPane=n.computed(function(){return p.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(m.bMobileDevice||e===p.InterfaceAnimation.None)l.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),m.sAnimationType=p.InterfaceAnimation.None;else switch(e){case p.InterfaceAnimation.Full:l.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),m.sAnimationType=e;break;case p.InterfaceAnimation.Normal:l.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),m.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=n.computed(function(){e.desktopNotifications();var t=p.DesktopNotifications.NotSupported;if(d&&d.permission)switch(d.permission.toLowerCase()){case"granted":t=p.DesktopNotifications.Allowed;break;case"denied":t=p.DesktopNotifications.Denied;break;case"default":t=p.DesktopNotifications.NotAllowed}else r.webkitNotifications&&r.webkitNotifications.checkPermission&&(t=r.webkitNotifications.checkPermission());return t}),e.useDesktopNotifications=n.computed({read:function(){return e.desktopNotifications()&&p.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var s=e.desktopNotificationsPermisions();p.DesktopNotifications.Allowed===s?e.desktopNotifications(!0):p.DesktopNotifications.NotAllowed===s?d.requestPermission(function(){e.desktopNotifications.valueHasMutated(),p.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated()}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=n.observable(""),e.languages=n.observableArray([]),e.mainLanguage=n.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(o,"hours")?i:t.format("L")===o.format("L")?s.i18n("MESSAGE_LIST/TODAY_AT",{TIME:o.format("LT")}):t.clone().subtract("days",1).format("L")===o.format("L")?s.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:o.format("LT")}):o.format(t.year()===o.year()?"D MMM.":"LL")},e)},s.initBlockquoteSwitcher=function(e){if(e){var t=o("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===o(this).parent().closest("blockquote",e).length});t&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),o('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),s.windowResize()}).after("
").before("
"))})}},s.removeBlockquoteSwitcher=function(e){e&&(o(e).find("blockquote.rl-bq-switcher").each(function(){o(this).removeClass("rl-bq-switcher hidden-bq")}),o(e).find(".rlBlockquoteSwitcher").each(function(){o(this).remove()}))},s.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},s.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=s.trim(e.substring(0,e.length-7))),s.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},s.quoteName=function(e){return e.replace(/["]/g,'\\"')},s.microtime=function(){return(new Date).getTime()},s.convertLangName=function(e,t){return s.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},s.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=s.isUnd(e)?32:s.pInt(e);t.length>>32-t}function s(e,t){var s,o,i,n,r;return i=2147483648&e,n=2147483648&t,s=1073741824&e,o=1073741824&t,r=(1073741823&e)+(1073741823&t),s&o?2147483648^r^i^n:s|o?1073741824&r?3221225472^r^i^n:1073741824^r^i^n:r^i^n}function o(e,t,s){return e&t|~e&s}function i(e,t,s){return e&s|t&~s}function n(e,t,s){return e^t^s}function r(e,t,s){return t^(e|~s)}function a(e,i,n,r,a,l,c){return e=s(e,s(s(o(i,n,r),a),c)),s(t(e,l),i)}function l(e,o,n,r,a,l,c){return e=s(e,s(s(i(o,n,r),a),c)),s(t(e,l),o)}function c(e,o,i,r,a,l,c){return e=s(e,s(s(n(o,i,r),a),c)),s(t(e,l),o)}function u(e,o,i,n,a,l,c){return e=s(e,s(s(r(o,i,n),a),c)),s(t(e,l),o)}function d(e){for(var t,s=e.length,o=s+8,i=(o-o%64)/64,n=16*(i+1),r=Array(n-1),a=0,l=0;s>l;)t=(l-l%4)/4,a=l%4*8,r[t]=r[t]|e.charCodeAt(l)<>>29,r}function p(e){var t,s,o="",i="";for(s=0;3>=s;s++)t=e>>>8*s&255,i="0"+t.toString(16),o+=i.substr(i.length-2,2);return o}function h(e){e=e.replace(/rn/g,"n");for(var t="",s=0;so?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128))}return t}var m,g,f,b,S,y,v,C,w,E=Array(),A=7,j=12,T=17,F=22,M=5,N=9,R=14,L=20,P=4,I=11,x=16,k=23,D=6,U=10,O=15,_=21;for(e=h(e),E=d(e),y=1732584193,v=4023233417,C=2562383102,w=271733878,m=0;m/g,">").replace(/")},s.draggeblePlace=function(){return o('
').appendTo("#rl-hidden")},s.defautOptionsAfterRender=function(e,t){t&&!s.isUnd(t.disabled)&&e&&o(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},s.windowPopupKnockout=function(e,t,i,a){var l=null,c=r.open(""),u="__OpenerApplyBindingsUid"+s.fakeMd5()+"__",d=o("#"+t);r[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=o(c.document.body);o("#rl-content",t).html(d.html()),o("html",c.document).addClass("external "+o("html").attr("class")),s.i18nToNode(t),e&&o("#rl-content",t)[0]&&n.applyBindings(e,o("#rl-content",t)[0]),r[u]=null,a(c)}},c.document.open(),c.document.write(''+s.encodeHtml(i)+''),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},s.settingsSaveHelperFunction=function(e,t,o,n){return o=o||null,n=s.isUnd(n)?1e3:s.pInt(n),function(s,r,a,l,c){t.call(o,r&&r.Result?p.SaveSettingsStep.TrueResult:p.SaveSettingsStep.FalseResult),e&&e.call(o,s,r,a,l,c),i.delay(function(){t.call(o,p.SaveSettingsStep.Idle)},n)}},s.settingsSaveHelperSimpleFunction=function(e,t){return s.settingsSaveHelperFunction(null,e,t,1e3)},s.htmlToPlain=function(e){var t=0,s=0,i=0,n=0,r=0,a="",l=function(e){for(var t=100,s="",o="",i=e,n=0,r=0;i.length>t;)o=i.substring(0,t),n=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(n=r),-1===n&&(n=t),s+=o.substring(0,n)+"\n",i=i.substring(n+1);return s+i},u=function(e){return e=l(o.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+o.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},h=function(){return arguments&&1/g,">"):""},m=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/
]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/
]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/
]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,m).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),a=c.html(a).text(),a=a.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,r=100;r>0&&(r--,s=a.indexOf("__bq__start__",t),s>-1);)i=a.indexOf("__bq__start__",s+5),n=a.indexOf("__bq__end__",s+5),(-1===i||i>n)&&n>s?(a=a.substring(0,s)+u(a.substring(s+13,n))+a.substring(n+11),t=0):t=i>-1&&n>i?i-1:0;return a=a.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var o=!1,i=!0,n=!0,r=[],a="",l=0,c=e.split("\n");do{for(i=!1,r=[],l=0;l"===a.substr(0,1),n&&!o?(i=!0,o=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&o?(o=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(n&&o?a.substr(1):a);o&&(o=!1,r.push("~~~/blockquote~~~")),c=r}while(i);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"
").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t?s.linkify(e):e},r.rainloop_Utils_htmlToPlain=s.htmlToPlain,r.rainloop_Utils_plainToHtml=s.plainToHtml,s.linkify=function(e){return o.fn&&o.fn.linkify&&(e=c.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},s.resizeAndCrop=function(e,t,s){var o=new r.Image;o.onload=function(){var e=[0,0],o=r.document.createElement("canvas"),i=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],i.fillStyle="#fff",i.fillRect(0,0,t,t),i.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),s(o.toDataURL("image/jpeg"))},o.src=e},s.folderListOptionsBuilder=function(e,t,o,i,n,a,l,c,u,d){var h=null,m=!1,g=0,f=0,b="Â Â Â ",S=[];for(u=s.isNormal(u)?u:0
g;g++)S.push({id:i[g][0],name:i[g][1],system:!1,seporator:!1,disabled:!1});for(m=!0,g=0,f=e.length;f>g;g++)h=e[g],(l?l.call(null,h):!0)&&(m&&0g;g++)h=t[g],(h.subScribed()||!h.existen)&&(l?l.call(null,h):!0)&&(p.FolderType.User===h.type()||!u||01||c>0&&l>c){for(l>c?(u(c),o=c,i=c):((3>=l||l>=c-2)&&(n+=2),u(l),o=l,i=l);n>0;)if(o-=1,i+=1,o>0&&(u(o,!1),n--),c>=i)u(i,!0),n--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(r.Math.round((o-1)/2),!1,"..."),c-2===i?u(c-1,!0):c-2>i&&u(r.Math.round((c+i)/2),!0,"..."),o>1&&u(1,!1),c>i&&u(c,!0)}return a}},s.selectElement=function(e){if(r.getSelection){var t=r.getSelection();t.removeAllRanges();var s=r.document.createRange();s.selectNodeContents(e),t.addRange(s)}else if(r.document.selection){var o=r.document.body.createTextRange();o.moveToElementText(e),o.select()}},s.detectDropdownVisibility=i.debounce(function(){m.dropdownVisibility(!!i.find(m.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){o(".checkAutocomplete").trigger("change")};e?i.delay(t,100):t()},t.exports=s}(t)},{"../External/$div.js":15,"../External/$doc.js":16,"../External/$html.js":17,"../External/$window.js":18,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"./Consts.js":6,"./Enums.js":7,"./Globals.js":9}],15:[function(e,t){"use strict";t.exports=e("./jquery.js")("")},{"./jquery.js":26}],16:[function(e,t){"use strict";t.exports=e("./jquery.js")(window.document)},{"./jquery.js":26}],17:[function(e,t){"use strict";t.exports=e("./jquery.js")("html")},{"./jquery.js":26}],18:[function(e,t){"use strict";t.exports=e("./jquery.js")(window)},{"./jquery.js":26}],19:[function(e,t){"use strict";t.exports=e("./window.js").rainloopAppData||{}},{"./window.js":32}],20:[function(e,t){"use strict";t.exports=JSON},{}],21:[function(e,t){"use strict";t.exports=Jua},{}],22:[function(e,t){"use strict";var s=e("./window.js");t.exports=s.Notification&&s.Notification.requestPermission?s.Notification:null},{"./window.js":32}],23:[function(e,t){"use strict";t.exports=crossroads},{}],24:[function(e,t){"use strict";t.exports=hasher},{}],25:[function(e,t){"use strict";t.exports=ifvisible},{}],26:[function(e,t){"use strict";t.exports=$},{}],27:[function(e,t){"use strict";t.exports=key},{}],28:[function(e,t){!function(t,s){"use strict";var o=e("./window.js"),i=e("./underscore.js"),n=e("./jquery.js"),r=e("./$window.js"),a=e("./$doc.js");s.bindingHandlers.tooltip={init:function(t,o){var i=e("../Common/Globals.js"),r=e("../Common/Utils.js");if(!i.bMobileDevice){var a=n(t),l=a.data("tooltip-class")||"",c=a.data("tooltip-placement")||"top";a.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return a.is(".disabled")||i.dropdownVisibility()?"":''+r.i18n(s.utils.unwrapObservable(o()))+""}}).click(function(){a.tooltip("hide")}),i.tooltipTrigger.subscribe(function(){a.tooltip("hide")})}}},s.bindingHandlers.tooltip2={init:function(t,s){var o=e("../Common/Globals.js"),i=n(t),r=i.data("tooltip-class")||"",a=i.data("tooltip-placement")||"top";i.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:a,title:function(){return i.is(".disabled")||o.dropdownVisibility()?"":''+s()()+""}}).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})}},s.bindingHandlers.tooltip3={init:function(t){var s=n(t),o=e("../Common/Globals.js");s.tooltip({container:"body",trigger:"hover manual",title:function(){return s.data("tooltip3-data")||""}}),a.click(function(){s.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){s.tooltip("hide")})},update:function(e,t){var o=s.utils.unwrapObservable(t());""===o?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",o).tooltip("show")}},s.bindingHandlers.registrateBootstrapDropdown={init:function(t){var s=e("../Common/Globals.js");s.aBootstrapDropdowns.push(n(t))}},s.bindingHandlers.openDropdownTrigger={update:function(t,o){if(s.utils.unwrapObservable(o())){var i=n(t),r=e("../Common/Utils.js");i.hasClass("open")||(i.find(".dropdown-toggle").dropdown("toggle"),r.detectDropdownVisibility()),o()(!1)}}},s.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},s.bindingHandlers.popover={init:function(e,t){n(e).popover(s.utils.unwrapObservable(t()))}},s.bindingHandlers.csstext={init:function(t,o){var i=e("../Common/Utils.js");t&&t.styleSheet&&!i.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(o()):n(t).text(s.utils.unwrapObservable(o()))},update:function(t,o){var i=e("../Common/Utils.js");t&&t.styleSheet&&!i.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(o()):n(t).text(s.utils.unwrapObservable(o()))}},s.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},s.bindingHandlers.onEnter={init:function(e,t,s,i){n(e).on("keypress",function(s){s&&13===o.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(i))})}},s.bindingHandlers.onEsc={init:function(e,t,s,i){n(e).on("keypress",function(s){s&&27===o.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(i))})}},s.bindingHandlers.clickOnTrue={update:function(e,t){s.utils.unwrapObservable(t())&&n(e).click()}},s.bindingHandlers.modal={init:function(t,o){var i=e("../Common/Globals.js"),r=e("../Common/Utils.js");n(t).toggleClass("fade",!i.bMobileDevice).modal({keyboard:!1,show:s.utils.unwrapObservable(o())}).on("shown",function(){r.windowResize()}).find(".close").click(function(){o()(!1)})},update:function(e,t){n(e).modal(s.utils.unwrapObservable(t())?"show":"hide")}},s.bindingHandlers.i18nInit={init:function(t){var s=e("../Common/Utils.js");s.i18nToNode(t)}},s.bindingHandlers.i18nUpdate={update:function(t,o){var i=e("../Common/Utils.js");s.utils.unwrapObservable(o()),i.i18nToNode(t)}},s.bindingHandlers.link={update:function(e,t){n(e).attr("href",s.utils.unwrapObservable(t()))}},s.bindingHandlers.title={update:function(e,t){n(e).attr("title",s.utils.unwrapObservable(t()))}},s.bindingHandlers.textF={init:function(e,t){n(e).text(s.utils.unwrapObservable(t()))}},s.bindingHandlers.initDom={init:function(e,t){t()(e)}},s.bindingHandlers.initResizeTrigger={init:function(e,t){var o=s.utils.unwrapObservable(t());n(e).css({height:o[1],"min-height":o[1]})},update:function(t,o){var i=e("../Common/Utils.js"),a=s.utils.unwrapObservable(o()),l=i.pInt(a[1]),c=0,u=n(t).offset().top;u>0&&(u+=i.pInt(a[2]),c=r.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},s.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(s.utils.unwrapObservable(t())).show()}},s.bindingHandlers.draggable={init:function(t,i,r){var a=e("../Common/Globals.js"),l=e("../Common/Utils.js");if(!a.bMobileDevice){var c=100,u=3,d=r(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){n(p).each(function(){var t=null,s=null,i=n(this),r=i.offset(),a=r.top+i.height();o.clearInterval(i.data("timerScroll")),i.data("timerScroll",!1),e.pageX>=r.left&&e.pageX<=r.left+i.width()&&(e.pageY>=a-c&&e.pageY<=a&&(t=function(){i.scrollTop(i.scrollTop()+u),l.windowResize()},i.data("timerScroll",o.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+c&&(s=function(){i.scrollTop(i.scrollTop()-u),l.windowResize()},i.data("timerScroll",o.setInterval(s,10)),s()))})},h.stop=function(){n(p).each(function(){o.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return i()(e&&e.target?s.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},s.bindingHandlers.droppable={init:function(t,s,o){var i=e("../Common/Globals.js");if(!i.bMobileDevice){var r=s(),a=o(),l=a&&a.droppableOver?a.droppableOver:null,c=a&&a.droppableOut?a.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};r&&(u.drop=function(e,t){r(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},s.bindingHandlers.nano={init:function(t){var s=e("../Common/Globals.js");s.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},s.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append(' ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var o=s.utils.unwrapObservable(t()),i=n(e);if("custom"===i.data("save-trigger-type"))switch(o.toString()){case"1":i.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":i.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":i.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:i.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(o.toString()){case"1":i.addClass("success").removeClass("error");break;case"0":i.addClass("error").removeClass("success");break;case"-2":break;default:i.removeClass("error success")}}},s.bindingHandlers.emailsTags={init:function(t,s,o){var r=e("../Common/Utils.js"),a=e("../Models/EmailModel.js"),l=n(t),c=s(),u=o(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return i.map(e,function(e){var t=r.trim(e),s=null;return""!==t?(s=new a,s.mailsoParse(t),s.clearDuplicateName(),[s.toLine(!1),s]):[t,null]})},change:i.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,o){var i=n(e),r=o(),a=r.emailsTagsFilter||null,l=s.utils.unwrapObservable(t());i.data("EmailsTagsValue")!==l&&(i.val(l),i.data("EmailsTagsValue",l),i.inputosaurus("refresh")),a&&s.utils.unwrapObservable(a)&&i.inputosaurus("focus")}},s.bindingHandlers.contactTags={init:function(t,s,o){var r=e("../Common/Utils.js"),a=e("../Models/ContactTagModel.js"),l=n(t),c=s(),u=o(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return i.map(e,function(e){var t=r.trim(e),s=null;return""!==t?(s=new a,s.name(t),[s.toLine(!1),s]):[t,null]})},change:i.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,o){var i=n(e),r=o(),a=r.contactTagsFilter||null,l=s.utils.unwrapObservable(t());i.data("ContactTagsValue")!==l&&(i.val(l),i.data("ContactTagsValue",l),i.inputosaurus("refresh")),a&&s.utils.unwrapObservable(a)&&i.inputosaurus("focus")}},s.bindingHandlers.command={init:function(e,t,o,i){var r=n(e),a=t();if(!a||!a.enabled||!a.canExecute)throw new Error("You are not using command function");r.addClass("command"),s.bindingHandlers[r.is("form")?"submit":"click"].init.apply(i,arguments)},update:function(e,t){var s=!0,o=n(e),i=t();s=i.enabled(),o.toggleClass("command-not-enabled",!s),s&&(s=i.canExecute(),o.toggleClass("command-can-not-be-execute",!s)),o.toggleClass("command-disabled disable disabled",!s).toggleClass("no-disabled",!!s),(o.is("input")||o.is("button"))&&o.prop("disabled",!s)}},s.extenders.trimmer=function(t){var o=e("../Common/Utils.js"),i=s.computed({read:t,write:function(e){t(o.trim(e.toString()))},owner:this});return i(t()),i},s.extenders.posInterer=function(t,o){var i=e("../Common/Utils.js"),n=s.computed({read:t,write:function(e){var s=i.pInt(e.toString(),o);0>=s&&(s=o),s===t()&&""+s!=""+e&&t(s+1),t(s)}});return n(t()),n},s.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},s.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},s.extenders.falseTimeout=function(t,s){var i=e("../Common/Utils.js");return t.iTimeout=0,t.subscribe(function(e){e&&(o.clearTimeout(t.iTimeout),t.iTimeout=o.setTimeout(function(){t(!1),t.iTimeout=0},i.pInt(s)))}),t},s.observable.fn.validateNone=function(){return this.hasError=s.observable(!1),this},s.observable.fn.validateEmail=function(){var t=e("../Common/Utils.js");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateSimpleEmail=function(){var t=e("../Common/Utils.js");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateFunc=function(t){var o=e("../Common/Utils.js");return this.hasFuncError=s.observable(!1),o.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=s}(t,ko)},{"../Common/Globals.js":9,"../Common/Utils.js":14,"../Models/ContactTagModel.js":42,"../Models/EmailModel.js":43,"./$doc.js":16,"./$window.js":18,"./jquery.js":26,"./underscore.js":31,"./window.js":32}],29:[function(e,t){"use strict";t.exports=moment},{}],30:[function(e,t){"use strict";t.exports=ssm},{}],31:[function(e,t){"use strict";t.exports=_},{}],32:[function(e,t){"use strict";t.exports=window},{}],33:[function(e,t){!function(t){"use strict";function s(){this.sDefaultScreenName="",this.oScreens={},this.oCurrentScreen=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/hasher.js"),a=e("../External/crossroads.js"),l=e("../External/$html.js"),c=e("../Common/Globals.js"),u=e("../Common/Plugins.js"),d=e("../Common/Utils.js"),p=e("../Knoin/KnoinAbstractViewModel.js");
+s.prototype.sDefaultScreenName="",s.prototype.oScreens={},s.prototype.oCurrentScreen=null,s.prototype.hideLoading=function(){o("#rl-loading").hide()},s.prototype.constructorEnd=function(e){d.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},s.prototype.extendAsViewModel=function(e,t,s){t&&(s||(s=p),t.__name=e,u.regViewModelHook(e,t),i.extend(t.prototype,s.prototype))},s.prototype.addSettingsViewModel=function(e,t,s,o,i){e.__rlSettingsData={Label:s,Template:t,Route:o,IsDefault:!!i},c.aViewModels.settings.push(e)},s.prototype.removeSettingsViewModel=function(e){c.aViewModels["settings-removed"].push(e)},s.prototype.disableSettingsViewModel=function(e){c.aViewModels["settings-disabled"].push(e)},s.prototype.routeOff=function(){r.changed.active=!1},s.prototype.routeOn=function(){r.changed.active=!0},s.prototype.screen=function(e){return""===e||d.isUnd(this.oScreens[e])?null:this.oScreens[e]},s.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var s=this,r=new e(t),a=r.viewModelPosition(),l=o("#rl-content #rl-"+a.toLowerCase()),p=null;e.__builded=!0,e.__vm=r,r.viewModelName=e.__name,l&&1===l.length?(p=o("").addClass("rl-view-model").addClass("RL-"+r.viewModelTemplate()).hide(),p.appendTo(l),r.viewModelDom=p,e.__dom=p,"Popups"===a&&(r.cancelCommand=r.closeCommand=d.createCommand(r,function(){s.hideScreenPopup(e)}),r.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),c.popupVisibilityNames.push(this.viewModelName),r.viewModelDom.css("z-index",3e3+c.popupVisibilityNames().length+10),d.delegateRun(this,"onFocus",[],500)):(d.delegateRun(this,"onHide"),this.restoreKeyScope(),c.popupVisibilityNames.remove(this.viewModelName),r.viewModelDom.css("z-index",2e3),c.tooltipTrigger(!c.tooltipTrigger()),i.delay(function(){t.viewModelDom.hide()},300))},r)),u.runHook("view-model-pre-build",[e.__name,r,p]),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:r.viewModelTemplate()}}},r),d.delegateRun(r,"onBuild",[p]),r&&"Popups"===a&&r.registerPopupKeyDown(),u.runHook("view-model-post-build",[e.__name,r,p])):d.log("Cannot find view model position: "+a)}return e?e.__vm:null},s.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),u.runHook("view-model-on-hide",[e.__name,e.__vm]))},s.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),d.delegateRun(e.__vm,"onShow",t||[]),u.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},s.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},s.prototype.screenOnRoute=function(e,t){var s=this,o=null,n=null;""===d.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,d.isNonEmptyArray(o.viewModels())&&i.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),d.delegateRun(o,"onBuild")),i.defer(function(){s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onHide"),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),d.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=o,s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onShow"),u.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),d.delegateRun(e.__vm,"onShow"),d.delegateRun(e.__vm,"onFocus",[],200),u.runHook("view-model-on-show",[e.__name,e.__vm]))},s)),n=o.__cross(),n&&n.parse(t)})))},s.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),i.each(e,function(e){var t=new e,s=t?t.screenName():"";t&&""!==s&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=s),this.oScreens[s]=t)},this),i.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),u.runHook("screen-pre-start",[e.screenName(),e]),d.delegateRun(e,"onStart"),u.runHook("screen-post-start",[e.screenName(),e]))},this);var t=a.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),i.delay(function(){l.removeClass("rl-started-trigger").addClass("rl-started")},50)},s.prototype.setHash=function(e,t,s){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,s=d.isUnd(s)?!1:!!s,(d.isUnd(t)?1:!t)?(r.changed.active=!0,r[s?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[s?"replaceHash":"setHash"](e),r.changed.active=!0)},t.exports=new s}(t)},{"../Common/Globals.js":9,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/$html.js":17,"../External/crossroads.js":23,"../External/hasher.js":24,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/KnoinAbstractViewModel.js":36}],34:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t)},{}],35:[function(e,t){!function(t){"use strict";function s(e,t){this.sScreenName=e,this.aViewModels=i.isArray(t)?t:[]}var o=e("../External/crossroads.js"),i=e("../Common/Utils.js");s.prototype.oCross=null,s.prototype.sScreenName="",s.prototype.aViewModels=[],s.prototype.viewModels=function(){return this.aViewModels},s.prototype.screenName=function(){return this.sScreenName},s.prototype.routes=function(){return null},s.prototype.__cross=function(){return this.oCross},s.prototype.__start=function(){var e=this.routes(),t=null,s=null;i.isNonEmptyArray(e)&&(s=_.bind(this.onRoute||i.emptyFunction,this),t=o.create(),_.each(e,function(e){t.addRoute(e[0],s).rules=e[1]}),this.oCross=t)},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/crossroads.js":23}],36:[function(e,t){!function(t){"use strict";function s(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=a.pString(e),this.sTemplate=a.pString(t),this.sDefaultKeyScope=n.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=o.observable(!1),this.modalVisibility=o.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}var o=e("../External/ko.js"),i=e("../External/$window.js"),n=e("../Common/Enums.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js");s.prototype.sPosition="",s.prototype.sTemplate="",s.prototype.viewModelName="",s.prototype.viewModelDom=null,s.prototype.viewModelTemplate=function(){return this.sTemplate},s.prototype.viewModelPosition=function(){return this.sPosition},s.prototype.cancelCommand=function(){},s.prototype.closeCommand=function(){},s.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=r.keyScope(),r.keyScope(this.sDefaultKeyScope)},s.prototype.restoreKeyScope=function(){r.keyScope(this.sCurrentKeyScope)},s.prototype.registerPopupKeyDown=function(){var e=this;i.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&n.EventKeyCode.Esc===t.keyCode)return a.delegateRun(e,"cancelCommand"),!1;if(n.EventKeyCode.Backspace===t.keyCode&&!a.inFocus())return!1}return!0})},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$window.js":18,"../External/ko.js":28}],37:[function(e,t){!function(t){"use strict";function s(e,t){this.email=e,this.deleteAccess=o.observable(!1),this.canBeDalete=o.observable(t)}var o=e("../External/ko.js");s.prototype.email="",s.prototype.changeAccountLink=function(){return e("../Common/LinkBuilder.js").change(this.email)},t.exports=s}(t)},{"../Common/LinkBuilder.js":10,"../External/ko.js":28}],38:[function(e,t){!function(t){"use strict";function s(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var o=e("../External/window.js"),i=e("../Common/Globals.js"),n=e("../Common/Utils.js"),r=e("../Common/LinkBuilder.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.prototype.mimeType="",s.prototype.fileName="",s.prototype.estimatedSize=0,s.prototype.friendlySize="",s.prototype.isInline=!1,s.prototype.isLinked=!1,s.prototype.cid="",s.prototype.cidWithOutTags="",s.prototype.contentLocation="",s.prototype.download="",s.prototype.folder="",s.prototype.uid="",s.prototype.mimeIndex="",s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},s.prototype.isImage=function(){return-1,]+)>?,? ?/g,s=t.exec(e);s?(this.name=s[1]||"",this.email=s[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=i.trim(e.Name),this.email=i.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},s.prototype.toLine=function(e,t,s){var o="";return""!==this.email&&(t=i.isUnd(t)?!1:!!t,s=i.isUnd(s)?!1:!!s,e&&""!==this.name?o=t?'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(this.name)+"":s?i.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=i.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(o)+""+i.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",s&&(o=i.encodeHtml(o))):t&&(o=''+i.encodeHtml(this.email)+""))),o},s.prototype.mailsoParse=function(e){if(e=i.trim(e),""===e)return!1;for(var t=function(e,t,s){e+="";var o=e.length;return 0>t&&(t+=o),o="undefined"==typeof s?o:0>s?s+o:s+t,t>=e.length||0>t||t>o?!1:e.slice(t,o)},s=function(e,t,s,o){return 0>s&&(s+=e.length),o=void 0!==o?o:e.length,0>o&&(o=o+e.length-s),e.slice(0,s)+t.substr(0,o)+t.slice(o)+e.slice(s+o)},o="",n="",r="",a=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===o.length&&(o=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":a||l||c||(c=!0,d=h);break;case")":c&&(p=h,r=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===r.length&&(o=e.replace(n,"")),n=i.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=i.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=i.trim(r).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/,"$1"),r=r.replace(/\\\\(.)/,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},s.prototype.inputoTagLine=function(){return 00){if(r.FolderType.Draft===s)return""+e;if(t>0&&r.FolderType.Trash!==s&&r.FolderType.Archive!==s&&r.FolderType.SentItems!==s)return""+t}return""},this),this.canBeDeleted=i.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=i.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){l.timeOutAction("folder-list-folder-visibility-change",function(){n.trigger("folder-list-folder-visibility-change")},100)}),this.localName=i.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case r.FolderType.Inbox:t=l.i18n("FOLDER_LIST/INBOX_NAME");break;case r.FolderType.SentItems:t=l.i18n("FOLDER_LIST/SENT_NAME");break;case r.FolderType.Draft:t=l.i18n("FOLDER_LIST/DRAFTS_NAME");break;case r.FolderType.Spam:t=l.i18n("FOLDER_LIST/SPAM_NAME");break;case r.FolderType.Trash:t=l.i18n("FOLDER_LIST/TRASH_NAME");break;case r.FolderType.Archive:t=l.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=i.computed(function(){a.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case r.FolderType.Inbox:e="("+l.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case r.FolderType.SentItems:e="("+l.i18n("FOLDER_LIST/SENT_NAME")+")";break;case r.FolderType.Draft:e="("+l.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case r.FolderType.Spam:e="("+l.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case r.FolderType.Trash:e="("+l.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case r.FolderType.Archive:e="("+l.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+s+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=i.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=i.computed(function(){return 0"},s.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},s.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+i.quoteName(e)+'" <'+this.email()+">"},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28}],48:[function(e,t){!function(t){"use strict";function s(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=r.observable(""),this.subjectPrefix=r.observable(""),this.subjectSuffix=r.observable(""),this.size=r.observable(0),this.dateTimeStampInUTC=r.observable(0),this.priority=r.observable(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=r.observable(""),this.fromClearEmailString=r.observable(""),this.toEmailsString=r.observable(""),this.toClearEmailsString=r.observable(""),this.senderEmailsString=r.observable(""),this.senderClearEmailsString=r.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=r.observable(!1),this.deleted=r.observable(!1),this.unseen=r.observable(!1),this.flagged=r.observable(!1),this.answered=r.observable(!1),this.forwarded=r.observable(!1),this.isReadReceipt=r.observable(!1),this.focused=r.observable(!1),this.selected=r.observable(!1),this.checked=r.observable(!1),this.hasAttachments=r.observable(!1),this.attachmentsMainType=r.observable(""),this.moment=r.observable(a(a.unix(0))),this.attachmentIconClass=r.computed(function(){var e="";if(this.hasAttachments())switch(e="icon-attachment",this.attachmentsMainType()){case"image":e="icon-image";break;case"archive":e="icon-file-zip";break;case"doc":e="icon-file-text"}return e},this),this.fullFormatDateValue=r.computed(function(){return s.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=d.createMomentDate(this),this.momentShortDate=d.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=a().unix();this.moment(a.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=r.observable(!1),this.hasImages=r.observable(!1),this.attachments=r.observableArray([]),this.isPgpSigned=r.observable(!1),this.isPgpEncrypted=r.observable(!1),this.pgpSignedVerifyStatus=r.observable(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser=r.observable(""),this.priority=r.observable(u.MessagePriority.Normal),this.readReceipt=r.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=r.observable(0),this.threads=r.observableArray([]),this.threadsLen=r.observable(0),this.hasUnseenSubMessage=r.observable(!1),this.hasFlaggedSubMessage=r.observable(!1),this.lastInCollapsedThread=r.observable(!1),this.lastInCollapsedThreadLoading=r.observable(!1),this.threadsLenResult=r.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$window.js"),c=e("../External/$div.js"),u=e("../Common/Enums.js"),d=e("../Common/Utils.js"),p=e("../Common/LinkBuilder.js"),h=e("./EmailModel.js"),m=e("./AttachmentModel.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.calculateFullFromatDateValue=function(e){return e>0?a.unix(e).format("LLL"):""},s.emailsToLine=function(e,t,s){var o=[],i=0,n=0;if(d.isNonEmptyArray(e))for(i=0,n=e.length;n>i;i++)o.push(e[i].toLine(t,s));return o.join(", ")},s.emailsToLineClear=function(e){var t=[],s=0,o=0;if(d.isNonEmptyArray(e))for(s=0,o=e.length;o>s;s++)e[s]&&e[s].email&&""!==e[s].name&&t.push(e[s].email);return t.join(", ")},s.initEmailsFromJson=function(e){var t=0,s=0,o=null,i=[];
+if(d.isNonEmptyArray(e))for(t=0,s=e.length;s>t;t++)o=h.newInstanceFromJson(e[t]),o&&i.push(o);return i},s.replyHelper=function(e,t,s){if(e&&0o;o++)d.isUnd(t[e[o].email])&&(t[e[o].email]=!0,s.push(e[o]))},s.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(u.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},s.prototype.computeSenderEmail=function(){var t=e("../Storages/WebMailDataStorage.js"),s=t.sentFolder(),o=t.draftFolder();this.senderEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===o?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===o?this.toClearEmailsString():this.fromClearEmailString())},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(d.pInt(e.Size)),this.from=s.initEmailsFromJson(e.From),this.to=s.initEmailsFromJson(e.To),this.cc=s.initEmailsFromJson(e.Cc),this.bcc=s.initEmailsFromJson(e.Bcc),this.replyTo=s.initEmailsFromJson(e.ReplyTo),this.deliveredTo=s.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),d.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(d.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(s.emailsToLine(this.from,!0)),this.fromClearEmailString(s.emailsToLineClear(this.from)),this.toEmailsString(s.emailsToLine(this.to,!0)),this.toClearEmailsString(s.emailsToLineClear(this.to)),this.parentUid(d.pInt(e.ParentThread)),this.threads(d.isArray(e.Threads)?e.Threads:[]),this.threadsLen(d.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},s.prototype.initUpdateByMessageJson=function(t){var s=e("../Storages/WebMailDataStorage.js"),o=!1,i=u.MessagePriority.Normal;return t&&"Object/Message"===t["@Object"]&&(i=d.pInt(t.Priority),this.priority(-1t;t++)o=m.newInstanceFromJson(e["@Collection"][t]),o&&(""!==o.cidWithOutTags&&0+$/,""),t=n.find(s,function(t){return e===t.cidWithOutTags})),t||null},s.prototype.findAttachmentByContentLocation=function(e){var t=null,s=this.attachments();return d.isNonEmptyArray(s)&&(t=n.find(s,function(t){return e===t.contentLocation})),t||null},s.prototype.messageId=function(){return this.sMessageId},s.prototype.inReplyTo=function(){return this.sInReplyTo},s.prototype.references=function(){return this.sReferences},s.prototype.fromAsSingleEmail=function(){return d.isArray(this.from)&&this.from[0]?this.from[0].email:""},s.prototype.viewLink=function(){return p.messageViewLink(this.requestHash)},s.prototype.downloadLink=function(){return p.messageDownloadLink(this.requestHash)},s.prototype.replyEmails=function(e){var t=[],o=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,o,t),0===t.length&&s.replyHelper(this.from,o,t),t},s.prototype.replyAllEmails=function(e){var t=[],o=[],i=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,i,t),0===t.length&&s.replyHelper(this.from,i,t),s.replyHelper(this.to,i,t),s.replyHelper(this.cc,i,o),[t,o]},s.prototype.textBodyToString=function(){return this.body?this.body.html():""},s.prototype.attachmentsToStringLine=function(){var e=n.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&o&&!n&&s.attr("src",o)}),e&&o.setTimeout(function(){t.print()},100))})},s.prototype.printMessage=function(){this.viewPopupMessage(!0)},s.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},s.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(u.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},s.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=d.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",i("["+t+"]",this.body).each(function(){e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",i(this).attr(t)).removeAttr(t):i(this).attr("src",i(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",i("["+t+"]",this.body).each(function(){var e=d.trim(i(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+i(this).attr(t)).removeAttr(t)}),e&&(i("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:i(".RL-MailMessageView .messageView .messageItem .content")[0]}),l.resize()),d.windowResize(500)}},s.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=d.isUnd(e)?!1:e;var t=this;i("[data-x-src-cid]",this.body).each(function(){var s=t.findAttachmentByCid(i(this).attr("data-x-src-cid"));s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-src-location]",this.body).each(function(){var s=t.findAttachmentByContentLocation(i(this).attr("data-x-src-location"));s||(s=t.findAttachmentByCid(i(this).attr("data-x-src-location"))),s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-style-cid]",this.body).each(function(){var e="",s="",o=t.findAttachmentByCid(i(this).attr("data-x-style-cid"));o&&o.linkPreview&&(s=i(this).attr("data-x-style-cid-name"),""!==s&&(e=d.trim(i(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+s+": url('"+o.linkPreview()+"')")))}),e&&!function(e,t){n.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(i("img.lazy",t.body),i(".RL-MailMessageView .messageView .messageItem .content")[0]),d.windowResize(500)}},s.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw);var t=e("../Storages/WebMailDataStorage.js");t.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},s.prototype.storePgpVerifyDataToDom=function(){var t=e("../Storages/WebMailDataStorage.js");this.body&&t.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},s.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=d.pString(this.body.data("rl-plain-raw"));var t=e("../Storages/WebMailDataStorage.js");t.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},s.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var t=[],s=null,r=e("../Storages/WebMailDataStorage.js"),a=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",l=r.findPublicKeysByEmail(a),d=null,p=null,h="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{s=o.openpgp.cleartext.readArmored(this.plainRaw),s&&s.getText&&(this.pgpSignedVerifyStatus(l.length?u.SignedVerifyStatus.Unverified:u.SignedVerifyStatus.UnknownPublicKeys),t=s.verify(l),t&&0').text(h)).html(),c.empty(),this.replacePlaneTextBody(h)))))}catch(m){}this.storePgpVerifyDataToDom()}},s.prototype.decryptPgpEncryptedMessage=function(t){if(this.isPgpEncrypted()){var s=[],r=null,a=null,l=e("../Storages/WebMailDataStorage.js"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=l.findPublicKeysByEmail(d),h=l.findSelfPrivateKey(t),m=null,g=null,f="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(u.SignedVerifyStatus.UnknownPrivateKey);try{r=o.openpgp.message.readArmored(this.plainRaw),r&&h&&r.decrypt&&(this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Unverified),a=r.decrypt(h),a&&(s=a.verify(p),s&&0').text(f)).html(),c.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},s.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},s.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/$window.js":18,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Storages/WebMailDataStorage.js":74,"./AttachmentModel.js":38,"./EmailModel.js":43}],49:[function(e,t){!function(t){"use strict";function s(e,t,s,i,n,r,a){this.index=e,this.id=s,this.guid=t,this.user=i,this.email=n,this.armor=a,this.isPrivate=!!r,this.deleteAccess=o.observable(!1)}var o=e("../External/ko.js");s.prototype.index=0,s.prototype.id="",s.prototype.guid="",s.prototype.user="",s.prototype.email="",s.prototype.armor="",s.prototype.isPrivate=!1,t.exports=s}(t)},{"../External/ko.js":28}],50:[function(e,t){!function(t){"use strict";function s(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Knoin/Knoin.js"),u=e("../Knoin/KnoinAbstractScreen.js");i.extend(s.prototype,u.prototype),s.prototype.onRoute=function(e){var t=this,s=null,u=null,d=null,p=null;u=i.find(r.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(i.find(r.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&i.find(r.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?s=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(u=u,s=new u,p=o("").addClass("rl-settings-view-model").hide(),p.appendTo(d),s.viewModelDom=p,s.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=s,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},s),a.delegateRun(s,"onBuild",[p])):a.log("Cannot find sub settings view model position: SettingsSubScreen")),s&&i.defer(function(){t.oCurrentSubScreen&&(a.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=s,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),a.delegateRun(t.oCurrentSubScreen,"onShow"),a.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),i.each(t.menu(),function(e){e.selected(s&&s.__rlSettingsData&&e.route===s.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),a.windowResize()})):c.setHash(l.settings(),!1,!0)},s.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(a.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},s.prototype.onBuild=function(){i.each(r.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!i.find(r.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!i.find(r.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},s.prototype.routes=function(){var e=i.find(r.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",s={subname:/^(.*)$/,normalize_:function(e,s){return s.subname=a.isUnd(s.subname)?t:a.pString(s.subname),[s.subname]}};return[["{subname}/",s],["{subname}",s],["",s]]},t.exports=s}(t)},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractScreen.js":35}],51:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/LoginViewModel.js");i.call(this,"login",[t])}var o=e("../External/underscore.js"),i=e("../Knoin/KnoinAbstractScreen.js");o.extend(s.prototype,i.prototype),s.prototype.onShow=function(){var t=e("../Boots/RainLoopApp.js");t.setTitle("")},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../ViewModels/LoginViewModel.js":76}],52:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/MailBoxSystemDropDownViewModel.js"),s=e("../ViewModels/MailBoxFolderListViewModel.js"),o=e("../ViewModels/MailBoxMessageListViewModel.js"),i=e("../ViewModels/MailBoxMessageViewViewModel.js");c.call(this,"mailbox",[t,s,o,i]),this.oLastRoute={}}var o=e("../External/underscore.js"),i=e("../External/$html.js"),n=e("../Common/Enums.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Common/Events.js"),c=e("../Knoin/KnoinAbstractScreen.js"),u=e("../Storages/AppSettings.js"),d=e("../Storages/WebMailDataStorage.js"),p=e("../Storages/WebMailCacheStorage.js"),h=e("../Storages/WebMailAjaxRemoteStorage.js");o.extend(s.prototype,c.prototype),s.prototype.oLastRoute={},s.prototype.setNewTitle=function(){var t=e("../Boots/RainLoopApp.js"),s=d.accountEmail(),o=d.foldersInboxUnreadCount();t.setTitle((""===s?"":(o>0?"("+o+") ":" ")+s+" - ")+a.i18n("TITLES/MAILBOX"))},s.prototype.onShow=function(){this.setNewTitle(),r.keyScope(n.KeyState.MessageList)},s.prototype.onRoute=function(t,s,o,i){var r=e("../Boots/RainLoopApp.js");if(a.isUnd(i)?1:!i){var l=p.getFolderFullNameRaw(t),c=p.getFolderFromCacheList(l);c&&(d.currentFolder(c).messageListPage(s).messageListSearch(o),n.Layout.NoPreview===d.layout()&&d.message()&&d.message(null),r.reloadMessageList())}else n.Layout.NoPreview!==d.layout()||d.message()||r.historyBack()},s.prototype.onStart=function(){var t=e("../Boots/RainLoopApp.js"),s=function(){a.windowResize()};(u.capa(n.Capa.AdditionalAccounts)||u.capa(n.Capa.AdditionalIdentities))&&t.accountsAndIdentities(),o.delay(function(){"INBOX"!==d.currentFolderFullNameRaw()&&t.folderInformation("INBOX")},1e3),o.delay(function(){t.quota()},5e3),o.delay(function(){h.appDelayStart(a.emptyFunction)},35e3),i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===d.layout()),d.folderList.subscribe(s),d.messageList.subscribe(s),d.message.subscribe(s),d.layout.subscribe(function(e){i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===e)}),l.sub("mailbox.inbox-unread-count",function(e){d.foldersInboxUnreadCount(e)}),d.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},s.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},s=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:s}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/MailBoxFolderListViewModel.js":77,"../ViewModels/MailBoxMessageListViewModel.js":78,"../ViewModels/MailBoxMessageViewViewModel.js":79,"../ViewModels/MailBoxSystemDropDownViewModel.js":80}],53:[function(e,t){!function(t){"use strict";function s(){var t=e("../Boots/RainLoopApp.js"),s=e("../ViewModels/SettingsSystemDropDownViewModel.js"),o=e("../ViewModels/SettingsMenuViewModel.js"),i=e("../ViewModels/SettingsPaneViewModel.js");a.call(this,[s,o,i]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){t.setTitle(this.sSettingsTitle)})}var o=e("../External/underscore.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/Globals.js"),a=e("./AbstractSettings.js");o.extend(s.prototype,a.prototype),s.prototype.onShow=function(){var t=e("../Boots/RainLoopApp.js");t.setTitle(this.sSettingsTitle),r.keyScope(i.KeyState.Settings)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"../ViewModels/SettingsMenuViewModel.js":98,"../ViewModels/SettingsPaneViewModel.js":99,"../ViewModels/SettingsSystemDropDownViewModel.js":100,"./AbstractSettings.js":50}],54:[function(e,t){!function(t){"use strict";function s(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?a.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/window.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js"),d=e("../Knoin/Knoin.js"),p=e("../ViewModels/Popups/PopupsAddAccountViewModel.js");s.prototype.addNewAccount=function(){d.showScreenPopup(p)},s.prototype.deleteAccount=function(t){if(t&&t.deleteAccess()){this.accountForDeletion(null);var s=e("../Boots/RainLoopApp.js"),n=function(e){return t===e};t&&(this.accounts.remove(n),u.accountDelete(function(e,t){r.StorageResultType.Success===e&&t&&t.Result&&t.Reload?(d.routeOff(),d.setHash(l.root(),!0),d.routeOff(),i.defer(function(){o.location.reload()})):s.accountsAndIdentities()},t.email))}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddAccountViewModel.js":81}],55:[function(e,t){!function(t){"use strict";function s(){this.changeProcess=i.observable(!1),this.errorDescription=i.observable(""),this.passwordMismatch=i.observable(!1),this.passwordUpdateError=i.observable(!1),this.passwordUpdateSuccess=i.observable(!1),this.currentPassword=i.observable(""),this.currentPassword.error=i.observable(!1),this.newPassword=i.observable(""),this.newPassword2=i.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=r.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(r.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),a.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=o.bind(this.onChangePasswordResponse,this)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../Common/Enums.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},s.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(r.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../Storages/WebMailAjaxRemoteStorage.js":72}],56:[function(e,t){!function(t){"use strict";function s(){this.contactsAutosave=r.contactsAutosave,this.allowContactsSync=r.allowContactsSync,this.enableContactsSync=r.enableContactsSync,this.contactsSyncUrl=r.contactsSyncUrl,this.contactsSyncUser=r.contactsSyncUser,this.contactsSyncPass=r.contactsSyncPass,this.saveTrigger=o.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var o=e("../External/ko.js"),i=e("../Common/Utils.js"),n=e("../Storages/WebMailAjaxRemoteStorage.js"),r=e("../Storages/WebMailDataStorage.js");s.prototype.onBuild=function(){r.contactsAutosave.subscribe(function(e){n.saveSettings(i.emptyFunction,{ContactsAutosave:e?"1":"0"})})},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],57:[function(e,t){!function(t){"use strict";function s(){this.filters=o.observableArray([]),this.filters.loading=o.observable(!1),this.filters.subscribe(function(){i.windowResize()})}var o=e("../External/ko.js"),i=e("../Common/Utils.js");s.prototype.deleteFilter=function(e){this.filters.remove(e)},s.prototype.addFilter=function(){var t=e("../Knoin/Knoin.js"),s=e("../Models/FilterModel.js"),o=e("../ViewModels/Popups/PopupsFilterViewModel.js");t.showScreenPopup(o,[new s])},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Models/FilterModel.js":45,"../ViewModels/Popups/PopupsFilterViewModel.js":88}],58:[function(e,t){!function(t){"use strict";function s(){this.foldersListError=c.foldersListError,this.folderList=c.folderList,this.processText=o.computed(function(){var e=c.foldersLoading(),t=c.foldersCreating(),s=c.foldersDeleting(),o=c.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):o?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=o.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=o.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Knoin/Knoin.js"),a=e("../Storages/AppSettings.js"),l=e("../Storages/LocalStorage.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailCacheStorage.js"),d=e("../Storages/WebMailAjaxRemoteStorage.js"),p=e("../ViewModels/Popups/PopupsFolderCreateViewModel.js"),h=e("../ViewModels/Popups/PopupsFolderSystemViewModel.js");s.prototype.folderEditOnEnter=function(t){var s=e("../Boots/RainLoopApp.js"),o=t?n.trim(t.nameForEdit()):"";""!==o&&t.name()!==o&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.foldersRenaming(!0),d.folderRename(function(e,t){c.foldersRenaming(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),s.folders()},t.fullNameRaw,o),u.removeFolderFromCacheList(t.fullNameRaw),t.name(o)),t.edited(!1)},s.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},s.prototype.onShow=function(){c.foldersListError("")},s.prototype.createFolder=function(){r.showScreenPopup(p)},s.prototype.systemFolder=function(){r.showScreenPopup(h)},s.prototype.deleteFolder=function(t){if(t&&t.canBeDeleted()&&t.deleteAccess()&&0===t.privateMessageCountAll()){this.folderForDeletion(null);var s=e("../Boots/RainLoopApp.js"),o=function(e){return t===e?!0:(e.subFolders.remove(o),!1)
+};t&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.folderList.remove(o),c.foldersDeleting(!0),d.folderDelete(function(e,t){c.foldersDeleting(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),s.folders()},t.fullNameRaw),u.removeFolderFromCacheList(t.fullNameRaw))}else 0"},s.prototype.addNewIdentity=function(){c.showScreenPopup(u)},s.prototype.editIdentity=function(e){c.showScreenPopup(u,[e])},s.prototype.deleteIdentity=function(t){if(t&&t.deleteAccess()){this.identityForDeletion(null);var s=e("../Boots/RainLoopApp.js"),o=function(e){return t===e};t&&(this.identities.remove(o),l.identityDelete(function(){s.accountsAndIdentities()},t.id))}},s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=o.dataFor(this);e&&t.editIdentity(e)}),_.delay(function(){var e=n.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),s=n.settingsSaveHelperSimpleFunction(t.replyTrigger,t),o=n.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),i=n.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);a.defaultIdentityID.subscribe(function(e){l.saveSettings(i,{DefaultIdentityID:e})}),a.displayName.subscribe(function(t){l.saveSettings(e,{DisplayName:t})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsIdentityViewModel.js":93}],61:[function(e,t){!function(t){"use strict";function s(){this.editor=null,this.displayName=a.displayName,this.signature=a.signature,this.signatureToAll=a.signatureToAll,this.replyTo=a.replyTo,this.signatureDom=o.observable(null),this.displayNameTrigger=o.observable(i.SaveSettingsStep.Idle),this.replyTrigger=o.observable(i.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(i.SaveSettingsStep.Idle)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/NewHtmlEditorWrapper.js"),a=e("../Storages/WebMailDataStorage.js"),l=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(){var e=this;_.delay(function(){var t=n.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),s=n.settingsSaveHelperSimpleFunction(e.replyTrigger,e),o=n.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);a.displayName.subscribe(function(e){l.saveSettings(t,{DisplayName:e})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],62:[function(e,t){!function(t){"use strict";function s(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/ko.js"),i=e("../Knoin/Knoin.js"),n=e("../Storages/WebMailDataStorage.js"),r=e("../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js"),a=e("../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js"),l=e("../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js");s.prototype.addOpenPgpKey=function(){i.showScreenPopup(r)},s.prototype.generateOpenPgpKey=function(){i.showScreenPopup(a)},s.prototype.viewOpenPgpKey=function(e){e&&i.showScreenPopup(l,[e])},s.prototype.deleteOpenPgpKey=function(t){if(t&&t.deleteAccess()&&(this.openPgpKeyForDeletion(null),t&&n.openpgpKeyring)){this.openpgpkeys.remove(function(e){return t===e}),n.openpgpKeyring[t.isPrivate?"privateKeys":"publicKeys"].removeForId(t.guid),n.openpgpKeyring.store();var s=e("../Boots/RainLoopApp.js");s.reloadOpenPgpKeys()}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js":82,"../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js":92,"../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js":97}],63:[function(e,t){!function(t){"use strict";function s(){this.processing=o.observable(!1),this.clearing=o.observable(!1),this.secreting=o.observable(!1),this.viewUser=o.observable(""),this.viewEnable=o.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=o.observable(!1),this.viewSecret=o.observable(""),this.viewBackupCodes=o.observable(""),this.viewUrl=o.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=o.computed(function(){return n.langChangeTrigger(),r.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Globals.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js"),l=e("../Knoin/Knoin.js"),c=e("../ViewModels/Popups/PopupsTwoFactorTestViewModel.js");s.prototype.showSecret=function(){this.secreting(!0),a.showTwoFactorSecret(this.onSecretResult)},s.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.createTwoFactor=function(){this.processing(!0),a.createTwoFactor(this.onResult)},s.prototype.enableTwoFactor=function(){this.processing(!0),a.enableTwoFactor(this.onResult,this.viewEnable())},s.prototype.testTwoFactor=function(){l.showScreenPopup(c)},s.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),a.clearTwoFactor(this.onResult)},s.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(r.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(r.pString(t.Result.Secret)),this.viewBackupCodes(r.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(r.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var s=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&a.enableTwoFactor(function(e,t){i.StorageResultType.Success===e&&t&&t.Result||(s.viewEnable.subs=!1,s.viewEnable(!1),s.viewEnable.subs=!0)},e)},this)}},s.prototype.onSecretResult=function(e,t){this.secreting(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(r.pString(t.Result.Secret)),this.viewUrl(r.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},s.prototype.onBuild=function(){this.processing(!0),a.getTwoFactor(this.onResult)},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../ViewModels/Popups/PopupsTwoFactorTestViewModel.js":96}],64:[function(e,t){!function(t){"use strict";function s(){var t=e("../Common/Utils.js"),s=e("../Boots/RainLoopApp.js"),o=e("../Storages/WebMailDataStorage.js");this.googleEnable=o.googleEnable,this.googleActions=o.googleActions,this.googleLoggined=o.googleLoggined,this.googleUserName=o.googleUserName,this.facebookEnable=o.facebookEnable,this.facebookActions=o.facebookActions,this.facebookLoggined=o.facebookLoggined,this.facebookUserName=o.facebookUserName,this.twitterEnable=o.twitterEnable,this.twitterActions=o.twitterActions,this.twitterLoggined=o.twitterLoggined,this.twitterUserName=o.twitterUserName,this.connectGoogle=t.createCommand(this,function(){this.googleLoggined()||s.googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=t.createCommand(this,function(){s.googleDisconnect()}),this.connectFacebook=t.createCommand(this,function(){this.facebookLoggined()||s.facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=t.createCommand(this,function(){s.facebookDisconnect()}),this.connectTwitter=t.createCommand(this,function(){this.twitterLoggined()||s.twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=t.createCommand(this,function(){s.twitterDisconnect()})}t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Utils.js":14,"../Storages/WebMailDataStorage.js":74}],65:[function(e,t){!function(t){"use strict";function s(){var e=this;this.mainTheme=c.mainTheme,this.themesObjects=n.observableArray([]),this.themeTrigger=n.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,c.theme.subscribe(function(t){_.each(this.themesObjects(),function(e){e.selected(t===e.name)});var s=i("#rlThemeLink"),n=i("#rlThemeStyle"),l=s.attr("href");l||(l=n.attr("data-href")),l&&(l=l.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),l=l.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==l.substring(l.length-5,l.length)&&(l+="Json/"),o.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=i.ajax({url:l,dataType:"json"}).done(function(t){t&&a.isArray(t)&&2===t.length&&(!s||!s[0]||n&&n[0]||(n=i(''),s.after(n),s.remove()),n&&n[0]&&(n.attr("data-href",l).attr("data-theme",t[0]),n&&n[0]&&n[0].styleSheet&&!a.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=t[1]:n.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=o.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),u.saveSettings(null,{Theme:t})},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onBuild=function(){var e=c.theme();this.themesObjects(_.map(c.themes(),function(t){return{name:t,nameDisplay:a.convertThemeName(t),selected:n.observable(t===e),themePreviewSrc:l.themePreviewLink(t)}}))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/window.js":32,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],66:[function(e,t){!function(t){"use strict";function s(){this.oRequests={}}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../Common/Consts.js"),r=e("../Common/Enums.js"),a=e("../Common/Globals.js"),l=e("../Common/Utils.js"),c=e("../Common/Plugins.js"),u=e("../Common/LinkBuilder.js"),d=e("./AppSettings.js");s.prototype.oRequests={},s.prototype.defaultResponse=function(e,t,s,i,u,d){var p=function(){r.StorageResultType.Success!==s&&a.bUnload&&(s=r.StorageResultType.Unload),r.StorageResultType.Success===s&&i&&!i.Result?(i&&-1(new o.Date).getTime()-h),g&&a.oRequests[g]&&(a.oRequests[g].__aborted&&(i="abort"),a.oRequests[g]=null),a.defaultResponse(e,g,i,s,n,t)}),g&&00?(this.defaultRequest(e,"Message",{},null,"Message/"+a.urlsafe_encode([t,s,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},s.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},s.prototype.composeUploadDrive=function(e,t,s){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:s,Url:t},999e3)},s.prototype.folderInformation=function(e,t,s){var n=!0,a=[];i.isArray(s)&&0=e?1:e},this),this.mainMessageListSearch=r.computed({read:this.messageListSearch,write:function(e){b.setHash(m.mailBox(this.currentFolderFullNameHash(),1,h.trim(e.toString())))},owner:this}),this.messageListError=r.observable(""),this.messageListLoading=r.observable(!1),this.messageListIsNotCompleted=r.observable(!1),this.messageListCompleteLoadingThrottle=r.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=r.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(n.debounce(function(e){n.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new S,this.message=r.observable(null),this.messageLoading=r.observable(!1),this.messageLoadingThrottle=r.observable(!1).extend({throttle:50}),this.message.focused=r.observable(!1),this.message.subscribe(function(e){e?d.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),d.Layout.NoPreview===this.layout()&&-10?o.Math.ceil(t/e*100):0},this),this.capaOpenPGP=r.observable(!1),this.openpgpkeys=r.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=r.observable(!1),this.googleLoggined=r.observable(!1),this.googleUserName=r.observable(""),this.facebookActions=r.observable(!1),this.facebookLoggined=r.observable(!1),this.facebookUserName=r.observable(""),this.twitterActions=r.observable(!1),this.twitterLoggined=r.observable(!1),this.twitterUserName=r.observable(""),this.customThemeType=r.observable(d.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=n.throttle(this.purgeMessageBodyCache,3e4)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$div.js"),c=e("../External/NotificationClass.js"),u=e("../Common/Consts.js"),d=e("../Common/Enums.js"),p=e("../Common/Globals.js"),h=e("../Common/Utils.js"),m=e("../Common/LinkBuilder.js"),g=e("./AppSettings.js"),f=e("./WebMailCacheStorage.js"),b=e("../Knoin/Knoin.js"),S=e("../Models/MessageModel.js"),y=e("./LocalStorage.js"),v=e("./AbstractData.js");n.extend(s.prototype,v.prototype),s.prototype.purgeMessageBodyCache=function(){var e=0,t=null,s=p.iMessageBodyCacheCount-u.Values.MessageBodyCacheLimit;s>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=i(this);s>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&n.delay(function(){t.find(".rl-cache-purge").remove()},300)))},s.prototype.populateDataOnStart=function(){v.prototype.populateDataOnStart.call(this),this.accountEmail(g.settingsGet("Email")),this.accountIncLogin(g.settingsGet("IncLogin")),this.accountOutLogin(g.settingsGet("OutLogin")),this.projectHash(g.settingsGet("ProjectHash")),this.defaultIdentityID(g.settingsGet("DefaultIdentityID")),this.displayName(g.settingsGet("DisplayName")),this.replyTo(g.settingsGet("ReplyTo")),this.signature(g.settingsGet("Signature")),this.signatureToAll(!!g.settingsGet("SignatureToAll")),this.enableTwoFactor(!!g.settingsGet("EnableTwoFactor")),this.lastFoldersHash=y.get(d.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!g.settingsGet("RemoteSuggestions"),this.devEmail=g.settingsGet("DevEmail"),this.devPassword=g.settingsGet("DevPassword")},s.prototype.initUidNextAndNewMessages=function(e,t,s){if("INBOX"===e&&h.isNormal(t)&&""!==t){if(h.isArray(s)&&03)l(m.notificationMailIcon(),this.accountEmail(),h.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:a}));else for(;a>r;r++)l(m.notificationMailIcon(),S.emailsToLine(S.initEmailsFromJson(s[r].From),!1),s[r].Subject)}f.setFolderUidNext(e,t)}},s.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},s.prototype.getNextFolderNames=function(e){e=h.isUnd(e)?!1:!!e;var t=[],s=10,o=a().unix(),i=o-300,r=[],l=function(t){n.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&i>t.interval&&(!e||t.subScribed())&&r.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),n.find(r,function(e){var i=f.getFolderFromCacheList(e[1]);return i&&(i.interval=o,t.push(e[1])),s<=t.length}),n.uniq(t)},s.prototype.removeMessagesFromList=function(e,t,s,o){s=h.isNormal(s)?s:"",o=h.isUnd(o)?!1:!!o,t=n.map(t,function(e){return h.pInt(e)});var i=this,r=0,a=this.messageList(),l=f.getFolderFromCacheList(e),c=""===s?null:f.getFolderFromCacheList(s||""),u=this.currentFolderFullNameRaw(),d=this.message(),p=u===e?n.filter(a,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-r?l.messageCountUnread()-r:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),r>0&&c.messageCountUnread(c.messageCountUnread()+r),c.actionBlink(!0)),0').hide().addClass("rl-cache-class"),r.data("rl-cache-count",++p.iMessageBodyCacheCount),h.isNormal(e.Result.Html)&&""!==e.Result.Html?(s=!0,u=e.Result.Html.toString()):h.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(s=!1,u=h.plainToHtml(e.Result.Plain.toString(),!1),(S.isPgpSigned()||S.isPgpEncrypted())&&this.capaOpenPGP()&&(S.plainRaw=h.pString(e.Result.Plain),g=/---BEGIN PGP MESSAGE---/.test(S.plainRaw),g||(m=/-----BEGIN PGP SIGNED MESSAGE-----/.test(S.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(S.plainRaw)),l.empty(),m&&S.isPgpSigned()?u=l.append(i('').text(S.plainRaw)).html():g&&S.isPgpEncrypted()&&(u=l.append(i('').text(S.plainRaw)).html()),l.empty(),S.isPgpSigned(m),S.isPgpEncrypted(g))):s=!1,r.html(h.linkify(u)).addClass("b-text-part "+(s?"html":"plain")),S.isHtml(!!s),S.hasImages(!!o),S.pgpSignedVerifyStatus(d.SignedVerifyStatus.None),S.pgpSignedVerifyUser(""),S.body=r,S.body&&b.append(S.body),S.storeDataToDom(),n&&S.showInternalImages(!0),S.hasImages()&&this.showImages()&&S.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(S.body),this.hideMessageBodies(),S.body.show(),r&&h.initBlockquoteSwitcher(r)),f.initMessageFlagsFromCache(S),S.unseen()&&p.__RL&&p.__RL.setMessageSeen(S),h.windowResize())},s.prototype.calculateMessageListHash=function(e){return n.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},s.prototype.findPublicKeyByHex=function(e){return n.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},s.prototype.findPublicKeysByEmail=function(e){return n.compact(n.map(this.openpgpkeysPublic(),function(t){var s=null;if(t&&e===t.email)try{if(s=o.openpgp.key.readArmored(t.armor),s&&!s.err&&s.keys&&s.keys[0])return s.keys[0]}catch(i){}return null}))},s.prototype.findPrivateKeyByEmail=function(e,t){var s=null,i=n.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(i)try{s=o.openpgp.key.readArmored(i.armor),s&&!s.err&&s.keys&&s.keys[0]?(s=s.keys[0],s.decrypt(h.pString(t))):s=null}catch(r){s=null}return s},s.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},t.exports=new s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Models/MessageModel.js":48,"./AbstractData.js":67,"./AppSettings.js":68,"./LocalStorage.js":69,"./WebMailCacheStorage.js":73}],75:[function(e,t){!function(t){"use strict";function s(){f.call(this,"Right","SystemDropDown"),this.accounts=d.accounts,this.accountEmail=d.accountEmail,this.accountsLoading=d.accountsLoading,this.accountMenuDropdownTrigger=i.observable(!1),this.capaAdditionalAccounts=u.capa(a.Capa.AdditionalAccounts),this.loading=i.computed(function(){return this.accountsLoading()},this),this.accountClick=o.bind(this.accountClick,this)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../External/window.js"),r=e("../External/key.js"),a=e("../Common/Enums.js"),l=e("../Common/Utils.js"),c=e("../Common/LinkBuilder.js"),u=e("../Storages/AppSettings.js"),d=e("../Storages/WebMailDataStorage.js"),p=e("../Storages/WebMailAjaxRemoteStorage.js"),h=e("../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js"),m=e("../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js"),g=e("../Knoin/Knoin.js"),f=e("../Knoin/KnoinAbstractViewModel.js");o.extend(s.prototype,f.prototype),s.prototype.accountClick=function(e,t){if(e&&t&&!l.isUnd(t.which)&&1===t.which){var s=this;this.accountsLoading(!0),o.delay(function(){s.accountsLoading(!1)},1e3)}return!0},s.prototype.emailTitle=function(){return d.accountEmail()},s.prototype.settingsClick=function(){g.setHash(c.settings())},s.prototype.settingsHelp=function(){g.showScreenPopup(h)},s.prototype.addAccountClick=function(){this.capaAdditionalAccounts&&g.showScreenPopup(m)},s.prototype.logoutClick=function(){var t=e("../Boots/RainLoopApp.js");p.logout(function(){n.__rlah_clear&&n.__rlah_clear(),t.loginAndLogoutReload(!0,u.settingsGet("ParentEmail")&&0-1&&a.eq(n).removeClass("focused"),38===r&&n>0?n--:40===r&&no)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-o+n+e),!0):!1},s.prototype.messagesDrop=function(t,s){if(t&&s&&s.helper){var o=e("../Boots/RainLoopApp.js"),i=s.helper.data("rl-folder"),n=a.hasClass("rl-ctrl-key-pressed"),r=s.helper.data("rl-uids");l.isNormal(i)&&""!==i&&l.isArray(r)&&o.moveMessagesToFolder(i,r,t.fullNameRaw,n)}},s.prototype.composeClick=function(){S.showScreenPopup(g)},s.prototype.createFolder=function(){S.showScreenPopup(f)},s.prototype.configureFolders=function(){S.setHash(d.settings("folders"))},s.prototype.contactsClick=function(){this.allowContacts&&S.showScreenPopup(b)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86,"./Popups/PopupsContactsViewModel.js":87,"./Popups/PopupsFolderCreateViewModel.js":90}],78:[function(e,t){!function(t){"use strict";function s(){var t=e("../Boots/RainLoopApp.js");C.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=S.message,this.messageList=S.messageList,this.folderList=S.folderList,this.currentMessage=S.currentMessage,this.isMessageSelected=S.isMessageSelected,this.messageListSearch=S.messageListSearch,this.messageListError=S.messageListError,this.folderMenuForMove=S.folderMenuForMove,this.useCheckboxesInList=S.useCheckboxesInList,this.mainMessageListSearch=S.mainMessageListSearch,this.messageListEndFolder=S.messageListEndFolder,this.messageListChecked=S.messageListChecked,this.messageListCheckedOrSelected=S.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=S.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=S.messageListCompleteLoadingThrottle,p.initOnStartOrLangChange(function(){this.emptySubjectValue=p.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=S.userQuota,this.userUsageSize=S.userUsageSize,this.userUsageProc=S.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return c.Layout.NoPreview!==S.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=S.messageListEndSearch();return""===e?"":p.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(p.computedPagenatorHelper(S.messageListPage,S.messageListPageCount)),this.checkAll=n.computed({read:function(){return 00&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 01?" ("+(100>e?e:"99+")+")":""},s.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},s.prototype.moveSelectedMessagesToFolder=function(e,t){return this.canBeMoved()&&RL.moveMessagesToFolder(S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),e,t),!1},s.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),s=S.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",S.currentFolderFullNameRaw()),t.data("rl-uids",s),t.find(".text").text(""+s.length),i.defer(function(){var e=S.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},s.prototype.onMessageResponse=function(e,t,s){S.hideMessageBodies(),S.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?S.setMessage(t,s):c.StorageResultType.Unload===e?(S.message(null),S.messageError("")):c.StorageResultType.Abort!==e&&(S.message(null),S.messageError(p.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},s.prototype.populateMessageBody=function(e){e&&(y.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?S.messageLoading(!0):p.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},s.prototype.setAction=function(e,t,s){var o=[],n=null,r=0;if(p.isUnd(s)&&(s=S.messageListChecked()),o=i.map(s,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},s.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},s.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},s.prototype.readReceipt=function(t){if(t&&""!==t.readReceipt()){m.sendReadReceiptMessage(u.emptyFunction,t.folderFullNameRaw,t.uid,t.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:t.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),t.isReadReceipt(!0),p.storeMessageFlagsToCache(t);var s=e("../Boots/RainLoopApp.js");s.reloadFlagsCurrentMessageListAndMessageFromCache()}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86}],80:[function(e,t){!function(t){"use strict";function s(){i.call(this),o.constructorEnd(this)}var o=e("../Knoin/Knoin.js"),i=e("./AbstractSystemDropDownViewModel.js");o.extendAsViewModel("MailBoxSystemDropDownViewModel",s,i),t.exports=s}(t)},{"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":75}],81:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsAddAccount");var t=e("../../Boots/RainLoopApp.js");this.email=i.observable(""),this.password=i.observable(""),this.emailError=i.observable(!1),this.passwordError=i.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=i.observable(!1),this.submitError=i.observable(""),this.emailFocus=i.observable(!1),this.addAccountCommand=r.createCommand(this,function(){return this.emailError(""===r.trim(this.email())),this.passwordError(""===r.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),a.accountAdd(o.bind(function(e,s){this.submitRequest(!1),n.StorageResultType.Success===e&&s&&"AccountAdd"===s.Action?s.Result?(t.accountsAndIdentities(),this.cancelCommand()):s.ErrorCode&&this.submitError(r.getNotification(s.ErrorCode)):this.submitError(r.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/ko.js"),n=e("../../Common/Enums.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/WebMailAjaxRemoteStorage.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsAddAccountViewModel",s),s.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.emailFocus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72}],82:[function(e,t){!function(t){"use strict";function s(){a.call(this,"Popups","PopupsAddOpenPgpKey");var t=e("../../Boots/RainLoopApp.js");this.key=o.observable(""),this.key.error=o.observable(!1),this.key.focus=o.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=i.createCommand(this,function(){var e=30,s=null,o=i.trim(this.key()),r=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,a=n.openpgpKeyring;if(o=o.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===o),!a||this.key.error())return!1;for(;;){if(s=r.exec(o),!s||0>e)break;s[0]&&s[1]&&s[2]&&s[1]===s[2]&&("PRIVATE"===s[1]?a.privateKeys.importKey(s[0]):"PUBLIC"===s[1]&&a.publicKeys.importKey(s[0])),e--}return a.store(),t.reloadOpenPgpKeys(),i.delegateRun(this,"cancelCommand"),!0}),r.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Utils.js"),n=e("../../Storages/WebMailDataStorage.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsAddOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.key.focus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],83:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=o.observable(!1),this.from=o.observable(""),this.to=o.observable(""),this.subject=o.observable(""),this.text=o.observable(""),this.selectedDateValue=o.observable(-1),this.hasAttachment=o.observable(!1),this.starred=o.observable(!1),this.unseen=o.observable(!1),this.searchCommand=n.createCommand(this,function(){var e=this.buildSearchString();""!==e&&r.mainMessageListSearch(e),this.cancelCommand()}),a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../External/moment.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsAdvancedSearchViewModel",s),s.prototype.buildSearchStringValue=function(e){return-1"},s.prototype.sendMessageResponse=function(e,t){var s=!1,i="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(s=!0,this.modalVisibility()&&p.delegateRun(this,"closeCommand")),this.modalVisibility()&&!s&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),o.alert(p.trim(p.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(i=p.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),o.alert(i||p.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},s.prototype.saveMessageResponse=function(e,t){var s=!1,i=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(i=S.message(),i&&this.draftFolder()===i.folderFullNameRaw&&this.draftUid()===i.uid&&S.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(o.Math.round((new o.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
"+s}return e},s.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?n.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},s.prototype.onShow=function(e,t,s,o,r){j.routeOff();var a=this,l="",c="",d="",h="",m="",g=null,f=null,b="",y="",C=[],w={},E=S.accountEmail(),A=S.signature(),T=S.signatureToAll(),F=[],M=null,N=null,R=e||u.ComposeType.Empty,L=function(e,t){for(var s=0,o=e.length,i=[];o>s;s++)i.push(e[s].toLine(!!t));return i.join(", ")};if(t=t||null,t&&p.isNormal(t)&&(N=p.isArray(t)&&1===t.length?t[0]:p.isArray(t)?null:t),null!==E&&(w[E]=!0),this.currentIdentityID(this.findIdentityIdByMessage(R,N)),this.reset(),p.isNonEmptyArray(s)&&this.to(L(s)),""!==R&&N){switch(h=N.fullFormatDateValue(),m=N.subject(),M=N.aDraftInfo,g=i(N.body).clone(),p.removeBlockquoteSwitcher(g),f=g.find("[data-html-editor-font-wrapper=true]"),b=f&&f[0]?f.html():g.html(),R){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(L(N.replyEmails(w))),this.subject(p.replySubjectAdd("Re",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["reply",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.ReplyAll:C=N.replyAllEmails(w),this.to(L(C[0])),this.cc(L(C[1])),this.subject(p.replySubjectAdd("Re",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["reply",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.references());break;case u.ComposeType.Forward:this.subject(p.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["forward",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(p.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["forward",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.Draft:this.to(L(N.to)),this.cc(L(N.cc)),this.bcc(L(N.bcc)),this.bFromDraft=!0,this.draftFolder(N.folderFullNameRaw),this.draftUid(N.uid),this.subject(m),this.prepearMessageAttachments(N,R),this.aDraftInfo=p.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=N.sInReplyTo,this.sReferences=N.sReferences;break;case u.ComposeType.EditAsNew:this.to(L(N.to)),this.cc(L(N.cc)),this.bcc(L(N.bcc)),this.subject(m),this.prepearMessageAttachments(N,R),this.aDraftInfo=p.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=N.sInReplyTo,this.sReferences=N.sReferences}switch(R){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=N.fromToLine(!1,!0),y=p.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:l}),b="
"+y+":"+b+"
";break;case u.ComposeType.Forward:l=N.fromToLine(!1,!0),c=N.toToLine(!1,!0),d=N.ccToLine(!1,!0),b="
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+p.encodeHtml(h)+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+p.encodeHtml(m)+"
"+b;break;case u.ComposeType.ForwardAsAttachment:b=""}T&&""!==A&&u.ComposeType.EditAsNew!==R&&u.ComposeType.Draft!==R&&(b=this.convertSignature(A,L(N.from,!0),b,R)),this.editor(function(e){e.setHtml(b,!1),N.isHtml()||e.modeToggle(!1)})}else u.ComposeType.Empty===R?(this.subject(p.isNormal(o)?""+o:""),b=p.isNormal(r)?""+r:"",T&&""!==A&&(b=this.convertSignature(A,"",p.convertPlainTextToHtml(b),R)),this.editor(function(e){e.setHtml(b,!1),u.EditorDefaultType.Html!==S.editorDefaultType()&&e.modeToggle(!1)})):p.isNonEmptyArray(t)&&n.each(t,function(e){a.addMessageAsAttachment(e)});F=this.getAttachmentsDownloadsForUpload(),p.isNonEmptyArray(F)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var s=null,o="";if(!a.viewModelVisibility())for(o in t.Result)t.Result.hasOwnProperty(o)&&(s=a.getAttachmentById(t.Result[o]),s&&s.tempName(o))}else a.setMessageAttachmentFailedDowbloadText()},F),this.triggerForResize()},s.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},s.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},s.prototype.tryToClosePopup=function(){var e=this;j.isPopupVisible(A)||j.showScreenPopup(A,[p.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&p.delegateRun(e,"closeCommand")}])},s.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),l.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=o.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",i(t).attr("id","dropboxjs").attr("data-app-key",b.settingsGet("DropboxApiKey")),o.document.body.appendChild(t)),this.driveEnabled()&&i.getScript("https://apis.google.com/js/api.js",function(){o.gapi&&e.driveVisible(!0)})},s.prototype.driveCallback=function(e,t){if(t&&o.XMLHttpRequest&&o.google&&t[o.google.picker.Response.ACTION]===o.google.picker.Action.PICKED&&t[o.google.picker.Response.DOCUMENTS]&&t[o.google.picker.Response.DOCUMENTS][0]&&t[o.google.picker.Response.DOCUMENTS][0].id){var s=this,i=new o.XMLHttpRequest;i.open("GET","https://www.googleapis.com/drive/v2/files/"+t[o.google.picker.Response.DOCUMENTS][0].id),i.setRequestHeader("Authorization","Bearer "+e),i.addEventListener("load",function(){if(i&&i.responseText){var t=c.parse(i.responseText),o=function(e,t,s){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+s,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))
+};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":o(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":o(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":o(t,"image/png","png");break;case"application/vnd.google-apps.presentation":o(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:o(t,"application/pdf","pdf")}t&&t.downloadUrl&&s.addDriveAttachment(t,e)}}),i.send()}},s.prototype.driveCreatePiker=function(e){if(o.gapi&&e&&e.access_token){var t=this;o.gapi.load("picker",{callback:function(){if(o.google&&o.google.picker){var s=(new o.google.picker.PickerBuilder).addView((new o.google.picker.DocsView).setIncludeFolders(!0)).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(n.bind(t.driveCallback,t,e.access_token)).enableFeature(o.google.picker.Feature.NAV_HIDDEN).build();s.setVisible(!0)}}})}},s.prototype.driveOpenPopup=function(){if(o.gapi){var e=this;o.gapi.load("auth",{callback:function(){var t=o.gapi.auth.getToken();t?e.driveCreatePiker(t):o.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var s=o.gapi.auth.getToken();s&&e.driveCreatePiker(s)}else o.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var s=o.gapi.auth.getToken();s&&e.driveCreatePiker(s)}})})}})}},s.prototype.getAttachmentById=function(e){for(var t=this.attachments(),s=0,o=t.length;o>s;s++)if(t[s]&&e===t[s].id)return t[s];return null},s.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=p.pInt(b.settingsGet("AttachmentLimit")),s=new Jua({action:m.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.on("onDragEnter",n.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",n.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",n.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",n.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",n.bind(function(t,s,i){var n=null;p.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+o.Math.floor(s/i*100)+"%")},this)).on("onSelect",n.bind(function(e,o){this.dragAndDropOver(!1);var i=this,n=p.isUnd(o.FileName)?"":o.FileName.toString(),r=p.isNormal(o.Size)?p.pInt(o.Size):null,a=new C(e,n,r);return a.cancel=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e}),s&&s.cancel(e)}}(e),this.attachments.push(a),r>0&&t>0&&r>t?(a.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",n.bind(function(t){var s=null;p.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&(s.waiting(!1),s.uploading(!0))},this)).on("onComplete",n.bind(function(t,s,o){var i="",n=null,r=null,a=this.getAttachmentById(t);r=s&&o&&o.Result&&o.Result.Attachment?o.Result.Attachment:null,n=o&&o.Result&&o.Result.ErrorCode?o.Result.ErrorCode:null,null!==n?i=p.getUploadErrorDescByCode(n):r||(i=p.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==i&&00&&i>0&&n>i?(s.uploading(!1),s.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,t){var o=!1;s.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(o=!0,s.tempName(t.Result[s.id])),o||s.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},s.prototype.addDriveAttachment=function(e,t){var s=this,o=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}},i=p.pInt(b.settingsGet("AttachmentLimit")),n=null,r=e.fileSize?p.pInt(e.fileSize):0;return n=new C(e.downloadUrl,e.title,r),n.fromMessage=!1,n.cancel=o(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),r>0&&i>0&&r>i?(n.uploading(!1),n.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var s=!1;n.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(s=!0,n.tempName(t.Result[n.id][0]),n.size(p.pInt(t.Result[n.id][1]))),s||n.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},s.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,o=p.isNonEmptyArray(e.attachments())?e.attachments():[],i=0,n=o.length,r=null,a=null,l=!1,c=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}};if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>i;i++){switch(a=o[i],l=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=a.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:l=!0}l&&(r=new C(a.download,a.fileName,a.estimatedSize,a.isInline,a.isLinked,a.cid,a.contentLocation),r.fromMessage=!0,r.cancel=c(a.download),r.waiting(!1).uploading(!0),this.attachments.push(r))}}},s.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},s.prototype.setMessageAttachmentFailedDowbloadText=function(){n.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},s.prototype.isEmptyForm=function(e){e=p.isUnd(e)?!0:!!e;var t=e?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&&t&&(!this.oEditor||""===this.oEditor.getData())},s.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!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(!1)},s.prototype.getAttachmentsDownloadsForUpload=function(){return n.map(n.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},s.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Events.js":8,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/NewHtmlEditorWrapper.js":11,"../../Common/Utils.js":14,"../../External/$window.js":18,"../../External/JSON.js":20,"../../External/jquery.js":26,"../../External/ko.js":28,"../../External/moment.js":29,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ComposeAttachmentModel.js":39,"../../Storages/AppSettings.js":68,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74,"./PopupsAskViewModel.js":84,"./PopupsComposeOpenPgpViewModel.js":85,"./PopupsFolderSystemViewModel.js":91}],87:[function(e,t){!function(t){"use strict";function s(){w.call(this,"Popups","PopupsContacts");var t=this,i=function(e){e&&0=e?1:e},this),this.contactsPagenator=r.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=r.observable(!0),this.viewClearSearch=r.observable(!1),this.viewID=r.observable(""),this.viewReadOnly=r.observable(!1),this.viewProperties=r.observableArray([]),this.viewTags=r.observable(""),this.viewTags.visibility=r.observable(!1),this.viewTags.focusTrigger=r.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=r.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1=o&&(this.bDropPageAfterDelete=!0),n.delay(function(){n.each(i,function(e){t.remove(e)})},500))},s.prototype.deleteSelectedContacts=function(){00?o:0),d.isNonEmptyArray(s.Result.Tags)&&(r=n.map(s.Result.Tags,function(e){var t=new S;return t.parse(e)?t:null}),r=n.compact(r))),t.contactsCount(o),t.contacts(i),t.contacts.loading(!1),t.contactTags(r),t.viewClearSearch(""!==t.search())},s,c.Defaults.ContactsPerPage,this.search())},s.prototype.onBuild=function(e){this.oContentVisible=i(".b-list-content",e),this.oContentScrollable=i(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;a("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=r.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},s.prototype.onShow=function(){C.routeOff(),this.reloadContactList(!0)},s.prototype.onHide=function(){C.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/Selector.js":13,"../../Common/Utils.js":14,"../../External/jquery.js":26,"../../External/key.js":27,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ContactModel.js":40,"../../Models/ContactPropertyModel.js":41,"../../Models/ContactTagModel.js":42,"../../Models/EmailModel.js":43,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74,"./PopupsComposeViewModel.js":86}],88:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsFilter"),this.filter=o.observable(null),this.selectedFolderValue=o.observable(i.Values.UnuseOptionValue),this.folderSelectList=r.folderMenuForMove,this.defautOptionsAfterRender=n.defautOptionsAfterRender,a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Consts.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsFilterViewModel",s),s.prototype.clearPopup=function(){},s.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},t.exports=s}(t)},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],89:[function(e,t){!function(t){"use strict";function s(){u.call(this,"Popups","PopupsFolderClear");var t=e("../../Boots/RainLoopApp.js");this.selectedFolder=o.observable(null),this.clearingProcess=o.observable(!1),this.clearingError=o.observable(""),this.folderFullNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=o.computed(function(){return n.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=n.createCommand(this,function(){var e=this,s=this.selectedFolder();s&&(r.message(null),r.messageList([]),this.clearingProcess(!0),a.setFolderHash(s.fullNameRaw,""),l.folderClear(function(s,o){e.clearingProcess(!1),i.StorageResultType.Success===s&&o&&o.Result?(t.reloadMessageList(!0),e.cancelCommand()):e.clearingError(o&&o.ErrorCode?n.getNotification(o.ErrorCode):n.getNotification(i.Notification.MailServerError))},s.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),c.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Storages/WebMailCacheStorage.js"),l=e("../../Storages/WebMailAjaxRemoteStorage.js"),c=e("../../Knoin/Knoin.js"),u=e("../../Knoin/KnoinAbstractViewModel.js");c.extendAsViewModel("PopupsFolderClearViewModel",s),s.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},s.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74}],90:[function(e,t){!function(t){"use strict";function s(){u.call(this,"Popups","PopupsFolderCreate"),r.initOnStartOrLangChange(function(){this.sNoParentText=r.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(n.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,s=null,o=a.folderList(),i=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==a.namespace&&(t=function(e){return a.namespace!==e.fullNameRaw.substr(0,a.namespace.length)}),r.folderListOptionsBuilder([],o,[],e,null,t,s,i)},this),this.createFolder=r.createCommand(this,function(){var t=e("../../Boots/RainLoopApp.js"),s=this.selectedParentValue();""===s&&1"),this.submitRequest(!0),i.delay(function(){n=o.openpgp.generateKeyPair({userId:s,numBits:r.pInt(e.keyBitLength()),passphrase:r.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t.reloadOpenPgpKeys(),r.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var o=e("../../External/window.js"),i=e("../../External/underscore.js"),n=e("../../External/ko.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/WebMailDataStorage.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsGenerateNewOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)
+},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.email.focus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],93:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsIdentity");var t=e("../../Boots/RainLoopApp.js");this.id="",this.edit=o.observable(!1),this.owner=o.observable(!1),this.email=o.observable("").validateEmail(),this.email.focused=o.observable(!1),this.name=o.observable(""),this.name.focused=o.observable(!1),this.replyTo=o.observable("").validateSimpleEmail(),this.replyTo.focused=o.observable(!1),this.bcc=o.observable("").validateSimpleEmail(),this.bcc.focused=o.observable(!1),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.addOrEditIdentityCommand=n.createCommand(this,function(){return this.email.hasError()||this.email.hasError(""===n.trim(this.email())),this.email.hasError()?(this.owner()||this.email.focused(!0),!1):this.replyTo.hasError()?(this.replyTo.focused(!0),!1):this.bcc.hasError()?(this.bcc.focused(!0),!1):(this.submitRequest(!0),a.identityUpdate(_.bind(function(e,s){this.submitRequest(!1),i.StorageResultType.Success===e&&s?s.Result?(t.accountsAndIdentities(),this.cancelCommand()):s.ErrorCode&&this.submitError(n.getNotification(s.ErrorCode)):this.submitError(n.getNotification(i.Notification.UnknownError))},this),this.id,this.email(),this.name(),this.replyTo(),this.bcc()),!0)},function(){return!this.submitRequest()}),this.label=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"TITLE_UPDATE_IDENTITY":"TITLE_ADD_IDENTITY"))},this),this.button=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"BUTTON_UPDATE_IDENTITY":"BUTTON_ADD_IDENTITY"))},this),r.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Storages/WebMailAjaxRemoteStorage.js"),l=e("../../Storages/WebMailDataStorage.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsIdentityViewModel",s),s.prototype.clearPopup=function(){this.id="",this.edit(!1),this.owner(!1),this.name(""),this.email(""),this.replyTo(""),this.bcc(""),this.email.hasError(!1),this.replyTo.hasError(!1),this.bcc.hasError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(e){this.clearPopup(),e&&(this.edit(!0),this.id=e.id,this.name(e.name()),this.email(e.email()),this.replyTo(e.replyTo()),this.bcc(e.bcc()),this.owner(this.id===l.accountEmail()))},s.prototype.onFocus=function(){this.owner()||this.email.focused(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],94:[function(e,t){!function(t){"use strict";function s(){a.call(this,"Popups","PopupsKeyboardShortcutsHelp"),this.sDefaultKeyScope=n.KeyState.PopupKeyboardShortcutsHelp,r.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/key.js"),n=e("../../Common/Enums.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsKeyboardShortcutsHelpViewModel",s),s.prototype.onBuild=function(e){i("tab, shift+tab, left, right",n.KeyState.PopupKeyboardShortcutsHelp,o.bind(function(t,s){if(t&&s){var o=e.find(".nav.nav-tabs > li"),i=s&&("tab"===s.shortcut||"right"===s.shortcut),n=o.index(o.filter(".active"));return!i&&n>0?n--:i&&n