OpenPGP - part 2 - unstable (#53)

This commit is contained in:
RainLoop Team 2014-01-28 20:09:41 +04:00
parent d181974127
commit 0bb69d4494
23 changed files with 600 additions and 339 deletions

View file

@ -6,6 +6,7 @@
function AdminSecurity()
{
this.csrfProtection = ko.observable(!!RL.settingsGet('UseTokenProtection'));
this.openPGP = ko.observable(!!RL.settingsGet('OpenPGP'));
this.adminLogin = ko.observable(RL.settingsGet('AdminLogin'));
this.adminPassword = ko.observable('');
@ -65,6 +66,12 @@ AdminSecurity.prototype.onBuild = function ()
'TokenProtection': bValue ? '1' : '0'
});
});
this.openPGP.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, {
'OpenPGP': bValue ? '1' : '0'
});
});
};
AdminSecurity.prototype.onHide = function ()

View file

@ -238,6 +238,7 @@ AbstractApp.prototype.sub = function (sName, fFunc, oContext)
*/
AbstractApp.prototype.pub = function (sName, aArgs)
{
Plugins.runHook('rl-pub', [sName, aArgs]);
if (!Utils.isUnd(this.oSubs[sName]))
{
_.each(this.oSubs[sName], function (aItem) {

View file

@ -703,6 +703,7 @@ RainLoopApp.prototype.mailToHelper = function (sMailToUrl)
RainLoopApp.prototype.bootstart = function ()
{
RL.pub('rl.bootstart');
AbstractApp.prototype.bootstart.call(this);
RL.data().populateDataOnStart();
@ -785,17 +786,26 @@ RainLoopApp.prototype.bootstart = function ()
if (bValue)
{
// if (window.crypto && window.crypto.getRandomValues)
// {
// $.ajax({
// 'url': RL.link().openPgpJs(),
// 'dataType': 'script',
// 'cache': true,
// 'success': function () {
// window.console.log('openPgpJs');
// }
// });
// }
if (window.crypto && window.crypto.getRandomValues && RL.settingsGet('OpenPGP'))
{
$.ajax({
'url': RL.link().openPgpJs(),
'dataType': 'script',
'cache': true,
'success': function () {
if (window.openpgp)
{
// window.console.log(window.openpgp);
Globals.bAllowOpenPGP = true;
RL.pub('openpgp.init');
}
}
});
}
else
{
Globals.bAllowOpenPGP = false;
}
kn.startScreens([MailBoxScreen, SettingsScreen]);
@ -846,13 +856,15 @@ RainLoopApp.prototype.bootstart = function ()
}, 2000);
Plugins.runHook('rl-start-user-screens');
RL.pub('rl.bootstart-user-screens');
}
else
{
kn.startScreens([LoginScreen]);
Plugins.runHook('rl-start-login-screens');
RL.pub('rl.bootstart-login-screens');
}
if (window.SimplePace)
@ -878,6 +890,7 @@ RainLoopApp.prototype.bootstart = function ()
kn.startScreens([LoginScreen]);
Plugins.runHook('rl-start-login-screens');
RL.pub('rl.bootstart-login-screens');
if (window.SimplePace)
{
@ -925,6 +938,7 @@ RainLoopApp.prototype.bootstart = function ()
});
Plugins.runHook('rl-start-screens');
RL.pub('rl.bootstart-end');
};
/**

View file

@ -65,6 +65,11 @@ Globals.bDisableNanoScroll = Globals.bMobileDevice;
*/
Globals.bAllowPdfPreview = !Globals.bMobileDevice;
/**
* @type {boolean}
*/
Globals.bAllowOpenPGP = false;
/**
* @type {boolean}
*/

View file

@ -82,11 +82,16 @@ function MessageModel()
}, this);
this.body = null;
this.plainRaw = '';
this.isRtl = ko.observable(false);
this.isHtml = ko.observable(false);
this.hasImages = ko.observable(false);
this.attachments = ko.observableArray([]);
this.isPgpSigned = ko.observable(false);
this.isPgpEncrypted = ko.observable(false);
this.pgpSignature = ko.observable('');
this.priority = ko.observable(Enums.MessagePriority.Normal);
this.readReceipt = ko.observable('');
@ -253,6 +258,10 @@ MessageModel.prototype.clear = function ()
this.isHtml(false);
this.hasImages(false);
this.attachments([]);
this.isPgpSigned(false);
this.isPgpEncrypted(false);
this.pgpSignature('');
this.priority(Enums.MessagePriority.Normal);
this.readReceipt('');
@ -347,6 +356,13 @@ MessageModel.prototype.initUpdateByMessageJson = function (oJsonMessage)
this.sInReplyTo = oJsonMessage.InReplyTo;
this.sReferences = oJsonMessage.References;
if (Globals.bAllowOpenPGP)
{
this.isPgpSigned(!!oJsonMessage.PgpSigned);
this.isPgpEncrypted(!!oJsonMessage.PgpEncrypted);
this.pgpSignature(oJsonMessage.PgpSignature);
}
this.hasAttachments(!!oJsonMessage.HasAttachments);
this.attachmentsMainType(oJsonMessage.AttachmentsMainType);
@ -808,6 +824,10 @@ MessageModel.prototype.populateByMessageListItem = function (oMessage)
// this.hasImages(false);
// this.attachments([]);
// this.isPgpSigned(false);
// this.isPgpEncrypted(false);
// this.pgpSignature('');
this.priority(Enums.MessagePriority.Normal);
this.aDraftInfo = [];
this.sMessageId = '';

View file

@ -709,6 +709,10 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
oBody = null,
oTextBody = null,
sId = '',
sPlain = '',
bPgpSigned = false,
bPgpEncrypted = false,
mPgpMessage = null,
oMessagesBodiesDom = this.messagesBodiesDom(),
oMessage = this.message()
;
@ -747,7 +751,57 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
else if (Utils.isNormal(oData.Result.Plain) && '' !== oData.Result.Plain)
{
bIsHtml = false;
oBody.html(oData.Result.Plain.toString()).addClass('b-text-part plain');
sPlain = oData.Result.Plain.toString();
if (Globals.bAllowOpenPGP && (oMessage.isPgpSigned() || oMessage.isPgpEncrypted()) &&
Utils.isNormal(oData.Result.PlainRaw))
{
bPgpEncrypted = /---BEGIN PGP MESSAGE---/.test(oData.Result.PlainRaw);
if (!bPgpEncrypted)
{
bPgpSigned = /-----BEGIN PGP SIGNED MESSAGE-----/.test(oData.Result.PlainRaw) &&
/-----BEGIN PGP SIGNATURE-----/.test(oData.Result.PlainRaw);
}
if (bPgpSigned && oMessage.isPgpSigned() && oMessage.pgpSignature())
{
sPlain = '<pre class="b-plain-openpgp signed">' + oData.Result.PlainRaw + '</pre>';
try
{
mPgpMessage = window.openpgp.cleartext.readArmored(oData.Result.PlainRaw);
}
catch (oExc) {}
if (mPgpMessage && mPgpMessage.getText)
{
sPlain = mPgpMessage.getText();
}
else
{
bPgpSigned = false;
}
}
else if (bPgpEncrypted && oMessage.isPgpEncrypted())
{
try
{
mPgpMessage = window.openpgp.message.readArmored(oData.Result.PlainRaw);
}
catch (oExc) {}
sPlain = '<pre class="b-plain-openpgp encrypted">' + oData.Result.PlainRaw + '</pre>';
}
if (bPgpSigned || bPgpEncrypted)
{
oBody.data('rl-plain-raw', oData.Result.PlainRaw);
oBody.data('rl-plain-pgp-encrypted', bPgpEncrypted);
oBody.data('rl-plain-pgp-signed', bPgpSigned);
}
}
oBody.html(sPlain).addClass('b-text-part plain');
}
else
{
@ -760,15 +814,19 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
oBody.addClass('rtl-text-part');
}
oMessagesBodiesDom.append(oBody);
oBody.data('rl-is-html', bIsHtml);
oBody.data('rl-has-images', bHasExternals);
oMessage.isRtl(!!oBody.data('rl-is-rtl'));
oMessage.isHtml(!!oBody.data('rl-is-html'));
oMessage.hasImages(!!oBody.data('rl-has-images'));
oMessage.body = oBody;
if (oMessage.body)
{
oMessagesBodiesDom.append(oMessage.body);
oMessage.body.data('rl-is-html', bIsHtml);
oMessage.body.data('rl-has-images', bHasExternals);
oMessage.isRtl(!!oMessage.body.data('rl-is-rtl'));
oMessage.isHtml(!!oMessage.body.data('rl-is-html'));
oMessage.hasImages(!!oMessage.body.data('rl-has-images'));
oMessage.plainRaw = Utils.pString(oMessage.body.data('rl-plain-raw'));
}
if (bHasInternals)
{
@ -784,12 +842,26 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
}
else
{
oTextBody.data('rl-cache-count', ++Globals.iMessageBodyCacheCount);
oMessage.isRtl(!!oTextBody.data('rl-is-rtl'));
oMessage.isHtml(!!oTextBody.data('rl-is-html'));
oMessage.hasImages(!!oTextBody.data('rl-has-images'));
oMessage.body = oTextBody;
if (oMessage.body)
{
oMessage.body.data('rl-cache-count', ++Globals.iMessageBodyCacheCount);
oMessage.isRtl(!!oMessage.body.data('rl-is-rtl'));
oMessage.isHtml(!!oMessage.body.data('rl-is-html'));
oMessage.hasImages(!!oMessage.body.data('rl-has-images'));
oMessage.plainRaw = Utils.pString(oMessage.body.data('rl-plain-raw'));
}
}
if (Globals.bAllowOpenPGP && oMessage.body)
{
oMessage.isPgpSigned(!!oMessage.body.data('rl-plain-pgp-signed'));
oMessage.isPgpEncrypted(!!oMessage.body.data('rl-plain-pgp-encrypted'));
}
else
{
oMessage.isPgpSigned(false);
oMessage.isPgpEncrypted(false);
}
this.messageActiveDom(oMessage.body);

View file

@ -145,24 +145,4 @@
color: #fff;
}
}
.editorTextArea, .editorHtmlArea {
background: #fff;
color: #000;
font-family: Arial, Verdana, Geneva, sans-serif;
font-size: 14px;
table {
border-collapse: separate;
}
blockquote {
border: 0;
border-left: solid 2px #444;
margin-left: 5px;
margin: 5px 0;
padding-left: 5px;
}
}
}

View file

@ -76,12 +76,15 @@
.box-sizing(border-box);
background: #fff;
color: #000;
border: 0px !important;
overflow: auto;
overflow-y: scroll;
font-family: arial, sans-serif;
font-size: 14px;
line-height: 16px;
font-family: Arial, Verdana, Geneva, sans-serif;
font-size: 13px;
line-height: 15px;
margin: 0px;
padding: 8px;
@ -102,9 +105,11 @@
}
blockquote {
border: 0;
border-left: solid 2px #444;
margin-left: 5px;
padding-left: 5px
margin: 5px 0;
padding-left: 5px;
}
img {
@ -119,14 +124,17 @@
.editorTextArea {
.box-sizing(border-box);
background: #fff;
color: #000;
display: block;
border: 0px !important;
width: 100%;
line-height: 16px;
margin: 0px;
padding: 8px;
font-family: arial, sans-serif;
font-size: 14px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;
font-size: 13px;
line-height: 15px;
overflow: auto;
overflow-y: scroll;

View file

@ -181,7 +181,7 @@ html.rl-no-preview-pane {
height: 0px;
}
.showImages, .readReceipt {
.showImages, .readReceipt, .pgpSigned, .pgpEncrypted {
cursor: pointer;
padding: 10px 15px;
border-bottom: 1px solid #ddd;
@ -192,6 +192,10 @@ html.rl-no-preview-pane {
background-color: #ffffd9;
}
.pgpSigned, .pgpEncrypted {
cursor: default;
}
.attachmentsPlace {
padding: 10px;
@ -306,16 +310,15 @@ html.rl-no-preview-pane {
&.plain {
padding: 15px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;
pre {
margin: 0px;
padding: 0px;
font-family: arial, sans-serif;
background: #fff;
border: none;
white-space: normal;
}
blockquote {
border-left: 2px solid blue;
color: blue;

View file

@ -84,7 +84,7 @@ function MailBoxMessageViewViewModel()
this.viewDownloadLink = ko.observable('');
this.viewUserPic = ko.observable(Consts.DataImages.UserDotPic);
this.viewUserPicVisible = ko.observable(false);
this.message.subscribe(function (oMessage) {
this.messageActiveDom(null);

View file

@ -103,11 +103,6 @@ class Message
*/
private $sPlain;
/**
* @var string
*/
private $sPlainRaw;
/**
* @var string
*/
@ -168,6 +163,16 @@ class Message
*/
private $sPgpSignature;
/**
* @var bool
*/
private $bPgpSigned;
/**
* @var bool
*/
private $bPgpEncrypted;
/**
* @access private
*/
@ -201,7 +206,6 @@ class Message
$this->oBcc = null;
$this->sPlain = '';
$this->sPlainRaw = '';
$this->sHtml = '';
$this->oAttachments = null;
@ -220,6 +224,8 @@ class Message
$this->iParentThread = 0;
$this->sPgpSignature = '';
$this->bPgpSigned = false;
$this->bPgpEncrypted = false;
return $this;
}
@ -240,14 +246,6 @@ class Message
return $this->sPlain;
}
/**
* @return string
*/
public function PlainRaw()
{
return $this->sPlainRaw;
}
/**
* @return string
*/
@ -264,6 +262,22 @@ class Message
return $this->sPgpSignature;
}
/**
* @return bool
*/
public function PgpSigned()
{
return $this->bPgpSigned;
}
/**
* @return bool
*/
public function PgpEncrypted()
{
return $this->bPgpEncrypted;
}
/**
* @param string $sHtml
*
@ -776,24 +790,20 @@ class Message
}
else
{
$this->sPlain = \implode("\n", $sPlainParts);
$this->sPlainRaw = $this->sPlain;
$this->sPlain = \trim(\implode("\n", $sPlainParts));
}
$aMatch = array();
if (\preg_match('/-----BEGIN PGP SIGNATURE-----(.+)-----END PGP SIGNATURE-----/ism', $this->sPlain, $aMatch) && !empty($aMatch[0]))
{
$this->sPgpSignature = $aMatch[0];
$this->sPlain = \trim($this->sPlain);
$this->sPgpSignature = \trim($aMatch[0]);
$this->bPgpSigned = true;
}
$aMatch = array();
if (!empty($this->sPgpSignature) &&
\preg_match('/-----BEGIN PGP SIGNED MESSAGE-----(.+)-----BEGIN PGP SIGNATURE-----(.+)-----END PGP SIGNATURE-----/ism', $this->sPlain, $aMatch) &&
!empty($aMatch[0]) && isset($aMatch[1]))
if (\preg_match('/-----BEGIN PGP MESSAGE-----/ism', $this->sPlain, $aMatch) && !empty($aMatch[0]))
{
$this->sPlain = \str_replace($aMatch[0], $aMatch[1], $this->sPlain);
$this->sPlain = \trim(\preg_replace('/^Hash: [^\s]+/i', '', \trim($this->sPlain)));
$this->bPgpEncrypted = true;
}
unset($sHtmlParts, $sPlainParts, $aMatch);
@ -812,6 +822,7 @@ class Message
if (\is_string($sPgpSignatureText) && 0 < \strlen($sPgpSignatureText) && 0 < \strpos($sPgpSignatureText, 'BEGIN PGP SIGNATURE'))
{
$this->sPgpSignature = \trim($sPgpSignatureText);
$this->bPgpSigned = true;
}
}
}

View file

@ -902,6 +902,7 @@ class Actions
'LoginDescription' => $oConfig->Get('branding', 'login_desc', ''),
'LoginCss' => $oConfig->Get('branding', 'login_css', ''),
'Token' => $oConfig->Get('security', 'csrf_protection', false) ? \RainLoop\Utils::GetCsrfToken() : '',
'OpenPGP' => $oConfig->Get('security', 'openpgp', false),
'InIframe' => (bool) $oConfig->Get('labs', 'in_iframe', false),
'AllowAdminPanel' => (bool) $oConfig->Get('security', 'allow_admin_panel', true),
'CustomLoginLink' => $oConfig->Get('labs', 'custom_login_link', ''),
@ -1955,6 +1956,7 @@ class Actions
$this->setConfigFromParams($oConfig, 'LoginCss', 'branding', 'login_css', 'string');
$this->setConfigFromParams($oConfig, 'TokenProtection', 'security', 'csrf_protection', 'bool');
$this->setConfigFromParams($oConfig, 'OpenPGP', 'security', 'openpgp', 'bool');
$this->setConfigFromParams($oConfig, 'EnabledPlugins', 'plugins', 'enable', 'bool');
$this->setConfigFromParams($oConfig, 'GoogleEnable', 'social', 'google_enable', 'bool');
@ -6320,14 +6322,13 @@ class Actions
}
}
$sPlain = $sPlainRaw = '';
$sPlain = '';
$sHtml = $mResponse->Html();
$bRtl = false;
if (0 === \strlen($sHtml))
{
$sPlain = $mResponse->Plain();
$sPlainRaw = $mResponse->PlainRaw();
$bRtl = \MailSo\Base\Utils::IsRTL($sPlain);
}
else
@ -6341,13 +6342,15 @@ class Actions
$mResult['Html'] = 0 === \strlen($sHtml) ? '' : \MailSo\Base\HtmlUtils::ClearHtml(
$sHtml, $bHasExternals, $mFoundedCIDs, $aContentLocationUrls, $mFoundedContentLocationUrls);
$mResult['PlainRaw'] = $sPlain;
$mResult['Plain'] = 0 === \strlen($sPlain) ? '' : \MailSo\Base\HtmlUtils::ConvertPlainToHtml($sPlain);
$mResult['PlainRaw'] = $sPlainRaw;
$mResult['Rtl'] = $bRtl;
$mResult['PgpSigned'] = $mResponse->PgpSigned();
$mResult['PgpEncrypted'] = $mResponse->PgpEncrypted();
$mResult['PgpSignature'] = $mResponse->PgpSignature();
unset($sHtml, $sPlain, $sPlainRaw);
unset($sHtml, $sPlain);
$mResult['HasExternals'] = $bHasExternals;
$mResult['HasInternals'] = (\is_array($mFoundedCIDs) && 0 < \count($mFoundedCIDs)) ||

View file

@ -103,6 +103,7 @@ class Application extends \RainLoop\Config\AbstractConfig
'Enable CSRF protection (http://en.wikipedia.org/wiki/Cross-site_request_forgery)'),
'custom_server_signature' => array('RainLoop'),
'openpgp' => array(false),
'admin_login' => array('admin', 'Login and password for web admin panel'),
'admin_password' => array('12345'),
'allow_admin_panel' => array(true, 'Access settings'),

View file

@ -12,6 +12,15 @@
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label data-bind="click: function () { openPGP(!openPGP()); }">
<i data-bind="css: openPGP() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
Allow OpenPGP (beta)
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<a href="#" target="_blank" class="g-ui-link" data-bind="link: phpInfoLink()">Show PHP information</a>

View file

@ -194,6 +194,16 @@
&nbsp;&nbsp;
<span class="i18n text" data-i18n-text="MESSAGE/BUTTON_NOTIFY_READ_RECEIPT"></span>
</div>
<div class="pgpSigned" data-bind="visible: message() && message().isPgpSigned(), click: function() {}">
<i class="icon-lock"></i>
&nbsp;&nbsp;
PGP signed
</div>
<div class="pgpEncrypted" data-bind="visible: message() && message().isPgpEncrypted(), click: function() {}">
<i class="icon-lock"></i>
&nbsp;&nbsp;
PGP encrypted
</div>
<div class="attachmentsPlace" data-bind="visible: message() && message().hasVisibleAttachments()">
<ul class="attachmentList" data-bind="foreach: message() ? message().attachments() : []">
<li class="attachmentItem" draggable="true" data-bind="visible: !isLinked, title: fileName, event: { 'dragstart': eventDragStart }">

View file

@ -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 {
@ -1474,7 +1474,7 @@ table {
.icon-mail:before {
content: "\e062";
}
/** initial setup **/
.nano {
/*
@ -1591,7 +1591,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;
@ -1956,7 +1956,7 @@ img.mfp-img {
right: 0;
padding-top: 0; }
/* overlay at start */
.mfp-fade.mfp-bg {
@ -2002,7 +2002,7 @@ img.mfp-img {
-moz-transform: translateX(50px);
transform: translateX(50px);
}
.simple-pace {
-webkit-pointer-events: none;
pointer-events: none;
@ -2073,7 +2073,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;
@ -2141,7 +2141,7 @@ img.mfp-img {
box-shadow:none;
}
.inputosaurus-input-hidden { display:none; }
.flag-wrapper {
width: 24px;
height: 16px;
@ -2182,7 +2182,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;
@ -7064,7 +7064,9 @@ showImages html.rl-no-preview-pane .messageView.message-selected {
height: 0px;
}
.messageView .b-content .messageItem .showImages,
.messageView .b-content .messageItem .readReceipt {
.messageView .b-content .messageItem .readReceipt,
.messageView .b-content .messageItem .pgpSigned,
.messageView .b-content .messageItem .pgpEncrypted {
cursor: pointer;
padding: 10px 15px;
border-bottom: 1px solid #ddd;
@ -7073,6 +7075,10 @@ showImages html.rl-no-preview-pane .messageView.message-selected {
.messageView .b-content .messageItem .readReceipt {
background-color: #ffffd9;
}
.messageView .b-content .messageItem .pgpSigned,
.messageView .b-content .messageItem .pgpEncrypted {
cursor: default;
}
.messageView .b-content .messageItem .attachmentsPlace {
padding: 10px;
}
@ -7165,14 +7171,13 @@ showImages html.rl-no-preview-pane .messageView.message-selected {
}
.messageView .b-content .messageItem .bodyText .b-text-part.plain {
padding: 15px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;
}
.messageView .b-content .messageItem .bodyText .b-text-part.plain pre {
margin: 0px;
padding: 0px;
font-family: arial, sans-serif;
background: #fff;
border: none;
white-space: normal;
}
.messageView .b-content .messageItem .bodyText .b-text-part.plain blockquote {
border-left: 2px solid blue;
@ -7686,25 +7691,6 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
background: #777;
color: #fff;
}
.b-compose .editorTextArea,
.b-compose .editorHtmlArea {
background: #fff;
color: #000;
font-family: Arial, Verdana, Geneva, sans-serif;
font-size: 14px;
}
.b-compose .editorTextArea table,
.b-compose .editorHtmlArea table {
border-collapse: separate;
}
.b-compose .editorTextArea blockquote,
.b-compose .editorHtmlArea blockquote {
border: 0;
border-left: solid 2px #444;
margin-left: 5px;
margin: 5px 0;
padding-left: 5px;
}
.b-admin-left .b-toolbar {
position: absolute;
top: 0;
@ -8650,12 +8636,14 @@ html.rl-started-trigger.no-mobile #rl-content {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
color: #000;
border: 0px !important;
overflow: auto;
overflow-y: scroll;
font-family: arial, sans-serif;
font-size: 14px;
line-height: 16px;
font-family: Arial, Verdana, Geneva, sans-serif;
font-size: 13px;
line-height: 15px;
margin: 0px;
padding: 8px;
}
@ -8672,8 +8660,10 @@ html.rl-started-trigger.no-mobile #rl-content {
list-style-type: decimal !important;
}
.textAreaParent .editorHtmlArea blockquote {
border: 0;
border-left: solid 2px #444;
margin-left: 5px;
margin: 5px 0;
padding-left: 5px;
}
.textAreaParent .editorHtmlArea img {
@ -8686,14 +8676,16 @@ html.rl-started-trigger.no-mobile #rl-content {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
color: #000;
display: block;
border: 0px !important;
width: 100%;
line-height: 16px;
margin: 0px;
padding: 8px;
font-family: arial, sans-serif;
font-size: 14px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;
font-size: 13px;
line-height: 15px;
overflow: auto;
overflow-y: scroll;
}

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, _) {
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, _) {
'use strict';
@ -70,14 +70,14 @@ var
$document = $(window.document),
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
;
/*jshint onevar: false*/
/**
* @type {?AdminApp}
*/
var RL = null;
/*jshint onevar: true*/
/**
* @type {?}
*/
@ -143,6 +143,11 @@ Globals.bDisableNanoScroll = Globals.bMobileDevice;
*/
Globals.bAllowPdfPreview = !Globals.bMobileDevice;
/**
* @type {boolean}
*/
Globals.bAllowOpenPGP = false;
/**
* @type {boolean}
*/
@ -159,7 +164,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
Consts.Defaults = {};
Consts.Values = {};
Consts.DataImages = {};
@ -277,7 +282,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/**
* @enum {string}
*/
@ -613,7 +618,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
Utils.trim = $.trim;
Utils.inArray = $.inArray;
Utils.isArray = _.isArray;
@ -2179,7 +2184,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount)
return aResult;
};
};
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -2342,7 +2347,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
ko.bindingHandlers.tooltip = {
'init': function (oElement, fValueAccessor) {
if (!Globals.bMobileDevice)
@ -2964,7 +2969,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/**
* @constructor
*/
@ -3254,7 +3259,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/**
* @type {Object}
*/
@ -3348,7 +3353,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
/**
* @constructor
*/
@ -3422,7 +3427,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -3494,7 +3499,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -3537,7 +3542,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/**
* @constructor
*/
@ -3550,7 +3555,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/**
* @param {string=} sPosition = ''
* @param {string=} sTemplate = ''
@ -3610,7 +3615,7 @@ KnoinAbstractViewModel.prototype.viewModelPosition = function ()
KnoinAbstractViewModel.prototype.cancelCommand = KnoinAbstractViewModel.prototype.closeCommand = function ()
{
};
/**
* @param {string} sScreenName
* @param {?=} aViewModels = []
@ -3686,7 +3691,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/**
* @constructor
*/
@ -4077,7 +4082,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/**
* @param {string=} sEmail
* @param {string=} sName
@ -4441,7 +4446,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -4661,7 +4666,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
this.smtpAuth(true);
this.whiteList('');
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -4798,7 +4803,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
return bResult;
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -4914,7 +4919,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
{
var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
};
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -4988,7 +4993,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5106,7 +5111,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5193,7 +5198,7 @@ AdminLoginViewModel.prototype.onHide = function ()
{
this.loginFocus(false);
};
/**
* @param {?} oScreen
*
@ -5215,7 +5220,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
{
return '#/' + sRoute;
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5237,7 +5242,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
RL.remote().adminLogout(function () {
RL.loginAndLogoutReload();
});
};
};
/**
* @constructor
*/
@ -5337,7 +5342,7 @@ AdminGeneral.prototype.selectLanguage = function ()
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/**
* @constructor
*/
@ -5389,7 +5394,7 @@ AdminLogin.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -5458,7 +5463,7 @@ AdminBranding.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -5678,7 +5683,7 @@ AdminContacts.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -5767,13 +5772,14 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
{
RL.reloadDomainList();
};
/**
* @constructor
*/
function AdminSecurity()
{
this.csrfProtection = ko.observable(!!RL.settingsGet('UseTokenProtection'));
this.openPGP = ko.observable(!!RL.settingsGet('OpenPGP'));
this.adminLogin = ko.observable(RL.settingsGet('AdminLogin'));
this.adminPassword = ko.observable('');
@ -5833,6 +5839,12 @@ AdminSecurity.prototype.onBuild = function ()
'TokenProtection': bValue ? '1' : '0'
});
});
this.openPGP.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, {
'OpenPGP': bValue ? '1' : '0'
});
});
};
AdminSecurity.prototype.onHide = function ()
@ -5848,7 +5860,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
{
return RL.link().phpInfo();
};
/**
* @constructor
*/
@ -5964,7 +5976,7 @@ AdminSocial.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -6061,7 +6073,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
RL.reloadPluginList();
};
/**
* @constructor
*/
@ -6165,7 +6177,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
}
};
/**
* @constructor
*/
@ -6216,7 +6228,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
{
var oDate = moment.unix(this.licenseExpired());
return oDate.format('LL') + ' (' + oDate.from(moment()) + ')';
};
};
/**
* @constructor
*/
@ -6285,7 +6297,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/**
* @constructor
* @extends AbstractData
@ -6319,7 +6331,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
AdminDataStorage.prototype.populateDataOnStart = function()
{
AbstractData.prototype.populateDataOnStart.call(this);
};
};
/**
* @constructor
*/
@ -6593,7 +6605,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/**
* @constructor
* @extends AbstractAjaxRemoteStorage
@ -6837,7 +6849,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
{
this.defaultRequest(fCallback, 'AdminPing');
};
/**
* @constructor
*/
@ -6903,7 +6915,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{
this.oEmailsPicsHashes = oData;
};
/**
* @constructor
* @extends AbstractCacheStorage
@ -6914,7 +6926,7 @@ function AdminCacheStorage()
}
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
/**
* @param {Array} aViewModels
* @constructor
@ -7091,7 +7103,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/**
* @constructor
* @extends KnoinAbstractScreen
@ -7106,7 +7118,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
AdminLoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/**
* @constructor
* @extends AbstractSettings
@ -7126,7 +7138,7 @@ AdminSettingsScreen.prototype.onShow = function ()
// AbstractSettings.prototype.onShow.call(this);
RL.setTitle('');
};
};
/**
* @constructor
* @extends KnoinAbstractBoot
@ -7365,6 +7377,7 @@ AbstractApp.prototype.sub = function (sName, fFunc, oContext)
*/
AbstractApp.prototype.pub = function (sName, aArgs)
{
Plugins.runHook('rl-pub', [sName, aArgs]);
if (!Utils.isUnd(this.oSubs[sName]))
{
_.each(this.oSubs[sName], function (aItem) {
@ -7436,7 +7449,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/**
* @constructor
* @extends AbstractApp
@ -7683,7 +7696,7 @@ AdminApp.prototype.bootstart = function ()
* @type {AdminApp}
*/
RL = new AdminApp();
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
@ -7730,9 +7743,9 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}
}
}(window, jQuery, ko, crossroads, hasher, _));

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible) {
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible) {
'use strict';
@ -70,14 +70,14 @@ var
$document = $(window.document),
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
;
/*jshint onevar: false*/
/**
* @type {?RainLoopApp}
*/
var RL = null;
/*jshint onevar: true*/
/**
* @type {?}
*/
@ -143,6 +143,11 @@ Globals.bDisableNanoScroll = Globals.bMobileDevice;
*/
Globals.bAllowPdfPreview = !Globals.bMobileDevice;
/**
* @type {boolean}
*/
Globals.bAllowOpenPGP = false;
/**
* @type {boolean}
*/
@ -159,7 +164,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
Consts.Defaults = {};
Consts.Values = {};
Consts.DataImages = {};
@ -277,7 +282,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/**
* @enum {string}
*/
@ -613,7 +618,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
Utils.trim = $.trim;
Utils.inArray = $.inArray;
Utils.isArray = _.isArray;
@ -2179,7 +2184,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount)
return aResult;
};
};
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -2342,7 +2347,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
ko.bindingHandlers.tooltip = {
'init': function (oElement, fValueAccessor) {
if (!Globals.bMobileDevice)
@ -2964,7 +2969,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/**
* @constructor
*/
@ -3254,7 +3259,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/**
* @type {Object}
*/
@ -3348,7 +3353,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
/**
* @constructor
*/
@ -4244,7 +4249,7 @@ HtmlEditor.htmlFunctions = {
}, this), this.toolbar);
}
};
/**
* @constructor
* @param {koProperty} oKoList
@ -4785,7 +4790,7 @@ Selector.prototype.on = function (sEventName, fCallback)
{
this.oCallbacks[sEventName] = fCallback;
};
/**
* @constructor
*/
@ -4859,7 +4864,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -4931,7 +4936,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -4974,7 +4979,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/**
* @constructor
*/
@ -4987,7 +4992,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/**
* @param {string=} sPosition = ''
* @param {string=} sTemplate = ''
@ -5047,7 +5052,7 @@ KnoinAbstractViewModel.prototype.viewModelPosition = function ()
KnoinAbstractViewModel.prototype.cancelCommand = KnoinAbstractViewModel.prototype.closeCommand = function ()
{
};
/**
* @param {string} sScreenName
* @param {?=} aViewModels = []
@ -5123,7 +5128,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/**
* @constructor
*/
@ -5514,7 +5519,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/**
* @param {string=} sEmail
* @param {string=} sName
@ -5878,7 +5883,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/**
* @constructor
*/
@ -6000,7 +6005,7 @@ ContactModel.prototype.lineAsCcc = function ()
return aResult.join(' ');
};
/**
* @param {number=} iType = Enums.ContactPropertyType.Unknown
* @param {string=} sValue = ''
@ -6022,7 +6027,7 @@ function ContactPropertyModel(iType, sValue, bFocused, sPlaceholder)
return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
}, this);
}
/**
* @constructor
*/
@ -6258,7 +6263,7 @@ AttachmentModel.prototype.iconClass = function ()
return sClass;
};
/**
* @constructor
* @param {string} sId
@ -6319,7 +6324,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
}
return bResult;
};
};
/**
* @constructor
*/
@ -6402,11 +6407,16 @@ function MessageModel()
}, this);
this.body = null;
this.plainRaw = '';
this.isRtl = ko.observable(false);
this.isHtml = ko.observable(false);
this.hasImages = ko.observable(false);
this.attachments = ko.observableArray([]);
this.isPgpSigned = ko.observable(false);
this.isPgpEncrypted = ko.observable(false);
this.pgpSignature = ko.observable('');
this.priority = ko.observable(Enums.MessagePriority.Normal);
this.readReceipt = ko.observable('');
@ -6573,6 +6583,10 @@ MessageModel.prototype.clear = function ()
this.isHtml(false);
this.hasImages(false);
this.attachments([]);
this.isPgpSigned(false);
this.isPgpEncrypted(false);
this.pgpSignature('');
this.priority(Enums.MessagePriority.Normal);
this.readReceipt('');
@ -6667,6 +6681,13 @@ MessageModel.prototype.initUpdateByMessageJson = function (oJsonMessage)
this.sInReplyTo = oJsonMessage.InReplyTo;
this.sReferences = oJsonMessage.References;
if (Globals.bAllowOpenPGP)
{
this.isPgpSigned(!!oJsonMessage.PgpSigned);
this.isPgpEncrypted(!!oJsonMessage.PgpEncrypted);
this.pgpSignature(oJsonMessage.PgpSignature);
}
this.hasAttachments(!!oJsonMessage.HasAttachments);
this.attachmentsMainType(oJsonMessage.AttachmentsMainType);
@ -7128,6 +7149,10 @@ MessageModel.prototype.populateByMessageListItem = function (oMessage)
// this.hasImages(false);
// this.attachments([]);
// this.isPgpSigned(false);
// this.isPgpEncrypted(false);
// this.pgpSignature('');
this.priority(Enums.MessagePriority.Normal);
this.aDraftInfo = [];
this.sMessageId = '';
@ -7277,7 +7302,7 @@ MessageModel.prototype.showInternalImages = function (bLazy)
Utils.windowResize(500);
}
};
/**
* @constructor
*/
@ -7611,7 +7636,7 @@ FolderModel.prototype.printableFullName = function ()
{
return this.fullName.split(this.delimiter).join(' / ');
};
/**
* @param {string} sEmail
* @param {boolean=} bCanBeDelete = true
@ -7632,7 +7657,7 @@ AccountModel.prototype.email = '';
AccountModel.prototype.changeAccountLink = function ()
{
return RL.link().change(this.email);
};
};
/**
* @param {string} sId
* @param {string} sEmail
@ -7668,7 +7693,7 @@ IdentityModel.prototype.formattedNameForEmail = function ()
var sName = this.name();
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -7778,7 +7803,7 @@ PopupsFolderClearViewModel.prototype.onBuild = function ()
return bResult;
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -7902,7 +7927,7 @@ PopupsFolderCreateViewModel.prototype.onBuild = function ()
return bResult;
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -8021,7 +8046,7 @@ PopupsFolderSystemViewModel.prototype.onBuild = function ()
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -9469,7 +9494,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
this.resizer(!this.resizer());
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10109,7 +10134,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
oItem.checked(false);
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10253,7 +10278,7 @@ PopupsAdvancedSearchViewModel.prototype.onBuild = function ()
return bResult;
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10381,7 +10406,7 @@ PopupsAddAccountViewModel.prototype.onBuild = function ()
return bResult;
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10543,7 +10568,7 @@ PopupsIdentityViewModel.prototype.onBuild = function ()
return bResult;
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10617,7 +10642,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10735,7 +10760,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11007,7 +11032,7 @@ LoginViewModel.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11074,7 +11099,7 @@ AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
RL.loginAndLogoutReload(true, RL.settingsGet('ParentEmail') && 0 < RL.settingsGet('ParentEmail').length);
});
};
};
/**
* @constructor
* @extends AbstractSystemDropDownViewModel
@ -11086,7 +11111,7 @@ function MailBoxSystemDropDownViewModel()
}
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/**
* @constructor
* @extends AbstractSystemDropDownViewModel
@ -11098,7 +11123,7 @@ function SettingsSystemDropDownViewModel()
}
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11213,7 +11238,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
kn.showScreenPopup(PopupsContactsViewModel);
}
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -12127,7 +12152,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
;
return !!oJua;
};
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -12212,7 +12237,7 @@ function MailBoxMessageViewViewModel()
this.viewDownloadLink = ko.observable('');
this.viewUserPic = ko.observable(Consts.DataImages.UserDotPic);
this.viewUserPicVisible = ko.observable(false);
this.message.subscribe(function (oMessage) {
this.messageActiveDom(null);
@ -12476,7 +12501,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};
/**
* @param {?} oScreen
*
@ -12503,7 +12528,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -12526,7 +12551,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/**
* @constructor
*/
@ -12680,7 +12705,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/**
* @constructor
*/
@ -12718,7 +12743,7 @@ SettingsContacts.prototype.onShow = function ()
{
this.showPassword(false);
};
/**
* @constructor
*/
@ -12784,7 +12809,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
}
}
};
/**
* @constructor
*/
@ -12842,7 +12867,7 @@ SettingsIdentity.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -12970,7 +12995,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
});
}, 50);
};
};
/**
* @constructor
*/
@ -13037,7 +13062,7 @@ function SettingsSocialScreen()
}
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
/**
* @constructor
*/
@ -13101,7 +13126,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
this.passwordUpdateError(true);
}
};
/**
* @constructor
*/
@ -13296,7 +13321,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
oFolder.subScribed(false);
};
/**
* @constructor
*/
@ -13513,7 +13538,7 @@ SettingsThemes.prototype.initCustomThemeUploader = function ()
return false;
};
/**
* @constructor
*/
@ -13582,7 +13607,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/**
* @constructor
* @extends AbstractData
@ -14292,6 +14317,10 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
oBody = null,
oTextBody = null,
sId = '',
sPlain = '',
bPgpSigned = false,
bPgpEncrypted = false,
mPgpMessage = null,
oMessagesBodiesDom = this.messagesBodiesDom(),
oMessage = this.message()
;
@ -14330,7 +14359,57 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
else if (Utils.isNormal(oData.Result.Plain) && '' !== oData.Result.Plain)
{
bIsHtml = false;
oBody.html(oData.Result.Plain.toString()).addClass('b-text-part plain');
sPlain = oData.Result.Plain.toString();
if (Globals.bAllowOpenPGP && (oMessage.isPgpSigned() || oMessage.isPgpEncrypted()) &&
Utils.isNormal(oData.Result.PlainRaw))
{
bPgpEncrypted = /---BEGIN PGP MESSAGE---/.test(oData.Result.PlainRaw);
if (!bPgpEncrypted)
{
bPgpSigned = /-----BEGIN PGP SIGNED MESSAGE-----/.test(oData.Result.PlainRaw) &&
/-----BEGIN PGP SIGNATURE-----/.test(oData.Result.PlainRaw);
}
if (bPgpSigned && oMessage.isPgpSigned() && oMessage.pgpSignature())
{
sPlain = '<pre class="b-plain-openpgp signed">' + oData.Result.PlainRaw + '</pre>';
try
{
mPgpMessage = window.openpgp.cleartext.readArmored(oData.Result.PlainRaw);
}
catch (oExc) {}
if (mPgpMessage && mPgpMessage.getText)
{
sPlain = mPgpMessage.getText();
}
else
{
bPgpSigned = false;
}
}
else if (bPgpEncrypted && oMessage.isPgpEncrypted())
{
try
{
mPgpMessage = window.openpgp.message.readArmored(oData.Result.PlainRaw);
}
catch (oExc) {}
sPlain = '<pre class="b-plain-openpgp encrypted">' + oData.Result.PlainRaw + '</pre>';
}
if (bPgpSigned || bPgpEncrypted)
{
oBody.data('rl-plain-raw', oData.Result.PlainRaw);
oBody.data('rl-plain-pgp-encrypted', bPgpEncrypted);
oBody.data('rl-plain-pgp-signed', bPgpSigned);
}
}
oBody.html(sPlain).addClass('b-text-part plain');
}
else
{
@ -14343,15 +14422,19 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
oBody.addClass('rtl-text-part');
}
oMessagesBodiesDom.append(oBody);
oBody.data('rl-is-html', bIsHtml);
oBody.data('rl-has-images', bHasExternals);
oMessage.isRtl(!!oBody.data('rl-is-rtl'));
oMessage.isHtml(!!oBody.data('rl-is-html'));
oMessage.hasImages(!!oBody.data('rl-has-images'));
oMessage.body = oBody;
if (oMessage.body)
{
oMessagesBodiesDom.append(oMessage.body);
oMessage.body.data('rl-is-html', bIsHtml);
oMessage.body.data('rl-has-images', bHasExternals);
oMessage.isRtl(!!oMessage.body.data('rl-is-rtl'));
oMessage.isHtml(!!oMessage.body.data('rl-is-html'));
oMessage.hasImages(!!oMessage.body.data('rl-has-images'));
oMessage.plainRaw = Utils.pString(oMessage.body.data('rl-plain-raw'));
}
if (bHasInternals)
{
@ -14367,12 +14450,26 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
}
else
{
oTextBody.data('rl-cache-count', ++Globals.iMessageBodyCacheCount);
oMessage.isRtl(!!oTextBody.data('rl-is-rtl'));
oMessage.isHtml(!!oTextBody.data('rl-is-html'));
oMessage.hasImages(!!oTextBody.data('rl-has-images'));
oMessage.body = oTextBody;
if (oMessage.body)
{
oMessage.body.data('rl-cache-count', ++Globals.iMessageBodyCacheCount);
oMessage.isRtl(!!oMessage.body.data('rl-is-rtl'));
oMessage.isHtml(!!oMessage.body.data('rl-is-html'));
oMessage.hasImages(!!oMessage.body.data('rl-has-images'));
oMessage.plainRaw = Utils.pString(oMessage.body.data('rl-plain-raw'));
}
}
if (Globals.bAllowOpenPGP && oMessage.body)
{
oMessage.isPgpSigned(!!oMessage.body.data('rl-plain-pgp-signed'));
oMessage.isPgpEncrypted(!!oMessage.body.data('rl-plain-pgp-encrypted'));
}
else
{
oMessage.isPgpSigned(false);
oMessage.isPgpEncrypted(false);
}
this.messageActiveDom(oMessage.body);
@ -14532,7 +14629,7 @@ WebMailDataStorage.prototype.setMessageList = function (oData, bCached)
));
}
};
/**
* @constructor
*/
@ -14806,7 +14903,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/**
* @constructor
* @extends AbstractAjaxRemoteStorage
@ -15506,7 +15603,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
this.defaultRequest(fCallback, 'SocialUsers');
};
/**
* @constructor
*/
@ -15572,7 +15669,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{
this.oEmailsPicsHashes = oData;
};
/**
* @constructor
* @extends AbstractCacheStorage
@ -15890,7 +15987,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
this.setMessageFlagsToCache(sFolder, sUid, aFlags);
}
};
/**
* @param {Array} aViewModels
* @constructor
@ -16067,7 +16164,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/**
* @constructor
* @extends KnoinAbstractScreen
@ -16082,7 +16179,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
LoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/**
* @constructor
* @extends KnoinAbstractScreen
@ -16247,7 +16344,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([^\/]*)$/, {'normalize_': fNormS}]
];
};
/**
* @constructor
* @extends AbstractSettings
@ -16275,7 +16372,7 @@ SettingsScreen.prototype.onShow = function ()
RL.setTitle(this.sSettingsTitle);
};
/**
* @constructor
* @extends KnoinAbstractBoot
@ -16514,6 +16611,7 @@ AbstractApp.prototype.sub = function (sName, fFunc, oContext)
*/
AbstractApp.prototype.pub = function (sName, aArgs)
{
Plugins.runHook('rl-pub', [sName, aArgs]);
if (!Utils.isUnd(this.oSubs[sName]))
{
_.each(this.oSubs[sName], function (aItem) {
@ -16585,7 +16683,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/**
* @constructor
* @extends AbstractApp
@ -17289,6 +17387,7 @@ RainLoopApp.prototype.mailToHelper = function (sMailToUrl)
RainLoopApp.prototype.bootstart = function ()
{
RL.pub('rl.bootstart');
AbstractApp.prototype.bootstart.call(this);
RL.data().populateDataOnStart();
@ -17371,17 +17470,26 @@ RainLoopApp.prototype.bootstart = function ()
if (bValue)
{
// if (window.crypto && window.crypto.getRandomValues)
// {
// $.ajax({
// 'url': RL.link().openPgpJs(),
// 'dataType': 'script',
// 'cache': true,
// 'success': function () {
// window.console.log('openPgpJs');
// }
// });
// }
if (window.crypto && window.crypto.getRandomValues && RL.settingsGet('OpenPGP'))
{
$.ajax({
'url': RL.link().openPgpJs(),
'dataType': 'script',
'cache': true,
'success': function () {
if (window.openpgp)
{
// window.console.log(window.openpgp);
Globals.bAllowOpenPGP = true;
RL.pub('openpgp.init');
}
}
});
}
else
{
Globals.bAllowOpenPGP = false;
}
kn.startScreens([MailBoxScreen, SettingsScreen]);
@ -17432,13 +17540,15 @@ RainLoopApp.prototype.bootstart = function ()
}, 2000);
Plugins.runHook('rl-start-user-screens');
RL.pub('rl.bootstart-user-screens');
}
else
{
kn.startScreens([LoginScreen]);
Plugins.runHook('rl-start-login-screens');
RL.pub('rl.bootstart-login-screens');
}
if (window.SimplePace)
@ -17464,6 +17574,7 @@ RainLoopApp.prototype.bootstart = function ()
kn.startScreens([LoginScreen]);
Plugins.runHook('rl-start-login-screens');
RL.pub('rl.bootstart-login-screens');
if (window.SimplePace)
{
@ -17511,13 +17622,14 @@ RainLoopApp.prototype.bootstart = function ()
});
Plugins.runHook('rl-start-screens');
RL.pub('rl.bootstart-end');
};
/**
* @type {RainLoopApp}
*/
RL = new RainLoopApp();
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
@ -17564,9 +17676,9 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}
}
}(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible));

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
/*! See http://www.JSON.org/js.html */
var JSON;JSON||(JSON={}),function(){function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g;return e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)d=rep[c],typeof d=="string"&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g;return e}}function quote(a){escapable.lastIndex=0;return escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function f(a){return a<10?"0"+a:a}"use strict",typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(b&&typeof b!="function"&&(typeof b!="object"||typeof b.length!="number"))throw new Error("JSON.stringify");return str("",{"":a})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver=="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")})}();
/*! See http://www.JSON.org/js.html */
var JSON;JSON||(JSON={}),function(){function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g;return e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)d=rep[c],typeof d=="string"&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g;return e}}function quote(a){escapable.lastIndex=0;return escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function f(a){return a<10?"0"+a:a}"use strict",typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(b&&typeof b!="function"&&(typeof b!="object"||typeof b.length!="number"))throw new Error("JSON.stringify");return str("",{"":a})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver=="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")})}();
/*! RainLoop Simple Pace v1.0 (c) 2013 RainLoop Team; Licensed under MIT */
!function(a){function b(){var b=this;b.el=null,b.done=!1,b.progress=0,b.addInterval=0,b.addSpeed=3,b.stopProgress=100,b.interval=a.setInterval(function(){var c=b.build();c&&a.clearInterval(b.interval)},100)}if(b.prototype.startAddInterval=function(){var b=this;b.stopAddInterval(),b.addInterval=a.setInterval(function(){0<b.progress&&b.stopProgress>b.progress&&b.add(b.addSpeed)},500)},b.prototype.stopAddInterval=function(){a.clearInterval(this.addInterval),this.addInterval=0},b.prototype.build=function(){if(null===this.el){var a=document.querySelector("body");a&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='<div class="simple-pace-progress"><div class="simple-pace-progress-inner"></div></div><div class="simple-pace-activity"></div>',a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el))}return this.el},b.prototype.reset=function(){return this.progress=0,this.render()},b.prototype.update=function(b){var c=a.parseInt(b,10);return c>this.progress&&(this.progress=c,this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress),this.render()},b.prototype.add=function(b){return this.progress+=a.parseInt(b,10),this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress,this.render()},b.prototype.setSpeed=function(a,b){this.addSpeed=a,this.stopProgress=b||100},b.prototype.render=function(){var b=this.build();b&&b.children&&b.children[0]&&b.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),b.className=b.className.replace("simple-pace-inactive",""),b.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),a.setTimeout(function(){b.className=b.className.replace("simple-pace-active",""),b.className+=" simple-pace-inactive"},500))},!a.SimplePace){var c=new b;a.SimplePace={sleep:function(){c.setSpeed(2,95)},set:function(a){c.update(a)},add:function(a){c.add(a)}}}}(window);
!function(a){function b(){var b=this;b.el=null,b.done=!1,b.progress=0,b.addInterval=0,b.addSpeed=3,b.stopProgress=100,b.interval=a.setInterval(function(){var c=b.build();c&&a.clearInterval(b.interval)},100)}if(b.prototype.startAddInterval=function(){var b=this;b.stopAddInterval(),b.addInterval=a.setInterval(function(){0<b.progress&&b.stopProgress>b.progress&&b.add(b.addSpeed)},500)},b.prototype.stopAddInterval=function(){a.clearInterval(this.addInterval),this.addInterval=0},b.prototype.build=function(){if(null===this.el){var a=document.querySelector("body");a&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='<div class="simple-pace-progress"><div class="simple-pace-progress-inner"></div></div><div class="simple-pace-activity"></div>',a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el))}return this.el},b.prototype.reset=function(){return this.progress=0,this.render()},b.prototype.update=function(b){var c=a.parseInt(b,10);return c>this.progress&&(this.progress=c,this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress),this.render()},b.prototype.add=function(b){return this.progress+=a.parseInt(b,10),this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress,this.render()},b.prototype.setSpeed=function(a,b){this.addSpeed=a,this.stopProgress=b||100},b.prototype.render=function(){var b=this.build();b&&b.children&&b.children[0]&&b.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),b.className=b.className.replace("simple-pace-inactive",""),b.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),a.setTimeout(function(){b.className=b.className.replace("simple-pace-active",""),b.className+=" simple-pace-inactive"},500))},!a.SimplePace){var c=new b;a.SimplePace={sleep:function(){c.setSpeed(2,95)},set:function(a){c.update(a)},add:function(a){c.add(a)}}}}(window);
/*! RainLoop Top Driver v1.0 (c) 2013 RainLoop Team; Licensed under MIT */
!function(a,b){function c(){}c.prototype.s=a.sessionStorage,c.prototype.t=a.top||a,c.prototype.getHash=function(){var a=null;if(this.s)a=this.s.getItem("__rlA")||null;else if(this.t){var c=this.t.name&&b&&"{"===this.t.name.toString().substr(0,1)?b.parse(this.t.name.toString()):null;a=c?c.__rlA||null:null}return a},c.prototype.setHash=function(){var c=a.rainloopAppData,d=null;this.s?this.s.setItem("__rlA",c&&c.AuthAccountHash?c.AuthAccountHash:""):this.t&&b&&(d={},d.__rlA=c&&c.AuthAccountHash?c.AuthAccountHash:"",this.t.name=b.stringify(d))},c.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},a._rlhh=new c,a.__rlah=function(){return a._rlhh?a._rlhh.getHash():null},a.__rlah_set=function(){a._rlhh&&a._rlhh.setHash()},a.__rlah_clear=function(){a._rlhh&&a._rlhh.clearHash()}}(window,window.JSON);

File diff suppressed because one or more lines are too long