mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Improved js minification
This commit is contained in:
parent
8884adcb72
commit
b31bf3d7f5
16 changed files with 99 additions and 150 deletions
|
|
@ -25,16 +25,17 @@ class AdvancedSearchPopupView extends AbstractViewPopup {
|
|||
unseen: false
|
||||
});
|
||||
|
||||
let prefix = 'SEARCH/LABEL_ADV_DATE_';
|
||||
this.selectedDates = ko.computed(() => {
|
||||
translatorTrigger();
|
||||
return [
|
||||
{ id: -1, name: i18n('SEARCH/LABEL_ADV_DATE_ALL') },
|
||||
{ id: 3, name: i18n('SEARCH/LABEL_ADV_DATE_3_DAYS') },
|
||||
{ id: 7, name: i18n('SEARCH/LABEL_ADV_DATE_7_DAYS') },
|
||||
{ id: 30, name: i18n('SEARCH/LABEL_ADV_DATE_MONTH') },
|
||||
{ id: 90, name: i18n('SEARCH/LABEL_ADV_DATE_3_MONTHS') },
|
||||
{ id: 180, name: i18n('SEARCH/LABEL_ADV_DATE_6_MONTHS') },
|
||||
{ id: 365, name: i18n('SEARCH/LABEL_ADV_DATE_YEAR') }
|
||||
{ id: -1, name: i18n(prefix + 'ALL') },
|
||||
{ id: 3, name: i18n(prefix + '3_DAYS') },
|
||||
{ id: 7, name: i18n(prefix + '7_DAYS') },
|
||||
{ id: 30, name: i18n(prefix + 'MONTH') },
|
||||
{ id: 90, name: i18n(prefix + '3_MONTHS') },
|
||||
{ id: 180, name: i18n(prefix + '6_MONTHS') },
|
||||
{ id: 365, name: i18n(prefix + 'YEAR') }
|
||||
];
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,14 +12,15 @@ import { EmailModel } from 'Model/Email';
|
|||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
const KEY_NAME_SUBSTR = -8;
|
||||
const KEY_NAME_SUBSTR = -8,
|
||||
i18nPGP = (key, params) => i18n('PGP_NOTIFICATIONS/' + key, params);
|
||||
|
||||
class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super('ComposeOpenPgp');
|
||||
|
||||
this.publicKeysOptionsCaption = i18n('PGP_NOTIFICATIONS/ADD_A_PUBLICK_KEY');
|
||||
this.privateKeysOptionsCaption = i18n('PGP_NOTIFICATIONS/SELECT_A_PRIVATE_KEY');
|
||||
this.publicKeysOptionsCaption = i18nPGP('ADD_A_PUBLICK_KEY');
|
||||
this.privateKeysOptionsCaption = i18nPGP('SELECT_A_PRIVATE_KEY');
|
||||
|
||||
this.addObservables({
|
||||
notification: '',
|
||||
|
|
@ -114,11 +115,11 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
|
||||
if (result && this.sign()) {
|
||||
if (!this.signKey()) {
|
||||
this.notification(i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND'));
|
||||
this.notification(i18nPGP('NO_PRIVATE_KEY_FOUND'));
|
||||
result = false;
|
||||
} else if (!this.signKey().key) {
|
||||
this.notification(
|
||||
i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR', {
|
||||
i18nPGP('NO_PRIVATE_KEY_FOUND_FOR', {
|
||||
'EMAIL': this.signKey().email
|
||||
})
|
||||
);
|
||||
|
|
@ -139,7 +140,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
if (!privateKey) {
|
||||
this.notification(i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND'));
|
||||
this.notification(i18nPGP('NO_PRIVATE_KEY_FOUND'));
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -154,7 +155,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
aPublicKeys = aPublicKeys.concat(oKey.key.getNativeKeys().flat(Infinity).filter(v => v));
|
||||
} else if (oKey && oKey.email) {
|
||||
this.notification(
|
||||
i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR', {
|
||||
i18nPGP('NO_PUBLIC_KEYS_FOUND_FOR', {
|
||||
'EMAIL': oKey.email
|
||||
})
|
||||
);
|
||||
|
|
@ -167,7 +168,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
result = false;
|
||||
}
|
||||
} else {
|
||||
this.notification(i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND'));
|
||||
this.notification(i18nPGP('NO_PUBLIC_KEYS_FOUND'));
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -200,7 +201,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
console.log(e);
|
||||
|
||||
this.notification(
|
||||
i18n('PGP_NOTIFICATIONS/PGP_ERROR', {
|
||||
i18nPGP('PGP_ERROR', {
|
||||
'ERROR': '' + e
|
||||
})
|
||||
);
|
||||
|
|
@ -215,16 +216,14 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
})
|
||||
.catch((e) => {
|
||||
this.notification(
|
||||
i18n('PGP_NOTIFICATIONS/PGP_ERROR', {
|
||||
i18nPGP('PGP_ERROR', {
|
||||
'ERROR': '' + e
|
||||
})
|
||||
);
|
||||
});
|
||||
} catch (e) {
|
||||
this.notification(
|
||||
i18n('PGP_NOTIFICATIONS/PGP_ERROR', {
|
||||
'ERROR': '' + e
|
||||
})
|
||||
i18nPGP('PGP_ERROR', {'ERROR': '' + e})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,19 +60,21 @@ class FilterPopupView extends AbstractViewPopup {
|
|||
populateOptions() {
|
||||
this.actionTypeOptions([]);
|
||||
|
||||
let i18nFilter = key => i18n('POPUPS_FILTER/SELECT_' + key);
|
||||
|
||||
this.fieldOptions([
|
||||
{ 'id': FilterConditionField.From, 'name': i18n('GLOBAL/FROM') },
|
||||
{ 'id': FilterConditionField.Recipient, 'name': i18n('POPUPS_FILTER/SELECT_FIELD_RECIPIENTS') },
|
||||
{ 'id': FilterConditionField.Recipient, 'name': i18nFilter('FIELD_RECIPIENTS') },
|
||||
{ 'id': FilterConditionField.Subject, 'name': i18n('GLOBAL/SUBJECT') },
|
||||
{ 'id': FilterConditionField.Size, 'name': i18n('POPUPS_FILTER/SELECT_FIELD_SIZE') },
|
||||
{ 'id': FilterConditionField.Header, 'name': i18n('POPUPS_FILTER/SELECT_FIELD_HEADER') }
|
||||
{ 'id': FilterConditionField.Size, 'name': i18nFilter('FIELD_SIZE') },
|
||||
{ 'id': FilterConditionField.Header, 'name': i18nFilter('FIELD_HEADER') }
|
||||
]);
|
||||
|
||||
this.typeOptions([
|
||||
{ 'id': FilterConditionType.Contains, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_CONTAINS') },
|
||||
{ 'id': FilterConditionType.NotContains, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_NOT_CONTAINS') },
|
||||
{ 'id': FilterConditionType.EqualTo, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_EQUAL_TO') },
|
||||
{ 'id': FilterConditionType.NotEqualTo, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_NOT_EQUAL_TO') }
|
||||
{ 'id': FilterConditionType.Contains, 'name': i18nFilter('TYPE_CONTAINS') },
|
||||
{ 'id': FilterConditionType.NotContains, 'name': i18nFilter('TYPE_NOT_CONTAINS') },
|
||||
{ 'id': FilterConditionType.EqualTo, 'name': i18nFilter('TYPE_EQUAL_TO') },
|
||||
{ 'id': FilterConditionType.NotEqualTo, 'name': i18nFilter('TYPE_NOT_EQUAL_TO') }
|
||||
]);
|
||||
|
||||
// this.actionTypeOptions.push({'id': FilterAction.None,
|
||||
|
|
@ -86,27 +88,27 @@ class FilterPopupView extends AbstractViewPopup {
|
|||
if (modules.includes('fileinto')) {
|
||||
this.actionTypeOptions.push({
|
||||
'id': FilterAction.MoveTo,
|
||||
'name': i18n('POPUPS_FILTER/SELECT_ACTION_MOVE_TO')
|
||||
'name': i18nFilter('ACTION_MOVE_TO')
|
||||
});
|
||||
this.actionTypeOptions.push({
|
||||
'id': FilterAction.Forward,
|
||||
'name': i18n('POPUPS_FILTER/SELECT_ACTION_FORWARD_TO')
|
||||
'name': i18nFilter('ACTION_FORWARD_TO')
|
||||
});
|
||||
}
|
||||
|
||||
if (modules.includes('reject')) {
|
||||
this.actionTypeOptions.push({ 'id': FilterAction.Reject, 'name': i18n('POPUPS_FILTER/SELECT_ACTION_REJECT') });
|
||||
this.actionTypeOptions.push({ 'id': FilterAction.Reject, 'name': i18nFilter('ACTION_REJECT') });
|
||||
}
|
||||
|
||||
if (modules.includes('vacation')) {
|
||||
this.actionTypeOptions.push({
|
||||
'id': FilterAction.Vacation,
|
||||
'name': i18n('POPUPS_FILTER/SELECT_ACTION_VACATION_MESSAGE')
|
||||
'name': i18nFilter('ACTION_VACATION_MESSAGE')
|
||||
});
|
||||
}
|
||||
|
||||
if (modules.includes('body')) {
|
||||
this.fieldOptions.push({ 'id': FilterConditionField.Body, 'name': i18n('POPUPS_FILTER/SELECT_FIELD_BODY') });
|
||||
this.fieldOptions.push({ 'id': FilterConditionField.Body, 'name': i18nFilter('FIELD_BODY') });
|
||||
}
|
||||
|
||||
if (modules.includes('regex')) {
|
||||
|
|
@ -114,16 +116,16 @@ class FilterPopupView extends AbstractViewPopup {
|
|||
}
|
||||
}
|
||||
|
||||
this.actionTypeOptions.push({ 'id': FilterAction.Discard, 'name': i18n('POPUPS_FILTER/SELECT_ACTION_DISCARD') });
|
||||
this.actionTypeOptions.push({ 'id': FilterAction.Discard, 'name': i18nFilter('ACTION_DISCARD') });
|
||||
|
||||
this.typeOptionsSize([
|
||||
{ 'id': FilterConditionType.Over, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_OVER') },
|
||||
{ 'id': FilterConditionType.Under, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_UNDER') }
|
||||
{ 'id': FilterConditionType.Over, 'name': i18nFilter('TYPE_OVER') },
|
||||
{ 'id': FilterConditionType.Under, 'name': i18nFilter('TYPE_UNDER') }
|
||||
]);
|
||||
|
||||
this.typeOptionsBody([
|
||||
{ 'id': FilterConditionType.Text, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_TEXT') },
|
||||
{ 'id': FilterConditionType.Raw, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_RAW') }
|
||||
{ 'id': FilterConditionType.Text, 'name': i18nFilter('TYPE_TEXT') },
|
||||
{ 'id': FilterConditionType.Raw, 'name': i18nFilter('TYPE_RAW') }
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,22 +89,22 @@ class FolderSystemPopupView extends AbstractViewPopup {
|
|||
* @param {number=} notificationType = SetSystemFoldersNotification.None
|
||||
*/
|
||||
onShow(notificationType = SetSystemFoldersNotification.None) {
|
||||
let notification = '';
|
||||
let notification = '', prefix = 'POPUPS_SYSTEM_FOLDERS/NOTIFICATION_';
|
||||
switch (notificationType) {
|
||||
case SetSystemFoldersNotification.Sent:
|
||||
notification = i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT');
|
||||
notification = i18n(prefix + 'SENT');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Draft:
|
||||
notification = i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS');
|
||||
notification = i18n(prefix + 'DRAFTS');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Spam:
|
||||
notification = i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM');
|
||||
notification = i18n(prefix + 'SPAM');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Trash:
|
||||
notification = i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH');
|
||||
notification = i18n(prefix + 'TRASH');
|
||||
break;
|
||||
case SetSystemFoldersNotification.Archive:
|
||||
notification = i18n('POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE');
|
||||
notification = i18n(prefix + 'ARCHIVE');
|
||||
break;
|
||||
// no default
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue