mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
this.addObservables() to addObservablesTo()
This commit is contained in:
parent
839ebfb350
commit
7fac6ca9dd
30 changed files with 78 additions and 58 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
import { SaveSettingStatus } from 'Common/Enums';
|
import { SaveSettingStatus } from 'Common/Enums';
|
||||||
import { koComputable } from 'External/ko';
|
import { dispose, koComputable } from 'External/ko';
|
||||||
import { dispose } from 'External/ko';
|
|
||||||
import { defaultOptionsAfterRender } from 'Common/Utils';
|
import { defaultOptionsAfterRender } from 'Common/Utils';
|
||||||
|
|
||||||
export class SelectComponent {
|
export class SelectComponent {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
|
|
||||||
export class AccountModel extends AbstractModel {
|
export class AccountModel extends AbstractModel {
|
||||||
/**
|
/**
|
||||||
|
|
@ -11,7 +12,7 @@ export class AccountModel extends AbstractModel {
|
||||||
|
|
||||||
this.email = email;
|
this.email = email;
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
// count: count || 0,
|
// count: count || 0,
|
||||||
askDelete: false,
|
askDelete: false,
|
||||||
isAdditional: isAdditional
|
isAdditional: isAdditional
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import {
|
||||||
} from 'Common/Links';
|
} from 'Common/Links';
|
||||||
|
|
||||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { SMAudio } from 'Common/Audio';
|
import { SMAudio } from 'Common/Audio';
|
||||||
|
|
||||||
|
|
@ -30,7 +31,7 @@ export class AttachmentModel extends AbstractModel {
|
||||||
this.mimeIndex = '';
|
this.mimeIndex = '';
|
||||||
this.estimatedSize = 0;
|
this.estimatedSize = 0;
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
isInline: false,
|
isInline: false,
|
||||||
isLinked: false
|
isLinked: false
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { FileInfo } from 'Common/File';
|
import { FileInfo } from 'Common/File';
|
||||||
|
|
||||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
export class ComposeAttachmentModel extends AbstractModel {
|
export class ComposeAttachmentModel extends AbstractModel {
|
||||||
/**
|
/**
|
||||||
|
|
@ -22,7 +23,7 @@ export class ComposeAttachmentModel extends AbstractModel {
|
||||||
this.contentLocation = contentLocation;
|
this.contentLocation = contentLocation;
|
||||||
this.fromMessage = false;
|
this.fromMessage = false;
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
fileName: fileName,
|
fileName: fileName,
|
||||||
size: size,
|
size: size,
|
||||||
tempName: '',
|
tempName: '',
|
||||||
|
|
@ -35,7 +36,7 @@ export class ComposeAttachmentModel extends AbstractModel {
|
||||||
complete: false
|
complete: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
progressText: () => {
|
progressText: () => {
|
||||||
const p = this.progress();
|
const p = this.progress();
|
||||||
return 1 > p ? '' : (100 < p ? 100 : p) + '%';
|
return 1 > p ? '' : (100 < p ? 100 : p) + '%';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { JCard } from 'DAV/JCard';
|
import { JCard } from 'DAV/JCard';
|
||||||
//import { VCardProperty } from 'DAV/VCardProperty';
|
//import { VCardProperty } from 'DAV/VCardProperty';
|
||||||
|
|
@ -80,7 +81,7 @@ export class ContactModel extends AbstractModel {
|
||||||
|
|
||||||
this.jCard = ['vcard',[]];
|
this.jCard = ['vcard',[]];
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
// Also used by Selector
|
// Also used by Selector
|
||||||
focused: false,
|
focused: false,
|
||||||
selected: false,
|
selected: false,
|
||||||
|
|
@ -113,7 +114,7 @@ export class ContactModel extends AbstractModel {
|
||||||
this.url = ko.observableArray();
|
this.url = ko.observableArray();
|
||||||
this.adr = ko.observableArray();
|
this.adr = ko.observableArray();
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
fullName: () => [this.namePrefix(), this.givenName(), this.middleName(), this.surName()].join(' ').trim(),
|
fullName: () => [this.namePrefix(), this.givenName(), this.middleName(), this.surName()].join(' ').trim(),
|
||||||
|
|
||||||
display: () => {
|
display: () => {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import { i18n, translateTrigger } from 'Common/Translator';
|
||||||
|
|
||||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||||
|
|
||||||
import { koComputable } from 'External/ko';
|
import { koComputable, addObservablesTo } from 'External/ko';
|
||||||
|
|
||||||
//import { mailBox } from 'Common/Links';
|
//import { mailBox } from 'Common/Links';
|
||||||
|
|
||||||
|
|
@ -234,7 +234,7 @@ export class FolderModel extends AbstractModel {
|
||||||
// this.id = null;
|
// this.id = null;
|
||||||
this.uidNext = null;
|
this.uidNext = null;
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
name: '',
|
name: '',
|
||||||
type: FolderType.User,
|
type: FolderType.User,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
|
|
||||||
export class IdentityModel extends AbstractModel {
|
export class IdentityModel extends AbstractModel {
|
||||||
/**
|
/**
|
||||||
|
|
@ -8,7 +9,7 @@ export class IdentityModel extends AbstractModel {
|
||||||
constructor(id, email) {
|
constructor(id, email) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
id: id || '',
|
id: id || '',
|
||||||
email: email,
|
email: email,
|
||||||
name: '',
|
name: '',
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { doc, SettingsGet } from 'Common/Globals';
|
||||||
import { encodeHtml, plainToHtml, htmlToPlain, cleanHtml } from 'Common/Html';
|
import { encodeHtml, plainToHtml, htmlToPlain, cleanHtml } from 'Common/Html';
|
||||||
import { arrayLength, forEachObjectEntry } from 'Common/Utils';
|
import { arrayLength, forEachObjectEntry } from 'Common/Utils';
|
||||||
import { serverRequestRaw, proxy } from 'Common/Links';
|
import { serverRequestRaw, proxy } from 'Common/Links';
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { FolderUserStore, isAllowedKeyword } from 'Stores/User/Folder';
|
import { FolderUserStore, isAllowedKeyword } from 'Stores/User/Folder';
|
||||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||||
|
|
@ -65,7 +66,7 @@ export class MessageModel extends AbstractModel {
|
||||||
|
|
||||||
this._reset();
|
this._reset();
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
subject: '',
|
subject: '',
|
||||||
plain: '',
|
plain: '',
|
||||||
html: '',
|
html: '',
|
||||||
|
|
@ -108,7 +109,7 @@ export class MessageModel extends AbstractModel {
|
||||||
this.unsubsribeLinks = ko.observableArray();
|
this.unsubsribeLinks = ko.observableArray();
|
||||||
this.flags = ko.observableArray();
|
this.flags = ko.observableArray();
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
attachmentIconClass: () => FileInfo.getAttachmentsIconClass(this.attachments()),
|
attachmentIconClass: () => FileInfo.getAttachmentsIconClass(this.attachments()),
|
||||||
threadsLen: () => this.threads().length,
|
threadsLen: () => this.threads().length,
|
||||||
listAttachments: () => this.attachments()
|
listAttachments: () => this.attachments()
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { koComputable } from 'External/ko';
|
import { koComputable, addObservablesTo, addSubscribablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { FolderType } from 'Common/EnumsUser';
|
import { FolderType } from 'Common/EnumsUser';
|
||||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||||
import { forEachObjectEntry } from 'Common/Utils';
|
import { forEachObjectEntry } from 'Common/Utils';
|
||||||
import { addObservablesTo, addSubscribablesTo, addComputablesTo } from 'External/ko';
|
|
||||||
import { getFolderInboxName, getFolderFromCacheList } from 'Common/Cache';
|
import { getFolderInboxName, getFolderFromCacheList } from 'Common/Cache';
|
||||||
import { Settings, SettingsCapa } from 'Common/Globals';
|
import { Settings, SettingsCapa } from 'Common/Globals';
|
||||||
//import Remote from 'Remote/User/Fetch'; // Circular dependency
|
//import Remote from 'Remote/User/Fetch'; // Circular dependency
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
import { koComputable } from 'External/ko';
|
import { koComputable, addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { SMAudio } from 'Common/Audio';
|
import { SMAudio } from 'Common/Audio';
|
||||||
import { Notification } from 'Common/Enums';
|
import { Notification } from 'Common/Enums';
|
||||||
import { MessageSetAction } from 'Common/EnumsUser';
|
import { MessageSetAction } from 'Common/EnumsUser';
|
||||||
import { $htmlCL } from 'Common/Globals';
|
import { $htmlCL } from 'Common/Globals';
|
||||||
import { arrayLength, pInt, pString } from 'Common/Utils';
|
import { arrayLength, pInt, pString } from 'Common/Utils';
|
||||||
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
|
||||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { koComputable } from 'External/ko';
|
import { koComputable, addObservablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { Layout } from 'Common/EnumsUser';
|
import { Layout } from 'Common/EnumsUser';
|
||||||
import { pInt } from 'Common/Utils';
|
import { pInt } from 'Common/Utils';
|
||||||
import { addObservablesTo } from 'External/ko';
|
|
||||||
import { $htmlCL, SettingsGet, fireEvent } from 'Common/Globals';
|
import { $htmlCL, SettingsGet, fireEvent } from 'Common/Globals';
|
||||||
import { ThemeStore } from 'Stores/Theme';
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { fireEvent } from 'Common/Globals';
|
import { fireEvent } from 'Common/Globals';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
import { addObservablesTo, addSubscribablesTo } from 'External/ko';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Fetch';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
|
|
@ -10,7 +11,7 @@ export class AdminLoginView extends AbstractViewLogin {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('AdminLogin');
|
super('AdminLogin');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
login: '',
|
login: '',
|
||||||
password: '',
|
password: '',
|
||||||
totp: '',
|
totp: '',
|
||||||
|
|
@ -22,7 +23,7 @@ export class AdminLoginView extends AbstractViewLogin {
|
||||||
submitError: ''
|
submitError: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSubscribables({
|
addSubscribablesTo(this, {
|
||||||
login: () => this.loginError(false),
|
login: () => this.loginError(false),
|
||||||
password: () => this.passwordError(false)
|
password: () => this.passwordError(false)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Fetch';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
@ -8,7 +9,7 @@ export class AccountPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('Account');
|
super('Account');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
isNew: true,
|
isNew: true,
|
||||||
|
|
||||||
email: '',
|
email: '',
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
import { i18n, translateTrigger } from 'Common/Translator';
|
import { i18n, translateTrigger } from 'Common/Translator';
|
||||||
import { pString } from 'Common/Utils';
|
import { pString } from 'Common/Utils';
|
||||||
|
|
||||||
|
|
@ -10,7 +11,7 @@ export class AdvancedSearchPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('AdvancedSearch');
|
super('AdvancedSearch');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
from: '',
|
from: '',
|
||||||
to: '',
|
to: '',
|
||||||
subject: '',
|
subject: '',
|
||||||
|
|
@ -25,7 +26,7 @@ export class AdvancedSearchPopupView extends AbstractViewPopup {
|
||||||
unseen: false
|
unseen: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
showMultisearch: () => FolderUserStore.hasCapability('MULTISEARCH'),
|
showMultisearch: () => FolderUserStore.hasCapability('MULTISEARCH'),
|
||||||
|
|
||||||
// Almost the same as MessageModel.tagOptions
|
// Almost the same as MessageModel.tagOptions
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
import { isFunction } from 'Common/Utils';
|
import { isFunction } from 'Common/Utils';
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||||
|
|
||||||
export class AskPopupView extends AbstractViewPopup {
|
export class AskPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('Ask');
|
super('Ask');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
askDesc: '',
|
askDesc: '',
|
||||||
yesButton: '',
|
yesButton: '',
|
||||||
noButton: '',
|
noButton: '',
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import {
|
||||||
|
|
||||||
import { pInt, isArray, arrayLength, forEachObjectEntry } from 'Common/Utils';
|
import { pInt, isArray, arrayLength, forEachObjectEntry } from 'Common/Utils';
|
||||||
import { encodeHtml, HtmlEditor, htmlToPlain } from 'Common/Html';
|
import { encodeHtml, HtmlEditor, htmlToPlain } from 'Common/Html';
|
||||||
import { koArrayWithDestroy } from 'External/ko';
|
import { koArrayWithDestroy, addObservablesTo, addComputablesTo, addSubscribablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||||
import { folderInformation, messagesDeleteHelper } from 'Common/Folders';
|
import { folderInformation, messagesDeleteHelper } from 'Common/Folders';
|
||||||
|
|
@ -215,7 +215,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
this.allowContacts = AppUserStore.allowContacts();
|
this.allowContacts = AppUserStore.allowContacts();
|
||||||
this.allowIdentities = SettingsCapa('Identities');
|
this.allowIdentities = SettingsCapa('Identities');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
identitiesDropdownTrigger: false,
|
identitiesDropdownTrigger: false,
|
||||||
|
|
||||||
from: '',
|
from: '',
|
||||||
|
|
@ -304,7 +304,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.iTimer = 0;
|
this.iTimer = 0;
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
sendButtonSuccess: () => !this.sendError() && !this.sendSuccessButSaveError(),
|
sendButtonSuccess: () => !this.sendError() && !this.sendSuccessButSaveError(),
|
||||||
|
|
||||||
savedTimeText: () =>
|
savedTimeText: () =>
|
||||||
|
|
@ -344,7 +344,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
canBeSentOrSaved: () => !this.sending() && !this.saving()
|
canBeSentOrSaved: () => !this.sending() && !this.saving()
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSubscribables({
|
addSubscribablesTo(this, {
|
||||||
sendError: value => !value && this.sendErrorDesc(''),
|
sendError: value => !value && this.sendErrorDesc(''),
|
||||||
|
|
||||||
savedError: value => !value && this.savedErrorDesc(''),
|
savedError: value => !value && this.savedErrorDesc(''),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
import { ComposeType } from 'Common/EnumsUser';
|
import { ComposeType } from 'Common/EnumsUser';
|
||||||
import { registerShortcut } from 'Common/Globals';
|
import { registerShortcut } from 'Common/Globals';
|
||||||
import { arrayLength, pInt } from 'Common/Utils';
|
import { arrayLength, pInt } from 'Common/Utils';
|
||||||
|
|
@ -32,7 +33,7 @@ export class ContactsPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('Contacts');
|
super('Contacts');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
search: '',
|
search: '',
|
||||||
contactsCount: 0,
|
contactsCount: 0,
|
||||||
|
|
||||||
|
|
@ -64,7 +65,7 @@ export class ContactsPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.selector.on('ItemGetUid', contact => contact ? contact.generateUid() : '');
|
this.selector.on('ItemGetUid', contact => contact ? contact.generateUid() : '');
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
contactsPaginator: computedPaginatorHelper(
|
contactsPaginator: computedPaginatorHelper(
|
||||||
this.contactsPage,
|
this.contactsPage,
|
||||||
() => Math.max(1, Math.ceil(this.contactsCount() / CONTACTS_PER_PAGE))
|
() => Math.max(1, Math.ceil(this.contactsCount() / CONTACTS_PER_PAGE))
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { addObservablesTo, addComputablesTo, addSubscribablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { pInt, forEachObjectEntry } from 'Common/Utils';
|
import { pInt, forEachObjectEntry } from 'Common/Utils';
|
||||||
import { i18n, getNotification } from 'Common/Translator';
|
import { i18n, getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
|
|
@ -33,8 +35,8 @@ export class DomainPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('Domain');
|
super('Domain');
|
||||||
|
|
||||||
this.addObservables(this.getDefaults());
|
addObservablesTo(this, this.getDefaults());
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
edit: false,
|
edit: false,
|
||||||
|
|
||||||
saving: false,
|
saving: false,
|
||||||
|
|
@ -53,7 +55,7 @@ export class DomainPopupView extends AbstractViewPopup {
|
||||||
smtpHostFocus: false,
|
smtpHostFocus: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
headerText: () => {
|
headerText: () => {
|
||||||
const name = this.name(),
|
const name = this.name(),
|
||||||
aliasName = this.aliasName();
|
aliasName = this.aliasName();
|
||||||
|
|
@ -96,7 +98,7 @@ export class DomainPopupView extends AbstractViewPopup {
|
||||||
canBeSaved: () => !this.saving() && this.domainIsComputed()
|
canBeSaved: () => !this.saving() && this.domainIsComputed()
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSubscribables({
|
addSubscribablesTo(this, {
|
||||||
testingImapError: value => value || this.testingImapErrorDesc(''),
|
testingImapError: value => value || this.testingImapErrorDesc(''),
|
||||||
testingSieveError: value => value || this.testingSieveErrorDesc(''),
|
testingSieveError: value => value || this.testingSieveErrorDesc(''),
|
||||||
testingSmtpError: value => value || this.testingSmtpErrorDesc(''),
|
testingSmtpError: value => value || this.testingSmtpErrorDesc(''),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
||||||
|
|
||||||
|
|
@ -11,7 +12,7 @@ export class DomainAliasPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('DomainAlias');
|
super('DomainAlias');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
saving: false,
|
saving: false,
|
||||||
savingError: '',
|
savingError: '',
|
||||||
|
|
||||||
|
|
@ -20,7 +21,7 @@ export class DomainAliasPopupView extends AbstractViewPopup {
|
||||||
alias: ''
|
alias: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
domains: () => DomainAdminStore.filter(item => item && !item.alias),
|
domains: () => DomainAdminStore.filter(item => item && !item.alias),
|
||||||
|
|
||||||
domainsOptions: () => this.domains().map(item => ({ optValue: item.name, optText: item.name })),
|
domainsOptions: () => this.domains().map(item => ({ optValue: item.name, optText: item.name })),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
import { i18n, getNotification } from 'Common/Translator';
|
import { i18n, getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import { MessageUserStore } from 'Stores/User/Message';
|
import { MessageUserStore } from 'Stores/User/Message';
|
||||||
|
|
@ -12,12 +13,12 @@ export class FolderClearPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('FolderClear');
|
super('FolderClear');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
folder: null,
|
folder: null,
|
||||||
clearing: false
|
clearing: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
dangerDescHtml: () => {
|
dangerDescHtml: () => {
|
||||||
// const folder = this.folder();
|
// const folder = this.folder();
|
||||||
// return i18n('POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1', { FOLDER: folder.fullName.replace(folder.delimiter, ' / ') });
|
// return i18n('POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1', { FOLDER: folder.fullName.replace(folder.delimiter, ' / ') });
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { koComputable } from 'External/ko';
|
import { koComputable, addObservablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { Notification } from 'Common/Enums';
|
import { Notification } from 'Common/Enums';
|
||||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||||
|
|
@ -20,7 +20,7 @@ export class FolderCreatePopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('FolderCreate');
|
super('FolderCreate');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
folderName: '',
|
folderName: '',
|
||||||
folderSubscribe: SettingsUserStore.hideUnsubscribed(),
|
folderSubscribe: SettingsUserStore.hideUnsubscribed(),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { addObservablesTo, addSubscribablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Fetch';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
@ -9,7 +11,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
||||||
super('Identity');
|
super('Identity');
|
||||||
|
|
||||||
this.id = '';
|
this.id = '';
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
edit: false,
|
edit: false,
|
||||||
owner: false,
|
owner: false,
|
||||||
|
|
||||||
|
|
@ -35,7 +37,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
||||||
submitError: ''
|
submitError: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSubscribables({
|
addSubscribablesTo(this, {
|
||||||
replyTo: value => {
|
replyTo: value => {
|
||||||
if (false === this.showReplyTo() && value.length) {
|
if (false === this.showReplyTo() && value.length) {
|
||||||
this.showReplyTo(true);
|
this.showReplyTo(true);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
//import { pInt } from 'Common/Utils';
|
//import { pInt } from 'Common/Utils';
|
||||||
|
|
||||||
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
||||||
|
|
@ -15,7 +16,7 @@ export class OpenPgpGeneratePopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.identities = IdentityUserStore;
|
this.identities = IdentityUserStore;
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
email: '',
|
email: '',
|
||||||
emailError: false,
|
emailError: false,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
||||||
import { OpenPGPUserStore } from 'Stores/User/OpenPGP';
|
import { OpenPGPUserStore } from 'Stores/User/OpenPGP';
|
||||||
|
|
||||||
|
|
@ -7,7 +8,7 @@ export class OpenPgpImportPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('OpenPgpImport');
|
super('OpenPgpImport');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
key: '',
|
key: '',
|
||||||
keyError: false,
|
keyError: false,
|
||||||
keyErrorMessage: '',
|
keyErrorMessage: '',
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
import { doc, addShortcut } from 'Common/Globals';
|
import { doc, addShortcut } from 'Common/Globals';
|
||||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||||
|
|
||||||
|
|
@ -5,7 +6,7 @@ export class OpenPgpKeyPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('OpenPgpKey');
|
super('OpenPgpKey');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
key: '',
|
key: '',
|
||||||
keyDom: null
|
keyDom: null
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { getNotification, i18n } from 'Common/Translator';
|
import { getNotification, i18n } from 'Common/Translator';
|
||||||
import { arrayLength } from 'Common/Utils';
|
import { arrayLength } from 'Common/Utils';
|
||||||
|
|
@ -13,7 +14,7 @@ export class PluginPopupView extends AbstractViewPopup {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('Plugin');
|
super('Plugin');
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
saveError: '',
|
saveError: '',
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
|
|
@ -22,7 +23,7 @@ export class PluginPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.config = ko.observableArray();
|
this.config = ko.observableArray();
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
hasReadme: () => !!this.readme(),
|
hasReadme: () => !!this.readme(),
|
||||||
hasConfiguration: () => 0 < this.config().length
|
hasConfiguration: () => 0 < this.config().length
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { Notification } from 'Common/Enums';
|
||||||
import { ClientSideKeyNameLastSignMe } from 'Common/EnumsUser';
|
import { ClientSideKeyNameLastSignMe } from 'Common/EnumsUser';
|
||||||
import { SettingsGet, fireEvent } from 'Common/Globals';
|
import { SettingsGet, fireEvent } from 'Common/Globals';
|
||||||
import { getNotification, translatorReload, convertLangName } from 'Common/Translator';
|
import { getNotification, translatorReload, convertLangName } from 'Common/Translator';
|
||||||
|
import { addObservablesTo, addComputablesTo, addSubscribablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { LanguageStore } from 'Stores/Language';
|
import { LanguageStore } from 'Stores/Language';
|
||||||
|
|
||||||
|
|
@ -24,7 +25,7 @@ export class LoginUserView extends AbstractViewLogin {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
loadingDesc: SettingsGet('LoadingDescription'),
|
loadingDesc: SettingsGet('LoadingDescription'),
|
||||||
|
|
||||||
email: SettingsGet('DevEmail'),
|
email: SettingsGet('DevEmail'),
|
||||||
|
|
@ -50,14 +51,14 @@ export class LoginUserView extends AbstractViewLogin {
|
||||||
|
|
||||||
this.bSendLanguage = false;
|
this.bSendLanguage = false;
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
|
|
||||||
languageFullName: () => convertLangName(this.language()),
|
languageFullName: () => convertLangName(this.language()),
|
||||||
|
|
||||||
signMeVisibility: () => SignMeUnused !== this.signMeType()
|
signMeVisibility: () => SignMeUnused !== this.signMeType()
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSubscribables({
|
addSubscribablesTo(this, {
|
||||||
email: () => this.emailError(false),
|
email: () => this.emailError(false),
|
||||||
|
|
||||||
password: () => this.passwordError(false),
|
password: () => this.passwordError(false),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { Scope } from 'Common/Enums';
|
import { Scope } from 'Common/Enums';
|
||||||
|
|
||||||
|
|
@ -89,7 +90,7 @@ export class MailMessageList extends AbstractViewRight {
|
||||||
|
|
||||||
this.userUsageProc = FolderUserStore.quotaPercentage;
|
this.userUsageProc = FolderUserStore.quotaPercentage;
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
moreDropdownTrigger: false,
|
moreDropdownTrigger: false,
|
||||||
sortDropdownTrigger: false,
|
sortDropdownTrigger: false,
|
||||||
|
|
||||||
|
|
@ -100,7 +101,7 @@ export class MailMessageList extends AbstractViewRight {
|
||||||
this.dragOver = ko.observable(false).extend({ throttle: 1 });
|
this.dragOver = ko.observable(false).extend({ throttle: 1 });
|
||||||
this.dragOverEnter = ko.observable(false).extend({ throttle: 1 });
|
this.dragOverEnter = ko.observable(false).extend({ throttle: 1 });
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
|
|
||||||
sortSupported: () =>
|
sortSupported: () =>
|
||||||
FolderUserStore.hasCapability('SORT') | FolderUserStore.hasCapability('ESORT'),
|
FolderUserStore.hasCapability('SORT') | FolderUserStore.hasCapability('ESORT'),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
import { addObservablesTo, addComputablesTo, addSubscribablesTo } from 'External/ko';
|
||||||
|
|
||||||
import { Scope } from 'Common/Enums';
|
import { Scope } from 'Common/Enums';
|
||||||
|
|
||||||
|
|
@ -92,7 +93,7 @@ export class MailMessageView extends AbstractViewRight {
|
||||||
|
|
||||||
this.msgDefaultAction = SettingsUserStore.msgDefaultAction;
|
this.msgDefaultAction = SettingsUserStore.msgDefaultAction;
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
showAttachmentControls: !!Local.get(ClientSideKeyNameMessageAttachmentControls),
|
showAttachmentControls: !!Local.get(ClientSideKeyNameMessageAttachmentControls),
|
||||||
downloadAsZipLoading: false,
|
downloadAsZipLoading: false,
|
||||||
showFullInfo: '1' === Local.get(ClientSideKeyNameMessageHeaderFullInfo),
|
showFullInfo: '1' === Local.get(ClientSideKeyNameMessageHeaderFullInfo),
|
||||||
|
|
@ -132,7 +133,7 @@ export class MailMessageView extends AbstractViewRight {
|
||||||
// viewer
|
// viewer
|
||||||
this.viewHash = '';
|
this.viewHash = '';
|
||||||
|
|
||||||
this.addComputables({
|
addComputablesTo(this, {
|
||||||
allowAttachmentControls: () => arrayLength(attachmentsActions) && SettingsCapa('AttachmentsActions'),
|
allowAttachmentControls: () => arrayLength(attachmentsActions) && SettingsCapa('AttachmentsActions'),
|
||||||
|
|
||||||
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip')
|
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip')
|
||||||
|
|
@ -174,7 +175,7 @@ export class MailMessageView extends AbstractViewRight {
|
||||||
() => MessagelistUserStore.isLoading() | MessageUserStore.loading()
|
() => MessagelistUserStore.isLoading() | MessageUserStore.loading()
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSubscribables({
|
addSubscribablesTo(this, {
|
||||||
message: message => {
|
message: message => {
|
||||||
if (message) {
|
if (message) {
|
||||||
if (this.viewHash !== message.hash) {
|
if (this.viewHash !== message.hash) {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import Remote from 'Remote/User/Fetch';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
//import { clearCache } from 'Common/Cache';
|
//import { clearCache } from 'Common/Cache';
|
||||||
//import { koComputable } from 'External/ko';
|
//import { koComputable } from 'External/ko';
|
||||||
|
import { addObservablesTo } from 'External/ko';
|
||||||
|
|
||||||
export class SystemDropDownUserView extends AbstractViewRight {
|
export class SystemDropDownUserView extends AbstractViewRight {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -36,7 +37,7 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
||||||
this.accountsUnreadCount = : koComputable(() => AccountUserStore.accounts().reduce((result, item) => result + item.count(), 0));
|
this.accountsUnreadCount = : koComputable(() => AccountUserStore.accounts().reduce((result, item) => result + item.count(), 0));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
this.addObservables({
|
addObservablesTo(this, {
|
||||||
currentAudio: '',
|
currentAudio: '',
|
||||||
accountMenuDropdownTrigger: false
|
accountMenuDropdownTrigger: false
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue