diff --git a/dev/App/User.js b/dev/App/User.js
index c21d080f4..154819268 100644
--- a/dev/App/User.js
+++ b/dev/App/User.js
@@ -1265,25 +1265,25 @@
bTwitter = Settings.settingsGet('AllowTwitterSocial')
;
- Utils.initOnStartOrLangChange(function () {
-
- $.extend(true, $.magnificPopup.defaults, {
- 'tClose': Utils.i18n('MAGNIFIC_POPUP/CLOSE'),
- 'tLoading': Utils.i18n('MAGNIFIC_POPUP/LOADING'),
- 'gallery': {
- 'tPrev': Utils.i18n('MAGNIFIC_POPUP/GALLERY_PREV'),
- 'tNext': Utils.i18n('MAGNIFIC_POPUP/GALLERY_NEXT'),
- 'tCounter': Utils.i18n('MAGNIFIC_POPUP/GALLERY_COUNTER')
- },
- 'image': {
- 'tError': Utils.i18n('MAGNIFIC_POPUP/IMAGE_ERROR')
- },
- 'ajax': {
- 'tError': Utils.i18n('MAGNIFIC_POPUP/AJAX_ERROR')
- }
- });
-
- }, this);
+// Utils.initOnStartOrLangChange(function () {
+//
+// $.extend(true, $.magnificPopup.defaults, {
+// 'tClose': Utils.i18n('PREVIEW_POPUP/CLOSE'),
+// 'tLoading': Utils.i18n('PREVIEW_POPUP/LOADING'),
+// 'gallery': {
+// 'tPrev': Utils.i18n('PREVIEW_POPUP/GALLERY_PREV'),
+// 'tNext': Utils.i18n('PREVIEW_POPUP/GALLERY_NEXT'),
+// 'tCounter': Utils.i18n('PREVIEW_POPUP/GALLERY_COUNTER')
+// },
+// 'image': {
+// 'tError': Utils.i18n('PREVIEW_POPUP/IMAGE_ERROR')
+// },
+// 'ajax': {
+// 'tError': Utils.i18n('PREVIEW_POPUP/AJAX_ERROR')
+// }
+// });
+//
+// }, this);
if (SimplePace)
{
diff --git a/dev/Common/Globals.js b/dev/Common/Globals.js
index 87d32af36..c819c02cb 100644
--- a/dev/Common/Globals.js
+++ b/dev/Common/Globals.js
@@ -145,7 +145,7 @@
'removeButtons': 'Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll,Source',
'removeDialogTabs': 'link:advanced;link:target;image:advanced;images:advanced',
- 'extraPlugins': 'plain,signature',
+ 'extraPlugins': 'plain,bidi', // signature
'allowedContent': true,
'font_defaultLabel': 'Arial',
diff --git a/dev/Common/HtmlEditor.js b/dev/Common/HtmlEditor.js
index c255ce956..198bd5de3 100644
--- a/dev/Common/HtmlEditor.js
+++ b/dev/Common/HtmlEditor.js
@@ -198,6 +198,10 @@
{
oConfig.removePlugins += (oConfig.removePlugins ? ',' : '') + 'bidi';
}
+ else
+ {
+ oConfig.removeButtons = oConfig.removeButtons.replace(',bidi', '');
+ }
}
oConfig.enterMode = window.CKEDITOR.ENTER_BR;
diff --git a/dev/Styles/Login.less b/dev/Styles/Login.less
index 5166c99eb..0f70cf73f 100644
--- a/dev/Styles/Login.less
+++ b/dev/Styles/Login.less
@@ -30,14 +30,15 @@
color: #333;
margin: 0;
float: none;
+ width: 303px;
}
- .control-label {
+/* .control-label {
font-size: 16px;
line-height: 30px;
- }
+ }*/
- .control-group {
+ .controls, .control-group {
margin-bottom: 25px;
}
@@ -50,10 +51,20 @@
border-radius: 3px;
}
- .inputLoginForm, .inputEmail, .inputLogin, .inputPassword, .inputAdditionalCode {
- font-size: 18px;
- height: 30px;
- line-height: 29px;
+ .control-group {
+ .inputLoginForm, .inputEmail, .inputLogin, .inputPassword, .inputAdditionalCode {
+ font-size: 18px;
+ height: 30px;
+ line-height: 29px;
+ }
+ }
+
+ .controls {
+ .inputLoginForm, .inputEmail, .inputLogin, .inputPassword, .inputAdditionalCode {
+ font-size: 18px;
+ height: 40px;
+ line-height: 39px;
+ }
}
.signMeLabel, .languageLabel {
@@ -79,7 +90,7 @@
color: #999;
}
- .control-group.error .add-on i {
+ .controls.error .add-on i, .control-group.error .add-on i {
color: #b94a48;
}
}
diff --git a/dev/Styles/MessageView.less b/dev/Styles/MessageView.less
index 30a2348d7..ec5e3a51e 100644
--- a/dev/Styles/MessageView.less
+++ b/dev/Styles/MessageView.less
@@ -33,7 +33,7 @@ html.rl-no-preview-pane {
left: -1px;
overflow: hidden;
border: @rlLowBorderSize solid @rlMainDarkColor;
-
+
.border-top-right-radius(@rlLowBorderRadius);
.border-bottom-right-radius(@rlLowBorderRadius);
@@ -218,7 +218,9 @@ html.rl-no-preview-pane {
.attachmentsPlace {
- padding: 10px;
+ padding: 10px 10px 6px 10px;
+ background: #eee;
+ border-bottom: 1px solid #ddd;
.attachmentList {
@@ -235,17 +237,20 @@ html.rl-no-preview-pane {
cursor: pointer;
list-style: none;
line-height: 24px;
- border: 2px solid grey;
+ /*border: 2px solid grey;*/
+ border: 0;
background-color: #fff;
- box-shadow: 1px 1px 5px #ccc;
- box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
+ box-shadow: 0 1px 5px #ccc;
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 1px 5px rgba(0, 0, 0, 0.1);
- border-radius: 6px;
+ border-radius: 2px;
.attachmentIcon {
font-size: 23px;
width: 23px;
height: 23px;
+ color: #666;
}
.attachmentPreview {
diff --git a/dev/Styles/SettingsIdentities.less b/dev/Styles/SettingsIdentities.less
index 5a600587e..5545ef66a 100644
--- a/dev/Styles/SettingsIdentities.less
+++ b/dev/Styles/SettingsIdentities.less
@@ -10,7 +10,7 @@
.e-signature-place {
display: inline-block;
width: 680px;
- width: 725px;
+ width: 730px;
height: 250px;
}
diff --git a/dev/Styles/SettingsIdentity.less b/dev/Styles/SettingsIdentity.less
index a99427467..cb95e2f64 100644
--- a/dev/Styles/SettingsIdentity.less
+++ b/dev/Styles/SettingsIdentity.less
@@ -3,7 +3,7 @@
.e-signature-place {
display: inline-block;
width: 680px;
- width: 725px;
+ width: 730px;
height: 250px;
}
}
diff --git a/dev/Styles/_CkeFix.less b/dev/Styles/_CkeFix.less
index 158f07624..708572c55 100644
--- a/dev/Styles/_CkeFix.less
+++ b/dev/Styles/_CkeFix.less
@@ -27,7 +27,7 @@
}
.cke_combo_button {
- background: #FBFBFB !important;
+ /*background: #FBFBFB !important;*/
}
.cke_source {
diff --git a/dev/Styles/_End.less b/dev/Styles/_End.less
index 33dfbbfa9..177bb118f 100644
--- a/dev/Styles/_End.less
+++ b/dev/Styles/_End.less
@@ -10,4 +10,15 @@
.mfp-container .mfp-figure {
min-height: 300px;
min-width: 300px;
+}
+
+.pswp__error-msg {
+ color: #ccc;
+ a, a:hover {
+ color: #fff;
+ }
+}
+
+.pswp__img--placeholder {
+ opacity: 0;
}
\ No newline at end of file
diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js
index 2039a4eb8..e0ef5a387 100644
--- a/dev/View/Popup/Compose.js
+++ b/dev/View/Popup/Compose.js
@@ -461,9 +461,12 @@
var
oIDs = {},
sResult = '',
+ sEmail = '',
+
fFindHelper = function (oItem) {
if (oItem && oItem.email && oIDs[oItem.email])
{
+ sEmail = oItem.email;
sResult = oIDs[oItem.email];
return true;
}
@@ -507,9 +510,10 @@
if ('' === sResult)
{
sResult = Data.accountEmail();
+ sEmail = sResult;
}
- return sResult;
+ return [sResult, sEmail];
};
ComposePopupView.prototype.selectIdentity = function (oIdentity)
@@ -744,6 +748,7 @@
sReplyTitle = '',
aResplyAllParts = [],
oExcludeEmail = {},
+ oIdResult = null,
mEmail = Data.accountEmail(),
sSignature = Data.signature(),
bSignatureToAll = Data.signatureToAll(),
@@ -780,7 +785,13 @@
oExcludeEmail[mEmail] = true;
}
- this.currentIdentityID(this.findIdentityIdByMessage(sComposeType, oMessage));
+ oIdResult = this.findIdentityIdByMessage(sComposeType, oMessage);
+ if (oIdResult && oIdResult[0])
+ {
+ oExcludeEmail[oIdResult[1]] = true;
+ this.currentIdentityID(oIdResult[0]);
+ }
+
this.reset();
if (Utils.isNonEmptyArray(aToEmails))
diff --git a/dev/View/User/Login.js b/dev/View/User/Login.js
index e65b540c4..ae158bc2b 100644
--- a/dev/View/User/Login.js
+++ b/dev/View/User/Login.js
@@ -13,6 +13,8 @@
Utils = require('Common/Utils'),
Links = require('Common/Links'),
+ Plugins = require('Common/Plugins'),
+
Settings = require('Storage/Settings'),
Data = require('Storage/User/Data'),
Remote = require('Storage/User/Remote'),
@@ -111,6 +113,27 @@
return false;
}
+ var
+ iPluginResultCode = 0,
+ sPluginResultMessage = '',
+ fSubmitResult = function (iResultCode, sResultMessage) {
+ iPluginResultCode = iResultCode || 0;
+ sPluginResultMessage = sResultMessage || '';
+ }
+ ;
+
+ Plugins.runHook('user-login-submit', [fSubmitResult]);
+ if (0 < iPluginResultCode)
+ {
+ this.submitError(Utils.getNotification(iPluginResultCode));
+ return false;
+ }
+ else if ('' !== sPluginResultMessage)
+ {
+ this.submitError(sPluginResultMessage);
+ return false;
+ }
+
this.submitRequest(true);
var
diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js
index 2fa1cd386..e95094beb 100644
--- a/dev/View/User/MailBox/MessageView.js
+++ b/dev/View/User/MailBox/MessageView.js
@@ -9,6 +9,9 @@
ko = require('ko'),
key = require('key'),
+ PhotoSwipe = require('PhotoSwipe'),
+ PhotoSwipeUI_Default = require('PhotoSwipeUI_Default'),
+
Consts = require('Common/Consts'),
Enums = require('Common/Enums'),
Globals = require('Common/Globals'),
@@ -43,6 +46,8 @@
this.oMessageScrollerDom = null;
+ this.pswp = null;
+
this.message = Data.message;
this.currentMessage = Data.currentMessage;
this.messageListChecked = Data.messageListChecked;
@@ -323,7 +328,11 @@
MessageViewMailBoxUserView.prototype.onBuild = function (oDom)
{
- var self = this;
+ var
+ self = this,
+ sErrorMessage = Utils.i18n('PREVIEW_POPUP/IMAGE_ERROR')
+ ;
+
this.fullScreenMode.subscribe(function (bValue) {
if (bValue)
{
@@ -331,25 +340,89 @@
}
}, this);
- $('.attachmentsPlace', oDom).magnificPopup({
- 'delegate': '.magnificPopupImage:visible',
- 'type': 'image',
- 'gallery': {
- 'enabled': true,
- 'preload': [1, 1],
- 'navigateByImgClick': true
- },
- 'callbacks': {
- 'open': function() {
- Globals.useKeyboardShortcuts(false);
- },
- 'close': function() {
- Globals.useKeyboardShortcuts(true);
- }
- },
- 'mainClass': 'mfp-fade',
- 'removalDelay': 400
- });
+// $('.attachmentsPlace', oDom).magnificPopup({
+// 'delegate': '.attachmentImagePreview:visible',
+// 'type': 'image',
+// 'gallery': {
+// 'enabled': true,
+// 'preload': [1, 1],
+// 'navigateByImgClick': true
+// },
+// 'callbacks': {
+// 'open': function() {
+// Globals.useKeyboardShortcuts(false);
+// },
+// 'close': function() {
+// Globals.useKeyboardShortcuts(true);
+// }
+// },
+// 'mainClass': 'mfp-fade',
+// 'removalDelay': 400
+// });
+
+ this.pswpDom = $('.pswp', oDom)[0];
+ if (this.pswpDom)
+ {
+ oDom
+ .on('click', 'a.attachmentImagePreview[data-index]:visible', function (oEvent) {
+
+ var
+ oPs = null,
+ oEl = oEvent.currentTarget || null,
+ aItems = []
+ ;
+
+ oDom.find('a.attachmentImagePreview:visible').each(function (index, oSubElement) {
+
+ var $oItem = $(oSubElement);
+
+ aItems.push({
+ w: 600, h: 400,
+ 'src': $oItem.attr('href'),
+ 'title': $oItem.attr('title') || ''
+ });
+
+ });
+
+ if (aItems && 0 < aItems.length)
+ {
+ Globals.useKeyboardShortcuts(false);
+
+ oPs = new PhotoSwipe(self.pswpDom, PhotoSwipeUI_Default, aItems, {
+ 'index': Utils.pInt($(oEl).data('index')),
+ 'bgOpacity': 0.85,
+ 'loadingIndicatorDelay': 500,
+ 'errorMsg': '
' + sErrorMessage + '
',
+ 'showHideOpacity': true,
+ 'tapToToggleControls': false,
+ 'timeToIdle': 0,
+ 'timeToIdleOutside': 0,
+ 'history': false,
+ 'arrowEl': 1 < aItems.length,
+ 'counterEl': 1 < aItems.length,
+ 'shareEl': false
+ });
+
+ oPs.listen('imageLoadComplete', function(index, item) {
+ if (item && item.img && item.img.width && item.img.height)
+ {
+ item.w = item.img.width;
+ item.h = item.img.height;
+
+ oPs.updateSize();
+ }
+ });
+
+ oPs.listen('close', function() {
+ Globals.useKeyboardShortcuts(true);
+ });
+
+ oPs.init();
+ }
+
+ return false;
+ });
+ }
oDom
.on('click', 'a', function (oEvent) {
diff --git a/gulpfile.js b/gulpfile.js
index d1529077d..c6a8e3d70 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -95,11 +95,13 @@ cfg.paths.css = {
'vendors/normalize/normalize.css',
'vendors/fontastic/styles.css',
'vendors/jquery-nanoscroller/nanoscroller.css',
- 'vendors/jquery-magnific-popup/magnific-popup.css',
- 'vendors/jquery-magnific-popup/magnific-popup-animations.css',
+// 'vendors/jquery-magnific-popup/magnific-popup.css',
+// 'vendors/jquery-magnific-popup/magnific-popup-animations.css',
'vendors/jquery-letterfx/jquery-letterfx.min.css',
'vendors/simple-pace/styles.css',
'vendors/inputosaurus/inputosaurus.css',
+ 'vendors/photoswipe/photoswipe.css',
+ 'vendors/photoswipe/default-skin/default-skin.css',
'vendors/flags/flags-fixed.css',
cfg.paths.staticCSS + cfg.paths.less.main.name
]
@@ -162,10 +164,12 @@ cfg.paths.js = {
'vendors/ssm/ssm.min.js',
'vendors/jua/jua.min.js',
'vendors/Autolinker/Autolinker.min.js',
+ 'vendors/photoswipe/photoswipe.min.js',
+ 'vendors/photoswipe/photoswipe-ui-default.min.js',
'vendors/jsencrypt/jsencrypt.min.js',
'vendors/keymaster/keymaster.min.js',
'vendors/ifvisible/ifvisible.min.js',
- 'vendors/jquery-magnific-popup/jquery.magnific-popup.min.js',
+// 'vendors/jquery-magnific-popup/jquery.magnific-popup.min.js',
'vendors/bootstrap/js/bootstrap.min.js'
]
},
@@ -411,6 +415,7 @@ gulp.task('ckeditor:copy', ['ckeditor:clear'], function() {
});
gulp.task('ckeditor:copy-plugins', ['ckeditor:copy'], function() {
+ return true;
return gulp.src('vendors/ckeditor-plugins/**/*')
.pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor/plugins'));
});
@@ -418,7 +423,7 @@ gulp.task('ckeditor:copy-plugins', ['ckeditor:copy'], function() {
gulp.task('ckeditor', ['ckeditor:copy-plugins'], function () {
return gulp.src('rainloop/v/' + cfg.devVersion + '/static/ckeditor/*.js')
.pipe(stripbom())
- .pipe(replace("\u200B", "\\u200B"))
+// .pipe(replace("\u200B", "\\u200B"))
.pipe(header("\uFEFF")) // BOM
.pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor'));
});
diff --git a/package.json b/package.json
index a35dc8e77..6e52b4a3a 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.7.0",
- "release": "207",
+ "release": "210",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "gulpfile.js",
diff --git a/plugins/recaptcha-2/index.php b/plugins/recaptcha-2/index.php
new file mode 100644
index 000000000..b3426cc02
--- /dev/null
+++ b/plugins/recaptcha-2/index.php
@@ -0,0 +1,150 @@
+UseLangs(true);
+
+ $this->addJs('js/recaptcha.js');
+
+ $this->addHook('ajax.action-pre-call', 'AjaxActionPreCall');
+ $this->addHook('filter.ajax-response', 'FilterAjaxResponse');
+
+ $this->addTemplate('templates/PluginLoginReCaptchaGroup.html');
+ $this->addTemplateHook('Login', 'BottomControlGroup', 'PluginLoginReCaptchaGroup');
+ }
+
+ /**
+ * @return array
+ */
+ public function configMapping()
+ {
+ return array(
+ \RainLoop\Plugins\Property::NewInstance('public_key')->SetLabel('Site key')
+ ->SetAllowedInJs(true)
+ ->SetDefaultValue(''),
+ \RainLoop\Plugins\Property::NewInstance('private_key')->SetLabel('Secret key')
+ ->SetDefaultValue(''),
+ \RainLoop\Plugins\Property::NewInstance('theme')->SetLabel('Theme')
+ ->SetAllowedInJs(true)
+ ->SetType(\RainLoop\Enumerations\PluginPropertyType::SELECTION)
+ ->SetDefaultValue(array('light', 'dark')),
+ \RainLoop\Plugins\Property::NewInstance('error_limit')->SetLabel('Limit')
+ ->SetType(\RainLoop\Enumerations\PluginPropertyType::SELECTION)
+ ->SetDefaultValue(array(0, 1, 2, 3, 4, 5))
+ ->SetDescription('')
+ );
+ }
+
+ /**
+ * @return string
+ */
+ private function getCaptchaCacherKey()
+ {
+ return 'Captcha2/Login/'.\RainLoop\Utils::GetConnectionToken();
+ }
+
+ /**
+ * @return int
+ */
+ private function getLimit()
+ {
+ $iConfigLimit = $this->Config()->Get('plugin', 'error_limit', 0);
+ if (0 < $iConfigLimit)
+ {
+ $oCacher = $this->Manager()->Actions()->Cacher();
+ $sLimit = $oCacher && $oCacher->IsInited() ? $oCacher->Get($this->getCaptchaCacherKey()) : '0';
+
+ if (0 < \strlen($sLimit) && \is_numeric($sLimit))
+ {
+ $iConfigLimit -= (int) $sLimit;
+ }
+ }
+
+ return $iConfigLimit;
+ }
+
+ /**
+ * @return void
+ */
+ public function FilterAppDataPluginSection($bAdmin, $bAuth, &$aData)
+ {
+ if (!$bAdmin && !$bAuth && \is_array($aData))
+ {
+ $aData['show_captcha_on_login'] = 1 > $this->getLimit();
+ }
+ }
+
+ /**
+ * @param string $sAction
+ */
+ public function AjaxActionPreCall($sAction)
+ {
+ if ('Login' === $sAction && 0 >= $this->getLimit())
+ {
+ $bResult = false;
+
+ $sResult = $this->Manager()->Actions()->Http()->GetUrlAsString(
+ 'https://www.google.com/recaptcha/api/siteverify?secret='.
+ \urlencode($this->Config()->Get('plugin', 'private_key', '')).'&response='.
+ \urlencode($this->Manager()->Actions()->GetActionParam('RecaptchaResponse', '')));
+
+ if ($sResult)
+ {
+ $aResp = @\json_decode($sResult, true);
+ if (\is_array($aResp) && isset($aResp['success']) && $aResp['success'])
+ {
+ $bResult = true;
+ }
+ }
+
+ if (!$bResult)
+ {
+ $this->Manager()->Actions()->Logger()->Write('RecaptchaResponse:'.$sResult);
+ throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CaptchaError);
+ }
+ }
+ }
+
+ /**
+ * @param string $sAction
+ * @param array $aResponseItem
+ */
+ public function FilterAjaxResponse($sAction, &$aResponseItem)
+ {
+ if ('Login' === $sAction && $aResponseItem && isset($aResponseItem['Result']))
+ {
+ $oCacher = $this->Manager()->Actions()->Cacher();
+ $iConfigLimit = (int) $this->Config()->Get('plugin', 'error_limit', 0);
+ $sKey = $this->getCaptchaCacherKey();
+
+ if (0 < $iConfigLimit && $oCacher && $oCacher->IsInited())
+ {
+ if (false === $aResponseItem['Result'])
+ {
+ $iLimit = 0;
+ $sLimut = $oCacher->Get($sKey);
+ if (0 < \strlen($sLimut) && \is_numeric($sLimut))
+ {
+ $iLimit = (int) $sLimut;
+ }
+
+ $oCacher->Set($sKey, ++$iLimit);
+
+ if ($iConfigLimit <= $iLimit)
+ {
+ $aResponseItem['Captcha'] = true;
+ }
+ }
+ else
+ {
+ $oCacher->Delete($sKey);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/recaptcha-2/js/recaptcha.js b/plugins/recaptcha-2/js/recaptcha.js
new file mode 100644
index 000000000..d824f5a18
--- /dev/null
+++ b/plugins/recaptcha-2/js/recaptcha.js
@@ -0,0 +1,83 @@
+
+$(function () {
+
+ var
+ nId = null,
+ bStarted = false
+ ;
+
+ function ShowRecaptcha()
+ {
+ if (window.grecaptcha)
+ {
+ if (null === nId)
+ {
+ $('#recaptcha-place').show();
+
+ nId = window.grecaptcha.render('recaptcha-div', {
+ 'sitekey': window.rl.pluginSettingsGet('recaptcha-2', 'public_key'),
+ 'theme': window.rl.pluginSettingsGet('recaptcha-2', 'theme')
+ });
+ }
+ }
+ }
+
+ window.__globalShowRecaptcha = ShowRecaptcha;
+
+ function StartRecaptcha()
+ {
+ if (!window.grecaptcha && window.rl)
+ {
+ $.getScript('https://www.google.com/recaptcha/api.js?onload=__globalShowRecaptcha&render=explicit&hl=' + window.rl.settingsGet('Language'));
+ }
+ else
+ {
+ ShowRecaptcha();
+ }
+ }
+
+ if (window.rl)
+ {
+ window.rl.addHook('user-login-submit', function (fSubmitResult) {
+ if (null !== nId && !window.grecaptcha.getResponse(nId))
+ {
+ fSubmitResult(105);
+ }
+ });
+
+ window.rl.addHook('view-model-on-show', function (sName, oViewModel) {
+ if (!bStarted && oViewModel &&
+ ('View:RainLoop:Login' === sName || 'View/App/Login' === sName || 'LoginViewModel' === sName || 'LoginAppView' === sName) &&
+ window.rl.pluginSettingsGet('recaptcha-2', 'show_captcha_on_login'))
+ {
+ bStarted = true;
+ StartRecaptcha();
+ }
+ });
+
+ window.rl.addHook('ajax-default-request', function (sAction, oParameters) {
+ if ('Login' === sAction && oParameters && null !== nId && window.grecaptcha)
+ {
+ oParameters['RecaptchaResponse'] = window.grecaptcha.getResponse(nId);
+ }
+ });
+
+ window.rl.addHook('ajax-default-response', function (sAction, oData, sType) {
+ if ('Login' === sAction)
+ {
+ if (!oData || 'success' !== sType || !oData['Result'])
+ {
+ if (null !== nId && window.grecaptcha)
+ {
+ window.grecaptcha.reset(nId);
+ }
+ else if (oData && oData['Captcha'])
+ {
+ StartRecaptcha();
+ }
+
+ }
+ }
+ });
+ }
+});
\ No newline at end of file
diff --git a/plugins/recaptcha-2/templates/PluginLoginReCaptchaGroup.html b/plugins/recaptcha-2/templates/PluginLoginReCaptchaGroup.html
new file mode 100644
index 000000000..1f4332f6e
--- /dev/null
+++ b/plugins/recaptcha-2/templates/PluginLoginReCaptchaGroup.html
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/plugins/recaptcha/VERSION b/plugins/recaptcha/VERSION
index 468437494..872765e5f 100644
--- a/plugins/recaptcha/VERSION
+++ b/plugins/recaptcha/VERSION
@@ -1 +1 @@
-1.8
\ No newline at end of file
+1.9
\ No newline at end of file
diff --git a/plugins/recaptcha/templates/PluginLoginReCaptchaGroup.html b/plugins/recaptcha/templates/PluginLoginReCaptchaGroup.html
index e6595a774..4a15d78c6 100644
--- a/plugins/recaptcha/templates/PluginLoginReCaptchaGroup.html
+++ b/plugins/recaptcha/templates/PluginLoginReCaptchaGroup.html
@@ -1,14 +1,14 @@
-
-
-
+
\ No newline at end of file
diff --git a/rainloop/v/0.0.0/app/templates/Index.html b/rainloop/v/0.0.0/app/templates/Index.html
index 8effbe0c5..02fc950a0 100644
--- a/rainloop/v/0.0.0/app/templates/Index.html
+++ b/rainloop/v/0.0.0/app/templates/Index.html
@@ -102,7 +102,7 @@
})
.script(function () {
return window.rainloopAppData['PluginsLink'] ?
- {'src': '{{BaseAppMainScriptLink}}', 'type': 'text/javascript', 'charset': 'utf-8'} : null;
+ {'src': window.rainloopAppData['PluginsLink'], 'type': 'text/javascript', 'charset': 'utf-8'} : null;
})
.wait(function () {
__simplePace(5);
diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html
index c1e3cfc5d..cf279de0f 100644
--- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html
+++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html
@@ -5,10 +5,10 @@
×
-