mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Replace viewDecorator and popupDecorator with proper AbstractView classes
This commit is contained in:
parent
51958babba
commit
864da66b5f
38 changed files with 202 additions and 359 deletions
|
|
@ -3,16 +3,12 @@ import { getNotification } from 'Common/Translator';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Account',
|
||||
templateID: 'PopupsAccount'
|
||||
})
|
||||
class AccountPopupView extends AbstractViewNext {
|
||||
class AccountPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Account');
|
||||
|
||||
this.addObservables({
|
||||
isNew: true,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
import PgpStore from 'Stores/User/Pgp';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/AddOpenPgpKey',
|
||||
templateID: 'PopupsAddOpenPgpKey'
|
||||
})
|
||||
class AddOpenPgpKeyPopupView extends AbstractViewNext {
|
||||
class AddOpenPgpKeyPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('AddOpenPgpKey');
|
||||
|
||||
this.addObservables({
|
||||
key: '',
|
||||
|
|
|
|||
|
|
@ -4,16 +4,12 @@ import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
|||
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/AdvancedSearch',
|
||||
templateID: 'PopupsAdvancedSearch'
|
||||
})
|
||||
class AdvancedSearchPopupView extends AbstractViewNext {
|
||||
class AdvancedSearchPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('AdvancedSearch');
|
||||
|
||||
this.addObservables({
|
||||
fromFocus: false,
|
||||
|
|
|
|||
|
|
@ -1,16 +1,11 @@
|
|||
import { KeyState } from 'Common/Enums';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
||||
import { popup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Ask',
|
||||
templateID: 'PopupsAsk'
|
||||
})
|
||||
class AskPopupView extends AbstractViewNext {
|
||||
class AskPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Ask');
|
||||
|
||||
this.addObservables({
|
||||
askDesc: '',
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ import Remote from 'Remote/User/Fetch';
|
|||
|
||||
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
|
||||
|
||||
import { popup, command, isPopupVisible, showScreenPopup, hideScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command, isPopupVisible, showScreenPopup, hideScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
const Settings = rl.settings,
|
||||
/**
|
||||
|
|
@ -88,13 +88,9 @@ ko.extenders.toggleSubscribe = (target, options) => {
|
|||
return target;
|
||||
};
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Compose',
|
||||
templateID: 'PopupsCompose'
|
||||
})
|
||||
class ComposePopupView extends AbstractViewNext {
|
||||
class ComposePopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Compose');
|
||||
|
||||
const fEmailOutInHelper = (context, identity, name, isIn) => {
|
||||
if (identity && context && identity[name]() && (isIn ? true : context[name]())) {
|
||||
|
|
|
|||
|
|
@ -9,18 +9,14 @@ import PgpStore from 'Stores/User/Pgp';
|
|||
|
||||
import { EmailModel } from 'Model/Email';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
const KEY_NAME_SUBSTR = -8;
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/ComposeOpenPgp',
|
||||
templateID: 'PopupsComposeOpenPgp'
|
||||
})
|
||||
class ComposeOpenPgpPopupView extends AbstractViewNext {
|
||||
class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('ComposeOpenPgp');
|
||||
|
||||
this.publicKeysOptionsCaption = i18n('PGP_NOTIFICATIONS/ADD_A_PUBLICK_KEY');
|
||||
this.privateKeysOptionsCaption = i18n('PGP_NOTIFICATIONS/SELECT_A_PRIVATE_KEY');
|
||||
|
|
|
|||
|
|
@ -26,20 +26,16 @@ import { EmailModel } from 'Model/Email';
|
|||
import { ContactModel } from 'Model/Contact';
|
||||
import { ContactPropertyModel } from 'Model/ContactProperty';
|
||||
|
||||
import { popup, command, showScreenPopup, hideScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command, showScreenPopup, hideScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
const CONTACTS_PER_PAGE = 50,
|
||||
propertyIsMail = prop => prop.isType(ContactPropertyType.Email),
|
||||
propertyIsName = prop => prop.isType(ContactPropertyType.FirstName) || prop.isType(ContactPropertyType.LastName);
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Contacts',
|
||||
templateID: 'PopupsContacts'
|
||||
})
|
||||
class ContactsPopupView extends AbstractViewNext {
|
||||
class ContactsPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Contacts');
|
||||
|
||||
this.bBackToCompose = false;
|
||||
this.sLastComposeFocusedField = '';
|
||||
|
|
|
|||
|
|
@ -6,16 +6,12 @@ import CapaAdminStore from 'Stores/Admin/Capa';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Domain',
|
||||
templateID: 'PopupsDomain'
|
||||
})
|
||||
class DomainPopupView extends AbstractViewNext {
|
||||
class DomainPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Domain');
|
||||
|
||||
this.addObservables({
|
||||
edit: false,
|
||||
|
|
|
|||
|
|
@ -7,16 +7,12 @@ import DomainStore from 'Stores/Admin/Domain';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/DomainAlias',
|
||||
templateID: 'PopupsDomainAlias'
|
||||
})
|
||||
class DomainAliasPopupView extends AbstractViewNext {
|
||||
class DomainAliasPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('DomainAlias');
|
||||
|
||||
this.addObservables({
|
||||
saving: false,
|
||||
|
|
|
|||
|
|
@ -7,16 +7,12 @@ import { i18n, initOnStartOrLangChange } from 'Common/Translator';
|
|||
import FolderStore from 'Stores/User/Folder';
|
||||
import SieveStore from 'Stores/User/Sieve';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Filter',
|
||||
templateID: 'PopupsFilter'
|
||||
})
|
||||
class FilterPopupView extends AbstractViewNext {
|
||||
class FilterPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Filter');
|
||||
|
||||
this.addObservables({
|
||||
isNew: true,
|
||||
|
|
|
|||
|
|
@ -6,16 +6,12 @@ import MessageStore from 'Stores/User/Message';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/FolderClear',
|
||||
templateID: 'PopupsFolderClear'
|
||||
})
|
||||
class FolderClearPopupView extends AbstractViewNext {
|
||||
class FolderClearPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('FolderClear');
|
||||
|
||||
this.addObservables({
|
||||
selectedFolder: null,
|
||||
|
|
|
|||
|
|
@ -9,16 +9,12 @@ import FolderStore from 'Stores/User/Folder';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/FolderCreate',
|
||||
templateID: 'PopupsFolderCreate'
|
||||
})
|
||||
class FolderCreateView extends AbstractViewNext {
|
||||
class FolderCreateView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('FolderCreate');
|
||||
|
||||
this.addObservables({
|
||||
folderName: '',
|
||||
|
|
|
|||
|
|
@ -10,16 +10,11 @@ import FolderStore from 'Stores/User/Folder';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/FolderSystem',
|
||||
templateID: 'PopupsFolderSystem'
|
||||
})
|
||||
class FolderSystemPopupView extends AbstractViewNext {
|
||||
class FolderSystemPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('FolderSystem');
|
||||
|
||||
this.sChooseOnText = '';
|
||||
this.sUnuseText = '';
|
||||
|
|
|
|||
|
|
@ -3,18 +3,14 @@ import { getNotification } from 'Common/Translator';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
const reEmail = /^[^@\s]+@[^@\s]+$/;
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Identity',
|
||||
templateID: 'PopupsIdentity'
|
||||
})
|
||||
class IdentityPopupView extends AbstractViewNext {
|
||||
class IdentityPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Identity');
|
||||
|
||||
this.id = '';
|
||||
this.addObservables({
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
import { KeyState } from 'Common/Enums';
|
||||
|
||||
import { popup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/KeyboardShortcutsHelp',
|
||||
templateID: 'PopupsKeyboardShortcutsHelp'
|
||||
})
|
||||
class KeyboardShortcutsHelpPopupView extends AbstractViewNext {
|
||||
class KeyboardShortcutsHelpPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('KeyboardShortcutsHelp');
|
||||
this.sDefaultKeyScope = KeyState.PopupKeyboardShortcutsHelp;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,11 @@ import ko from 'ko';
|
|||
|
||||
import { convertLangName } from 'Common/Utils';
|
||||
|
||||
// import {view, ViewType} from 'Knoin/Knoin';
|
||||
import { popup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Languages',
|
||||
templateID: 'PopupsLanguages'
|
||||
})
|
||||
class LanguagesPopupView extends AbstractViewNext {
|
||||
class LanguagesPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Languages');
|
||||
|
||||
this.fLang = null;
|
||||
this.userLanguage = ko.observable('');
|
||||
|
|
|
|||
|
|
@ -3,16 +3,12 @@ import ko from 'ko';
|
|||
import { pString } from 'Common/Utils';
|
||||
import { KeyState } from 'Common/Enums';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/MessageOpenPgp',
|
||||
templateID: 'PopupsMessageOpenPgp'
|
||||
})
|
||||
class MessageOpenPgpPopupView extends AbstractViewNext {
|
||||
class MessageOpenPgpPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('MessageOpenPgp');
|
||||
|
||||
this.addObservables({
|
||||
notification: '',
|
||||
|
|
|
|||
|
|
@ -2,16 +2,12 @@ import { pInt } from 'Common/Utils';
|
|||
|
||||
import PgpStore from 'Stores/User/Pgp';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/NewOpenPgpKey',
|
||||
templateID: 'PopupsNewOpenPgpKey'
|
||||
})
|
||||
class NewOpenPgpKeyPopupView extends AbstractViewNext {
|
||||
class NewOpenPgpKeyPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('NewOpenPgpKey');
|
||||
|
||||
this.addObservables({
|
||||
email: '',
|
||||
|
|
|
|||
|
|
@ -5,16 +5,12 @@ import { getNotification, i18n } from 'Common/Translator';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { popup, command, isPopupVisible, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command, isPopupVisible, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Plugin',
|
||||
templateID: 'PopupsPlugin'
|
||||
})
|
||||
class PluginPopupView extends AbstractViewNext {
|
||||
class PluginPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Plugin');
|
||||
|
||||
this.onPluginSettingsUpdateResponse = this.onPluginSettingsUpdateResponse.bind(this);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,16 +9,12 @@ import Remote from 'Remote/User/Fetch';
|
|||
import { FilterModel } from 'Model/Filter';
|
||||
import SieveStore from 'Stores/User/Sieve';
|
||||
|
||||
import { popup, showScreenPopup/*, command*/ } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { showScreenPopup/*, command*/ } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/SieveScript',
|
||||
templateID: 'PopupsSieveScript'
|
||||
})
|
||||
class SieveScriptPopupView extends AbstractViewNext {
|
||||
class SieveScriptPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('SieveScript');
|
||||
|
||||
ko.addObservablesTo(this, {
|
||||
saveError: false,
|
||||
|
|
|
|||
|
|
@ -4,17 +4,13 @@ import { HtmlEditor } from 'Common/HtmlEditor';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
import { TemplateModel } from 'Model/Template';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Template',
|
||||
templateID: 'PopupsTemplate'
|
||||
})
|
||||
class TemplatePopupView extends AbstractViewNext {
|
||||
class TemplatePopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('Template');
|
||||
|
||||
this.editor = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,16 +4,12 @@ import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/TwoFactorConfiguration',
|
||||
templateID: 'PopupsTwoFactorConfiguration'
|
||||
})
|
||||
class TwoFactorConfigurationPopupView extends AbstractViewNext {
|
||||
class TwoFactorConfigurationPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('TwoFactorConfiguration');
|
||||
|
||||
this.addObservables({
|
||||
lock: false,
|
||||
|
|
|
|||
|
|
@ -2,16 +2,12 @@ import { StorageResultType } from 'Common/Enums';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/TwoFactorTest',
|
||||
templateID: 'PopupsTwoFactorTest'
|
||||
})
|
||||
class TwoFactorTestPopupView extends AbstractViewNext {
|
||||
class TwoFactorTestPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('TwoFactorTest');
|
||||
|
||||
this.addObservables({
|
||||
code: '',
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
import { KeyState } from 'Common/Enums';
|
||||
|
||||
import { popup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/ViewOpenPgpKey',
|
||||
templateID: 'PopupsViewOpenPgpKey'
|
||||
})
|
||||
class ViewOpenPgpKeyPopupView extends AbstractViewNext {
|
||||
class ViewOpenPgpKeyPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super();
|
||||
super('ViewOpenPgpKey');
|
||||
|
||||
this.addObservables({
|
||||
key: '',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue