diff --git a/dev/Admin/Social.js b/dev/Admin/Social.js
index f5def0c3d..0b775c6c2 100644
--- a/dev/Admin/Social.js
+++ b/dev/Admin/Social.js
@@ -10,8 +10,10 @@ function AdminSocial()
this.googleEnable = oData.googleEnable;
this.googleClientID = oData.googleClientID;
this.googleClientSecret = oData.googleClientSecret;
+ this.googleApiKey = oData.googleApiKey;
this.googleTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle);
this.googleTrigger2 = ko.observable(Enums.SaveSettingsStep.Idle);
+ this.googleTrigger3 = ko.observable(Enums.SaveSettingsStep.Idle);
this.facebookSupported = oData.facebookSupported;
this.facebookEnable = oData.facebookEnable;
@@ -45,7 +47,8 @@ AdminSocial.prototype.onBuild = function ()
f4 = Utils.settingsSaveHelperSimpleFunction(self.twitterTrigger2, self),
f5 = Utils.settingsSaveHelperSimpleFunction(self.googleTrigger1, self),
f6 = Utils.settingsSaveHelperSimpleFunction(self.googleTrigger2, self),
- f7 = Utils.settingsSaveHelperSimpleFunction(self.dropboxTrigger1, self)
+ f7 = Utils.settingsSaveHelperSimpleFunction(self.googleTrigger3, self),
+ f8 = Utils.settingsSaveHelperSimpleFunction(self.dropboxTrigger1, self)
;
self.facebookEnable.subscribe(function (bValue) {
@@ -111,6 +114,12 @@ AdminSocial.prototype.onBuild = function ()
});
});
+ self.googleApiKey.subscribe(function (sValue) {
+ RL.remote().saveAdminConfig(f7, {
+ 'GoogleApiKey': Utils.trim(sValue)
+ });
+ });
+
self.dropboxEnable.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, {
'DropboxEnable': bValue ? '1' : '0'
@@ -118,7 +127,7 @@ AdminSocial.prototype.onBuild = function ()
});
self.dropboxApiKey.subscribe(function (sValue) {
- RL.remote().saveAdminConfig(f7, {
+ RL.remote().saveAdminConfig(f8, {
'DropboxApiKey': Utils.trim(sValue)
});
});
diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js
index 4cc2059fa..11ab0e893 100644
--- a/dev/Common/Utils.js
+++ b/dev/Common/Utils.js
@@ -1118,6 +1118,7 @@ Utils.initDataConstructorBySettings = function (oData)
oData.googleEnable = ko.observable(false);
oData.googleClientID = ko.observable('');
oData.googleClientSecret = ko.observable('');
+ oData.googleApiKey = ko.observable('');
oData.dropboxEnable = ko.observable(false);
oData.dropboxApiKey = ko.observable('');
diff --git a/dev/Storages/AbstractData.js b/dev/Storages/AbstractData.js
index c8ba1a256..4afd05795 100644
--- a/dev/Storages/AbstractData.js
+++ b/dev/Storages/AbstractData.js
@@ -125,6 +125,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.googleEnable(!!RL.settingsGet('AllowGoogleSocial'));
this.googleClientID(RL.settingsGet('GoogleClientID'));
this.googleClientSecret(RL.settingsGet('GoogleClientSecret'));
+ this.googleApiKey(RL.settingsGet('GoogleApiKey'));
this.dropboxEnable(!!RL.settingsGet('AllowDropboxSocial'));
this.dropboxApiKey(RL.settingsGet('DropboxApiKey'));
diff --git a/dev/ViewModels/PopupsComposeViewModel.js b/dev/ViewModels/PopupsComposeViewModel.js
index 31f474f92..5b2ffdef2 100644
--- a/dev/ViewModels/PopupsComposeViewModel.js
+++ b/dev/ViewModels/PopupsComposeViewModel.js
@@ -321,7 +321,7 @@ function PopupsComposeViewModel()
this.triggerForResize();
}, this);
- this.dropboxEnabled = ko.observable(RL.settingsGet('DropboxApiKey') ? true : false);
+ this.dropboxEnabled = ko.observable(!!RL.settingsGet('DropboxApiKey'));
this.dropboxCommand = Utils.createCommand(this, function () {
@@ -347,18 +347,19 @@ function PopupsComposeViewModel()
return this.dropboxEnabled();
});
- this.driveEnabled = ko.observable(false);
+ this.driveEnabled = ko.observable(!!RL.settingsGet('GoogleApiKey') && !!RL.settingsGet('GoogleClientID'));
+ this.driveVisible = ko.observable(false);
this.driveCommand = Utils.createCommand(this, function () {
-// this.driveOpenPopup();
+ this.driveOpenPopup();
return true;
}, function () {
return this.driveEnabled();
});
-// this.driveCallback = _.bind(this.driveCallback, this);
+ this.driveCallback = _.bind(this.driveCallback, this);
this.bDisabeCloseOnEsc = true;
this.sDefaultKeyScope = Enums.KeyState.Compose;
@@ -980,41 +981,89 @@ PopupsComposeViewModel.prototype.onBuild = function ()
document.body.appendChild(oScript);
}
-// TODO (Google Drive)
-// if (false)
-// {
-// $.getScript('http://www.google.com/jsapi', function () {
-// if (window.google)
-// {
-// window.google.load('picker', '1', {
-// 'callback': Utils.emptyFunction
-// });
-// }
-// });
-// }
+ if (this.driveEnabled())
+ {
+ $.getScript('https://apis.google.com/js/api.js', function () {
+ if (window.gapi)
+ {
+ self.driveVisible(true);
+ }
+ });
+ }
};
-//PopupsComposeViewModel.prototype.driveCallback = function (oData)
-//{
-// if (oData && window.google && oData['action'] === window.google.picker.Action.PICKED)
-// {
-// }
-//};
-//
-//PopupsComposeViewModel.prototype.driveOpenPopup = function ()
-//{
-// if (window.google)
-// {
-// var
-// oPicker = new window.google.picker.PickerBuilder()
-// .enableFeature(window.google.picker.Feature.NAV_HIDDEN)
-// .addView(new window.google.picker.View(window.google.picker.ViewId.DOCS))
-// .setCallback(this.driveCallback).build()
-// ;
-//
-// oPicker.setVisible(true);
-// }
-//};
+PopupsComposeViewModel.prototype.driveCallback = function (oData)
+{
+ if (oData && window.google && oData[window.google.picker.Response.ACTION] === window.google.picker.Action.PICKED &&
+ oData[window.google.picker.Response.DOCUMENTS] && oData[window.google.picker.Response.DOCUMENTS][0] &&
+ oData[window.google.picker.Response.DOCUMENTS][0]['url'])
+ {
+ this.addDriveAttachment(oData[window.google.picker.Response.DOCUMENTS][0]);
+ }
+};
+
+PopupsComposeViewModel.prototype.driveCreatePiker = function (oOauthToken)
+{
+ if (window.gapi && oOauthToken && oOauthToken.access_token)
+ {
+ var self = this;
+
+ window.gapi.load('picker', {'callback': function () {
+
+ if (window.google && window.google.picker)
+ {
+ var drivePicker = new window.google.picker.PickerBuilder()
+ .addView(
+ new window.google.picker.DocsView()
+ .setIncludeFolders(true)
+ )
+ .setAppId(RL.settingsGet('GoogleClientID'))
+ .setDeveloperKey(RL.settingsGet('GoogleApiKey'))
+ .setOAuthToken(oOauthToken.access_token)
+ .setCallback(_.bind(self.driveCallback, self))
+ .enableFeature(window.google.picker.Feature.NAV_HIDDEN)
+ .build()
+ ;
+
+ drivePicker.setVisible(true);
+ }
+ }});
+ }
+};
+
+PopupsComposeViewModel.prototype.driveOpenPopup = function ()
+{
+ if (window.gapi)
+ {
+ var self = this;
+
+ window.gapi.load('auth', {'callback': function () {
+
+ var oAuthToken = window.gapi.auth.getToken();
+ if (!oAuthToken)
+ {
+ window.gapi.auth.authorize({
+ 'client_id': RL.settingsGet('GoogleClientID'),
+ 'scope': 'https://www.googleapis.com/auth/drive.readonly',
+ 'immediate': false
+ }, function (oAuthResult) {
+ if (oAuthResult && !oAuthResult.error)
+ {
+ var oAuthToken = window.gapi.auth.getToken();
+ if (oAuthToken)
+ {
+ self.driveCreatePiker(oAuthToken);
+ }
+ }
+ });
+ }
+ else
+ {
+ self.driveCreatePiker(oAuthToken);
+ }
+ }});
+ }
+};
/**
* @param {string} sId
@@ -1339,6 +1388,16 @@ PopupsComposeViewModel.prototype.addDropboxAttachment = function (oDropboxFile)
return true;
};
+/**
+ * @param {Object} oDriveFile
+ * @return {boolean}
+ */
+PopupsComposeViewModel.prototype.addDriveAttachment = function (oDriveFile)
+{
+ window.console.log(oDriveFile);
+ return false;
+};
+
/**
* @param {MessageModel} oMessage
* @param {string} sType
diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php
index b870395e4..c7891b4d7 100644
--- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php
+++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php
@@ -626,6 +626,74 @@ class Utils
return \trim($sValue);
}
+ /**
+ * @param string $sAttrName
+ * @param string $sValue = 'utf-8'
+ * @param string $sCharset = ''
+ * @param string $sLang = ''
+ * @param int $iLen = 78
+ *
+ * @return string|bool
+ */
+ public static function AttributeRfc2231Encode($sAttrName, $sValue, $sCharset = 'utf-8', $sLang = '', $iLen = 1000)
+ {
+ $sValue = \strtoupper($sCharset).'\''.$sLang.'\''.
+ \preg_replace_callback('/[\x00-\x20*\'%()<>@,;:\\\\"\/[\]?=\x80-\xFF]/', function ($match) {
+ return \rawurlencode($match[0]);
+ }, $sValue);
+
+ $iNlen = \strlen($sAttrName);
+ $iVlen = \strlen($sValue);
+
+ if (\strlen($sAttrName) + $iVlen > $iLen - 3)
+ {
+ $sections = array();
+ $section = 0;
+
+ for ($i = 0, $j = 0; $i < $iVlen; $i += $j)
+ {
+ $j = $iLen - $iNlen - \strlen($section) - 4;
+ $sections[$section++] = \substr($sValue, $i, $j);
+ }
+
+ for ($i = 0, $n = $section; $i < $n; $i++)
+ {
+ $sections[$i] = ' '.$sAttrName.'*'.$i.'*='.$sections[$i];
+ }
+
+ return \implode(";\r\n", $sections);
+ }
+ else
+ {
+ return $sAttrName.'*='.$sValue;
+ }
+ }
+ /**
+ * @param string $sAttrName
+ * @param string $sValue
+ *
+ * @return string
+ */
+ public static function EncodeHeaderUtf8AttributeValue($sAttrName, $sValue)
+ {
+ $sAttrName = \trim($sAttrName);
+ $sValue = \trim($sValue);
+
+ if (0 < \strlen($sValue) && !\MailSo\Base\Utils::IsAscii($sValue))
+ {
+ if (!empty($_SERVER['HTTP_USER_AGENT']) && 0 < \strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
+ {
+ $sValue = $sAttrName.'="'.\preg_replace('/[+\s]+/', '%20', \urlencode($sValue)).'"';
+ }
+ else
+ {
+ $sValue = \MailSo\Base\Utils::AttributeRfc2231Encode($sAttrName, $sValue);
+ }
+ }
+
+ return \trim($sValue);
+ }
+
/**
* @param string $sEmail
*
diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php
index 9f1b168e5..508e3727d 100644
--- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php
+++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php
@@ -361,7 +361,7 @@ class Message
}
/**
- * @param $iDateTime $iDateTime
+ * @param int $iDateTime
*
* @return \MailSo\Mime\Message
*/
diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php
index 27ef272fc..3f5d83fdf 100644
--- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php
+++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php
@@ -1129,10 +1129,14 @@ class Actions
}
$aResult['AllowGoogleSocial'] = (bool) $oConfig->Get('social', 'google_enable', false);
+ $aResult['GoogleClientID'] = \trim($oConfig->Get('social', 'google_client_id', ''));
+ $aResult['GoogleApiKey'] = \trim($oConfig->Get('social', 'google_api_key', ''));
if ($aResult['AllowGoogleSocial'] && (
'' === \trim($oConfig->Get('social', 'google_client_id', '')) || '' === \trim($oConfig->Get('social', 'google_client_secret', ''))))
{
$aResult['AllowGoogleSocial'] = false;
+ $aResult['GoogleClientID'] = '';
+ $aResult['GoogleApiKey'] = '';
}
$aResult['AllowFacebookSocial'] = (bool) $oConfig->Get('social', 'fb_enable', false);
@@ -1189,6 +1193,7 @@ class Actions
$aResult['AllowGoogleSocial'] = (bool) $oConfig->Get('social', 'google_enable', false);
$aResult['GoogleClientID'] = (string) $oConfig->Get('social', 'google_client_id', '');
$aResult['GoogleClientSecret'] = (string) $oConfig->Get('social', 'google_client_secret', '');
+ $aResult['GoogleApiKey'] = (string) $oConfig->Get('social', 'google_api_key', '');
$aResult['AllowFacebookSocial'] = (bool) $oConfig->Get('social', 'fb_enable', false);
$aResult['FacebookAppID'] = (string) $oConfig->Get('social', 'fb_app_id', '');
@@ -2394,6 +2399,7 @@ class Actions
$this->setConfigFromParams($oConfig, 'GoogleEnable', 'social', 'google_enable', 'bool');
$this->setConfigFromParams($oConfig, 'GoogleClientID', 'social', 'google_client_id', 'string');
$this->setConfigFromParams($oConfig, 'GoogleClientSecret', 'social', 'google_client_secret', 'string');
+ $this->setConfigFromParams($oConfig, 'GoogleApiKey', 'social', 'google_api_key', 'string');
$this->setConfigFromParams($oConfig, 'FacebookEnable', 'social', 'fb_enable', 'bool');
$this->setConfigFromParams($oConfig, 'FacebookAppID', 'social', 'fb_app_id', 'string');
@@ -6389,7 +6395,7 @@ class Actions
$self = $this;
return $this->MailClient()->MessageMimeStream(
function($rResource, $sContentType, $sFileName, $sMimeIndex = '') use ($self, $sRawKey, $sContentTypeIn, $sFileNameIn, $bDownload) {
- if (is_resource($rResource))
+ if (\is_resource($rResource))
{
$sContentTypeOut = $sContentTypeIn;
if (empty($sContentTypeOut))
@@ -6409,10 +6415,12 @@ class Actions
$sFileNameOut = $self->MainClearFileName($sFileNameOut, $sContentTypeOut, $sMimeIndex);
- header('Content-Type: '.$sContentTypeOut);
- header('Content-Disposition: '.($bDownload ? 'attachment' : 'inline').'; filename="'.$sFileNameOut.'"; charset=utf-8', true);
- header('Accept-Ranges: none', true);
- header('Content-Transfer-Encoding: binary');
+ \header('Content-Type: '.$sContentTypeOut);
+ \header('Content-Disposition: '.($bDownload ? 'attachment' : 'inline').'; '.
+ \trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileNameOut)), true);
+
+ \header('Accept-Ranges: none', true);
+ \header('Content-Transfer-Encoding: binary');
$self->cacheByKey($sRawKey);
diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php
index 37358e62e..5dd6229b1 100644
--- a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php
+++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php
@@ -182,6 +182,7 @@ Examples:
'google_enable' => array(false, 'Google'),
'google_client_id' => array(''),
'google_client_secret' => array(''),
+ 'google_api_key' => array(''),
'fb_enable' => array(false, 'Facebook'),
'fb_app_id' => array(''),
diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSocial.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSocial.html
index e6c9681ef..217ee80e2 100644
--- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSocial.html
+++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSocial.html
@@ -18,9 +18,9 @@
-
+
diff --git a/rainloop/v/0.0.0/static/css/app.css b/rainloop/v/0.0.0/static/css/app.css
index f3bb15c19..2ce9c581a 100644
--- a/rainloop/v/0.0.0/static/css/app.css
+++ b/rainloop/v/0.0.0/static/css/app.css
@@ -637,7 +637,7 @@
border-radius: 8px;
}
-
+
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
/* =============================================================================
@@ -1142,7 +1142,7 @@ table {
border-collapse: collapse;
border-spacing: 0;
}
-
+
@charset "UTF-8";
@font-face {
@@ -1513,7 +1513,7 @@ table {
.icon-resize-out:before {
content: "\e06d";
}
-
+
/** initial setup **/
.nano {
/*
@@ -1630,7 +1630,7 @@ table {
.nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 {
background-color: rgba(0, 0, 0, 0.4);
}
-
+
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
@@ -1995,7 +1995,7 @@ img.mfp-img {
right: 0;
padding-top: 0; }
-
+
/* overlay at start */
.mfp-fade.mfp-bg {
@@ -2041,7 +2041,7 @@ img.mfp-img {
-moz-transform: translateX(50px);
transform: translateX(50px);
}
-
+
.simple-pace {
-webkit-pointer-events: none;
pointer-events: none;
@@ -2112,7 +2112,7 @@ img.mfp-img {
@keyframes simple-pace-stripe-animation {
0% { transform: none; transform: none; }
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
-}
+}
.inputosaurus-container {
background-color:#fff;
border:1px solid #bcbec0;
@@ -2180,7 +2180,7 @@ img.mfp-img {
box-shadow:none;
}
.inputosaurus-input-hidden { display:none; }
-
+
.flag-wrapper {
width: 24px;
height: 16px;
@@ -2226,7 +2226,7 @@ img.mfp-img {
.flag.flag-pt-br {background-position: -192px -11px}
.flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px}
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
.clearfix {
*zoom: 1;
diff --git a/rainloop/v/0.0.0/static/js/admin.js b/rainloop/v/0.0.0/static/js/admin.js
index 52f330b7e..79401a460 100644
--- a/rainloop/v/0.0.0/static/js/admin.js
+++ b/rainloop/v/0.0.0/static/js/admin.js
@@ -78,7 +78,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/
@@ -87,7 +87,7 @@ var
*/
var RL = null;
/*jshint onevar: true*/
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -243,7 +243,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {};
@@ -363,7 +363,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -794,7 +794,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim;
@@ -1915,6 +1915,7 @@ Utils.initDataConstructorBySettings = function (oData)
oData.googleEnable = ko.observable(false);
oData.googleClientID = ko.observable('');
oData.googleClientSecret = ko.observable('');
+ oData.googleApiKey = ko.observable('');
oData.dropboxEnable = ko.observable(false);
oData.dropboxApiKey = ko.observable('');
@@ -2812,7 +2813,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
return oItem.hasClass('open');
}));
}, 50);
-
+
/*jslint bitwise: true*/
// Base64 encode / decode
// http://www.webtoolkit.info/
@@ -2976,7 +2977,7 @@ Base64 = {
}
};
-/*jslint bitwise: false*/
+/*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = {
@@ -3819,7 +3820,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4125,7 +4126,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4221,7 +4222,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4297,7 +4298,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4370,7 +4371,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4415,7 +4416,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4430,7 +4431,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4525,7 +4526,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true;
});
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4603,7 +4604,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5019,7 +5020,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5385,7 +5386,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5431,7 +5432,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5728,7 +5729,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
this.smtpAuth(true);
this.whiteList('');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5872,7 +5873,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
return false;
}, this));
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5990,7 +5991,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
{
var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6052,7 +6053,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6165,7 +6166,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6254,7 +6255,7 @@ AdminLoginViewModel.prototype.onHide = function ()
{
this.loginFocus(false);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6280,7 +6281,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
{
return '#/' + sRoute;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6306,7 +6307,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
RL.remote().adminLogout(function () {
RL.loginAndLogoutReload();
});
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6434,7 +6435,7 @@ AdminGeneral.prototype.phpInfoLink = function ()
return RL.link().phpInfo();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6488,7 +6489,7 @@ AdminLogin.prototype.onBuild = function ()
}, 50);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6559,7 +6560,7 @@ AdminBranding.prototype.onBuild = function ()
}, 50);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6781,7 +6782,7 @@ AdminContacts.prototype.onBuild = function ()
}, 50);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6872,7 +6873,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
{
RL.reloadDomainList();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6987,7 +6988,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
{
return RL.link().phpInfo();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7000,8 +7001,10 @@ function AdminSocial()
this.googleEnable = oData.googleEnable;
this.googleClientID = oData.googleClientID;
this.googleClientSecret = oData.googleClientSecret;
+ this.googleApiKey = oData.googleApiKey;
this.googleTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle);
this.googleTrigger2 = ko.observable(Enums.SaveSettingsStep.Idle);
+ this.googleTrigger3 = ko.observable(Enums.SaveSettingsStep.Idle);
this.facebookSupported = oData.facebookSupported;
this.facebookEnable = oData.facebookEnable;
@@ -7035,7 +7038,8 @@ AdminSocial.prototype.onBuild = function ()
f4 = Utils.settingsSaveHelperSimpleFunction(self.twitterTrigger2, self),
f5 = Utils.settingsSaveHelperSimpleFunction(self.googleTrigger1, self),
f6 = Utils.settingsSaveHelperSimpleFunction(self.googleTrigger2, self),
- f7 = Utils.settingsSaveHelperSimpleFunction(self.dropboxTrigger1, self)
+ f7 = Utils.settingsSaveHelperSimpleFunction(self.googleTrigger3, self),
+ f8 = Utils.settingsSaveHelperSimpleFunction(self.dropboxTrigger1, self)
;
self.facebookEnable.subscribe(function (bValue) {
@@ -7101,6 +7105,12 @@ AdminSocial.prototype.onBuild = function ()
});
});
+ self.googleApiKey.subscribe(function (sValue) {
+ RL.remote().saveAdminConfig(f7, {
+ 'GoogleApiKey': Utils.trim(sValue)
+ });
+ });
+
self.dropboxEnable.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, {
'DropboxEnable': bValue ? '1' : '0'
@@ -7108,14 +7118,14 @@ AdminSocial.prototype.onBuild = function ()
});
self.dropboxApiKey.subscribe(function (sValue) {
- RL.remote().saveAdminConfig(f7, {
+ RL.remote().saveAdminConfig(f8, {
'DropboxApiKey': Utils.trim(sValue)
});
});
}, 50);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7214,7 +7224,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
RL.reloadPluginList();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7314,7 +7324,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7371,7 +7381,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
;
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7448,7 +7458,7 @@ AdminAbout.prototype.updateCoreData = function ()
RL.updateCoreData();
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7576,13 +7586,14 @@ AbstractData.prototype.populateDataOnStart = function()
this.googleEnable(!!RL.settingsGet('AllowGoogleSocial'));
this.googleClientID(RL.settingsGet('GoogleClientID'));
this.googleClientSecret(RL.settingsGet('GoogleClientSecret'));
+ this.googleApiKey(RL.settingsGet('GoogleApiKey'));
this.dropboxEnable(!!RL.settingsGet('AllowDropboxSocial'));
this.dropboxApiKey(RL.settingsGet('DropboxApiKey'));
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7635,7 +7646,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
AdminDataStorage.prototype.populateDataOnStart = function()
{
AbstractData.prototype.populateDataOnStart.call(this);
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -7919,7 +7930,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8182,7 +8193,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
{
this.defaultRequest(fCallback, 'AdminPing');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8243,7 +8254,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{
this.oServices = oData;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8256,7 +8267,7 @@ function AdminCacheStorage()
}
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8438,7 +8449,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8455,7 +8466,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
AdminLoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8475,7 +8486,7 @@ _.extend(AdminSettingsScreen.prototype, AbstractSettings.prototype);
AdminSettingsScreen.prototype.onShow = function ()
{
RL.setTitle('');
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8835,7 +8846,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -9138,7 +9149,7 @@ AdminApp.prototype.bootstart = function ()
* @type {AdminApp}
*/
RL = new AdminApp();
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@@ -9191,7 +9202,7 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
-
+
if (window.SimplePace) {
window.SimplePace.add(10);
}
diff --git a/rainloop/v/0.0.0/static/js/admin.min.js b/rainloop/v/0.0.0/static/js/admin.min.js
index d1eeac58e..d4f1d4615 100644
--- a/rainloop/v/0.0.0/static/js/admin.min.js
+++ b/rainloop/v/0.0.0/static/js/admin.min.js
@@ -1,5 +1,5 @@
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-!function(e,t,i,n,o,s){"use strict";function a(){this.sBase="#/",this.sServer="./?",this.sVersion=lt.settingsGet("Version"),this.sSpecSuffix=lt.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=lt.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}function r(){}function l(){}function c(){var e=[l,r],t=s.find(e,function(e){return e.supported()});t&&(t=t,this.oDriver=new t)}function u(){}function d(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=$.pString(e),this.sTemplate=$.pString(t),this.sDefaultKeyScope=W.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=i.observable(!1),this.modalVisibility=i.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}function p(e,t){this.sScreenName=e,this.aViewModels=$.isArray(t)?t:[]}function g(){this.sDefaultScreenName="",this.oScreens={},this.oBoot=null,this.oCurrentScreen=null}function h(e,t){this.email=e||"",this.name=t||"",this.privateType=null,this.clearDuplicateName()}function m(){this.idContactTag=0,this.name=i.observable(""),this.readOnly=!1}function f(){d.call(this,"Popups","PopupsDomain"),this.edit=i.observable(!1),this.saving=i.observable(!1),this.savingError=i.observable(""),this.whiteListPage=i.observable(!1),this.testing=i.observable(!1),this.testingDone=i.observable(!1),this.testingImapError=i.observable(!1),this.testingSmtpError=i.observable(!1),this.testingImapErrorDesc=i.observable(""),this.testingSmtpErrorDesc=i.observable(""),this.testingImapError.subscribe(function(e){e||this.testingImapErrorDesc("")},this),this.testingSmtpError.subscribe(function(e){e||this.testingSmtpErrorDesc("")},this),this.testingImapErrorDesc=i.observable(""),this.testingSmtpErrorDesc=i.observable(""),this.imapServerFocus=i.observable(!1),this.smtpServerFocus=i.observable(!1),this.name=i.observable(""),this.name.focused=i.observable(!1),this.imapServer=i.observable(""),this.imapPort=i.observable(""+z.Values.ImapDefaulPort),this.imapSecure=i.observable(W.ServerSecure.None),this.imapShortLogin=i.observable(!1),this.smtpServer=i.observable(""),this.smtpPort=i.observable(""+z.Values.SmtpDefaulPort),this.smtpSecure=i.observable(W.ServerSecure.None),this.smtpShortLogin=i.observable(!1),this.smtpAuth=i.observable(!0),this.whiteList=i.observable(""),this.headerText=i.computed(function(){var e=this.name();return this.edit()?'Edit Domain "'+e+'"':"Add Domain"+(""===e?"":' "'+e+'"')},this),this.domainIsComputed=i.computed(function(){return""!==this.name()&&""!==this.imapServer()&&""!==this.imapPort()&&""!==this.smtpServer()&&""!==this.smtpPort()},this),this.canBeTested=i.computed(function(){return!this.testing()&&this.domainIsComputed()},this),this.canBeSaved=i.computed(function(){return!this.saving()&&this.domainIsComputed()},this),this.createOrAddCommand=$.createCommand(this,function(){this.saving(!0),lt.remote().createOrUpdateDomain(s.bind(this.onDomainCreateOrSaveResponse,this),!this.edit(),this.name(),this.imapServer(),$.pInt(this.imapPort()),this.imapSecure(),this.imapShortLogin(),this.smtpServer(),$.pInt(this.smtpPort()),this.smtpSecure(),this.smtpShortLogin(),this.smtpAuth(),this.whiteList())},this.canBeSaved),this.testConnectionCommand=$.createCommand(this,function(){this.whiteListPage(!1),this.testingDone(!1),this.testingImapError(!1),this.testingSmtpError(!1),this.testing(!0),lt.remote().testConnectionForDomain(s.bind(this.onTestConnectionResponse,this),this.name(),this.imapServer(),$.pInt(this.imapPort()),this.imapSecure(),this.smtpServer(),$.pInt(this.smtpPort()),this.smtpSecure(),this.smtpAuth())},this.canBeTested),this.whiteListCommand=$.createCommand(this,function(){this.whiteListPage(!this.whiteListPage())}),this.imapServerFocus.subscribe(function(e){e&&""!==this.name()&&""===this.imapServer()&&this.imapServer(this.name().replace(/[.]?[*][.]?/g,""))},this),this.smtpServerFocus.subscribe(function(e){e&&""!==this.imapServer()&&""===this.smtpServer()&&this.smtpServer(this.imapServer().replace(/imap/gi,"smtp"))},this),this.imapSecure.subscribe(function(e){var t=$.pInt(this.imapPort());switch(e=$.pString(e)){case"0":993===t&&this.imapPort("143");break;case"1":143===t&&this.imapPort("993")}},this),this.smtpSecure.subscribe(function(e){var t=$.pInt(this.smtpPort());switch(e=$.pString(e)){case"0":(465===t||587===t)&&this.smtpPort("25");break;case"1":(25===t||587===t)&&this.smtpPort("465");break;case"2":(25===t||465===t)&&this.smtpPort("587")}},this),g.constructorEnd(this)}function b(){d.call(this,"Popups","PopupsPlugin");var e=this;this.onPluginSettingsUpdateResponse=s.bind(this.onPluginSettingsUpdateResponse,this),this.saveError=i.observable(""),this.name=i.observable(""),this.readme=i.observable(""),this.configures=i.observableArray([]),this.hasReadme=i.computed(function(){return""!==this.readme()},this),this.hasConfiguration=i.computed(function(){return 0
').appendTo("body"),st.on("error",function(e){lt&&e&&e.originalEvent&&e.originalEvent.message&&-1===$.inArray(e.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&<.remote().jsError($.emptyFunction,e.originalEvent.message,e.originalEvent.filename,e.originalEvent.lineno,location&&location.toString?location.toString():"",ot.attr("class"),$.microtime()-X.now)}),at.on("keydown",function(e){e&&e.ctrlKey&&ot.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&ot.removeClass("rl-ctrl-key-pressed")})}function j(){K.call(this),this.oData=null,this.oRemote=null,this.oCache=null}var z={},W={},Y={},$={},J={},Q={},X={},Z={settings:[],"settings-removed":[],"settings-disabled":[]},et=[],tt=null,it=e.rainloopAppData||{},nt=e.rainloopI18N||{},ot=t("html"),st=t(e),at=t(e.document),rt=e.Notification&&e.Notification.requestPermission?e.Notification:null,lt=null;X.now=(new Date).getTime(),X.momentTrigger=i.observable(!0),X.dropdownVisibility=i.observable(!1).extend({rateLimit:0}),X.tooltipTrigger=i.observable(!1).extend({rateLimit:0}),X.langChangeTrigger=i.observable(!0),X.iAjaxErrorCount=0,X.iTokenErrorCount=0,X.iMessageBodyCacheCount=0,X.bUnload=!1,X.sUserAgent=(navigator.userAgent||"").toLowerCase(),X.bIsiOSDevice=-1
/g,">").replace(/"/g,""").replace(/'/g,"'"):""},$.splitPlainText=function(e,t){var i="",n="",o=e,s=0,a=0;for(t=$.isUnd(t)?100:t;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},$.timeOutAction=function(){var t={};return function(i,n,o){$.isUnd(t[i])&&(t[i]=0),e.clearTimeout(t[i]),t[i]=e.setTimeout(n,o)}}(),$.timeOutActionSecond=function(){var t={};return function(i,n,o){t[i]||(t[i]=e.setTimeout(function(){n(),t[i]=0},o))}}(),$.audio=function(){var t=!1;return function(i,n){if(!1===t)if(X.bIsiOSDevice)t=null;else{var o=!1,s=!1,a=e.Audio?new e.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(s=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||s?(t=a,t.preload="none",t.loop=!1,t.autoplay=!1,t.muted=!1,t.src=o?i:n):t=null):t=null}return t}}(),$.hos=function(e,t){return e&&Object.hasOwnProperty?Object.hasOwnProperty.call(e,t):!1},$.i18n=function(e,t,i){var n="",o=$.isUnd(nt[e])?$.isUnd(i)?e:i:nt[e];if(!$.isUnd(t)&&!$.isNull(t))for(n in t)$.hos(t,n)&&(o=o.replace("%"+n+"%",t[n]));return o},$.i18nToNode=function(e){s.defer(function(){t(".i18n",e).each(function(){var e=t(this),i="";i=e.data("i18n-text"),i?e.text($.i18n(i)):(i=e.data("i18n-html"),i&&e.html($.i18n(i)),i=e.data("i18n-placeholder"),i&&e.attr("placeholder",$.i18n(i)),i=e.data("i18n-title"),i&&e.attr("title",$.i18n(i)))})})},$.i18nToDoc=function(){e.rainloopI18N&&(nt=e.rainloopI18N||{},$.i18nToNode(at),X.langChangeTrigger(!X.langChangeTrigger())),e.rainloopI18N={}
-},$.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?X.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&X.langChangeTrigger.subscribe(e,t)},$.inFocus=function(){return document.activeElement?($.isUnd(document.activeElement.__inFocusCache)&&(document.activeElement.__inFocusCache=t(document.activeElement).is("input,textarea,iframe,.cke_editable")),!!document.activeElement.__inFocusCache):!1},$.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var e=t(document.activeElement);e.is("input,textarea")&&document.activeElement.blur()}},$.removeSelection=function(){if(e&&e.getSelection){var t=e.getSelection();t&&t.removeAllRanges&&t.removeAllRanges()}else document&&document.selection&&document.selection.empty&&document.selection.empty()},$.replySubjectAdd=function(e,t){e=$.trim(e.toUpperCase()),t=$.trim(t.replace(/[\s]+/," "));var i=0,n="",o=!1,s="",a=[],r=[],l="RE"===e,c="FWD"===e,u=!c;if(""!==t){for(o=!1,r=t.split(":"),i=0;i
0);return e.replace(/[\s]+/," ")},$._replySubjectAdd_=function(t,i,n){var o=null,s=$.trim(i);return s=null===(o=new e.RegExp("^"+t+"[\\s]?\\:(.*)$","gi").exec(i))||$.isUnd(o[1])?null===(o=new e.RegExp("^("+t+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(i))||$.isUnd(o[1])||$.isUnd(o[2])||$.isUnd(o[3])?t+": "+i:o[1]+($.pInt(o[2])+1)+o[3]:t+"[2]: "+o[1],s=s.replace(/[\s]+/g," "),s=($.isUnd(n)?!0:n)?$.fixLongSubject(s):s},$._fixLongSubject_=function(e){var t=0,i=null;e=$.trim(e.replace(/[\s]+/," "));do i=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!i||$.isUnd(i[0]))&&(i=null),i&&(t=0,t+=$.isUnd(i[2])?1:0+$.pInt(i[2]),t+=$.isUnd(i[4])?1:0+$.pInt(i[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(i);return e=e.replace(/[\s]+/," ")},$.roundNumber=function(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},$.friendlySize=function(e){return e=$.pInt(e),e>=1073741824?$.roundNumber(e/1073741824,1)+"GB":e>=1048576?$.roundNumber(e/1048576,1)+"MB":e>=1024?$.roundNumber(e/1024,0)+"KB":e+"B"},$.log=function(t){e.console&&e.console.log&&e.console.log(t)},$.getNotification=function(e,t){return e=$.pInt(e),W.Notification.ClientViewError===e&&t?t:$.isUnd(Y[e])?"":Y[e]},$.initNotificationLanguage=function(){Y[W.Notification.InvalidToken]=$.i18n("NOTIFICATIONS/INVALID_TOKEN"),Y[W.Notification.AuthError]=$.i18n("NOTIFICATIONS/AUTH_ERROR"),Y[W.Notification.AccessError]=$.i18n("NOTIFICATIONS/ACCESS_ERROR"),Y[W.Notification.ConnectionError]=$.i18n("NOTIFICATIONS/CONNECTION_ERROR"),Y[W.Notification.CaptchaError]=$.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),Y[W.Notification.SocialFacebookLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),Y[W.Notification.SocialTwitterLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),Y[W.Notification.SocialGoogleLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),Y[W.Notification.DomainNotAllowed]=$.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),Y[W.Notification.AccountNotAllowed]=$.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),Y[W.Notification.AccountTwoFactorAuthRequired]=$.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),Y[W.Notification.AccountTwoFactorAuthError]=$.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),Y[W.Notification.CouldNotSaveNewPassword]=$.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),Y[W.Notification.CurrentPasswordIncorrect]=$.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),Y[W.Notification.NewPasswordShort]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),Y[W.Notification.NewPasswordWeak]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),Y[W.Notification.NewPasswordForbidden]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),Y[W.Notification.ContactsSyncError]=$.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),Y[W.Notification.CantGetMessageList]=$.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),Y[W.Notification.CantGetMessage]=$.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),Y[W.Notification.CantDeleteMessage]=$.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),Y[W.Notification.CantMoveMessage]=$.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Y[W.Notification.CantCopyMessage]=$.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Y[W.Notification.CantSaveMessage]=$.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),Y[W.Notification.CantSendMessage]=$.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),Y[W.Notification.InvalidRecipients]=$.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),Y[W.Notification.CantCreateFolder]=$.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),Y[W.Notification.CantRenameFolder]=$.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),Y[W.Notification.CantDeleteFolder]=$.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),Y[W.Notification.CantDeleteNonEmptyFolder]=$.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),Y[W.Notification.CantSubscribeFolder]=$.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),Y[W.Notification.CantUnsubscribeFolder]=$.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),Y[W.Notification.CantSaveSettings]=$.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),Y[W.Notification.CantSavePluginSettings]=$.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),Y[W.Notification.DomainAlreadyExists]=$.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),Y[W.Notification.CantInstallPackage]=$.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),Y[W.Notification.CantDeletePackage]=$.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),Y[W.Notification.InvalidPluginPackage]=$.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),Y[W.Notification.UnsupportedPluginPackage]=$.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),Y[W.Notification.LicensingServerIsUnavailable]=$.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),Y[W.Notification.LicensingExpired]=$.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),Y[W.Notification.LicensingBanned]=$.i18n("NOTIFICATIONS/LICENSING_BANNED"),Y[W.Notification.DemoSendMessageError]=$.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),Y[W.Notification.AccountAlreadyExists]=$.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),Y[W.Notification.MailServerError]=$.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),Y[W.Notification.InvalidInputArgument]=$.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),Y[W.Notification.UnknownNotification]=$.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),Y[W.Notification.UnknownError]=$.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},$.getUploadErrorDescByCode=function(e){var t="";switch($.pInt(e)){case W.UploadErrorCode.FileIsTooBig:t=$.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case W.UploadErrorCode.FilePartiallyUploaded:t=$.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case W.UploadErrorCode.FileNoUploaded:t=$.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case W.UploadErrorCode.MissingTempFolder:t=$.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case W.UploadErrorCode.FileOnSaveingError:t=$.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case W.UploadErrorCode.FileType:t=$.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=$.i18n("UPLOAD/ERROR_UNKNOWN")}return t},$.delegateRun=function(e,t,i,n){e&&e[t]&&(n=$.pInt(n),0>=n?e[t].apply(e,$.isArray(i)?i:[]):s.delay(function(){e[t].apply(e,$.isArray(i)?i:[])},n))},$.killCtrlAandS=function(t){if(t=t||e.event,t&&t.ctrlKey&&!t.shiftKey&&!t.altKey){var i=t.target||t.srcElement,n=t.keyCode||t.which;if(n===W.EventKeyCode.S)return void t.preventDefault();if(i&&i.tagName&&i.tagName.match(/INPUT|TEXTAREA/i))return;n===W.EventKeyCode.A&&(e.getSelection?e.getSelection().removeAllRanges():e.document.selection&&e.document.selection.clear&&e.document.selection.clear(),t.preventDefault())}},$.createCommand=function(e,t,n){var o=t?function(){return o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=i.observable(!0),n=$.isUnd(n)?!0:n,o.canExecute=i.computed($.isFunc(n)?function(){return o.enabled()&&n.call(e)}:function(){return o.enabled()&&!!n}),o},$.initDataConstructorBySettings=function(t){t.editorDefaultType=i.observable(W.EditorDefaultType.Html),t.showImages=i.observable(!1),t.interfaceAnimation=i.observable(W.InterfaceAnimation.Full),t.contactsAutosave=i.observable(!1),X.sAnimationType=W.InterfaceAnimation.Full,t.capaThemes=i.observable(!1),t.allowLanguagesOnSettings=i.observable(!0),t.allowLanguagesOnLogin=i.observable(!0),t.useLocalProxyForExternalImages=i.observable(!1),t.desktopNotifications=i.observable(!1),t.useThreads=i.observable(!0),t.replySameFolder=i.observable(!0),t.useCheckboxesInList=i.observable(!0),t.layout=i.observable(W.Layout.SidePreview),t.usePreviewPane=i.computed(function(){return W.Layout.NoPreview!==t.layout()}),t.interfaceAnimation.subscribe(function(e){if(X.bMobileDevice||e===W.InterfaceAnimation.None)ot.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),X.sAnimationType=W.InterfaceAnimation.None;else switch(e){case W.InterfaceAnimation.Full:ot.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),X.sAnimationType=e;break;case W.InterfaceAnimation.Normal:ot.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),X.sAnimationType=e}}),t.interfaceAnimation.valueHasMutated(),t.desktopNotificationsPermisions=i.computed(function(){t.desktopNotifications();var i=W.DesktopNotifications.NotSupported;if(rt&&rt.permission)switch(rt.permission.toLowerCase()){case"granted":i=W.DesktopNotifications.Allowed;break;case"denied":i=W.DesktopNotifications.Denied;break;case"default":i=W.DesktopNotifications.NotAllowed}else e.webkitNotifications&&e.webkitNotifications.checkPermission&&(i=e.webkitNotifications.checkPermission());return i}),t.useDesktopNotifications=i.computed({read:function(){return t.desktopNotifications()&&W.DesktopNotifications.Allowed===t.desktopNotificationsPermisions()},write:function(e){if(e){var i=t.desktopNotificationsPermisions();W.DesktopNotifications.Allowed===i?t.desktopNotifications(!0):W.DesktopNotifications.NotAllowed===i?rt.requestPermission(function(){t.desktopNotifications.valueHasMutated(),W.DesktopNotifications.Allowed===t.desktopNotificationsPermisions()?t.desktopNotifications()?t.desktopNotifications.valueHasMutated():t.desktopNotifications(!0):t.desktopNotifications()?t.desktopNotifications(!1):t.desktopNotifications.valueHasMutated()}):t.desktopNotifications(!1)}else t.desktopNotifications(!1)}}),t.language=i.observable(""),t.languages=i.observableArray([]),t.mainLanguage=i.computed({read:t.language,write:function(e){e!==t.language()?-1<$.inArray(e,t.languages())?t.language(e):0=t.diff(i,"hours")?n:t.format("L")===i.format("L")?$.i18n("MESSAGE_LIST/TODAY_AT",{TIME:i.format("LT")}):t.clone().subtract("days",1).format("L")===i.format("L")?$.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:i.format("LT")}):i.format(t.year()===i.year()?"D MMM.":"LL")},e)},$.isFolderExpanded=function(e){var t=lt.local().get(W.ClientSideKeyName.ExpandedFolders);return s.isArray(t)&&-1!==s.indexOf(t,e)},$.setExpandedFolder=function(e,t){var i=lt.local().get(W.ClientSideKeyName.ExpandedFolders);s.isArray(i)||(i=[]),t?(i.push(e),i=s.uniq(i)):i=s.without(i,e),lt.local().set(W.ClientSideKeyName.ExpandedFolders,i)},$.initLayoutResizer=function(e,i,n){var o=60,s=155,a=t(e),r=t(i),l=lt.local().get(n)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(o);else{a.resizable("enable");var t=$.pInt(lt.local().get(n))||s;c(t>s?t:s)}},d=function(e,t){t&&t.size&&t.size.width&&(lt.local().set(n,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>s?l:s),a.resizable({helper:"ui-resizable-helper",minWidth:s,maxWidth:350,handles:"e",stop:d}),lt.sub("left-panel.off",function(){u(!0)}),lt.sub("left-panel.on",function(){u(!1)})},$.initBlockquoteSwitcher=function(e){if(e){var i=t("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===t(this).parent().closest("blockquote",e).length});i&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),t('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),$.windowResize()}).after("
").before("
"))})}},$.removeBlockquoteSwitcher=function(e){e&&(t(e).find("blockquote.rl-bq-switcher").each(function(){t(this).removeClass("rl-bq-switcher hidden-bq")}),t(e).find(".rlBlockquoteSwitcher").each(function(){t(this).remove()}))},$.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},$.extendAsViewModel=function(e,t,i){t&&(i||(i=d),t.__name=e,J.regViewModelHook(e,t),s.extend(t.prototype,i.prototype))},$.addSettingsViewModel=function(e,t,i,n,o){e.__rlSettingsData={Label:i,Template:t,Route:n,IsDefault:!!o},Z.settings.push(e)},$.removeSettingsViewModel=function(e){Z["settings-removed"].push(e)},$.disableSettingsViewModel=function(e){Z["settings-disabled"].push(e)},$.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=$.trim(e.substring(0,e.length-7))),$.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},$.quoteName=function(e){return e.replace(/["]/g,'\\"')},$.microtime=function(){return(new Date).getTime()},$.convertLangName=function(e,t){return $.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},$.fakeMd5=function(e){var t="",i="0123456789abcdefghijklmnopqrstuvwxyz";for(e=$.isUnd(e)?32:$.pInt(e);t.length>>32-t}function i(e,t){var i,n,o,s,a;return o=2147483648&e,s=2147483648&t,i=1073741824&e,n=1073741824&t,a=(1073741823&e)+(1073741823&t),i&n?2147483648^a^o^s:i|n?1073741824&a?3221225472^a^o^s:1073741824^a^o^s:a^o^s}function n(e,t,i){return e&t|~e&i}function o(e,t,i){return e&i|t&~i}function s(e,t,i){return e^t^i}function a(e,t,i){return t^(e|~i)}function r(e,o,s,a,r,l,c){return e=i(e,i(i(n(o,s,a),r),c)),i(t(e,l),o)}function l(e,n,s,a,r,l,c){return e=i(e,i(i(o(n,s,a),r),c)),i(t(e,l),n)}function c(e,n,o,a,r,l,c){return e=i(e,i(i(s(n,o,a),r),c)),i(t(e,l),n)}function u(e,n,o,s,r,l,c){return e=i(e,i(i(a(n,o,s),r),c)),i(t(e,l),n)}function d(e){for(var t,i=e.length,n=i+8,o=(n-n%64)/64,s=16*(o+1),a=Array(s-1),r=0,l=0;i>l;)t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|e.charCodeAt(l)<>>29,a}function p(e){var t,i,n="",o="";for(i=0;3>=i;i++)t=e>>>8*i&255,o="0"+t.toString(16),n+=o.substr(o.length-2,2);return n}function g(e){e=e.replace(/rn/g,"n");for(var t="",i=0;in?t+=String.fromCharCode(n):n>127&&2048>n?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}var h,m,f,b,S,v,y,C,A,w=Array(),T=7,N=12,E=17,I=22,P=5,D=9,_=14,R=20,k=4,L=11,O=16,x=23,F=6,U=10,M=15,V=21;for(e=g(e),w=d(e),v=1732584193,y=4023233417,C=2562383102,A=271733878,h=0;h/g,">").replace(/")},$.draggeblePlace=function(){return t('
').appendTo("#rl-hidden")},$.defautOptionsAfterRender=function(e,i){i&&!$.isUnd(i.disabled)&&e&&t(e).toggleClass("disabled",i.disabled).prop("disabled",i.disabled)},$.windowPopupKnockout=function(i,n,o,s){var a=null,r=e.open(""),l="__OpenerApplyBindingsUid"+$.fakeMd5()+"__",c=t("#"+n);e[l]=function(){if(r&&r.document.body&&c&&c[0]){var n=t(r.document.body);t("#rl-content",n).html(c.html()),t("html",r.document).addClass("external "+t("html").attr("class")),$.i18nToNode(n),g.prototype.applyExternal(i,t("#rl-content",n)[0]),e[l]=null,s(r)}},r.document.open(),r.document.write(''+$.encodeHtml(o)+''),r.document.close(),a=r.document.createElement("script"),a.type="text/javascript",a.innerHTML="if(window&&window.opener&&window.opener['"+l+"']){window.opener['"+l+"']();window.opener['"+l+"']=null}",r.document.getElementsByTagName("head")[0].appendChild(a)},$.settingsSaveHelperFunction=function(e,t,i,n){return i=i||null,n=$.isUnd(n)?1e3:$.pInt(n),function(o,a,r,l,c){t.call(i,a&&a.Result?W.SaveSettingsStep.TrueResult:W.SaveSettingsStep.FalseResult),e&&e.call(i,o,a,r,l,c),s.delay(function(){t.call(i,W.SaveSettingsStep.Idle)},n)}},$.settingsSaveHelperSimpleFunction=function(e,t){return $.settingsSaveHelperFunction(null,e,t,1e3)},$.$div=t(""),$.htmlToPlain=function(e){var i=0,n=0,o=0,s=0,a=0,r="",l=function(e){for(var t=100,i="",n="",o=e,s=0,a=0;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},c=function(e){return e=l(t.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,u),e="\n"+t.trim(e)+"\n"),e}return""},d=function(){return arguments&&1/g,">"):""},p=function(){return arguments&&1/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(/
]*>/gim,"").replace(/]*>([\s\S\r\n]*)<\/div>/gim,u).replace(/
]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,p).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/&/gi,"&").replace(/<[^>]*>/gm,""),r=$.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<"),i=0,a=100;a>0&&(a--,n=r.indexOf("__bq__start__",i),n>-1);)o=r.indexOf("__bq__start__",n+5),s=r.indexOf("__bq__end__",n+5),(-1===o||o>s)&&s>n?(r=r.substring(0,n)+c(r.substring(n+13,s))+r.substring(s+11),i=0):i=o>-1&&s>o?o-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},$.plainToHtml=function(e){e=e.toString().replace(/\r/g,"");var i=!1,n=!0,o=!0,s=[],a="",r=0,l=e.split("\n");do{for(n=!1,s=[],r=0;r"===a.substr(0,1),o&&!i?(n=!0,i=!0,s.push("~~~blockquote~~~"),s.push(a.substr(1))):!o&&i?(i=!1,s.push("~~~/blockquote~~~"),s.push(a)):s.push(o&&i?a.substr(1):a);i&&(i=!1,s.push("~~~/blockquote~~~")),l=s}while(n);return e=l.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"
").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t.fn&&t.fn.linkify&&(e=$.$div.html(e).linkify().find(".linkified").removeClass("linkified").end().html()),e},$.resizeAndCrop=function(t,i,n){var o=new e.Image;o.onload=function(){var e=[0,0],t=document.createElement("canvas"),o=t.getContext("2d");t.width=i,t.height=i,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],o.fillStyle="#fff",o.fillRect(0,0,i,i),o.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,i,i),n(t.toDataURL("image/jpeg"))},o.src=t},$.computedPagenatorHelper=function(e,t){return function(){var i=0,n=0,o=2,s=[],a=e(),r=t(),l=function(e,t,i){var n={current:e===a,name:$.isUnd(i)?e.toString():i.toString(),custom:$.isUnd(i)?!1:!0,title:$.isUnd(i)?"":e.toString(),value:e.toString()};($.isUnd(t)?0:!t)?s.unshift(n):s.push(n)};if(r>1||r>0&&a>r){for(a>r?(l(r),i=r,n=r):((3>=a||a>=r-2)&&(o+=2),l(a),i=a,n=a);o>0;)if(i-=1,n+=1,i>0&&(l(i,!1),o--),r>=n)l(n,!0),o--;else if(0>=i)break;3===i?l(2,!1):i>3&&l(Math.round((i-1)/2),!1,"..."),r-2===n?l(r-1,!0):r-2>n&&l(Math.round((r+n)/2),!0,"..."),i>1&&l(1,!1),r>n&&l(r,!0)}return s}},$.selectElement=function(t){if(e.getSelection){var i=e.getSelection();i.removeAllRanges();var n=document.createRange();n.selectNodeContents(t),i.addRange(n)}else if(document.selection){var o=document.body.createTextRange();o.moveToElementText(t),o.select()}},$.disableKeyFilter=function(){e.key&&(key.filter=function(){return lt.data().useKeyboardShortcuts()})},$.restoreKeyFilter=function(){e.key&&(key.filter=function(e){if(lt.data().useKeyboardShortcuts()){var t=e.target||e.srcElement,i=t?t.tagName:"";return i=i.toUpperCase(),!("INPUT"===i||"SELECT"===i||"TEXTAREA"===i||t&&"DIV"===i&&"editorHtmlArea"===t.className&&t.contentEditable)}return!1})},$.detectDropdownVisibility=s.debounce(function(){X.dropdownVisibility(!!s.find(et,function(e){return e.hasClass("open")}))},50),Q={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return Q.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var t,i,n,o,s,a,r,l="",c=0;for(e=Q._utf8_encode(e);c
>2,s=(3&t)<<4|i>>4,a=(15&i)<<2|n>>6,r=63&n,isNaN(i)?a=r=64:isNaN(n)&&(r=64),l=l+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a)+this._keyStr.charAt(r);return l},decode:function(e){var t,i,n,o,s,a,r,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&s)<<4|a>>2,n=(3&a)<<6|r,l+=String.fromCharCode(t),64!==a&&(l+=String.fromCharCode(i)),64!==r&&(l+=String.fromCharCode(n));return Q._utf8_decode(l)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0,n=e.length,o=0;n>i;i++)o=e.charCodeAt(i),128>o?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},_utf8_decode:function(e){for(var t="",i=0,n=0,o=0,s=0;in?(t+=String.fromCharCode(n),i++):n>191&&224>n?(o=e.charCodeAt(i+1),t+=String.fromCharCode((31&n)<<6|63&o),i+=2):(o=e.charCodeAt(i+1),s=e.charCodeAt(i+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),i+=3);return t}},i.bindingHandlers.tooltip={init:function(e,n){if(!X.bMobileDevice){var o=t(e),s=o.data("tooltip-class")||"",a=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:a,trigger:"hover",title:function(){return o.is(".disabled")||X.dropdownVisibility()?"":''+$.i18n(i.utils.unwrapObservable(n()))+""}}).click(function(){o.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(e,i){var n=t(e),o=n.data("tooltip-class")||"",s=n.data("tooltip-placement")||"top";n.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:s,title:function(){return n.is(".disabled")||X.dropdownVisibility()?"":''+i()()+""}}).click(function(){n.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){n.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(e){var i=t(e);i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),at.click(function(){i.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,n){var o=i.utils.unwrapObservable(n());""===o?t(e).data("tooltip3-data","").tooltip("hide"):t(e).data("tooltip3-data",o).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(e){et.push(t(e))}},i.bindingHandlers.openDropdownTrigger={update:function(e,n){if(i.utils.unwrapObservable(n())){var o=t(e);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),$.detectDropdownVisibility()),n()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){t(e).closest(".dropdown").on("click",".e-item",function(){t(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,n){t(e).popover(i.utils.unwrapObservable(n()))}},i.bindingHandlers.csstext={init:function(e,n){e&&e.styleSheet&&!$.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=i.utils.unwrapObservable(n()):t(e).text(i.utils.unwrapObservable(n()))},update:function(e,n){e&&e.styleSheet&&!$.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=i.utils.unwrapObservable(n()):t(e).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.resizecrop={init:function(e){t(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,i){i()(),t(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(i,n,o,s){t(i).on("keypress",function(o){o&&13===e.parseInt(o.keyCode,10)&&(t(i).trigger("change"),n().call(s))})}},i.bindingHandlers.onEsc={init:function(i,n,o,s){t(i).on("keypress",function(o){o&&27===e.parseInt(o.keyCode,10)&&(t(i).trigger("change"),n().call(s))})}},i.bindingHandlers.clickOnTrue={update:function(e,n){i.utils.unwrapObservable(n())&&t(e).click()}},i.bindingHandlers.modal={init:function(e,n){t(e).toggleClass("fade",!X.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(n())}).on("shown",function(){$.windowResize()}).find(".close").click(function(){n()(!1)})},update:function(e,n){t(e).modal(i.utils.unwrapObservable(n())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(e){$.i18nToNode(e)}},i.bindingHandlers.i18nUpdate={update:function(e,t){i.utils.unwrapObservable(t()),$.i18nToNode(e)}},i.bindingHandlers.link={update:function(e,n){t(e).attr("href",i.utils.unwrapObservable(n()))}},i.bindingHandlers.title={update:function(e,n){t(e).attr("title",i.utils.unwrapObservable(n()))}},i.bindingHandlers.textF={init:function(e,n){t(e).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,n){var o=i.utils.unwrapObservable(n());t(e).css({height:o[1],"min-height":o[1]})},update:function(e,n){var o=i.utils.unwrapObservable(n()),s=$.pInt(o[1]),a=0,r=t(e).offset().top;r>0&&(r+=$.pInt(o[2]),a=st.height()-r,a>s&&(s=a),t(e).css({height:s,"min-height":s}))}},i.bindingHandlers.appendDom={update:function(e,n){t(e).hide().empty().append(i.utils.unwrapObservable(n())).show()}},i.bindingHandlers.draggable={init:function(n,o,s){if(!X.bMobileDevice){var a=100,r=3,l=s(),c=l&&l.droppableSelector?l.droppableSelector:"",u={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};c&&(u.drag=function(i){t(c).each(function(){var n=null,o=null,s=t(this),l=s.offset(),c=l.top+s.height();e.clearInterval(s.data("timerScroll")),s.data("timerScroll",!1),i.pageX>=l.left&&i.pageX<=l.left+s.width()&&(i.pageY>=c-a&&i.pageY<=c&&(n=function(){s.scrollTop(s.scrollTop()+r),$.windowResize()},s.data("timerScroll",e.setInterval(n,10)),n()),i.pageY>=l.top&&i.pageY<=l.top+a&&(o=function(){s.scrollTop(s.scrollTop()-r),$.windowResize()},s.data("timerScroll",e.setInterval(o,10)),o()))})},u.stop=function(){t(c).each(function(){e.clearInterval(t(this).data("timerScroll")),t(this).data("timerScroll",!1)
-})}),u.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},t(n).draggable(u).on("mousedown",function(){$.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(e,i,n){if(!X.bMobileDevice){var o=i(),s=n(),a=s&&s.droppableOver?s.droppableOver:null,r=s&&s.droppableOut?s.droppableOut:null,l={tolerance:"pointer",hoverClass:"droppableHover"};o&&(l.drop=function(e,t){o(e,t)},a&&(l.over=function(e,t){a(e,t)}),r&&(l.out=function(e,t){r(e,t)}),t(e).droppable(l))}}},i.bindingHandlers.nano={init:function(e){X.bDisableNanoScroll||t(e).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var i=t(e);i.data("save-trigger-type",i.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===i.data("save-trigger-type")?i.append(' ').addClass("settings-saved-trigger"):i.addClass("settings-saved-trigger-input")},update:function(e,n){var o=i.utils.unwrapObservable(n()),s=t(e);if("custom"===s.data("save-trigger-type"))switch(o.toString()){case"1":s.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":s.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":s.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:s.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(o.toString()){case"1":s.addClass("success").removeClass("error");break;case"0":s.addClass("error").removeClass("success");break;case"-2":break;default:s.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(e,i){var n=t(e),o=i(),a=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};n.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:a,inputDelimiters:[",",";"],autoCompleteSource:function(e,t){lt.getAutocomplete(e.term,function(e){t(s.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return s.map(e,function(e){var t=$.trim(e),i=null;return""!==t?(i=new h,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:s.bind(function(e){n.data("EmailsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){n.data("EmailsTagsValue")!==e&&(n.val(e),n.data("EmailsTagsValue",e),n.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&n.inputosaurus("focus")})}},i.bindingHandlers.contactTags={init:function(e,i){var n=t(e),o=i(),a=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};n.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:a,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:function(e,t){lt.getContactsTagsAutocomplete(e.term,function(e){t(s.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return s.map(e,function(e){var t=$.trim(e),i=null;return""!==t?(i=new m,i.name(t),[i.toLine(!1),i]):[t,null]})},change:s.bind(function(e){n.data("ContactsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){n.data("ContactsTagsValue")!==e&&(n.val(e),n.data("ContactsTagsValue",e),n.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&n.inputosaurus("focus")})}},i.bindingHandlers.command={init:function(e,n,o,s){var a=t(e),r=n();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(s,arguments)},update:function(e,i){var n=!0,o=t(e),s=i();n=s.enabled(),o.toggleClass("command-not-enabled",!n),n&&(n=s.canExecute(),o.toggleClass("command-can-not-be-execute",!n)),o.toggleClass("command-disabled disable disabled",!n).toggleClass("no-disabled",!!n),(o.is("input")||o.is("button"))&&o.prop("disabled",!n)}},i.extenders.trimmer=function(e){var t=i.computed({read:e,write:function(t){e($.trim(t.toString()))},owner:this});return t(e()),t},i.extenders.posInterer=function(e,t){var n=i.computed({read:e,write:function(i){var n=$.pInt(i.toString(),t);0>=n&&(n=t),n===e()&&""+n!=""+i&&e(n+1),e(n)}});return n(e()),n},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){return t.iTimeout=0,t.subscribe(function(n){n&&(e.clearTimeout(t.iTimeout),t.iTimeout=e.setTimeout(function(){t(!1),t.iTimeout=0},$.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){return this.hasError=i.observable(!1),this.subscribe(function(e){e=$.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){return this.hasError=i.observable(!1),this.subscribe(function(e){e=$.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(e){return this.hasFuncError=i.observable(!1),$.isFunc(e)&&(this.subscribe(function(t){this.hasFuncError(!e(t))},this),this.valueHasMutated()),this},a.prototype.root=function(){return this.sBase},a.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},a.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},a.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},a.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},a.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},a.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},a.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},a.prototype.change=function(t){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+e.encodeURIComponent(t)+"/"},a.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},a.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},a.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},a.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},a.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},a.prototype.settings=function(e){var t=this.sBase+"settings";return $.isUnd(e)||""===e||(t+="/"+e),t},a.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},a.prototype.mailBox=function(e,t,i){t=$.isNormal(t)?$.pInt(t):1,i=$.pString(i);var n=this.sBase+"mailbox/";return""!==e&&(n+=encodeURI(e)),t>1&&(n=n.replace(/[\/]+$/,""),n+="/p"+t),""!==i&&(n=n.replace(/[\/]+$/,""),n+="/"+encodeURI(i)),n},a.prototype.phpInfo=function(){return this.sServer+"Info"},a.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},a.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},a.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},a.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},a.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},a.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=$.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},a.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},a.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},a.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},a.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},a.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},J.oViewModelsHooks={},J.oSimpleHooks={},J.regViewModelHook=function(e,t){t&&(t.__hookName=e)},J.addHook=function(e,t){$.isFunc(t)&&($.isArray(J.oSimpleHooks[e])||(J.oSimpleHooks[e]=[]),J.oSimpleHooks[e].push(t))},J.runHook=function(e,t){$.isArray(J.oSimpleHooks[e])&&(t=t||[],s.each(J.oSimpleHooks[e],function(e){e.apply(null,t)}))},J.mainSettingsGet=function(e){return lt?lt.settingsGet(e):null},J.remoteRequest=function(e,t,i,n,o,s){lt&<.remote().defaultRequest(e,t,i,n,o,s)},J.settingsGet=function(e,t){var i=J.mainSettingsGet("Plugins");return i=i&&$.isUnd(i[e])?null:i[e],i?$.isUnd(i[t])?null:i[t]:null},r.supported=function(){return!0},r.prototype.set=function(e,i){var n=t.cookie(z.Values.ClientSideCookieIndexName),o=!1,s=null;try{s=null===n?null:JSON.parse(n),s||(s={}),s[e]=i,t.cookie(z.Values.ClientSideCookieIndexName,JSON.stringify(s),{expires:30}),o=!0}catch(a){}return o},r.prototype.get=function(e){var i=t.cookie(z.Values.ClientSideCookieIndexName),n=null;try{n=null===i?null:JSON.parse(i),n=n&&!$.isUnd(n[e])?n[e]:null}catch(o){}return n},l.supported=function(){return!!e.localStorage},l.prototype.set=function(t,i){var n=e.localStorage[z.Values.ClientSideCookieIndexName]||null,o=!1,s=null;try{s=null===n?null:JSON.parse(n),s||(s={}),s[t]=i,e.localStorage[z.Values.ClientSideCookieIndexName]=JSON.stringify(s),o=!0}catch(a){}return o},l.prototype.get=function(t){var i=e.localStorage[z.Values.ClientSideCookieIndexName]||null,n=null;try{n=null===i?null:JSON.parse(i),n=n&&!$.isUnd(n[t])?n[t]:null}catch(o){}return n},c.prototype.oDriver=null,c.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},c.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},u.prototype.bootstart=function(){},d.prototype.sPosition="",d.prototype.sTemplate="",d.prototype.viewModelName="",d.prototype.viewModelDom=null,d.prototype.viewModelTemplate=function(){return this.sTemplate},d.prototype.viewModelPosition=function(){return this.sPosition},d.prototype.cancelCommand=d.prototype.closeCommand=function(){},d.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=lt.data().keyScope(),lt.data().keyScope(this.sDefaultKeyScope)},d.prototype.restoreKeyScope=function(){lt.data().keyScope(this.sCurrentKeyScope)},d.prototype.registerPopupKeyDown=function(){var e=this;st.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&W.EventKeyCode.Esc===t.keyCode)return $.delegateRun(e,"cancelCommand"),!1;if(W.EventKeyCode.Backspace===t.keyCode&&!$.inFocus())return!1}return!0})},p.prototype.oCross=null,p.prototype.sScreenName="",p.prototype.aViewModels=[],p.prototype.viewModels=function(){return this.aViewModels},p.prototype.screenName=function(){return this.sScreenName},p.prototype.routes=function(){return null},p.prototype.__cross=function(){return this.oCross},p.prototype.__start=function(){var e=this.routes(),t=null,i=null;$.isNonEmptyArray(e)&&(i=s.bind(this.onRoute||$.emptyFunction,this),t=n.create(),s.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},g.constructorEnd=function(e){$.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},g.prototype.sDefaultScreenName="",g.prototype.oScreens={},g.prototype.oBoot=null,g.prototype.oCurrentScreen=null,g.prototype.hideLoading=function(){t("#rl-loading").hide()},g.prototype.routeOff=function(){o.changed.active=!1},g.prototype.routeOn=function(){o.changed.active=!0},g.prototype.setBoot=function(e){return $.isNormal(e)&&(this.oBoot=e),this},g.prototype.screen=function(e){return""===e||$.isUnd(this.oScreens[e])?null:this.oScreens[e]},g.prototype.buildViewModel=function(e,n){if(e&&!e.__builded){var o=new e(n),a=o.viewModelPosition(),r=t("#rl-content #rl-"+a.toLowerCase()),l=null;e.__builded=!0,e.__vm=o,o.data=lt.data(),o.viewModelName=e.__name,r&&1===r.length?(l=t("").addClass("rl-view-model").addClass("RL-"+o.viewModelTemplate()).hide(),l.appendTo(r),o.viewModelDom=l,e.__dom=l,"Popups"===a&&(o.cancelCommand=o.closeCommand=$.createCommand(o,function(){tt.hideScreenPopup(e)}),o.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),lt.popupVisibilityNames.push(this.viewModelName),o.viewModelDom.css("z-index",3e3+lt.popupVisibilityNames().length+10),$.delegateRun(this,"onFocus",[],500)):($.delegateRun(this,"onHide"),this.restoreKeyScope(),lt.popupVisibilityNames.remove(this.viewModelName),o.viewModelDom.css("z-index",2e3),X.tooltipTrigger(!X.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},o)),J.runHook("view-model-pre-build",[e.__name,o,l]),i.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:o.viewModelTemplate()}}},o),$.delegateRun(o,"onBuild",[l]),o&&"Popups"===a&&o.registerPopupKeyDown(),J.runHook("view-model-post-build",[e.__name,o,l])):$.log("Cannot find view model position: "+a)}return e?e.__vm:null},g.prototype.applyExternal=function(e,t){e&&t&&i.applyBindings(e,t)},g.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),J.runHook("view-model-on-hide",[e.__name,e.__vm]))},g.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),$.delegateRun(e.__vm,"onShow",t||[]),J.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},g.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},g.prototype.screenOnRoute=function(e,t){var i=this,n=null,o=null;""===$.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(n=this.screen(e),n||(n=this.screen(this.sDefaultScreenName),n&&(t=e+"/"+t,e=this.sDefaultScreenName)),n&&n.__started&&(n.__builded||(n.__builded=!0,$.isNonEmptyArray(n.viewModels())&&s.each(n.viewModels(),function(e){this.buildViewModel(e,n)},this),$.delegateRun(n,"onBuild")),s.defer(function(){i.oCurrentScreen&&($.delegateRun(i.oCurrentScreen,"onHide"),$.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),$.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=n,i.oCurrentScreen&&($.delegateRun(i.oCurrentScreen,"onShow"),J.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),$.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),$.delegateRun(e.__vm,"onShow"),$.delegateRun(e.__vm,"onFocus",[],200),J.runHook("view-model-on-show",[e.__name,e.__vm]))},i)),o=n.__cross(),o&&o.parse(t)})))},g.prototype.startScreens=function(e){t("#rl-content").css({visibility:"hidden"}),s.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),s.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),J.runHook("screen-pre-start",[e.screenName(),e]),$.delegateRun(e,"onStart"),J.runHook("screen-post-start",[e.screenName(),e]))},this);var i=n.create();i.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),o.initialized.add(i.parse,i),o.changed.add(i.parse,i),o.init(),t("#rl-content").css({visibility:"visible"}),s.delay(function(){ot.removeClass("rl-started-trigger").addClass("rl-started")},50)},g.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=$.isUnd(i)?!1:!!i,($.isUnd(t)?1:!t)?(o.changed.active=!0,o[i?"replaceHash":"setHash"](e),o.setHash(e)):(o.changed.active=!1,o[i?"replaceHash":"setHash"](e),o.changed.active=!0)},g.prototype.bootstart=function(){return this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart(),this},tt=new g,h.newInstanceFromJson=function(e){var t=new h;return t.initByJson(e)?t:null},h.prototype.name="",h.prototype.email="",h.prototype.privateType=null,h.prototype.clear=function(){this.email="",this.name="",this.privateType=null},h.prototype.validate=function(){return""!==this.name||""!==this.email},h.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},h.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},h.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=W.EmailType.Facebook),null===this.privateType&&(this.privateType=W.EmailType.Default)),this.privateType},h.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},h.prototype.parse=function(e){this.clear(),e=$.trim(e);var t=/(?:"([^"]+)")? ?(.*?@[^>,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},h.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=$.trim(e.Name),this.email=$.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},h.prototype.toLine=function(e,t,i){var n="";return""!==this.email&&(t=$.isUnd(t)?!1:!!t,i=$.isUnd(i)?!1:!!i,e&&""!==this.name?n=t?'")+'" target="_blank" tabindex="-1">'+$.encodeHtml(this.name)+"":i?$.encodeHtml(this.name):this.name:(n=this.email,""!==this.name?t?n=$.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+$.encodeHtml(n)+""+$.encodeHtml(">"):(n='"'+this.name+'" <'+n+">",i&&(n=$.encodeHtml(n))):t&&(n=''+$.encodeHtml(this.email)+""))),n},h.prototype.mailsoParse=function(e){if(e=$.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var n=e.length;return 0>t&&(t+=n),n="undefined"==typeof i?n:0>i?i+n:i+t,t>=e.length||0>t||t>n?!1:e.slice(t,n)},i=function(e,t,i,n){return 0>i&&(i+=e.length),n=void 0!==n?n:e.length,0>n&&(n=n+e.length-i),e.slice(0,i)+t.substr(0,n)+t.slice(n)+e.slice(i+n)},n="",o="",s="",a=!1,r=!1,l=!1,c=null,u=0,d=0,p=0;p0&&0===n.length&&(n=t(e,0,p)),r=!0,u=p);break;case">":r&&(d=p,o=t(e,u+1,d-u-1),e=i(e,"",u,d-u+1),d=0,p=0,u=0,r=!1);break;case"(":a||r||l||(l=!0,u=p);break;case")":l&&(d=p,s=t(e,u+1,d-u-1),e=i(e,"",u,d-u+1),d=0,p=0,u=0,l=!1);break;case"\\":p++}p++}return 0===o.length&&(c=e.match(/[^@\s]+@\S+/i),c&&c[0]?o=c[0]:n=e),o.length>0&&0===n.length&&0===s.length&&(n=e.replace(o,"")),o=$.trim(o).replace(/^[<]+/,"").replace(/[>]+$/,""),n=$.trim(n).replace(/^["']+/,"").replace(/["']+$/,""),s=$.trim(s).replace(/^[(]+/,"").replace(/[)]+$/,""),n=n.replace(/\\\\(.)/,"$1"),s=s.replace(/\\\\(.)/,"$1"),this.name=n,this.email=o,this.clearDuplicateName(),!0},h.prototype.inputoTagLine=function(){return 0(new e.Date).getTime()-d),g&&l.oRequests[g]&&(l.oRequests[g].__aborted&&(o="abort"),l.oRequests[g]=null),l.defaultResponse(i,g,o,t,s,n)}),g&&0 ").addClass("rl-settings-view-model").hide(),l.appendTo(r),o.data=lt.data(),o.viewModelDom=l,o.__rlSettingsData=a.__rlSettingsData,a.__dom=l,a.__builded=!0,a.__vm=o,i.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:a.__rlSettingsData.Template}}},o),$.delegateRun(o,"onBuild",[l])):$.log("Cannot find sub settings view model position: SettingsSubScreen")),o&&s.defer(function(){n.oCurrentSubScreen&&($.delegateRun(n.oCurrentSubScreen,"onHide"),n.oCurrentSubScreen.viewModelDom.hide()),n.oCurrentSubScreen=o,n.oCurrentSubScreen&&(n.oCurrentSubScreen.viewModelDom.show(),$.delegateRun(n.oCurrentSubScreen,"onShow"),$.delegateRun(n.oCurrentSubScreen,"onFocus",[],200),s.each(n.menu(),function(e){e.selected(o&&o.__rlSettingsData&&e.route===o.__rlSettingsData.Route)}),t("#rl-content .b-settings .b-content .content").scrollTop(0)),$.windowResize()})):tt.setHash(lt.link().settings(),!1,!0)},H.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&($.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},H.prototype.onBuild=function(){s.each(Z.settings,function(e){e&&e.__rlSettingsData&&!s.find(Z["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:i.observable(!1),disabled:!!s.find(Z["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=t("#rl-content #rl-settings-subscreen")},H.prototype.routes=function(){var e=s.find(Z.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=$.isUnd(i.subname)?t:$.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},s.extend(q.prototype,p.prototype),q.prototype.onShow=function(){lt.setTitle("")},s.extend(B.prototype,H.prototype),B.prototype.onShow=function(){lt.setTitle("")},s.extend(K.prototype,u.prototype),K.prototype.oSettings=null,K.prototype.oPlugins=null,K.prototype.oLocal=null,K.prototype.oLink=null,K.prototype.oSubs={},K.prototype.download=function(t){var i=null,n=null,o=navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=document.createElement("a"),i.href=t,document.createEvent&&(n=document.createEvent("MouseEvents"),n&&n.initEvent&&i.dispatchEvent))?(n.initEvent("click",!0,!0),i.dispatchEvent(n),!0):(X.bMobileDevice?(e.open(t,"_self"),e.focus()):this.iframe.attr("src",t),!0)},K.prototype.link=function(){return null===this.oLink&&(this.oLink=new a),this.oLink},K.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new c),this.oLocal},K.prototype.settingsGet=function(e){return null===this.oSettings&&(this.oSettings=$.isNormal(it)?it:{}),$.isUnd(this.oSettings[e])?null:this.oSettings[e]},K.prototype.settingsSet=function(e,t){null===this.oSettings&&(this.oSettings=$.isNormal(it)?it:{}),this.oSettings[e]=t},K.prototype.setTitle=function(t){t=($.isNormal(t)&&0').appendTo("body"),st.on("error",function(e){lt&&e&&e.originalEvent&&e.originalEvent.message&&-1===$.inArray(e.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&<.remote().jsError($.emptyFunction,e.originalEvent.message,e.originalEvent.filename,e.originalEvent.lineno,location&&location.toString?location.toString():"",ot.attr("class"),$.microtime()-X.now)}),at.on("keydown",function(e){e&&e.ctrlKey&&ot.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&ot.removeClass("rl-ctrl-key-pressed")})}function j(){K.call(this),this.oData=null,this.oRemote=null,this.oCache=null}var z={},W={},Y={},$={},J={},Q={},X={},Z={settings:[],"settings-removed":[],"settings-disabled":[]},et=[],tt=null,it=e.rainloopAppData||{},nt=e.rainloopI18N||{},ot=t("html"),st=t(e),at=t(e.document),rt=e.Notification&&e.Notification.requestPermission?e.Notification:null,lt=null;X.now=(new Date).getTime(),X.momentTrigger=i.observable(!0),X.dropdownVisibility=i.observable(!1).extend({rateLimit:0}),X.tooltipTrigger=i.observable(!1).extend({rateLimit:0}),X.langChangeTrigger=i.observable(!0),X.iAjaxErrorCount=0,X.iTokenErrorCount=0,X.iMessageBodyCacheCount=0,X.bUnload=!1,X.sUserAgent=(navigator.userAgent||"").toLowerCase(),X.bIsiOSDevice=-1/g,">").replace(/"/g,""").replace(/'/g,"'"):""},$.splitPlainText=function(e,t){var i="",n="",o=e,s=0,a=0;for(t=$.isUnd(t)?100:t;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},$.timeOutAction=function(){var t={};return function(i,n,o){$.isUnd(t[i])&&(t[i]=0),e.clearTimeout(t[i]),t[i]=e.setTimeout(n,o)}}(),$.timeOutActionSecond=function(){var t={};return function(i,n,o){t[i]||(t[i]=e.setTimeout(function(){n(),t[i]=0},o))}}(),$.audio=function(){var t=!1;return function(i,n){if(!1===t)if(X.bIsiOSDevice)t=null;else{var o=!1,s=!1,a=e.Audio?new e.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(s=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||s?(t=a,t.preload="none",t.loop=!1,t.autoplay=!1,t.muted=!1,t.src=o?i:n):t=null):t=null}return t}}(),$.hos=function(e,t){return e&&Object.hasOwnProperty?Object.hasOwnProperty.call(e,t):!1},$.i18n=function(e,t,i){var n="",o=$.isUnd(nt[e])?$.isUnd(i)?e:i:nt[e];if(!$.isUnd(t)&&!$.isNull(t))for(n in t)$.hos(t,n)&&(o=o.replace("%"+n+"%",t[n]));return o},$.i18nToNode=function(e){s.defer(function(){t(".i18n",e).each(function(){var e=t(this),i="";i=e.data("i18n-text"),i?e.text($.i18n(i)):(i=e.data("i18n-html"),i&&e.html($.i18n(i)),i=e.data("i18n-placeholder"),i&&e.attr("placeholder",$.i18n(i)),i=e.data("i18n-title"),i&&e.attr("title",$.i18n(i)))
+})})},$.i18nToDoc=function(){e.rainloopI18N&&(nt=e.rainloopI18N||{},$.i18nToNode(at),X.langChangeTrigger(!X.langChangeTrigger())),e.rainloopI18N={}},$.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?X.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&X.langChangeTrigger.subscribe(e,t)},$.inFocus=function(){return document.activeElement?($.isUnd(document.activeElement.__inFocusCache)&&(document.activeElement.__inFocusCache=t(document.activeElement).is("input,textarea,iframe,.cke_editable")),!!document.activeElement.__inFocusCache):!1},$.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var e=t(document.activeElement);e.is("input,textarea")&&document.activeElement.blur()}},$.removeSelection=function(){if(e&&e.getSelection){var t=e.getSelection();t&&t.removeAllRanges&&t.removeAllRanges()}else document&&document.selection&&document.selection.empty&&document.selection.empty()},$.replySubjectAdd=function(e,t){e=$.trim(e.toUpperCase()),t=$.trim(t.replace(/[\s]+/," "));var i=0,n="",o=!1,s="",a=[],r=[],l="RE"===e,c="FWD"===e,u=!c;if(""!==t){for(o=!1,r=t.split(":"),i=0;i0);return e.replace(/[\s]+/," ")},$._replySubjectAdd_=function(t,i,n){var o=null,s=$.trim(i);return s=null===(o=new e.RegExp("^"+t+"[\\s]?\\:(.*)$","gi").exec(i))||$.isUnd(o[1])?null===(o=new e.RegExp("^("+t+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(i))||$.isUnd(o[1])||$.isUnd(o[2])||$.isUnd(o[3])?t+": "+i:o[1]+($.pInt(o[2])+1)+o[3]:t+"[2]: "+o[1],s=s.replace(/[\s]+/g," "),s=($.isUnd(n)?!0:n)?$.fixLongSubject(s):s},$._fixLongSubject_=function(e){var t=0,i=null;e=$.trim(e.replace(/[\s]+/," "));do i=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!i||$.isUnd(i[0]))&&(i=null),i&&(t=0,t+=$.isUnd(i[2])?1:0+$.pInt(i[2]),t+=$.isUnd(i[4])?1:0+$.pInt(i[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(i);return e=e.replace(/[\s]+/," ")},$.roundNumber=function(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},$.friendlySize=function(e){return e=$.pInt(e),e>=1073741824?$.roundNumber(e/1073741824,1)+"GB":e>=1048576?$.roundNumber(e/1048576,1)+"MB":e>=1024?$.roundNumber(e/1024,0)+"KB":e+"B"},$.log=function(t){e.console&&e.console.log&&e.console.log(t)},$.getNotification=function(e,t){return e=$.pInt(e),W.Notification.ClientViewError===e&&t?t:$.isUnd(Y[e])?"":Y[e]},$.initNotificationLanguage=function(){Y[W.Notification.InvalidToken]=$.i18n("NOTIFICATIONS/INVALID_TOKEN"),Y[W.Notification.AuthError]=$.i18n("NOTIFICATIONS/AUTH_ERROR"),Y[W.Notification.AccessError]=$.i18n("NOTIFICATIONS/ACCESS_ERROR"),Y[W.Notification.ConnectionError]=$.i18n("NOTIFICATIONS/CONNECTION_ERROR"),Y[W.Notification.CaptchaError]=$.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),Y[W.Notification.SocialFacebookLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),Y[W.Notification.SocialTwitterLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),Y[W.Notification.SocialGoogleLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),Y[W.Notification.DomainNotAllowed]=$.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),Y[W.Notification.AccountNotAllowed]=$.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),Y[W.Notification.AccountTwoFactorAuthRequired]=$.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),Y[W.Notification.AccountTwoFactorAuthError]=$.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),Y[W.Notification.CouldNotSaveNewPassword]=$.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),Y[W.Notification.CurrentPasswordIncorrect]=$.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),Y[W.Notification.NewPasswordShort]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),Y[W.Notification.NewPasswordWeak]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),Y[W.Notification.NewPasswordForbidden]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),Y[W.Notification.ContactsSyncError]=$.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),Y[W.Notification.CantGetMessageList]=$.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),Y[W.Notification.CantGetMessage]=$.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),Y[W.Notification.CantDeleteMessage]=$.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),Y[W.Notification.CantMoveMessage]=$.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Y[W.Notification.CantCopyMessage]=$.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Y[W.Notification.CantSaveMessage]=$.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),Y[W.Notification.CantSendMessage]=$.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),Y[W.Notification.InvalidRecipients]=$.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),Y[W.Notification.CantCreateFolder]=$.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),Y[W.Notification.CantRenameFolder]=$.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),Y[W.Notification.CantDeleteFolder]=$.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),Y[W.Notification.CantDeleteNonEmptyFolder]=$.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),Y[W.Notification.CantSubscribeFolder]=$.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),Y[W.Notification.CantUnsubscribeFolder]=$.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),Y[W.Notification.CantSaveSettings]=$.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),Y[W.Notification.CantSavePluginSettings]=$.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),Y[W.Notification.DomainAlreadyExists]=$.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),Y[W.Notification.CantInstallPackage]=$.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),Y[W.Notification.CantDeletePackage]=$.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),Y[W.Notification.InvalidPluginPackage]=$.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),Y[W.Notification.UnsupportedPluginPackage]=$.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),Y[W.Notification.LicensingServerIsUnavailable]=$.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),Y[W.Notification.LicensingExpired]=$.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),Y[W.Notification.LicensingBanned]=$.i18n("NOTIFICATIONS/LICENSING_BANNED"),Y[W.Notification.DemoSendMessageError]=$.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),Y[W.Notification.AccountAlreadyExists]=$.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),Y[W.Notification.MailServerError]=$.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),Y[W.Notification.InvalidInputArgument]=$.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),Y[W.Notification.UnknownNotification]=$.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),Y[W.Notification.UnknownError]=$.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},$.getUploadErrorDescByCode=function(e){var t="";switch($.pInt(e)){case W.UploadErrorCode.FileIsTooBig:t=$.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case W.UploadErrorCode.FilePartiallyUploaded:t=$.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case W.UploadErrorCode.FileNoUploaded:t=$.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case W.UploadErrorCode.MissingTempFolder:t=$.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case W.UploadErrorCode.FileOnSaveingError:t=$.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case W.UploadErrorCode.FileType:t=$.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=$.i18n("UPLOAD/ERROR_UNKNOWN")}return t},$.delegateRun=function(e,t,i,n){e&&e[t]&&(n=$.pInt(n),0>=n?e[t].apply(e,$.isArray(i)?i:[]):s.delay(function(){e[t].apply(e,$.isArray(i)?i:[])},n))},$.killCtrlAandS=function(t){if(t=t||e.event,t&&t.ctrlKey&&!t.shiftKey&&!t.altKey){var i=t.target||t.srcElement,n=t.keyCode||t.which;if(n===W.EventKeyCode.S)return void t.preventDefault();if(i&&i.tagName&&i.tagName.match(/INPUT|TEXTAREA/i))return;n===W.EventKeyCode.A&&(e.getSelection?e.getSelection().removeAllRanges():e.document.selection&&e.document.selection.clear&&e.document.selection.clear(),t.preventDefault())}},$.createCommand=function(e,t,n){var o=t?function(){return o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=i.observable(!0),n=$.isUnd(n)?!0:n,o.canExecute=i.computed($.isFunc(n)?function(){return o.enabled()&&n.call(e)}:function(){return o.enabled()&&!!n}),o},$.initDataConstructorBySettings=function(t){t.editorDefaultType=i.observable(W.EditorDefaultType.Html),t.showImages=i.observable(!1),t.interfaceAnimation=i.observable(W.InterfaceAnimation.Full),t.contactsAutosave=i.observable(!1),X.sAnimationType=W.InterfaceAnimation.Full,t.capaThemes=i.observable(!1),t.allowLanguagesOnSettings=i.observable(!0),t.allowLanguagesOnLogin=i.observable(!0),t.useLocalProxyForExternalImages=i.observable(!1),t.desktopNotifications=i.observable(!1),t.useThreads=i.observable(!0),t.replySameFolder=i.observable(!0),t.useCheckboxesInList=i.observable(!0),t.layout=i.observable(W.Layout.SidePreview),t.usePreviewPane=i.computed(function(){return W.Layout.NoPreview!==t.layout()}),t.interfaceAnimation.subscribe(function(e){if(X.bMobileDevice||e===W.InterfaceAnimation.None)ot.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),X.sAnimationType=W.InterfaceAnimation.None;else switch(e){case W.InterfaceAnimation.Full:ot.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),X.sAnimationType=e;break;case W.InterfaceAnimation.Normal:ot.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),X.sAnimationType=e}}),t.interfaceAnimation.valueHasMutated(),t.desktopNotificationsPermisions=i.computed(function(){t.desktopNotifications();var i=W.DesktopNotifications.NotSupported;if(rt&&rt.permission)switch(rt.permission.toLowerCase()){case"granted":i=W.DesktopNotifications.Allowed;break;case"denied":i=W.DesktopNotifications.Denied;break;case"default":i=W.DesktopNotifications.NotAllowed}else e.webkitNotifications&&e.webkitNotifications.checkPermission&&(i=e.webkitNotifications.checkPermission());return i}),t.useDesktopNotifications=i.computed({read:function(){return t.desktopNotifications()&&W.DesktopNotifications.Allowed===t.desktopNotificationsPermisions()},write:function(e){if(e){var i=t.desktopNotificationsPermisions();W.DesktopNotifications.Allowed===i?t.desktopNotifications(!0):W.DesktopNotifications.NotAllowed===i?rt.requestPermission(function(){t.desktopNotifications.valueHasMutated(),W.DesktopNotifications.Allowed===t.desktopNotificationsPermisions()?t.desktopNotifications()?t.desktopNotifications.valueHasMutated():t.desktopNotifications(!0):t.desktopNotifications()?t.desktopNotifications(!1):t.desktopNotifications.valueHasMutated()}):t.desktopNotifications(!1)}else t.desktopNotifications(!1)}}),t.language=i.observable(""),t.languages=i.observableArray([]),t.mainLanguage=i.computed({read:t.language,write:function(e){e!==t.language()?-1<$.inArray(e,t.languages())?t.language(e):0=t.diff(i,"hours")?n:t.format("L")===i.format("L")?$.i18n("MESSAGE_LIST/TODAY_AT",{TIME:i.format("LT")}):t.clone().subtract("days",1).format("L")===i.format("L")?$.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:i.format("LT")}):i.format(t.year()===i.year()?"D MMM.":"LL")},e)},$.isFolderExpanded=function(e){var t=lt.local().get(W.ClientSideKeyName.ExpandedFolders);return s.isArray(t)&&-1!==s.indexOf(t,e)},$.setExpandedFolder=function(e,t){var i=lt.local().get(W.ClientSideKeyName.ExpandedFolders);s.isArray(i)||(i=[]),t?(i.push(e),i=s.uniq(i)):i=s.without(i,e),lt.local().set(W.ClientSideKeyName.ExpandedFolders,i)},$.initLayoutResizer=function(e,i,n){var o=60,s=155,a=t(e),r=t(i),l=lt.local().get(n)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(o);else{a.resizable("enable");var t=$.pInt(lt.local().get(n))||s;c(t>s?t:s)}},d=function(e,t){t&&t.size&&t.size.width&&(lt.local().set(n,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>s?l:s),a.resizable({helper:"ui-resizable-helper",minWidth:s,maxWidth:350,handles:"e",stop:d}),lt.sub("left-panel.off",function(){u(!0)}),lt.sub("left-panel.on",function(){u(!1)})},$.initBlockquoteSwitcher=function(e){if(e){var i=t("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===t(this).parent().closest("blockquote",e).length});i&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),t('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),$.windowResize()}).after("
").before("
"))})}},$.removeBlockquoteSwitcher=function(e){e&&(t(e).find("blockquote.rl-bq-switcher").each(function(){t(this).removeClass("rl-bq-switcher hidden-bq")}),t(e).find(".rlBlockquoteSwitcher").each(function(){t(this).remove()}))},$.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},$.extendAsViewModel=function(e,t,i){t&&(i||(i=d),t.__name=e,J.regViewModelHook(e,t),s.extend(t.prototype,i.prototype))},$.addSettingsViewModel=function(e,t,i,n,o){e.__rlSettingsData={Label:i,Template:t,Route:n,IsDefault:!!o},Z.settings.push(e)},$.removeSettingsViewModel=function(e){Z["settings-removed"].push(e)},$.disableSettingsViewModel=function(e){Z["settings-disabled"].push(e)},$.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=$.trim(e.substring(0,e.length-7))),$.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},$.quoteName=function(e){return e.replace(/["]/g,'\\"')},$.microtime=function(){return(new Date).getTime()},$.convertLangName=function(e,t){return $.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},$.fakeMd5=function(e){var t="",i="0123456789abcdefghijklmnopqrstuvwxyz";for(e=$.isUnd(e)?32:$.pInt(e);t.length>>32-t}function i(e,t){var i,n,o,s,a;return o=2147483648&e,s=2147483648&t,i=1073741824&e,n=1073741824&t,a=(1073741823&e)+(1073741823&t),i&n?2147483648^a^o^s:i|n?1073741824&a?3221225472^a^o^s:1073741824^a^o^s:a^o^s}function n(e,t,i){return e&t|~e&i}function o(e,t,i){return e&i|t&~i}function s(e,t,i){return e^t^i}function a(e,t,i){return t^(e|~i)}function r(e,o,s,a,r,l,c){return e=i(e,i(i(n(o,s,a),r),c)),i(t(e,l),o)}function l(e,n,s,a,r,l,c){return e=i(e,i(i(o(n,s,a),r),c)),i(t(e,l),n)}function c(e,n,o,a,r,l,c){return e=i(e,i(i(s(n,o,a),r),c)),i(t(e,l),n)}function u(e,n,o,s,r,l,c){return e=i(e,i(i(a(n,o,s),r),c)),i(t(e,l),n)}function d(e){for(var t,i=e.length,n=i+8,o=(n-n%64)/64,s=16*(o+1),a=Array(s-1),r=0,l=0;i>l;)t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|e.charCodeAt(l)<>>29,a}function p(e){var t,i,n="",o="";for(i=0;3>=i;i++)t=e>>>8*i&255,o="0"+t.toString(16),n+=o.substr(o.length-2,2);return n}function g(e){e=e.replace(/rn/g,"n");for(var t="",i=0;in?t+=String.fromCharCode(n):n>127&&2048>n?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}var h,m,f,b,S,v,y,A,C,w=Array(),T=7,N=12,E=17,I=22,P=5,D=9,_=14,R=20,k=4,L=11,O=16,x=23,F=6,U=10,M=15,V=21;for(e=g(e),w=d(e),v=1732584193,y=4023233417,A=2562383102,C=271733878,h=0;h/g,">").replace(/")},$.draggeblePlace=function(){return t('
').appendTo("#rl-hidden")},$.defautOptionsAfterRender=function(e,i){i&&!$.isUnd(i.disabled)&&e&&t(e).toggleClass("disabled",i.disabled).prop("disabled",i.disabled)},$.windowPopupKnockout=function(i,n,o,s){var a=null,r=e.open(""),l="__OpenerApplyBindingsUid"+$.fakeMd5()+"__",c=t("#"+n);e[l]=function(){if(r&&r.document.body&&c&&c[0]){var n=t(r.document.body);t("#rl-content",n).html(c.html()),t("html",r.document).addClass("external "+t("html").attr("class")),$.i18nToNode(n),g.prototype.applyExternal(i,t("#rl-content",n)[0]),e[l]=null,s(r)}},r.document.open(),r.document.write(''+$.encodeHtml(o)+''),r.document.close(),a=r.document.createElement("script"),a.type="text/javascript",a.innerHTML="if(window&&window.opener&&window.opener['"+l+"']){window.opener['"+l+"']();window.opener['"+l+"']=null}",r.document.getElementsByTagName("head")[0].appendChild(a)},$.settingsSaveHelperFunction=function(e,t,i,n){return i=i||null,n=$.isUnd(n)?1e3:$.pInt(n),function(o,a,r,l,c){t.call(i,a&&a.Result?W.SaveSettingsStep.TrueResult:W.SaveSettingsStep.FalseResult),e&&e.call(i,o,a,r,l,c),s.delay(function(){t.call(i,W.SaveSettingsStep.Idle)},n)}},$.settingsSaveHelperSimpleFunction=function(e,t){return $.settingsSaveHelperFunction(null,e,t,1e3)},$.$div=t(""),$.htmlToPlain=function(e){var i=0,n=0,o=0,s=0,a=0,r="",l=function(e){for(var t=100,i="",n="",o=e,s=0,a=0;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},c=function(e){return e=l(t.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,u),e="\n"+t.trim(e)+"\n"),e}return""},d=function(){return arguments&&1/g,">"):""},p=function(){return arguments&&1/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(/
]*>/gim,"").replace(/]*>([\s\S\r\n]*)<\/div>/gim,u).replace(/
]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,p).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/&/gi,"&").replace(/<[^>]*>/gm,""),r=$.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<"),i=0,a=100;a>0&&(a--,n=r.indexOf("__bq__start__",i),n>-1);)o=r.indexOf("__bq__start__",n+5),s=r.indexOf("__bq__end__",n+5),(-1===o||o>s)&&s>n?(r=r.substring(0,n)+c(r.substring(n+13,s))+r.substring(s+11),i=0):i=o>-1&&s>o?o-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},$.plainToHtml=function(e){e=e.toString().replace(/\r/g,"");var i=!1,n=!0,o=!0,s=[],a="",r=0,l=e.split("\n");do{for(n=!1,s=[],r=0;r"===a.substr(0,1),o&&!i?(n=!0,i=!0,s.push("~~~blockquote~~~"),s.push(a.substr(1))):!o&&i?(i=!1,s.push("~~~/blockquote~~~"),s.push(a)):s.push(o&&i?a.substr(1):a);i&&(i=!1,s.push("~~~/blockquote~~~")),l=s}while(n);return e=l.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"
").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t.fn&&t.fn.linkify&&(e=$.$div.html(e).linkify().find(".linkified").removeClass("linkified").end().html()),e},$.resizeAndCrop=function(t,i,n){var o=new e.Image;o.onload=function(){var e=[0,0],t=document.createElement("canvas"),o=t.getContext("2d");t.width=i,t.height=i,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],o.fillStyle="#fff",o.fillRect(0,0,i,i),o.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,i,i),n(t.toDataURL("image/jpeg"))},o.src=t},$.computedPagenatorHelper=function(e,t){return function(){var i=0,n=0,o=2,s=[],a=e(),r=t(),l=function(e,t,i){var n={current:e===a,name:$.isUnd(i)?e.toString():i.toString(),custom:$.isUnd(i)?!1:!0,title:$.isUnd(i)?"":e.toString(),value:e.toString()};($.isUnd(t)?0:!t)?s.unshift(n):s.push(n)};if(r>1||r>0&&a>r){for(a>r?(l(r),i=r,n=r):((3>=a||a>=r-2)&&(o+=2),l(a),i=a,n=a);o>0;)if(i-=1,n+=1,i>0&&(l(i,!1),o--),r>=n)l(n,!0),o--;else if(0>=i)break;3===i?l(2,!1):i>3&&l(Math.round((i-1)/2),!1,"..."),r-2===n?l(r-1,!0):r-2>n&&l(Math.round((r+n)/2),!0,"..."),i>1&&l(1,!1),r>n&&l(r,!0)}return s}},$.selectElement=function(t){if(e.getSelection){var i=e.getSelection();i.removeAllRanges();var n=document.createRange();n.selectNodeContents(t),i.addRange(n)}else if(document.selection){var o=document.body.createTextRange();o.moveToElementText(t),o.select()}},$.disableKeyFilter=function(){e.key&&(key.filter=function(){return lt.data().useKeyboardShortcuts()})},$.restoreKeyFilter=function(){e.key&&(key.filter=function(e){if(lt.data().useKeyboardShortcuts()){var t=e.target||e.srcElement,i=t?t.tagName:"";return i=i.toUpperCase(),!("INPUT"===i||"SELECT"===i||"TEXTAREA"===i||t&&"DIV"===i&&"editorHtmlArea"===t.className&&t.contentEditable)}return!1})},$.detectDropdownVisibility=s.debounce(function(){X.dropdownVisibility(!!s.find(et,function(e){return e.hasClass("open")}))},50),Q={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return Q.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var t,i,n,o,s,a,r,l="",c=0;for(e=Q._utf8_encode(e);c
>2,s=(3&t)<<4|i>>4,a=(15&i)<<2|n>>6,r=63&n,isNaN(i)?a=r=64:isNaN(n)&&(r=64),l=l+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a)+this._keyStr.charAt(r);return l},decode:function(e){var t,i,n,o,s,a,r,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&s)<<4|a>>2,n=(3&a)<<6|r,l+=String.fromCharCode(t),64!==a&&(l+=String.fromCharCode(i)),64!==r&&(l+=String.fromCharCode(n));return Q._utf8_decode(l)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0,n=e.length,o=0;n>i;i++)o=e.charCodeAt(i),128>o?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},_utf8_decode:function(e){for(var t="",i=0,n=0,o=0,s=0;in?(t+=String.fromCharCode(n),i++):n>191&&224>n?(o=e.charCodeAt(i+1),t+=String.fromCharCode((31&n)<<6|63&o),i+=2):(o=e.charCodeAt(i+1),s=e.charCodeAt(i+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),i+=3);return t}},i.bindingHandlers.tooltip={init:function(e,n){if(!X.bMobileDevice){var o=t(e),s=o.data("tooltip-class")||"",a=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:a,trigger:"hover",title:function(){return o.is(".disabled")||X.dropdownVisibility()?"":''+$.i18n(i.utils.unwrapObservable(n()))+""}}).click(function(){o.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(e,i){var n=t(e),o=n.data("tooltip-class")||"",s=n.data("tooltip-placement")||"top";n.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:s,title:function(){return n.is(".disabled")||X.dropdownVisibility()?"":''+i()()+""}}).click(function(){n.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){n.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(e){var i=t(e);i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),at.click(function(){i.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,n){var o=i.utils.unwrapObservable(n());""===o?t(e).data("tooltip3-data","").tooltip("hide"):t(e).data("tooltip3-data",o).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(e){et.push(t(e))}},i.bindingHandlers.openDropdownTrigger={update:function(e,n){if(i.utils.unwrapObservable(n())){var o=t(e);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),$.detectDropdownVisibility()),n()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){t(e).closest(".dropdown").on("click",".e-item",function(){t(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,n){t(e).popover(i.utils.unwrapObservable(n()))}},i.bindingHandlers.csstext={init:function(e,n){e&&e.styleSheet&&!$.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=i.utils.unwrapObservable(n()):t(e).text(i.utils.unwrapObservable(n()))},update:function(e,n){e&&e.styleSheet&&!$.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=i.utils.unwrapObservable(n()):t(e).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.resizecrop={init:function(e){t(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,i){i()(),t(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(i,n,o,s){t(i).on("keypress",function(o){o&&13===e.parseInt(o.keyCode,10)&&(t(i).trigger("change"),n().call(s))})}},i.bindingHandlers.onEsc={init:function(i,n,o,s){t(i).on("keypress",function(o){o&&27===e.parseInt(o.keyCode,10)&&(t(i).trigger("change"),n().call(s))})}},i.bindingHandlers.clickOnTrue={update:function(e,n){i.utils.unwrapObservable(n())&&t(e).click()}},i.bindingHandlers.modal={init:function(e,n){t(e).toggleClass("fade",!X.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(n())}).on("shown",function(){$.windowResize()}).find(".close").click(function(){n()(!1)})},update:function(e,n){t(e).modal(i.utils.unwrapObservable(n())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(e){$.i18nToNode(e)}},i.bindingHandlers.i18nUpdate={update:function(e,t){i.utils.unwrapObservable(t()),$.i18nToNode(e)}},i.bindingHandlers.link={update:function(e,n){t(e).attr("href",i.utils.unwrapObservable(n()))}},i.bindingHandlers.title={update:function(e,n){t(e).attr("title",i.utils.unwrapObservable(n()))}},i.bindingHandlers.textF={init:function(e,n){t(e).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,n){var o=i.utils.unwrapObservable(n());t(e).css({height:o[1],"min-height":o[1]})},update:function(e,n){var o=i.utils.unwrapObservable(n()),s=$.pInt(o[1]),a=0,r=t(e).offset().top;r>0&&(r+=$.pInt(o[2]),a=st.height()-r,a>s&&(s=a),t(e).css({height:s,"min-height":s}))}},i.bindingHandlers.appendDom={update:function(e,n){t(e).hide().empty().append(i.utils.unwrapObservable(n())).show()}},i.bindingHandlers.draggable={init:function(n,o,s){if(!X.bMobileDevice){var a=100,r=3,l=s(),c=l&&l.droppableSelector?l.droppableSelector:"",u={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};c&&(u.drag=function(i){t(c).each(function(){var n=null,o=null,s=t(this),l=s.offset(),c=l.top+s.height();e.clearInterval(s.data("timerScroll")),s.data("timerScroll",!1),i.pageX>=l.left&&i.pageX<=l.left+s.width()&&(i.pageY>=c-a&&i.pageY<=c&&(n=function(){s.scrollTop(s.scrollTop()+r),$.windowResize()},s.data("timerScroll",e.setInterval(n,10)),n()),i.pageY>=l.top&&i.pageY<=l.top+a&&(o=function(){s.scrollTop(s.scrollTop()-r),$.windowResize()
+},s.data("timerScroll",e.setInterval(o,10)),o()))})},u.stop=function(){t(c).each(function(){e.clearInterval(t(this).data("timerScroll")),t(this).data("timerScroll",!1)})}),u.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},t(n).draggable(u).on("mousedown",function(){$.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(e,i,n){if(!X.bMobileDevice){var o=i(),s=n(),a=s&&s.droppableOver?s.droppableOver:null,r=s&&s.droppableOut?s.droppableOut:null,l={tolerance:"pointer",hoverClass:"droppableHover"};o&&(l.drop=function(e,t){o(e,t)},a&&(l.over=function(e,t){a(e,t)}),r&&(l.out=function(e,t){r(e,t)}),t(e).droppable(l))}}},i.bindingHandlers.nano={init:function(e){X.bDisableNanoScroll||t(e).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var i=t(e);i.data("save-trigger-type",i.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===i.data("save-trigger-type")?i.append(' ').addClass("settings-saved-trigger"):i.addClass("settings-saved-trigger-input")},update:function(e,n){var o=i.utils.unwrapObservable(n()),s=t(e);if("custom"===s.data("save-trigger-type"))switch(o.toString()){case"1":s.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":s.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":s.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:s.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(o.toString()){case"1":s.addClass("success").removeClass("error");break;case"0":s.addClass("error").removeClass("success");break;case"-2":break;default:s.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(e,i){var n=t(e),o=i(),a=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};n.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:a,inputDelimiters:[",",";"],autoCompleteSource:function(e,t){lt.getAutocomplete(e.term,function(e){t(s.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return s.map(e,function(e){var t=$.trim(e),i=null;return""!==t?(i=new h,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:s.bind(function(e){n.data("EmailsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){n.data("EmailsTagsValue")!==e&&(n.val(e),n.data("EmailsTagsValue",e),n.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&n.inputosaurus("focus")})}},i.bindingHandlers.contactTags={init:function(e,i){var n=t(e),o=i(),a=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};n.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:a,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:function(e,t){lt.getContactsTagsAutocomplete(e.term,function(e){t(s.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return s.map(e,function(e){var t=$.trim(e),i=null;return""!==t?(i=new m,i.name(t),[i.toLine(!1),i]):[t,null]})},change:s.bind(function(e){n.data("ContactsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){n.data("ContactsTagsValue")!==e&&(n.val(e),n.data("ContactsTagsValue",e),n.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&n.inputosaurus("focus")})}},i.bindingHandlers.command={init:function(e,n,o,s){var a=t(e),r=n();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(s,arguments)},update:function(e,i){var n=!0,o=t(e),s=i();n=s.enabled(),o.toggleClass("command-not-enabled",!n),n&&(n=s.canExecute(),o.toggleClass("command-can-not-be-execute",!n)),o.toggleClass("command-disabled disable disabled",!n).toggleClass("no-disabled",!!n),(o.is("input")||o.is("button"))&&o.prop("disabled",!n)}},i.extenders.trimmer=function(e){var t=i.computed({read:e,write:function(t){e($.trim(t.toString()))},owner:this});return t(e()),t},i.extenders.posInterer=function(e,t){var n=i.computed({read:e,write:function(i){var n=$.pInt(i.toString(),t);0>=n&&(n=t),n===e()&&""+n!=""+i&&e(n+1),e(n)}});return n(e()),n},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){return t.iTimeout=0,t.subscribe(function(n){n&&(e.clearTimeout(t.iTimeout),t.iTimeout=e.setTimeout(function(){t(!1),t.iTimeout=0},$.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){return this.hasError=i.observable(!1),this.subscribe(function(e){e=$.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){return this.hasError=i.observable(!1),this.subscribe(function(e){e=$.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(e){return this.hasFuncError=i.observable(!1),$.isFunc(e)&&(this.subscribe(function(t){this.hasFuncError(!e(t))},this),this.valueHasMutated()),this},a.prototype.root=function(){return this.sBase},a.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},a.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},a.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},a.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},a.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},a.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},a.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},a.prototype.change=function(t){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+e.encodeURIComponent(t)+"/"},a.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},a.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},a.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},a.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},a.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},a.prototype.settings=function(e){var t=this.sBase+"settings";return $.isUnd(e)||""===e||(t+="/"+e),t},a.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},a.prototype.mailBox=function(e,t,i){t=$.isNormal(t)?$.pInt(t):1,i=$.pString(i);var n=this.sBase+"mailbox/";return""!==e&&(n+=encodeURI(e)),t>1&&(n=n.replace(/[\/]+$/,""),n+="/p"+t),""!==i&&(n=n.replace(/[\/]+$/,""),n+="/"+encodeURI(i)),n},a.prototype.phpInfo=function(){return this.sServer+"Info"},a.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},a.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},a.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},a.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},a.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},a.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=$.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},a.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},a.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},a.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},a.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},a.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},J.oViewModelsHooks={},J.oSimpleHooks={},J.regViewModelHook=function(e,t){t&&(t.__hookName=e)},J.addHook=function(e,t){$.isFunc(t)&&($.isArray(J.oSimpleHooks[e])||(J.oSimpleHooks[e]=[]),J.oSimpleHooks[e].push(t))},J.runHook=function(e,t){$.isArray(J.oSimpleHooks[e])&&(t=t||[],s.each(J.oSimpleHooks[e],function(e){e.apply(null,t)}))},J.mainSettingsGet=function(e){return lt?lt.settingsGet(e):null},J.remoteRequest=function(e,t,i,n,o,s){lt&<.remote().defaultRequest(e,t,i,n,o,s)},J.settingsGet=function(e,t){var i=J.mainSettingsGet("Plugins");return i=i&&$.isUnd(i[e])?null:i[e],i?$.isUnd(i[t])?null:i[t]:null},r.supported=function(){return!0},r.prototype.set=function(e,i){var n=t.cookie(z.Values.ClientSideCookieIndexName),o=!1,s=null;try{s=null===n?null:JSON.parse(n),s||(s={}),s[e]=i,t.cookie(z.Values.ClientSideCookieIndexName,JSON.stringify(s),{expires:30}),o=!0}catch(a){}return o},r.prototype.get=function(e){var i=t.cookie(z.Values.ClientSideCookieIndexName),n=null;try{n=null===i?null:JSON.parse(i),n=n&&!$.isUnd(n[e])?n[e]:null}catch(o){}return n},l.supported=function(){return!!e.localStorage},l.prototype.set=function(t,i){var n=e.localStorage[z.Values.ClientSideCookieIndexName]||null,o=!1,s=null;try{s=null===n?null:JSON.parse(n),s||(s={}),s[t]=i,e.localStorage[z.Values.ClientSideCookieIndexName]=JSON.stringify(s),o=!0}catch(a){}return o},l.prototype.get=function(t){var i=e.localStorage[z.Values.ClientSideCookieIndexName]||null,n=null;try{n=null===i?null:JSON.parse(i),n=n&&!$.isUnd(n[t])?n[t]:null}catch(o){}return n},c.prototype.oDriver=null,c.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},c.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},u.prototype.bootstart=function(){},d.prototype.sPosition="",d.prototype.sTemplate="",d.prototype.viewModelName="",d.prototype.viewModelDom=null,d.prototype.viewModelTemplate=function(){return this.sTemplate},d.prototype.viewModelPosition=function(){return this.sPosition},d.prototype.cancelCommand=d.prototype.closeCommand=function(){},d.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=lt.data().keyScope(),lt.data().keyScope(this.sDefaultKeyScope)},d.prototype.restoreKeyScope=function(){lt.data().keyScope(this.sCurrentKeyScope)},d.prototype.registerPopupKeyDown=function(){var e=this;st.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&W.EventKeyCode.Esc===t.keyCode)return $.delegateRun(e,"cancelCommand"),!1;if(W.EventKeyCode.Backspace===t.keyCode&&!$.inFocus())return!1}return!0})},p.prototype.oCross=null,p.prototype.sScreenName="",p.prototype.aViewModels=[],p.prototype.viewModels=function(){return this.aViewModels},p.prototype.screenName=function(){return this.sScreenName},p.prototype.routes=function(){return null},p.prototype.__cross=function(){return this.oCross},p.prototype.__start=function(){var e=this.routes(),t=null,i=null;$.isNonEmptyArray(e)&&(i=s.bind(this.onRoute||$.emptyFunction,this),t=n.create(),s.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},g.constructorEnd=function(e){$.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},g.prototype.sDefaultScreenName="",g.prototype.oScreens={},g.prototype.oBoot=null,g.prototype.oCurrentScreen=null,g.prototype.hideLoading=function(){t("#rl-loading").hide()},g.prototype.routeOff=function(){o.changed.active=!1},g.prototype.routeOn=function(){o.changed.active=!0},g.prototype.setBoot=function(e){return $.isNormal(e)&&(this.oBoot=e),this},g.prototype.screen=function(e){return""===e||$.isUnd(this.oScreens[e])?null:this.oScreens[e]},g.prototype.buildViewModel=function(e,n){if(e&&!e.__builded){var o=new e(n),a=o.viewModelPosition(),r=t("#rl-content #rl-"+a.toLowerCase()),l=null;e.__builded=!0,e.__vm=o,o.data=lt.data(),o.viewModelName=e.__name,r&&1===r.length?(l=t("").addClass("rl-view-model").addClass("RL-"+o.viewModelTemplate()).hide(),l.appendTo(r),o.viewModelDom=l,e.__dom=l,"Popups"===a&&(o.cancelCommand=o.closeCommand=$.createCommand(o,function(){tt.hideScreenPopup(e)}),o.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),lt.popupVisibilityNames.push(this.viewModelName),o.viewModelDom.css("z-index",3e3+lt.popupVisibilityNames().length+10),$.delegateRun(this,"onFocus",[],500)):($.delegateRun(this,"onHide"),this.restoreKeyScope(),lt.popupVisibilityNames.remove(this.viewModelName),o.viewModelDom.css("z-index",2e3),X.tooltipTrigger(!X.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},o)),J.runHook("view-model-pre-build",[e.__name,o,l]),i.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:o.viewModelTemplate()}}},o),$.delegateRun(o,"onBuild",[l]),o&&"Popups"===a&&o.registerPopupKeyDown(),J.runHook("view-model-post-build",[e.__name,o,l])):$.log("Cannot find view model position: "+a)}return e?e.__vm:null},g.prototype.applyExternal=function(e,t){e&&t&&i.applyBindings(e,t)},g.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),J.runHook("view-model-on-hide",[e.__name,e.__vm]))},g.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),$.delegateRun(e.__vm,"onShow",t||[]),J.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},g.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},g.prototype.screenOnRoute=function(e,t){var i=this,n=null,o=null;""===$.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(n=this.screen(e),n||(n=this.screen(this.sDefaultScreenName),n&&(t=e+"/"+t,e=this.sDefaultScreenName)),n&&n.__started&&(n.__builded||(n.__builded=!0,$.isNonEmptyArray(n.viewModels())&&s.each(n.viewModels(),function(e){this.buildViewModel(e,n)},this),$.delegateRun(n,"onBuild")),s.defer(function(){i.oCurrentScreen&&($.delegateRun(i.oCurrentScreen,"onHide"),$.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),$.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=n,i.oCurrentScreen&&($.delegateRun(i.oCurrentScreen,"onShow"),J.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),$.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),$.delegateRun(e.__vm,"onShow"),$.delegateRun(e.__vm,"onFocus",[],200),J.runHook("view-model-on-show",[e.__name,e.__vm]))},i)),o=n.__cross(),o&&o.parse(t)})))},g.prototype.startScreens=function(e){t("#rl-content").css({visibility:"hidden"}),s.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),s.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),J.runHook("screen-pre-start",[e.screenName(),e]),$.delegateRun(e,"onStart"),J.runHook("screen-post-start",[e.screenName(),e]))},this);var i=n.create();i.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),o.initialized.add(i.parse,i),o.changed.add(i.parse,i),o.init(),t("#rl-content").css({visibility:"visible"}),s.delay(function(){ot.removeClass("rl-started-trigger").addClass("rl-started")},50)},g.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=$.isUnd(i)?!1:!!i,($.isUnd(t)?1:!t)?(o.changed.active=!0,o[i?"replaceHash":"setHash"](e),o.setHash(e)):(o.changed.active=!1,o[i?"replaceHash":"setHash"](e),o.changed.active=!0)},g.prototype.bootstart=function(){return this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart(),this},tt=new g,h.newInstanceFromJson=function(e){var t=new h;return t.initByJson(e)?t:null},h.prototype.name="",h.prototype.email="",h.prototype.privateType=null,h.prototype.clear=function(){this.email="",this.name="",this.privateType=null},h.prototype.validate=function(){return""!==this.name||""!==this.email},h.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},h.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},h.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=W.EmailType.Facebook),null===this.privateType&&(this.privateType=W.EmailType.Default)),this.privateType},h.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},h.prototype.parse=function(e){this.clear(),e=$.trim(e);var t=/(?:"([^"]+)")? ?(.*?@[^>,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},h.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=$.trim(e.Name),this.email=$.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},h.prototype.toLine=function(e,t,i){var n="";return""!==this.email&&(t=$.isUnd(t)?!1:!!t,i=$.isUnd(i)?!1:!!i,e&&""!==this.name?n=t?'")+'" target="_blank" tabindex="-1">'+$.encodeHtml(this.name)+"":i?$.encodeHtml(this.name):this.name:(n=this.email,""!==this.name?t?n=$.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+$.encodeHtml(n)+""+$.encodeHtml(">"):(n='"'+this.name+'" <'+n+">",i&&(n=$.encodeHtml(n))):t&&(n=''+$.encodeHtml(this.email)+""))),n},h.prototype.mailsoParse=function(e){if(e=$.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var n=e.length;return 0>t&&(t+=n),n="undefined"==typeof i?n:0>i?i+n:i+t,t>=e.length||0>t||t>n?!1:e.slice(t,n)},i=function(e,t,i,n){return 0>i&&(i+=e.length),n=void 0!==n?n:e.length,0>n&&(n=n+e.length-i),e.slice(0,i)+t.substr(0,n)+t.slice(n)+e.slice(i+n)},n="",o="",s="",a=!1,r=!1,l=!1,c=null,u=0,d=0,p=0;p0&&0===n.length&&(n=t(e,0,p)),r=!0,u=p);break;case">":r&&(d=p,o=t(e,u+1,d-u-1),e=i(e,"",u,d-u+1),d=0,p=0,u=0,r=!1);break;case"(":a||r||l||(l=!0,u=p);break;case")":l&&(d=p,s=t(e,u+1,d-u-1),e=i(e,"",u,d-u+1),d=0,p=0,u=0,l=!1);break;case"\\":p++}p++}return 0===o.length&&(c=e.match(/[^@\s]+@\S+/i),c&&c[0]?o=c[0]:n=e),o.length>0&&0===n.length&&0===s.length&&(n=e.replace(o,"")),o=$.trim(o).replace(/^[<]+/,"").replace(/[>]+$/,""),n=$.trim(n).replace(/^["']+/,"").replace(/["']+$/,""),s=$.trim(s).replace(/^[(]+/,"").replace(/[)]+$/,""),n=n.replace(/\\\\(.)/,"$1"),s=s.replace(/\\\\(.)/,"$1"),this.name=n,this.email=o,this.clearDuplicateName(),!0},h.prototype.inputoTagLine=function(){return 0(new e.Date).getTime()-d),g&&l.oRequests[g]&&(l.oRequests[g].__aborted&&(o="abort"),l.oRequests[g]=null),l.defaultResponse(i,g,o,t,s,n)}),g&&0 ").addClass("rl-settings-view-model").hide(),l.appendTo(r),o.data=lt.data(),o.viewModelDom=l,o.__rlSettingsData=a.__rlSettingsData,a.__dom=l,a.__builded=!0,a.__vm=o,i.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:a.__rlSettingsData.Template}}},o),$.delegateRun(o,"onBuild",[l])):$.log("Cannot find sub settings view model position: SettingsSubScreen")),o&&s.defer(function(){n.oCurrentSubScreen&&($.delegateRun(n.oCurrentSubScreen,"onHide"),n.oCurrentSubScreen.viewModelDom.hide()),n.oCurrentSubScreen=o,n.oCurrentSubScreen&&(n.oCurrentSubScreen.viewModelDom.show(),$.delegateRun(n.oCurrentSubScreen,"onShow"),$.delegateRun(n.oCurrentSubScreen,"onFocus",[],200),s.each(n.menu(),function(e){e.selected(o&&o.__rlSettingsData&&e.route===o.__rlSettingsData.Route)}),t("#rl-content .b-settings .b-content .content").scrollTop(0)),$.windowResize()})):tt.setHash(lt.link().settings(),!1,!0)},H.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&($.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},H.prototype.onBuild=function(){s.each(Z.settings,function(e){e&&e.__rlSettingsData&&!s.find(Z["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:i.observable(!1),disabled:!!s.find(Z["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=t("#rl-content #rl-settings-subscreen")},H.prototype.routes=function(){var e=s.find(Z.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=$.isUnd(i.subname)?t:$.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},s.extend(q.prototype,p.prototype),q.prototype.onShow=function(){lt.setTitle("")},s.extend(B.prototype,H.prototype),B.prototype.onShow=function(){lt.setTitle("")},s.extend(K.prototype,u.prototype),K.prototype.oSettings=null,K.prototype.oPlugins=null,K.prototype.oLocal=null,K.prototype.oLink=null,K.prototype.oSubs={},K.prototype.download=function(t){var i=null,n=null,o=navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=document.createElement("a"),i.href=t,document.createEvent&&(n=document.createEvent("MouseEvents"),n&&n.initEvent&&i.dispatchEvent))?(n.initEvent("click",!0,!0),i.dispatchEvent(n),!0):(X.bMobileDevice?(e.open(t,"_self"),e.focus()):this.iframe.attr("src",t),!0)},K.prototype.link=function(){return null===this.oLink&&(this.oLink=new a),this.oLink},K.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new c),this.oLocal},K.prototype.settingsGet=function(e){return null===this.oSettings&&(this.oSettings=$.isNormal(it)?it:{}),$.isUnd(this.oSettings[e])?null:this.oSettings[e]},K.prototype.settingsSet=function(e,t){null===this.oSettings&&(this.oSettings=$.isNormal(it)?it:{}),this.oSettings[e]=t},K.prototype.setTitle=function(t){t=($.isNormal(t)&&0 ')
;
-/*jshint onevar: true*/
+/*jshint onevar: true*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -246,7 +246,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {};
@@ -366,7 +366,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -797,7 +797,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim;
@@ -1918,6 +1918,7 @@ Utils.initDataConstructorBySettings = function (oData)
oData.googleEnable = ko.observable(false);
oData.googleClientID = ko.observable('');
oData.googleClientSecret = ko.observable('');
+ oData.googleApiKey = ko.observable('');
oData.dropboxEnable = ko.observable(false);
oData.dropboxApiKey = ko.observable('');
@@ -2815,7 +2816,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
return oItem.hasClass('open');
}));
}, 50);
-
+
/*jslint bitwise: true*/
// Base64 encode / decode
// http://www.webtoolkit.info/
@@ -2979,7 +2980,7 @@ Base64 = {
}
};
-/*jslint bitwise: false*/
+/*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = {
@@ -3822,7 +3823,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4128,7 +4129,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -4224,7 +4225,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
-
+
/**
* @constructor
@@ -4463,7 +4464,7 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus)
this.setHtml('', bFocus);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5176,7 +5177,7 @@ Selector.prototype.on = function (sEventName, fCallback)
{
this.oCallbacks[sEventName] = fCallback;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5252,7 +5253,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5325,7 +5326,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5370,7 +5371,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5385,7 +5386,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5480,7 +5481,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true;
});
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5558,7 +5559,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -5974,7 +5975,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6340,7 +6341,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6466,7 +6467,7 @@ ContactModel.prototype.lineAsCcc = function ()
return aResult.join(' ');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6497,7 +6498,7 @@ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
}, this);
}
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6543,7 +6544,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6781,7 +6782,7 @@ AttachmentModel.prototype.iconClass = function ()
return sClass;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -6844,7 +6845,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
}
return bResult;
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8070,7 +8071,7 @@ MessageModel.prototype.flagHash = function ()
return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(),
this.isReadReceipt()].join('');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8404,7 +8405,7 @@ FolderModel.prototype.printableFullName = function ()
{
return this.fullName.split(this.delimiter).join(' / ');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8427,7 +8428,7 @@ AccountModel.prototype.email = '';
AccountModel.prototype.changeAccountLink = function ()
{
return RL.link().change(this.email);
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8465,7 +8466,7 @@ IdentityModel.prototype.formattedNameForEmail = function ()
var sName = this.name();
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8515,7 +8516,7 @@ FilterActionModel.prototype.removeSelf = function ()
{
this.parentList.remove(this);
}
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8566,7 +8567,7 @@ FilterConditionModel.prototype.removeSelf = function ()
this.parentList.remove(this);
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8622,7 +8623,7 @@ FilterModel.prototype.parse = function (oItem)
return bResult;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8655,7 +8656,7 @@ OpenPgpKeyModel.prototype.user = '';
OpenPgpKeyModel.prototype.email = '';
OpenPgpKeyModel.prototype.armor = '';
OpenPgpKeyModel.prototype.isPrivate = false;
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8753,7 +8754,7 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
this.selectedFolder(oFolder);
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8865,7 +8866,7 @@ PopupsFolderCreateViewModel.prototype.onFocus = function ()
{
this.folderName.focused(true);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -8980,7 +8981,7 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
this.notification(sNotification);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -9304,7 +9305,7 @@ function PopupsComposeViewModel()
this.triggerForResize();
}, this);
- this.dropboxEnabled = ko.observable(RL.settingsGet('DropboxApiKey') ? true : false);
+ this.dropboxEnabled = ko.observable(!!RL.settingsGet('DropboxApiKey'));
this.dropboxCommand = Utils.createCommand(this, function () {
@@ -9330,18 +9331,19 @@ function PopupsComposeViewModel()
return this.dropboxEnabled();
});
- this.driveEnabled = ko.observable(false);
+ this.driveEnabled = ko.observable(!!RL.settingsGet('GoogleApiKey') && !!RL.settingsGet('GoogleClientID'));
+ this.driveVisible = ko.observable(false);
this.driveCommand = Utils.createCommand(this, function () {
-// this.driveOpenPopup();
+ this.driveOpenPopup();
return true;
}, function () {
return this.driveEnabled();
});
-// this.driveCallback = _.bind(this.driveCallback, this);
+ this.driveCallback = _.bind(this.driveCallback, this);
this.bDisabeCloseOnEsc = true;
this.sDefaultKeyScope = Enums.KeyState.Compose;
@@ -9963,41 +9965,89 @@ PopupsComposeViewModel.prototype.onBuild = function ()
document.body.appendChild(oScript);
}
-// TODO (Google Drive)
-// if (false)
-// {
-// $.getScript('http://www.google.com/jsapi', function () {
-// if (window.google)
-// {
-// window.google.load('picker', '1', {
-// 'callback': Utils.emptyFunction
-// });
-// }
-// });
-// }
+ if (this.driveEnabled())
+ {
+ $.getScript('https://apis.google.com/js/api.js', function () {
+ if (window.gapi)
+ {
+ self.driveVisible(true);
+ }
+ });
+ }
};
-//PopupsComposeViewModel.prototype.driveCallback = function (oData)
-//{
-// if (oData && window.google && oData['action'] === window.google.picker.Action.PICKED)
-// {
-// }
-//};
-//
-//PopupsComposeViewModel.prototype.driveOpenPopup = function ()
-//{
-// if (window.google)
-// {
-// var
-// oPicker = new window.google.picker.PickerBuilder()
-// .enableFeature(window.google.picker.Feature.NAV_HIDDEN)
-// .addView(new window.google.picker.View(window.google.picker.ViewId.DOCS))
-// .setCallback(this.driveCallback).build()
-// ;
-//
-// oPicker.setVisible(true);
-// }
-//};
+PopupsComposeViewModel.prototype.driveCallback = function (oData)
+{
+ if (oData && window.google && oData[window.google.picker.Response.ACTION] === window.google.picker.Action.PICKED &&
+ oData[window.google.picker.Response.DOCUMENTS] && oData[window.google.picker.Response.DOCUMENTS][0] &&
+ oData[window.google.picker.Response.DOCUMENTS][0]['url'])
+ {
+ this.addDriveAttachment(oData[window.google.picker.Response.DOCUMENTS][0]);
+ }
+};
+
+PopupsComposeViewModel.prototype.driveCreatePiker = function (oOauthToken)
+{
+ if (window.gapi && oOauthToken && oOauthToken.access_token)
+ {
+ var self = this;
+
+ window.gapi.load('picker', {'callback': function () {
+
+ if (window.google && window.google.picker)
+ {
+ var drivePicker = new window.google.picker.PickerBuilder()
+ .addView(
+ new window.google.picker.DocsView()
+ .setIncludeFolders(true)
+ )
+ .setAppId(RL.settingsGet('GoogleClientID'))
+ .setDeveloperKey(RL.settingsGet('GoogleApiKey'))
+ .setOAuthToken(oOauthToken.access_token)
+ .setCallback(_.bind(self.driveCallback, self))
+ .enableFeature(window.google.picker.Feature.NAV_HIDDEN)
+ .build()
+ ;
+
+ drivePicker.setVisible(true);
+ }
+ }});
+ }
+};
+
+PopupsComposeViewModel.prototype.driveOpenPopup = function ()
+{
+ if (window.gapi)
+ {
+ var self = this;
+
+ window.gapi.load('auth', {'callback': function () {
+
+ var oAuthToken = window.gapi.auth.getToken();
+ if (!oAuthToken)
+ {
+ window.gapi.auth.authorize({
+ 'client_id': RL.settingsGet('GoogleClientID'),
+ 'scope': 'https://www.googleapis.com/auth/drive.readonly',
+ 'immediate': false
+ }, function (oAuthResult) {
+ if (oAuthResult && !oAuthResult.error)
+ {
+ var oAuthToken = window.gapi.auth.getToken();
+ if (oAuthToken)
+ {
+ self.driveCreatePiker(oAuthToken);
+ }
+ }
+ });
+ }
+ else
+ {
+ self.driveCreatePiker(oAuthToken);
+ }
+ }});
+ }
+};
/**
* @param {string} sId
@@ -10322,6 +10372,16 @@ PopupsComposeViewModel.prototype.addDropboxAttachment = function (oDropboxFile)
return true;
};
+/**
+ * @param {Object} oDriveFile
+ * @return {boolean}
+ */
+PopupsComposeViewModel.prototype.addDriveAttachment = function (oDriveFile)
+{
+ window.console.log(oDriveFile);
+ return false;
+};
+
/**
* @param {MessageModel} oMessage
* @param {string} sType
@@ -10487,7 +10547,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
this.editorResizeThrottle();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -11231,7 +11291,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
// oItem.checked(false);
// });
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -11369,7 +11429,7 @@ PopupsAdvancedSearchViewModel.prototype.onFocus = function ()
{
this.fromFocus(true);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -11465,7 +11525,7 @@ PopupsAddAccountViewModel.prototype.onFocus = function ()
{
this.emailFocus(true);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -11556,7 +11616,7 @@ PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.key.focus(true);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -11598,7 +11658,7 @@ PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey)
this.key(oOpenPgpKey.armor);
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -11695,7 +11755,7 @@ PopupsGenerateNewOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.email.focus(true);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -11937,7 +11997,7 @@ PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFr
this.to(aRec);
this.text(sText);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12087,7 +12147,7 @@ PopupsIdentityViewModel.prototype.onFocus = function ()
this.email.focused(true);
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12149,7 +12209,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12205,7 +12265,7 @@ PopupsTwoFactorTestViewModel.prototype.onFocus = function ()
{
this.code.focused(true);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12318,7 +12378,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12365,7 +12425,7 @@ PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom)
}
}, this));
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12700,7 +12760,7 @@ LoginViewModel.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12798,7 +12858,7 @@ AbstractSystemDropDownViewModel.prototype.onBuild = function ()
}
});
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12812,7 +12872,7 @@ function MailBoxSystemDropDownViewModel()
}
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -12826,7 +12886,7 @@ function SettingsSystemDropDownViewModel()
}
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -13076,7 +13136,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
kn.showScreenPopup(PopupsContactsViewModel);
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -13981,7 +14041,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
;
return !!oJua;
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -14675,7 +14735,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -14706,7 +14766,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -14739,7 +14799,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -14901,7 +14961,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -14953,7 +15013,7 @@ SettingsContacts.prototype.onBuild = function ()
//{
//
//};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15036,7 +15096,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
}
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15126,7 +15186,7 @@ SettingsIdentity.prototype.onBuild = function ()
}, 50);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15345,7 +15405,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
});
}, 50);
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15382,7 +15442,7 @@ SettingsFilters.prototype.addFilter = function ()
this.filters.push(oFilter);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15534,7 +15594,7 @@ SettingsSecurity.prototype.onBuild = function ()
this.processing(true);
RL.remote().getTwoFactor(this.onResult);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15603,7 +15663,7 @@ function SettingsSocialScreen()
}
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15710,7 +15770,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword));
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -15907,7 +15967,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
oFolder.subScribed(false);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -16023,7 +16083,7 @@ SettingsThemes.prototype.onBuild = function ()
};
}));
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -16093,7 +16153,7 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
RL.reloadOpenPgpKeys();
}
}
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -16221,13 +16281,14 @@ AbstractData.prototype.populateDataOnStart = function()
this.googleEnable(!!RL.settingsGet('AllowGoogleSocial'));
this.googleClientID(RL.settingsGet('GoogleClientID'));
this.googleClientSecret(RL.settingsGet('GoogleClientSecret'));
+ this.googleApiKey(RL.settingsGet('GoogleApiKey'));
this.dropboxEnable(!!RL.settingsGet('AllowDropboxSocial'));
this.dropboxApiKey(RL.settingsGet('DropboxApiKey'));
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -17484,7 +17545,7 @@ WebMailDataStorage.prototype.findSelfPrivateKey = function (sPassword)
{
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -17768,7 +17829,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -18555,7 +18616,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
this.defaultRequest(fCallback, 'SocialUsers');
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -18616,7 +18677,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{
this.oServices = oData;
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -18936,7 +18997,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
this.setMessageFlagsToCache(sFolder, sUid, aFlags);
}
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -19118,7 +19179,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -19135,7 +19196,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
LoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
-};
+};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -19308,7 +19369,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([^\/]*)$/, {'normalize_': fNormS}]
];
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -19337,7 +19398,7 @@ SettingsScreen.prototype.onShow = function ()
RL.setTitle(this.sSettingsTitle);
RL.data().keyScope(Enums.KeyState.Settings);
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -19697,7 +19758,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@@ -20994,7 +21055,7 @@ RainLoopApp.prototype.bootstart = function ()
* @type {RainLoopApp}
*/
RL = new RainLoopApp();
-
+
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@@ -21047,7 +21108,7 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
-
+
if (window.SimplePace) {
window.SimplePace.add(10);
}
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 f144ab3b3..67f4efbf9 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,10 @@
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
-!function(e,t,s,i,o,n,a,r,l,c){"use strict";function u(){this.sBase="#/",this.sServer="./?",this.sVersion=jt.settingsGet("Version"),this.sSpecSuffix=jt.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=jt.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}function d(e,s,i,o){var n=this;n.editor=null,n.iBlurTimer=0,n.fOnBlur=s||null,n.fOnReady=i||null,n.fOnModeChange=o||null,n.$element=t(e),n.init(),n.resize=r.throttle(r.bind(n.resize,n),100)}function h(e,t,i,o,n,a){this.list=e,this.listChecked=s.computed(function(){return r.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=s.computed(function(){return 0