mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
Code refactoring (Translator, Stores, ko)
This commit is contained in:
parent
929bffccef
commit
b42ce01e7e
102 changed files with 6775 additions and 6511 deletions
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
|
@ -71,13 +72,13 @@
|
|||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(oData.ErrorCode));
|
||||
this.submitError(Translator.getNotification(oData.ErrorCode));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
this.submitError(Translator.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.login(), this.password());
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
|
|
@ -76,13 +77,13 @@
|
|||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
self.activateText(Utils.getNotification(oData.ErrorCode));
|
||||
self.activateText(Translator.getNotification(oData.ErrorCode));
|
||||
self.activateText.isError(true);
|
||||
self.key.focus(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.activateText(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
self.activateText(Translator.getNotification(Enums.Notification.UnknownError));
|
||||
self.activateText.isError(true);
|
||||
self.key.focus(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Remote = require('Storage/User/Remote'),
|
||||
|
||||
|
|
@ -69,12 +70,12 @@
|
|||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitError(Utils.getNotification(oData.ErrorCode));
|
||||
this.submitError(Translator.getNotification(oData.ErrorCode));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
this.submitError(Translator.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.email(), this.password(), this.isNew());
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
|
|
@ -46,8 +47,8 @@
|
|||
AskPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.askDesc('');
|
||||
this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES'));
|
||||
this.noButton(Utils.i18n('POPUPS_ASK/BUTTON_NO'));
|
||||
this.yesButton(Translator.i18n('POPUPS_ASK/BUTTON_YES'));
|
||||
this.noButton(Translator.i18n('POPUPS_ASK/BUTTON_NO'));
|
||||
|
||||
this.yesFocus(false);
|
||||
this.noFocus(false);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@
|
|||
Events = require('Common/Events'),
|
||||
Links = require('Common/Links'),
|
||||
HtmlEditor = require('Common/HtmlEditor'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
SocialStore = require('Stores/Social'),
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
|
@ -61,6 +65,7 @@
|
|||
|
||||
this.bSkipNextHide = false;
|
||||
this.composeInEdit = Data.composeInEdit;
|
||||
this.editorDefaultType = UserSettingsStore.editorDefaultType;
|
||||
|
||||
this.capaOpenPGP = Data.capaOpenPGP;
|
||||
|
||||
|
|
@ -419,7 +424,8 @@
|
|||
this.triggerForResize();
|
||||
}, this);
|
||||
|
||||
this.dropboxEnabled = ko.observable(!!Settings.settingsGet('DropboxApiKey'));
|
||||
this.dropboxEnabled = SocialStore.dropbox.enabled;
|
||||
this.dropboxApiKey = SocialStore.dropbox.apiKey;
|
||||
|
||||
this.dropboxCommand = Utils.createCommand(this, function () {
|
||||
|
||||
|
|
@ -659,15 +665,15 @@
|
|||
if (oData && Enums.Notification.CantSaveMessage === oData.ErrorCode)
|
||||
{
|
||||
this.sendSuccessButSaveError(true);
|
||||
window.alert(Utils.trim(Utils.i18n('COMPOSE/SAVED_ERROR_ON_SEND')));
|
||||
window.alert(Utils.trim(Translator.i18n('COMPOSE/SAVED_ERROR_ON_SEND')));
|
||||
}
|
||||
else
|
||||
{
|
||||
sMessage = Utils.getNotification(oData && oData.ErrorCode ? oData.ErrorCode : Enums.Notification.CantSendMessage,
|
||||
sMessage = Translator.getNotification(oData && oData.ErrorCode ? oData.ErrorCode : Enums.Notification.CantSendMessage,
|
||||
oData && oData.ErrorMessage ? oData.ErrorMessage : '');
|
||||
|
||||
this.sendError(true);
|
||||
window.alert(sMessage || Utils.getNotification(Enums.Notification.CantSendMessage));
|
||||
window.alert(sMessage || Translator.getNotification(Enums.Notification.CantSendMessage));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -704,7 +710,7 @@
|
|||
this.savedTime(window.Math.round((new window.Date()).getTime() / 1000));
|
||||
|
||||
this.savedOrSendingText(
|
||||
0 < this.savedTime() ? Utils.i18n('COMPOSE/SAVED_TIME', {
|
||||
0 < this.savedTime() ? Translator.i18n('COMPOSE/SAVED_TIME', {
|
||||
'TIME': moment.unix(this.savedTime() - 1).format('LT')
|
||||
}) : ''
|
||||
);
|
||||
|
|
@ -719,7 +725,7 @@
|
|||
if (!bResult)
|
||||
{
|
||||
this.savedError(true);
|
||||
this.savedOrSendingText(Utils.getNotification(Enums.Notification.CantSaveMessage));
|
||||
this.savedOrSendingText(Translator.getNotification(Enums.Notification.CantSaveMessage));
|
||||
}
|
||||
|
||||
this.reloadDraftFolder();
|
||||
|
|
@ -848,7 +854,7 @@
|
|||
|
||||
if (Enums.ComposeType.Empty !== sType)
|
||||
{
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('COMPOSE/DISCARD_UNSAVED_DATA'), function () {
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Translator.i18n('COMPOSE/DISCARD_UNSAVED_DATA'), function () {
|
||||
self.initOnShow(sType, oMessageOrArray, aToEmails, sCustomSubject, sCustomPlainText);
|
||||
}, null, null, null, false]);
|
||||
}
|
||||
|
|
@ -1052,7 +1058,7 @@
|
|||
case Enums.ComposeType.Reply:
|
||||
case Enums.ComposeType.ReplyAll:
|
||||
sFrom = oMessage.fromToLine(false, true);
|
||||
sReplyTitle = Utils.i18n('COMPOSE/REPLY_MESSAGE_TITLE', {
|
||||
sReplyTitle = Translator.i18n('COMPOSE/REPLY_MESSAGE_TITLE', {
|
||||
'DATETIME': sDate,
|
||||
'EMAIL': sFrom
|
||||
});
|
||||
|
|
@ -1066,12 +1072,12 @@
|
|||
sFrom = oMessage.fromToLine(false, true);
|
||||
sTo = oMessage.toToLine(false, true);
|
||||
sCc = oMessage.ccToLine(false, true);
|
||||
sText = '<br /><br /><br />' + Utils.i18n('COMPOSE/FORWARD_MESSAGE_TOP_TITLE') +
|
||||
'<br />' + Utils.i18n('COMPOSE/FORWARD_MESSAGE_TOP_FROM') + ': ' + sFrom +
|
||||
'<br />' + Utils.i18n('COMPOSE/FORWARD_MESSAGE_TOP_TO') + ': ' + sTo +
|
||||
(0 < sCc.length ? '<br />' + Utils.i18n('COMPOSE/FORWARD_MESSAGE_TOP_CC') + ': ' + sCc : '') +
|
||||
'<br />' + Utils.i18n('COMPOSE/FORWARD_MESSAGE_TOP_SENT') + ': ' + Utils.encodeHtml(sDate) +
|
||||
'<br />' + Utils.i18n('COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT') + ': ' + Utils.encodeHtml(sSubject) +
|
||||
sText = '<br /><br /><br />' + Translator.i18n('COMPOSE/FORWARD_MESSAGE_TOP_TITLE') +
|
||||
'<br />' + Translator.i18n('COMPOSE/FORWARD_MESSAGE_TOP_FROM') + ': ' + sFrom +
|
||||
'<br />' + Translator.i18n('COMPOSE/FORWARD_MESSAGE_TOP_TO') + ': ' + sTo +
|
||||
(0 < sCc.length ? '<br />' + Translator.i18n('COMPOSE/FORWARD_MESSAGE_TOP_CC') + ': ' + sCc : '') +
|
||||
'<br />' + Translator.i18n('COMPOSE/FORWARD_MESSAGE_TOP_SENT') + ': ' + Utils.encodeHtml(sDate) +
|
||||
'<br />' + Translator.i18n('COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT') + ': ' + Utils.encodeHtml(sSubject) +
|
||||
'<br /><br />' + sText;
|
||||
break;
|
||||
case Enums.ComposeType.ForwardAsAttachment:
|
||||
|
|
@ -1087,8 +1093,8 @@
|
|||
|
||||
this.editor(function (oEditor) {
|
||||
oEditor.setHtml(sText, false);
|
||||
if (Enums.EditorDefaultType.PlainForced === Data.editorDefaultType() ||
|
||||
(!oMessage.isHtml() && Enums.EditorDefaultType.HtmlForced !== Data.editorDefaultType()))
|
||||
if (Enums.EditorDefaultType.PlainForced === self.editorDefaultType() ||
|
||||
(!oMessage.isHtml() && Enums.EditorDefaultType.HtmlForced !== self.editorDefaultType()))
|
||||
{
|
||||
oEditor.modeToggle(false);
|
||||
}
|
||||
|
|
@ -1107,8 +1113,8 @@
|
|||
|
||||
this.editor(function (oEditor) {
|
||||
oEditor.setHtml(sText, false);
|
||||
if (Enums.EditorDefaultType.Html !== Data.editorDefaultType() &&
|
||||
Enums.EditorDefaultType.HtmlForced !== Data.editorDefaultType())
|
||||
if (Enums.EditorDefaultType.Html !== self.editorDefaultType() &&
|
||||
Enums.EditorDefaultType.HtmlForced !== self.editorDefaultType())
|
||||
{
|
||||
oEditor.modeToggle(false);
|
||||
}
|
||||
|
|
@ -1197,7 +1203,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Translator.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
|
||||
if (self.modalVisibility())
|
||||
{
|
||||
Utils.delegateRun(self, 'closeCommand');
|
||||
|
|
@ -1251,7 +1257,7 @@
|
|||
oScript = window.document.createElement('script');
|
||||
oScript.type = 'text/javascript';
|
||||
oScript.src = 'https://www.dropbox.com/static/api/1/dropins.js';
|
||||
$(oScript).attr('id', 'dropboxjs').attr('data-app-key', Settings.settingsGet('DropboxApiKey'));
|
||||
$(oScript).attr('id', 'dropboxjs').attr('data-app-key', self.dropboxApiKey());
|
||||
|
||||
window.document.body.appendChild(oScript);
|
||||
}
|
||||
|
|
@ -1538,7 +1544,7 @@
|
|||
{
|
||||
oAttachment
|
||||
.waiting(false).uploading(true).complete(true)
|
||||
.error(Utils.i18n('UPLOAD/ERROR_FILE_IS_TOO_BIG'));
|
||||
.error(Translator.i18n('UPLOAD/ERROR_FILE_IS_TOO_BIG'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1585,11 +1591,11 @@
|
|||
|
||||
if (null !== mErrorCode)
|
||||
{
|
||||
sError = Utils.getUploadErrorDescByCode(mErrorCode);
|
||||
sError = Translator.getUploadErrorDescByCode(mErrorCode);
|
||||
}
|
||||
else if (!oAttachmentJson)
|
||||
{
|
||||
sError = Utils.i18n('UPLOAD/ERROR_UNKNOWN');
|
||||
sError = Translator.i18n('UPLOAD/ERROR_UNKNOWN');
|
||||
}
|
||||
|
||||
if (oAttachment)
|
||||
|
|
@ -1711,7 +1717,7 @@
|
|||
if (0 < mSize && 0 < iAttachmentSizeLimit && iAttachmentSizeLimit < mSize)
|
||||
{
|
||||
oAttachment.uploading(false).complete(true);
|
||||
oAttachment.error(Utils.i18n('UPLOAD/ERROR_FILE_IS_TOO_BIG'));
|
||||
oAttachment.error(Translator.i18n('UPLOAD/ERROR_FILE_IS_TOO_BIG'));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1731,7 +1737,7 @@
|
|||
|
||||
if (!bResult)
|
||||
{
|
||||
oAttachment.error(Utils.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded));
|
||||
oAttachment.error(Translator.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded));
|
||||
}
|
||||
|
||||
}, [oDropboxFile['link']]);
|
||||
|
|
@ -1767,7 +1773,7 @@
|
|||
if (0 < mSize && 0 < iAttachmentSizeLimit && iAttachmentSizeLimit < mSize)
|
||||
{
|
||||
oAttachment.uploading(false).complete(true);
|
||||
oAttachment.error(Utils.i18n('UPLOAD/ERROR_FILE_IS_TOO_BIG'));
|
||||
oAttachment.error(Translator.i18n('UPLOAD/ERROR_FILE_IS_TOO_BIG'));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1788,7 +1794,7 @@
|
|||
|
||||
if (!bResult)
|
||||
{
|
||||
oAttachment.error(Utils.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded));
|
||||
oAttachment.error(Translator.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded));
|
||||
}
|
||||
|
||||
}, oDriveFile['downloadUrl'], sAccessToken);
|
||||
|
|
@ -1877,7 +1883,7 @@
|
|||
.waiting(false)
|
||||
.uploading(false)
|
||||
.complete(true)
|
||||
.error(Utils.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded))
|
||||
.error(Translator.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded))
|
||||
;
|
||||
}
|
||||
}, this);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
Utils = require('Common/Utils'),
|
||||
Enums = require('Common/Enums'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
|
||||
|
|
@ -58,7 +59,7 @@
|
|||
|
||||
if (bResult && this.sign() && '' === this.from())
|
||||
{
|
||||
this.notification(Utils.i18n('PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL'));
|
||||
this.notification(Translator.i18n('PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL'));
|
||||
bResult = false;
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +68,7 @@
|
|||
oPrivateKey = Data.findPrivateKeyByEmail(this.from(), this.password());
|
||||
if (!oPrivateKey)
|
||||
{
|
||||
this.notification(Utils.i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR', {
|
||||
this.notification(Translator.i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR', {
|
||||
'EMAIL': this.from()
|
||||
}));
|
||||
|
||||
|
|
@ -77,7 +78,7 @@
|
|||
|
||||
if (bResult && this.encrypt() && 0 === this.to().length)
|
||||
{
|
||||
this.notification(Utils.i18n('PGP_NOTIFICATIONS/SPECIFY_AT_LEAST_ONE_RECIPIENT'));
|
||||
this.notification(Translator.i18n('PGP_NOTIFICATIONS/SPECIFY_AT_LEAST_ONE_RECIPIENT'));
|
||||
bResult = false;
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +89,7 @@
|
|||
var aKeys = Data.findPublicKeysByEmail(sEmail);
|
||||
if (0 === aKeys.length && bResult)
|
||||
{
|
||||
self.notification(Utils.i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR', {
|
||||
self.notification(Translator.i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR', {
|
||||
'EMAIL': sEmail
|
||||
}));
|
||||
|
||||
|
|
@ -131,7 +132,7 @@
|
|||
}
|
||||
catch (e)
|
||||
{
|
||||
self.notification(Utils.i18n('PGP_NOTIFICATIONS/PGP_ERROR', {
|
||||
self.notification(Translator.i18n('PGP_NOTIFICATIONS/PGP_ERROR', {
|
||||
'ERROR': '' + e
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Selector = require('Common/Selector'),
|
||||
Links = require('Common/Links'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote'),
|
||||
|
|
@ -338,7 +339,7 @@
|
|||
require('App/User').contactsSync(function (sResult, oData) {
|
||||
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
|
||||
{
|
||||
window.alert(Utils.getNotification(
|
||||
window.alert(Translator.getNotification(
|
||||
oData && oData.ErrorCode ? oData.ErrorCode : Enums.Notification.ContactsSyncError));
|
||||
}
|
||||
|
||||
|
|
@ -488,7 +489,7 @@
|
|||
|
||||
if (!sId || !bResult || !oData || !oData.Result)
|
||||
{
|
||||
window.alert(Utils.i18n('CONTACTS/ERROR_IMPORT_FILE'));
|
||||
window.alert(Translator.i18n('CONTACTS/ERROR_IMPORT_FILE'));
|
||||
}
|
||||
|
||||
}, this))
|
||||
|
|
|
|||
|
|
@ -9,9 +9,12 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
|
||||
FilterStore = require('Stores/Filter'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
|
@ -26,10 +29,11 @@
|
|||
|
||||
this.isNew = ko.observable(true);
|
||||
|
||||
this.modules = FilterStore.modules;
|
||||
|
||||
this.fTrueCallback = null;
|
||||
this.filter = ko.observable(null);
|
||||
|
||||
this.modules = Data.filterModules;
|
||||
this.allowMarkAsRead = ko.observable(false);
|
||||
|
||||
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
||||
|
|
@ -71,11 +75,11 @@
|
|||
return true;
|
||||
});
|
||||
|
||||
this.actionTypeOptions = [];
|
||||
this.fieldOptions = [];
|
||||
this.typeOptions = [];
|
||||
this.actionTypeOptions = ko.observableArray([]);
|
||||
this.fieldOptions = ko.observableArray([]);
|
||||
this.typeOptions = ko.observableArray([]);
|
||||
|
||||
this.populateOptions();
|
||||
Translator.initOnStartOrLangChange(this.populateOptions, this);
|
||||
|
||||
this.modules.subscribe(this.populateOptions, this);
|
||||
|
||||
|
|
@ -87,9 +91,10 @@
|
|||
|
||||
FilterPopupView.prototype.populateOptions = function ()
|
||||
{
|
||||
this.actionTypeOptions = [];
|
||||
this.actionTypeOptions([]);
|
||||
|
||||
// this.actionTypeOptions.push({'id': Enums.FiltersAction.None,
|
||||
// 'name': Utils.i18n('POPUPS_FILTER/SELECT_ACTION_NONE')});
|
||||
// 'name': Translator.i18n('POPUPS_FILTER/SELECT_ACTION_NONE')});
|
||||
|
||||
var oModules = this.modules();
|
||||
if (oModules)
|
||||
|
|
@ -102,44 +107,44 @@
|
|||
if (oModules.moveto)
|
||||
{
|
||||
this.actionTypeOptions.push({'id': Enums.FiltersAction.MoveTo,
|
||||
'name': Utils.i18n('POPUPS_FILTER/SELECT_ACTION_MOVE_TO')});
|
||||
'name': Translator.i18n('POPUPS_FILTER/SELECT_ACTION_MOVE_TO')});
|
||||
}
|
||||
|
||||
if (oModules.redirect)
|
||||
{
|
||||
this.actionTypeOptions.push({'id': Enums.FiltersAction.Forward,
|
||||
'name': Utils.i18n('POPUPS_FILTER/SELECT_ACTION_FORWARD_TO')});
|
||||
'name': Translator.i18n('POPUPS_FILTER/SELECT_ACTION_FORWARD_TO')});
|
||||
}
|
||||
|
||||
if (oModules.reject)
|
||||
{
|
||||
this.actionTypeOptions.push({'id': Enums.FiltersAction.Reject,
|
||||
'name': Utils.i18n('POPUPS_FILTER/SELECT_ACTION_REJECT')});
|
||||
'name': Translator.i18n('POPUPS_FILTER/SELECT_ACTION_REJECT')});
|
||||
}
|
||||
|
||||
if (oModules.vacation)
|
||||
{
|
||||
this.actionTypeOptions.push({'id': Enums.FiltersAction.Vacation,
|
||||
'name': Utils.i18n('POPUPS_FILTER/SELECT_ACTION_VACATION_MESSAGE')});
|
||||
'name': Translator.i18n('POPUPS_FILTER/SELECT_ACTION_VACATION_MESSAGE')});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
this.actionTypeOptions.push({'id': Enums.FiltersAction.Discard,
|
||||
'name': Utils.i18n('POPUPS_FILTER/SELECT_ACTION_DISCARD')});
|
||||
'name': Translator.i18n('POPUPS_FILTER/SELECT_ACTION_DISCARD')});
|
||||
|
||||
this.fieldOptions = [
|
||||
{'id': Enums.FilterConditionField.From, 'name': Utils.i18n('POPUPS_FILTER/SELECT_FIELD_FROM')},
|
||||
{'id': Enums.FilterConditionField.Recipient, 'name': Utils.i18n('POPUPS_FILTER/SELECT_FIELD_RECIPIENTS')},
|
||||
{'id': Enums.FilterConditionField.Subject, 'name': Utils.i18n('POPUPS_FILTER/SELECT_FIELD_SUBJECT')}
|
||||
];
|
||||
this.fieldOptions([
|
||||
{'id': Enums.FilterConditionField.From, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_FROM')},
|
||||
{'id': Enums.FilterConditionField.Recipient, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_RECIPIENTS')},
|
||||
{'id': Enums.FilterConditionField.Subject, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_SUBJECT')}
|
||||
]);
|
||||
|
||||
this.typeOptions = [
|
||||
{'id': Enums.FilterConditionType.Contains, 'name': Utils.i18n('POPUPS_FILTER/SELECT_TYPE_CONTAINS')},
|
||||
{'id': Enums.FilterConditionType.NotContains, 'name': Utils.i18n('POPUPS_FILTER/SELECT_TYPE_NOT_CONTAINS')},
|
||||
{'id': Enums.FilterConditionType.EqualTo, 'name': Utils.i18n('POPUPS_FILTER/SELECT_TYPE_EQUAL_TO')},
|
||||
{'id': Enums.FilterConditionType.NotEqualTo, 'name': Utils.i18n('POPUPS_FILTER/SELECT_TYPE_NOT_EQUAL_TO')}
|
||||
];
|
||||
this.typeOptions([
|
||||
{'id': Enums.FilterConditionType.Contains, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_CONTAINS')},
|
||||
{'id': Enums.FilterConditionType.NotContains, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_NOT_CONTAINS')},
|
||||
{'id': Enums.FilterConditionType.EqualTo, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_EQUAL_TO')},
|
||||
{'id': Enums.FilterConditionType.NotEqualTo, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_NOT_EQUAL_TO')}
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
|
|
@ -41,7 +42,7 @@
|
|||
}, this);
|
||||
|
||||
this.dangerDescHtml = ko.computed(function () {
|
||||
return Utils.i18n('POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1', {
|
||||
return Translator.i18n('POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1', {
|
||||
'FOLDER': this.folderNameForClear()
|
||||
});
|
||||
}, this);
|
||||
|
|
@ -77,11 +78,11 @@
|
|||
{
|
||||
if (oData && oData.ErrorCode)
|
||||
{
|
||||
self.clearingError(Utils.getNotification(oData.ErrorCode));
|
||||
self.clearingError(Translator.getNotification(oData.ErrorCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
self.clearingError(Utils.getNotification(Enums.Notification.MailServerError));
|
||||
self.clearingError(Translator.getNotification(Enums.Notification.MailServerError));
|
||||
}
|
||||
}
|
||||
}, oFolderToClear.fullNameRaw);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Consts = require('Common/Consts'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote'),
|
||||
|
|
@ -26,8 +27,8 @@
|
|||
{
|
||||
AbstractView.call(this, 'Popups', 'PopupsFolderCreate');
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
this.sNoParentText = Utils.i18n('POPUPS_CREATE_FOLDER/SELECT_NO_PARENT');
|
||||
Translator.initOnStartOrLangChange(function () {
|
||||
this.sNoParentText = Translator.i18n('POPUPS_CREATE_FOLDER/SELECT_NO_PARENT');
|
||||
}, this);
|
||||
|
||||
this.folderName = ko.observable('');
|
||||
|
|
@ -84,7 +85,7 @@
|
|||
else
|
||||
{
|
||||
Data.folderList.error(
|
||||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_CREATE_FOLDER'));
|
||||
oData && oData.ErrorCode ? Translator.getNotification(oData.ErrorCode) : Translator.i18n('NOTIFICATIONS/CANT_CREATE_FOLDER'));
|
||||
}
|
||||
|
||||
}, this.folderName(), sParentFolderName);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Consts = require('Common/Consts'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
|
@ -27,9 +28,9 @@
|
|||
{
|
||||
AbstractView.call(this, 'Popups', 'PopupsFolderSystem');
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
this.sChooseOnText = Utils.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE');
|
||||
this.sUnuseText = Utils.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME');
|
||||
Translator.initOnStartOrLangChange(function () {
|
||||
this.sChooseOnText = Translator.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE');
|
||||
this.sUnuseText = Translator.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME');
|
||||
}, this);
|
||||
|
||||
this.notification = ko.observable('');
|
||||
|
|
@ -112,19 +113,19 @@
|
|||
switch (iNotificationType)
|
||||
{
|
||||
case Enums.SetSystemFoldersNotification.Sent:
|
||||
sNotification = Utils.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT');
|
||||
sNotification = Translator.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT');
|
||||
break;
|
||||
case Enums.SetSystemFoldersNotification.Draft:
|
||||
sNotification = Utils.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS');
|
||||
sNotification = Translator.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS');
|
||||
break;
|
||||
case Enums.SetSystemFoldersNotification.Spam:
|
||||
sNotification = Utils.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM');
|
||||
sNotification = Translator.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM');
|
||||
break;
|
||||
case Enums.SetSystemFoldersNotification.Trash:
|
||||
sNotification = Utils.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH');
|
||||
sNotification = Translator.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH');
|
||||
break;
|
||||
case Enums.SetSystemFoldersNotification.Archive:
|
||||
sNotification = Utils.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE');
|
||||
sNotification = Translator.i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE');
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Remote = require('Storage/User/Remote'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
|
@ -88,12 +89,12 @@
|
|||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitError(Utils.getNotification(oData.ErrorCode));
|
||||
this.submitError(Translator.getNotification(oData.ErrorCode));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
this.submitError(Translator.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.id, this.email(), this.name(), this.replyTo(), this.bcc());
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
Globals = require('Common/Globals'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
|
|
@ -22,12 +21,12 @@
|
|||
{
|
||||
AbstractView.call(this, 'Popups', 'PopupsLanguages');
|
||||
|
||||
this.Data = Globals.__APP__.data(); // TODO
|
||||
this.UserSettingsStore = require('Stores/UserSettings');
|
||||
|
||||
this.exp = ko.observable(false);
|
||||
|
||||
this.languages = ko.computed(function () {
|
||||
return _.map(this.Data.languages(), function (sLanguage) {
|
||||
return _.map(this.UserSettingsStore.languages(), function (sLanguage) {
|
||||
return {
|
||||
'key': sLanguage,
|
||||
'selected': ko.observable(false),
|
||||
|
|
@ -36,7 +35,7 @@
|
|||
});
|
||||
}, this);
|
||||
|
||||
this.Data.mainLanguage.subscribe(function () {
|
||||
this.UserSettingsStore.language.subscribe(function () {
|
||||
this.resetMainLanguage();
|
||||
}, this);
|
||||
|
||||
|
|
@ -54,7 +53,7 @@
|
|||
|
||||
LanguagesPopupView.prototype.resetMainLanguage = function ()
|
||||
{
|
||||
var sCurrent = this.Data.mainLanguage();
|
||||
var sCurrent = this.UserSettingsStore.language();
|
||||
_.each(this.languages(), function (oItem) {
|
||||
oItem['selected'](oItem['key'] === sCurrent);
|
||||
});
|
||||
|
|
@ -74,7 +73,7 @@
|
|||
|
||||
LanguagesPopupView.prototype.changeLanguage = function (sLang)
|
||||
{
|
||||
this.Data.mainLanguage(sLang);
|
||||
this.UserSettingsStore.language(sLang);
|
||||
this.cancelCommand();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
|
|
@ -99,11 +100,11 @@
|
|||
this.saveError('');
|
||||
if (oData && oData.ErrorCode)
|
||||
{
|
||||
this.saveError(Utils.getNotification(oData.ErrorCode));
|
||||
this.saveError(Translator.getNotification(oData.ErrorCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.saveError(Utils.getNotification(Enums.Notification.CantSavePluginSettings));
|
||||
this.saveError(Translator.getNotification(Enums.Notification.CantSavePluginSettings));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -146,7 +147,7 @@
|
|||
|
||||
if (!kn.isPopupVisible(PopupsAskViewModel))
|
||||
{
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Translator.i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), function () {
|
||||
if (self.modalVisibility())
|
||||
{
|
||||
Utils.delegateRun(self, 'cancelCommand');
|
||||
|
|
|
|||
|
|
@ -13,8 +13,12 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Plugins = require('Common/Plugins'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote'),
|
||||
|
|
@ -87,11 +91,12 @@
|
|||
this.allowLanguagesOnLogin = Data.allowLanguagesOnLogin;
|
||||
|
||||
this.langRequest = ko.observable(false);
|
||||
this.mainLanguage = Data.mainLanguage;
|
||||
this.language = UserSettingsStore.language;
|
||||
|
||||
this.bSendLanguage = false;
|
||||
|
||||
this.mainLanguageFullName = ko.computed(function () {
|
||||
return Utils.convertLangName(this.mainLanguage());
|
||||
this.languageFullName = ko.computed(function () {
|
||||
return Utils.convertLangName(this.language());
|
||||
}, this);
|
||||
|
||||
this.signMeType = ko.observable(Enums.LoginSignMeType.Unused);
|
||||
|
|
@ -133,7 +138,7 @@
|
|||
Plugins.runHook('user-login-submit', [fSubmitResult]);
|
||||
if (0 < iPluginResultCode)
|
||||
{
|
||||
this.submitError(Utils.getNotification(iPluginResultCode));
|
||||
this.submitError(Translator.getNotification(iPluginResultCode));
|
||||
return false;
|
||||
}
|
||||
else if ('' !== sPluginResultMessage)
|
||||
|
|
@ -180,11 +185,11 @@
|
|||
oData.ErrorCode = Enums.Notification.AuthError;
|
||||
}
|
||||
|
||||
this.submitError(Utils.getNotification(oData.ErrorCode));
|
||||
this.submitError(Translator.getNotification(oData.ErrorCode));
|
||||
|
||||
if ('' === this.submitError())
|
||||
{
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
this.submitError(Translator.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -202,11 +207,11 @@
|
|||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
this.submitError(Translator.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.email(), '', sPassword, !!this.signMe(),
|
||||
this.bSendLanguage ? this.mainLanguage() : '',
|
||||
this.bSendLanguage ? this.language() : '',
|
||||
this.additionalCode.visibility() ? this.additionalCode() : '',
|
||||
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
|
||||
);
|
||||
|
|
@ -302,7 +307,7 @@
|
|||
|
||||
if (Settings.settingsGet('UserLanguage'))
|
||||
{
|
||||
$.cookie('rllang', Data.language(), {'expires': 30});
|
||||
$.cookie('rllang', UserSettingsStore.language(), {'expires': 30});
|
||||
}
|
||||
|
||||
}, this), 100);
|
||||
|
|
@ -328,7 +333,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
self.submitError(Utils.getNotification(iErrorCode));
|
||||
self.submitError(Translator.getNotification(iErrorCode));
|
||||
}
|
||||
}
|
||||
;
|
||||
|
|
@ -371,11 +376,11 @@
|
|||
}
|
||||
|
||||
_.delay(function () {
|
||||
Data.language.subscribe(function (sValue) {
|
||||
UserSettingsStore.language.subscribe(function (sValue) {
|
||||
|
||||
self.langRequest(true);
|
||||
|
||||
Utils.reloadLanguage(sValue, function() {
|
||||
Translator.reload(sValue, function() {
|
||||
self.langRequest(false);
|
||||
self.bSendLanguage = true;
|
||||
$.cookie('rllang', sValue, {'expires': 30});
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
Globals = require('Common/Globals'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
|
@ -88,7 +90,7 @@
|
|||
|
||||
if (oFolder)
|
||||
{
|
||||
if (Enums.Layout.NoPreview === Data.layout())
|
||||
if (Enums.Layout.NoPreview === UserSettingsStore.layout())
|
||||
{
|
||||
Data.message(null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@
|
|||
Links = require('Common/Links'),
|
||||
Events = require('Common/Events'),
|
||||
Selector = require('Common/Selector'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
QuotaStore = require('Stores/Quota'),
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
|
|
@ -63,13 +67,13 @@
|
|||
this.messageListCheckedOrSelectedUidsWithSubMails = Data.messageListCheckedOrSelectedUidsWithSubMails;
|
||||
this.messageListCompleteLoadingThrottle = Data.messageListCompleteLoadingThrottle;
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
this.emptySubjectValue = Utils.i18n('MESSAGE_LIST/EMPTY_SUBJECT_TEXT');
|
||||
Translator.initOnStartOrLangChange(function () {
|
||||
this.emptySubjectValue = Translator.i18n('MESSAGE_LIST/EMPTY_SUBJECT_TEXT');
|
||||
}, this);
|
||||
|
||||
this.userQuota = Data.userQuota;
|
||||
this.userUsageSize = Data.userUsageSize;
|
||||
this.userUsageProc = Data.userUsageProc;
|
||||
this.userQuota = QuotaStore.quota;
|
||||
this.userUsageSize = QuotaStore.usage;
|
||||
this.userUsageProc = QuotaStore.percentage;
|
||||
|
||||
this.moveDropdownTrigger = ko.observable(false);
|
||||
this.moreDropdownTrigger = ko.observable(false);
|
||||
|
|
@ -81,13 +85,13 @@
|
|||
this.dragOverBodyArea = ko.observable(null);
|
||||
|
||||
this.messageListItemTemplate = ko.computed(function () {
|
||||
return Enums.Layout.SidePreview === Data.layout() ?
|
||||
return Enums.Layout.SidePreview === UserSettingsStore.layout() ?
|
||||
'MailMessageListItem' : 'MailMessageListItemNoPreviewPane';
|
||||
});
|
||||
|
||||
this.messageListSearchDesc = ko.computed(function () {
|
||||
var sValue = Data.messageListEndSearch();
|
||||
return '' === sValue ? '' : Utils.i18n('MESSAGE_LIST/SEARCH_RESULT_FOR', {'SEARCH': sValue});
|
||||
return '' === sValue ? '' : Translator.i18n('MESSAGE_LIST/SEARCH_RESULT_FOR', {'SEARCH': sValue});
|
||||
});
|
||||
|
||||
this.messageListPagenator = ko.computed(Utils.computedPagenatorHelper(Data.messageListPage, Data.messageListPageCount));
|
||||
|
|
@ -227,7 +231,7 @@
|
|||
Data.message(Data.staticMessageList.populateByMessageListItem(oMessage));
|
||||
this.populateMessageBody(Data.message());
|
||||
|
||||
if (Enums.Layout.NoPreview === Data.layout())
|
||||
if (Enums.Layout.NoPreview === UserSettingsStore.layout())
|
||||
{
|
||||
kn.setHash(Links.messagePreview(), true);
|
||||
Data.message.focused(true);
|
||||
|
|
@ -247,11 +251,11 @@
|
|||
this.selector.scrollToTop();
|
||||
}, this);
|
||||
|
||||
Data.layout.subscribe(function (mValue) {
|
||||
UserSettingsStore.layout.subscribe(function (mValue) {
|
||||
this.selector.autoSelect(Enums.Layout.NoPreview !== mValue);
|
||||
}, this);
|
||||
|
||||
Data.layout.valueHasMutated();
|
||||
UserSettingsStore.layout.valueHasMutated();
|
||||
|
||||
Events
|
||||
.sub('mailbox.message-list.selector.go-down', function () {
|
||||
|
|
@ -360,8 +364,8 @@
|
|||
{
|
||||
Data.message(null);
|
||||
Data.messageError((oData && oData.ErrorCode ?
|
||||
Utils.getNotification(oData.ErrorCode) :
|
||||
Utils.getNotification(Enums.Notification.UnknownError)));
|
||||
Translator.getNotification(oData.ErrorCode) :
|
||||
Translator.getNotification(Enums.Notification.UnknownError)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -869,7 +873,7 @@
|
|||
|
||||
MessageListMailBoxUserView.prototype.quotaTooltip = function ()
|
||||
{
|
||||
return Utils.i18n('MESSAGE_LIST/QUOTA_SIZE', {
|
||||
return Translator.i18n('MESSAGE_LIST/QUOTA_SIZE', {
|
||||
'SIZE': Utils.friendlySize(this.userUsageSize()),
|
||||
'PROC': this.userUsageProc(),
|
||||
'LIMIT': Utils.friendlySize(this.userQuota())
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@
|
|||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
Events = require('Common/Events'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
|
||||
Local = require('Storage/Local'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
|
|
@ -61,8 +64,8 @@
|
|||
this.messagesBodiesDom = Data.messagesBodiesDom;
|
||||
this.useThreads = Data.useThreads;
|
||||
this.replySameFolder = Data.replySameFolder;
|
||||
this.layout = Data.layout;
|
||||
this.usePreviewPane = Data.usePreviewPane;
|
||||
this.layout = UserSettingsStore.layout;
|
||||
this.usePreviewPane = UserSettingsStore.usePreviewPane;
|
||||
this.isMessageSelected = Data.isMessageSelected;
|
||||
this.messageActiveDom = Data.messageActiveDom;
|
||||
this.messageError = Data.messageError;
|
||||
|
|
@ -329,19 +332,19 @@
|
|||
switch (this.viewPgpSignedVerifyStatus())
|
||||
{
|
||||
case Enums.SignedVerifyStatus.UnknownPublicKeys:
|
||||
sResult = Utils.i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND');
|
||||
sResult = Translator.i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND');
|
||||
break;
|
||||
case Enums.SignedVerifyStatus.UnknownPrivateKey:
|
||||
sResult = Utils.i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND');
|
||||
sResult = Translator.i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND');
|
||||
break;
|
||||
case Enums.SignedVerifyStatus.Unverified:
|
||||
sResult = Utils.i18n('PGP_NOTIFICATIONS/UNVERIFIRED_SIGNATURE');
|
||||
sResult = Translator.i18n('PGP_NOTIFICATIONS/UNVERIFIRED_SIGNATURE');
|
||||
break;
|
||||
case Enums.SignedVerifyStatus.Error:
|
||||
sResult = Utils.i18n('PGP_NOTIFICATIONS/DECRYPTION_ERROR');
|
||||
sResult = Translator.i18n('PGP_NOTIFICATIONS/DECRYPTION_ERROR');
|
||||
break;
|
||||
case Enums.SignedVerifyStatus.Success:
|
||||
sResult = Utils.i18n('PGP_NOTIFICATIONS/GOOD_SIGNATURE', {
|
||||
sResult = Translator.i18n('PGP_NOTIFICATIONS/GOOD_SIGNATURE', {
|
||||
'USER': this.viewPgpSignedVerifyUser()
|
||||
});
|
||||
break;
|
||||
|
|
@ -382,7 +385,7 @@
|
|||
{
|
||||
var
|
||||
self = this,
|
||||
sErrorMessage = Utils.i18n('PREVIEW_POPUP/IMAGE_ERROR'),
|
||||
sErrorMessage = Translator.i18n('PREVIEW_POPUP/IMAGE_ERROR'),
|
||||
fCheckHeaderHeight = function () {
|
||||
if (self.oHeaderDom)
|
||||
{
|
||||
|
|
@ -561,7 +564,7 @@
|
|||
{
|
||||
this.fullScreenMode(false);
|
||||
}
|
||||
else if (Enums.Layout.NoPreview === Data.layout())
|
||||
else if (Enums.Layout.NoPreview === this.layout())
|
||||
{
|
||||
this.message(null);
|
||||
}
|
||||
|
|
@ -590,7 +593,7 @@
|
|||
});
|
||||
|
||||
key('enter', Enums.KeyState.MessageList, function () {
|
||||
if (Enums.Layout.NoPreview !== Data.layout() && self.message())
|
||||
if (Enums.Layout.NoPreview !== self.layout() && self.message())
|
||||
{
|
||||
self.toggleFullScreen();
|
||||
return false;
|
||||
|
|
@ -681,7 +684,7 @@
|
|||
|
||||
// change focused state
|
||||
key('tab, shift+tab, left', Enums.KeyState.MessageView, function (event, handler) {
|
||||
if (!self.fullScreenMode() && self.message() && Enums.Layout.NoPreview !== Data.layout())
|
||||
if (!self.fullScreenMode() && self.message() && Enums.Layout.NoPreview !== self.layout())
|
||||
{
|
||||
if (event && handler && 'left' === handler.shortcut)
|
||||
{
|
||||
|
|
@ -697,7 +700,7 @@
|
|||
self.message.focused(false);
|
||||
}
|
||||
}
|
||||
else if (self.message() && Enums.Layout.NoPreview === Data.layout() && event && handler && 'left' === handler.shortcut)
|
||||
else if (self.message() && Enums.Layout.NoPreview === self.layout() && event && handler && 'left' === handler.shortcut)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -856,8 +859,8 @@
|
|||
{
|
||||
Remote.sendReadReceiptMessage(Utils.emptyFunction, oMessage.folderFullNameRaw, oMessage.uid,
|
||||
oMessage.readReceipt(),
|
||||
Utils.i18n('READ_RECEIPT/SUBJECT', {'SUBJECT': oMessage.subject()}),
|
||||
Utils.i18n('READ_RECEIPT/BODY', {'READ-RECEIPT': Data.accountEmail()}));
|
||||
Translator.i18n('READ_RECEIPT/SUBJECT', {'SUBJECT': oMessage.subject()}),
|
||||
Translator.i18n('READ_RECEIPT/BODY', {'READ-RECEIPT': Data.accountEmail()}));
|
||||
|
||||
oMessage.isReadReceipt(true);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue