From 786873041f6019535923766d76f15ae1b6df84f2 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Sun, 17 Jul 2016 18:03:38 +0300 Subject: [PATCH] Small fixes --- dev/Model/Message.jsx | 16 +- dev/Settings/Admin/Security.jsx | 19 +- dev/Styles/Activate.less | 28 +- dev/Styles/AdminPlugin.less | 58 +- dev/Styles/AdvancedSearch.less | 32 +- dev/View/User/MailBox/MessageView.js | 2 +- .../Views/Admin/AdminSettingsSecurity.html | 37 +- .../templates/Views/User/MailMessageView.html | 876 +++++++++--------- 8 files changed, 561 insertions(+), 507 deletions(-) diff --git a/dev/Model/Message.jsx b/dev/Model/Message.jsx index 3c9a2961c..66154a333 100644 --- a/dev/Model/Message.jsx +++ b/dev/Model/Message.jsx @@ -247,7 +247,7 @@ class MessageModel extends AbstractModel this.bcc = emailArrayFromJson(json.Bcc); this.replyTo = emailArrayFromJson(json.ReplyTo); this.deliveredTo = emailArrayFromJson(json.DeliveredTo); - this.unsubsribeLinks = json.UnsubsribeLinks; + this.unsubsribeLinks = isNonEmptyArray(json.UnsubsribeLinks) ? json.UnsubsribeLinks : []; this.subject(json.Subject); if (isArray(json.SubjectParts)) @@ -358,6 +358,20 @@ class MessageModel extends AbstractModel return result; } + /** + * @returns {boolean} + */ + hasUnsubsribeLinks() { + return this.unsubsribeLinks && 0 < this.unsubsribeLinks.length; + } + + /** + * @returns {string} + */ + getFirstUnsubsribeLink() { + return this.unsubsribeLinks && 0 < this.unsubsribeLinks.length ? (this.unsubsribeLinks[0] || '') : ''; + } + /** * @param {AjaxJsonMessage} json * @returns {boolean} diff --git a/dev/Settings/Admin/Security.jsx b/dev/Settings/Admin/Security.jsx index bd8df55c6..642f103ba 100644 --- a/dev/Settings/Admin/Security.jsx +++ b/dev/Settings/Admin/Security.jsx @@ -4,7 +4,7 @@ import ko from 'ko'; import {createCommand, trim, boolToAjax} from 'Common/Utils'; import {phpInfo} from 'Common/Links'; -import {StorageResultType} from 'Common/Enums'; +import {StorageResultType, Magics} from 'Common/Enums'; import {settingsGet} from 'Storage/Settings'; @@ -42,6 +42,10 @@ class SecurityAdminSettings } }); + this.isTwoFactorDropperShown = ko.observable(false); + this.twoFactorDropperUser = ko.observable(''); + this.twoFactorDropperUser.focused = ko.observable(false); + this.adminLogin = ko.observable(settingsGet('AdminLogin')); this.adminLoginError = ko.observable(false); this.adminPassword = ko.observable(''); @@ -102,6 +106,15 @@ class SecurityAdminSettings this.onNewAdminPasswordResponse = _.bind(this.onNewAdminPasswordResponse, this); } + showTwoFactorDropper() { + this.twoFactorDropperUser(''); + this.isTwoFactorDropperShown(true); + + _.delay(() => { + this.twoFactorDropperUser.focused(true); + }, Magics.Time50ms); + } + onNewAdminPasswordResponse(result, data) { if (StorageResultType.Success === result && data && data.Result) { @@ -161,6 +174,10 @@ class SecurityAdminSettings this.adminPassword(''); this.adminPasswordNew(''); this.adminPasswordNew2(''); + + this.isTwoFactorDropperShown(false); + this.twoFactorDropperUser(''); + this.twoFactorDropperUser.focused(false); } /** diff --git a/dev/Styles/Activate.less b/dev/Styles/Activate.less index 64252e5bd..b007df5c5 100644 --- a/dev/Styles/Activate.less +++ b/dev/Styles/Activate.less @@ -1,14 +1,14 @@ -.popups { - .b-activate-content { - - width: 700px; - - .modal-header { - background-color: #fff; - } - - .help-inline { - padding-left: 0px; - } - } -} +.popups { + .b-activate-content { + + width: 700px; + + .modal-header { + background-color: #fff; + } + + .help-inline { + padding-left: 0px; + } + } +} diff --git a/dev/Styles/AdminPlugin.less b/dev/Styles/AdminPlugin.less index f4948a41b..fbf31a1ec 100644 --- a/dev/Styles/AdminPlugin.less +++ b/dev/Styles/AdminPlugin.less @@ -1,30 +1,30 @@ -.b-plugin-content { - - &.modal { - width: 660px; - - .modal-body { - overflow: auto; - } - } - - .modal-header { - background-color: #fff; - } - - .information { - display: inline-block; - background-color: #ddd; - border-radius: 10px; - cursor: pointer; - height: 25px; - width: 30px; - text-align: center; - padding-top: 5px; - } - - textarea { - width: 400px; - height: 70px; - } +.b-plugin-content { + + &.modal { + width: 660px; + + .modal-body { + overflow: auto; + } + } + + .modal-header { + background-color: #fff; + } + + .information { + display: inline-block; + background-color: #ddd; + border-radius: 10px; + cursor: pointer; + height: 25px; + width: 30px; + text-align: center; + padding-top: 5px; + } + + textarea { + width: 400px; + height: 70px; + } } \ No newline at end of file diff --git a/dev/Styles/AdvancedSearch.less b/dev/Styles/AdvancedSearch.less index dc9609d5a..6d9cf916b 100644 --- a/dev/Styles/AdvancedSearch.less +++ b/dev/Styles/AdvancedSearch.less @@ -1,16 +1,16 @@ -.popups { - .b-advanced-search-content { - &.modal { - width: 750px; - .control-label { - width: 100px; - } - .controls { - margin-left: 110px; - } - } - .modal-header { - background-color: #fff; - } - } -} +.popups { + .b-advanced-search-content { + &.modal { + width: 750px; + .control-label { + width: 100px; + } + .controls { + margin-left: 110px; + } + } + .modal-header { + background-color: #fff; + } + } +} diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js index 87ee7fa20..6bcd86cba 100644 --- a/dev/View/User/MailBox/MessageView.js +++ b/dev/View/User/MailBox/MessageView.js @@ -375,7 +375,7 @@ function MessageViewMailBoxUserView() this.viewSize(oMessage.friendlySize()); this.viewLineAsCss(oMessage.lineAsCss()); this.viewViewLink(oMessage.viewLink()); - this.viewUnsubscribeLink(oMessage.unsubsribeLinks[0]); + this.viewUnsubscribeLink(oMessage.getFirstUnsubsribeLink()); this.viewDownloadLink(oMessage.downloadLink()); this.viewIsImportant(oMessage.isImportant()); this.viewIsFlagged(oMessage.flagged()); diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html index b9aebcbdf..fb6e1ca46 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html @@ -1,6 +1,6 @@
+
-
-
-
+
+
+
+ +
+
+
-    - ()
- +
diff --git a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html index a1480d41b..e5f1cbae1 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html @@ -1,438 +1,438 @@ -
-
-
- -
-
- - - -
-
 
-
- - - -
-
 
- -
 
- -
-
-
-
-
-
- - -
- -
- -
- -
- -
- -
- -
-
- -
- -
-
- -
- - - -
-
-
- - - - - - - - ! - - -
-
-
- -
-
-
- - - -   - - - - - () - -
-
-
-
-
- - : - - -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- -   - () -
-
-
-
-
-
- -
- -
- - - - - - - - - - -
- -
- ... -
-
- -
-
-
- -    - -
-
- -    - -
-
- - -
- -
- - - - -    - - - - - - -      - - - -    - - - - - - -      - - - -    - - - - - - -
-
- -
-
-
-
-
-
-
-
-
-
+
+
+
+ +
+
+ + + +
+
 
+
+ + + +
+
 
+ +
 
+ +
+
+
+
+
+
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ + + +
+
+
+ + + + + + + + ! + + +
+
+
+ +
+
+
+ + + +   + + + + + () + +
+
+
+
+
+ + : + + +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +   + () +
+
+
+
+
+
+ +
+ +
+ + + + + + + + + + +
+ +
+ ... +
+
+ +
+
+
+ +    + +
+
+ +    + +
+
+ + +
+ +
+ + + + +    + + + + + + +      + + + +    + + + + + + +      + + + +    + + + + + + +
+
+ +
+
+
+
+
+
+
+
+
+