mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +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,8 +3,9 @@ import ko from 'ko';
|
|||
import { inFocus } from 'Common/Utils';
|
||||
import { KeyState } from 'Common/Enums';
|
||||
import { keyScope } from 'Common/Globals';
|
||||
import { ViewType } from 'Knoin/Knoin';
|
||||
|
||||
export class AbstractViewNext {
|
||||
class AbstractView {
|
||||
bDisabeCloseOnEsc = false;
|
||||
sDefaultKeyScope = KeyState.None;
|
||||
sCurrentKeyScope = KeyState.None;
|
||||
|
|
@ -13,9 +14,15 @@ export class AbstractViewNext {
|
|||
modalVisibility = ko.observable(false).extend({ rateLimit: 0 });
|
||||
|
||||
viewModelName = '';
|
||||
viewModelNames = [];
|
||||
viewModelDom = null;
|
||||
|
||||
constructor(name, templateID, type)
|
||||
{
|
||||
this.viewModelName = 'View/' + name;
|
||||
this.viewModelTemplateID = templateID;
|
||||
this.viewModelPosition = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
|
|
@ -31,24 +38,6 @@ export class AbstractViewNext {
|
|||
keyScope(this.sCurrentKeyScope);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
registerPopupKeyDown() {
|
||||
addEventListener('keydown', event => {
|
||||
if (event && this.modalVisibility && this.modalVisibility()) {
|
||||
if (!this.bDisabeCloseOnEsc && 'Escape' == event.key) {
|
||||
this.cancelCommand && this.cancelCommand();
|
||||
return false;
|
||||
} else if ('Backspace' == event.key && !inFocus()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
cancelCommand() {} // eslint-disable-line no-empty-function
|
||||
closeCommand() {} // eslint-disable-line no-empty-function
|
||||
|
||||
|
|
@ -69,3 +58,53 @@ export class AbstractViewNext {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
export class AbstractViewPopup extends AbstractView
|
||||
{
|
||||
constructor(name)
|
||||
{
|
||||
super('Popup/' + name, 'Popups' + name, ViewType.Popup);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
registerPopupKeyDown() {
|
||||
addEventListener('keydown', event => {
|
||||
if (event && this.modalVisibility && this.modalVisibility()) {
|
||||
if (!this.bDisabeCloseOnEsc && 'Escape' == event.key) {
|
||||
this.cancelCommand && this.cancelCommand();
|
||||
return false;
|
||||
} else if ('Backspace' == event.key && !inFocus()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class AbstractViewCenter extends AbstractView
|
||||
{
|
||||
constructor(name, templateID)
|
||||
{
|
||||
super(name, templateID, ViewType.Center);
|
||||
}
|
||||
}
|
||||
|
||||
export class AbstractViewLeft extends AbstractView
|
||||
{
|
||||
constructor(name, templateID)
|
||||
{
|
||||
super(name, templateID, ViewType.Left);
|
||||
}
|
||||
}
|
||||
|
||||
export class AbstractViewRight extends AbstractView
|
||||
{
|
||||
constructor(name, templateID)
|
||||
{
|
||||
super(name, templateID, ViewType.Right);
|
||||
}
|
||||
}
|
||||
|
|
@ -105,17 +105,12 @@ function buildViewModel(ViewModelClass, vmScreen) {
|
|||
if (ViewModelClass && !ViewModelClass.__builded) {
|
||||
let vmDom = null;
|
||||
const vm = new ViewModelClass(vmScreen),
|
||||
position = ViewModelClass.__type || '',
|
||||
position = vm.viewModelPosition || '',
|
||||
vmPlace = position ? document.querySelector('#rl-content #rl-' + position.toLowerCase()) : null;
|
||||
|
||||
ViewModelClass.__builded = true;
|
||||
ViewModelClass.__vm = vm;
|
||||
|
||||
vm.viewModelName = ViewModelClass.__name;
|
||||
vm.viewModelNames = ViewModelClass.__names;
|
||||
vm.viewModelTemplateID = ViewModelClass.__templateID;
|
||||
vm.viewModelPosition = ViewModelClass.__type;
|
||||
|
||||
if (vmPlace) {
|
||||
vmDom = Element.fromHTML('<div class="rl-view-model RL-' + vm.viewModelTemplateID + '" hidden=""></div>');
|
||||
vmPlace.append(vmDom);
|
||||
|
|
@ -368,42 +363,6 @@ export function startScreens(screensClasses) {
|
|||
setTimeout(() => $htmlCL.add('rl-started-delay'), 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} params
|
||||
* @returns {Function}
|
||||
*/
|
||||
function viewDecorator({ name, type, templateID }) {
|
||||
return (target) => {
|
||||
if (target) {
|
||||
if (name) {
|
||||
if (Array.isArray(name)) {
|
||||
target.__names = name;
|
||||
} else {
|
||||
target.__names = [name];
|
||||
}
|
||||
|
||||
target.__name = target.__names[0];
|
||||
}
|
||||
|
||||
if (type) {
|
||||
target.__type = type;
|
||||
}
|
||||
|
||||
if (templateID) {
|
||||
target.__templateID = templateID;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} params
|
||||
* @returns {Function}
|
||||
*/
|
||||
function popupDecorator({ name, templateID }) {
|
||||
return viewDecorator({ name, type: ViewType.Popup, templateID });
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Function} canExecute
|
||||
* @returns {Function}
|
||||
|
|
@ -441,7 +400,7 @@ function settingsMenuKeysHandler(items) {
|
|||
let index = items.length;
|
||||
if (event && index) {
|
||||
while (index-- && !items[index].matches('.selected'));
|
||||
if (handler && 'up' === handler.shortcut) {
|
||||
if (handler && 'arrowup' === handler.shortcut) {
|
||||
index && --index;
|
||||
} else if (index < items.length - 1) {
|
||||
++index;
|
||||
|
|
@ -456,9 +415,5 @@ function settingsMenuKeysHandler(items) {
|
|||
export {
|
||||
commandDecorator,
|
||||
commandDecorator as command,
|
||||
viewDecorator,
|
||||
viewDecorator as view,
|
||||
popupDecorator,
|
||||
popupDecorator as popup,
|
||||
settingsMenuKeysHandler
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,17 +5,12 @@ import { getNotification } from 'Common/Translator';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { view, command, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewCenter } from 'Knoin/AbstractViews';
|
||||
|
||||
@view({
|
||||
name: 'View/Admin/Login',
|
||||
type: ViewType.Center,
|
||||
templateID: 'AdminLogin'
|
||||
})
|
||||
class LoginAdminView extends AbstractViewNext {
|
||||
class LoginAdminView extends AbstractViewCenter {
|
||||
constructor() {
|
||||
super();
|
||||
super('Admin/Login', 'AdminLogin');
|
||||
|
||||
const appSettingsGet = rl.settings.app;
|
||||
this.mobile = !!appSettingsGet('mobile');
|
||||
|
|
|
|||
|
|
@ -1,20 +1,15 @@
|
|||
import { leftPanelDisabled } from 'Common/Globals';
|
||||
import { KeyState } from 'Common/Enums';
|
||||
|
||||
import { view, ViewType, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
||||
|
||||
@view({
|
||||
name: 'View/Admin/Settings/Menu',
|
||||
type: ViewType.Left,
|
||||
templateID: 'AdminMenu'
|
||||
})
|
||||
class MenuSettingsAdminView extends AbstractViewNext {
|
||||
class MenuSettingsAdminView extends AbstractViewLeft {
|
||||
/**
|
||||
* @param {?} screen
|
||||
*/
|
||||
constructor(screen) {
|
||||
super();
|
||||
super('Admin/Settings/Menu', 'AdminMenu');
|
||||
|
||||
this.leftPanelDisabled = leftPanelDisabled;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,17 +6,11 @@ import DomainStore from 'Stores/Admin/Domain';
|
|||
import PluginStore from 'Stores/Admin/Plugin';
|
||||
import PackageStore from 'Stores/Admin/Package';
|
||||
|
||||
import { view, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||
|
||||
@view({
|
||||
name: 'View/Admin/Settings/Pane',
|
||||
type: ViewType.Right,
|
||||
templateID: 'AdminPane'
|
||||
})
|
||||
class PaneSettingsAdminView extends AbstractViewNext {
|
||||
class PaneSettingsAdminView extends AbstractViewRight {
|
||||
constructor() {
|
||||
super();
|
||||
super('Admin/Settings/Pane', 'AdminPane');
|
||||
|
||||
this.version = ko.observable(rl.settings.app('version'));
|
||||
|
||||
|
|
|
|||
|
|
@ -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: '',
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ import { Capa, KeyState } from 'Common/Enums';
|
|||
import { settings } from 'Common/Links';
|
||||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
||||
export class AbstractSystemDropDownUserView extends AbstractViewNext {
|
||||
constructor() {
|
||||
super();
|
||||
export class AbstractSystemDropDownUserView extends AbstractViewRight {
|
||||
constructor(name) {
|
||||
super(name, 'SystemDropDown');
|
||||
|
||||
this.mobile = !!Settings.app('mobile');
|
||||
this.mobileDevice = !!Settings.app('mobileDevice');
|
||||
|
|
|
|||
|
|
@ -19,21 +19,16 @@ import * as Local from 'Storage/Client';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { view, command, ViewType, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewCenter } from 'Knoin/AbstractViews';
|
||||
|
||||
import { rootAdmin } from 'Common/Links';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
||||
@view({
|
||||
name: ['View/App/Login', 'View/User/Login'],
|
||||
type: ViewType.Center,
|
||||
templateID: 'Login'
|
||||
})
|
||||
class LoginUserView extends AbstractViewNext {
|
||||
class LoginUserView extends AbstractViewCenter {
|
||||
constructor() {
|
||||
super();
|
||||
super('User/Login', 'Login');
|
||||
|
||||
this.hideSubmitButton = Settings.app('hideSubmitButton');
|
||||
|
||||
|
|
|
|||
|
|
@ -10,19 +10,14 @@ import SettingsStore from 'Stores/User/Settings';
|
|||
import FolderStore from 'Stores/User/Folder';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
import { view, ViewType, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
||||
@view({
|
||||
name: 'View/User/MailBox/FolderList',
|
||||
type: ViewType.Left,
|
||||
templateID: 'MailFolderList'
|
||||
})
|
||||
class FolderListMailBoxUserView extends AbstractViewNext {
|
||||
class FolderListMailBoxUserView extends AbstractViewLeft {
|
||||
constructor() {
|
||||
super();
|
||||
super('User/MailBox/FolderList', 'MailFolderList');
|
||||
|
||||
this.oContentScrollable = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,22 +38,17 @@ import MessageStore from 'Stores/User/Message';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { view, command, ViewType, showScreenPopup, popupVisibility } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command, showScreenPopup, popupVisibility } from 'Knoin/Knoin';
|
||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||
|
||||
const
|
||||
Settings = rl.settings,
|
||||
canBeMovedHelper = (self) => self.canBeMoved(),
|
||||
ifvisible = window.ifvisible;
|
||||
|
||||
@view({
|
||||
name: 'View/User/MailBox/MessageList',
|
||||
type: ViewType.Right,
|
||||
templateID: 'MailMessageList'
|
||||
})
|
||||
class MessageListMailBoxUserView extends AbstractViewNext {
|
||||
class MessageListMailBoxUserView extends AbstractViewRight {
|
||||
constructor() {
|
||||
super();
|
||||
super('User/MailBox/MessageList', 'MailMessageList');
|
||||
|
||||
this.sLastUid = null;
|
||||
this.bPrefetch = false;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ import * as Local from 'Storage/Client';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { view, command, ViewType, showScreenPopup, createCommand } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { command, showScreenPopup, createCommand } from 'Knoin/Knoin';
|
||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
||||
|
|
@ -44,14 +44,9 @@ function isTransparent(color) {
|
|||
return 'rgba(0, 0, 0, 0)' === color || 'transparent' === color;
|
||||
}
|
||||
|
||||
@view({
|
||||
name: 'View/User/MailBox/MessageView',
|
||||
type: ViewType.Right,
|
||||
templateID: 'MailMessageView'
|
||||
})
|
||||
class MessageViewMailBoxUserView extends AbstractViewNext {
|
||||
class MessageViewMailBoxUserView extends AbstractViewRight {
|
||||
constructor() {
|
||||
super();
|
||||
super('User/MailBox/MessageView', 'MailMessageView');
|
||||
|
||||
const createCommandReplyHelper = type =>
|
||||
createCommand(() => {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { view, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractSystemDropDownUserView } from 'View/User/AbstractSystemDropDown';
|
||||
|
||||
@view({
|
||||
name: 'View/User/MailBox/SystemDropDown',
|
||||
type: ViewType.Right,
|
||||
templateID: 'SystemDropDown'
|
||||
})
|
||||
class SystemDropDownMailBoxUserView extends AbstractSystemDropDownUserView {}
|
||||
class SystemDropDownMailBoxUserView extends AbstractSystemDropDownUserView
|
||||
{
|
||||
constructor() {
|
||||
super('User/MailBox/SystemDropDown');
|
||||
}
|
||||
}
|
||||
|
||||
export { SystemDropDownMailBoxUserView };
|
||||
|
|
|
|||
|
|
@ -3,20 +3,15 @@ import { leftPanelDisabled } from 'Common/Globals';
|
|||
import { settings, inbox } from 'Common/Links';
|
||||
import { getFolderInboxName } from 'Common/Cache';
|
||||
|
||||
import { view, ViewType, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
||||
|
||||
@view({
|
||||
name: 'View/User/Settings/Menu',
|
||||
type: ViewType.Left,
|
||||
templateID: 'SettingsMenu'
|
||||
})
|
||||
class MenuSettingsUserView extends AbstractViewNext {
|
||||
class MenuSettingsUserView extends AbstractViewLeft {
|
||||
/**
|
||||
* @param {Object} screen
|
||||
*/
|
||||
constructor(screen) {
|
||||
super();
|
||||
super('User/Settings/Menu', 'SettingsMenu');
|
||||
|
||||
this.leftPanelDisabled = leftPanelDisabled;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,17 +4,11 @@ import { leftPanelDisabled } from 'Common/Globals';
|
|||
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
import { view, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||
|
||||
@view({
|
||||
name: 'View/User/Settings/Pane',
|
||||
type: ViewType.Right,
|
||||
templateID: 'SettingsPane'
|
||||
})
|
||||
class PaneSettingsUserView extends AbstractViewNext {
|
||||
class PaneSettingsUserView extends AbstractViewRight {
|
||||
constructor() {
|
||||
super();
|
||||
super('User/Settings/Pane', 'SettingsPane');
|
||||
|
||||
this.mobile = rl.settings.app('mobile');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { view, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractSystemDropDownUserView } from 'View/User/AbstractSystemDropDown';
|
||||
|
||||
@view({
|
||||
name: 'View/User/Settings/SystemDropDown',
|
||||
type: ViewType.Right,
|
||||
templateID: 'SystemDropDown'
|
||||
})
|
||||
class SystemDropDownSettingsUserView extends AbstractSystemDropDownUserView {}
|
||||
class SystemDropDownSettingsUserView extends AbstractSystemDropDownUserView
|
||||
{
|
||||
constructor() {
|
||||
super('User/Settings/SystemDropDown');
|
||||
}
|
||||
}
|
||||
|
||||
export { SystemDropDownSettingsUserView };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue