Small fixes

This commit is contained in:
RainLoop Team 2016-07-17 18:03:38 +03:00
parent 278e98561d
commit 786873041f
8 changed files with 561 additions and 507 deletions

View file

@ -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}

View file

@ -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);
}
/**

View file

@ -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;
}
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}
}

View file

@ -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());