mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
prevent creation of _defineProperty() function
This commit is contained in:
parent
eff92c3152
commit
986b8f056b
8 changed files with 24 additions and 57 deletions
|
|
@ -19,20 +19,6 @@ export function encodeHtml(text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
class HtmlEditor {
|
class HtmlEditor {
|
||||||
editor;
|
|
||||||
blurTimer = 0;
|
|
||||||
|
|
||||||
__resizable = false;
|
|
||||||
__inited = false;
|
|
||||||
|
|
||||||
onBlur = null;
|
|
||||||
onReady = null;
|
|
||||||
onModeChange = null;
|
|
||||||
|
|
||||||
element;
|
|
||||||
|
|
||||||
resize;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} element
|
* @param {Object} element
|
||||||
* @param {Function=} onBlur
|
* @param {Function=} onBlur
|
||||||
|
|
@ -40,6 +26,12 @@ class HtmlEditor {
|
||||||
* @param {Function=} onModeChange
|
* @param {Function=} onModeChange
|
||||||
*/
|
*/
|
||||||
constructor(element, onBlur = null, onReady = null, onModeChange = null) {
|
constructor(element, onBlur = null, onReady = null, onModeChange = null) {
|
||||||
|
this.editor;
|
||||||
|
this.blurTimer = 0;
|
||||||
|
|
||||||
|
this.__resizable = false;
|
||||||
|
this.__inited = false;
|
||||||
|
|
||||||
this.onBlur = onBlur;
|
this.onBlur = onBlur;
|
||||||
this.onReady = onReady;
|
this.onReady = onReady;
|
||||||
this.onModeChange = onModeChange;
|
this.onModeChange = onModeChange;
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,11 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
export class Selector {
|
export class Selector {
|
||||||
list;
|
|
||||||
listChecked;
|
|
||||||
isListChecked;
|
|
||||||
|
|
||||||
focusedItem;
|
|
||||||
selectedItem;
|
|
||||||
|
|
||||||
selectedItemUseCallback = true;
|
|
||||||
|
|
||||||
iSelectNextHelper = 0;
|
|
||||||
iFocusedNextHelper = 0;
|
|
||||||
oContentScrollable;
|
|
||||||
|
|
||||||
sItemSelector;
|
|
||||||
sItemSelectedSelector;
|
|
||||||
sItemCheckedSelector;
|
|
||||||
sItemFocusedSelector;
|
|
||||||
|
|
||||||
sLastUid = '';
|
|
||||||
oCallbacks = {};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {koProperty} koList
|
* @param {koProperty} koList
|
||||||
* @param {koProperty} koSelectedItem
|
* @param {koProperty} koSelectedItem
|
||||||
* @param {koProperty} koFocusedItem
|
* @param {koProperty} koFocusedItem
|
||||||
* @param {string} sItemSelector
|
* @param {string} sItemSelector
|
||||||
* @param {string} sItemSelectedSelector
|
|
||||||
* @param {string} sItemCheckedSelector
|
* @param {string} sItemCheckedSelector
|
||||||
* @param {string} sItemFocusedSelector
|
* @param {string} sItemFocusedSelector
|
||||||
*/
|
*/
|
||||||
|
|
@ -36,18 +14,29 @@ export class Selector {
|
||||||
koSelectedItem,
|
koSelectedItem,
|
||||||
koFocusedItem,
|
koFocusedItem,
|
||||||
sItemSelector,
|
sItemSelector,
|
||||||
sItemSelectedSelector,
|
|
||||||
sItemCheckedSelector,
|
sItemCheckedSelector,
|
||||||
sItemFocusedSelector
|
sItemFocusedSelector
|
||||||
) {
|
) {
|
||||||
this.list = koList;
|
this.list = koList;
|
||||||
|
|
||||||
this.listChecked = ko.computed(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 });
|
this.listChecked = ko.computed(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||||
this.isListChecked = ko.computed(() => 0 < this.listChecked().length);
|
this.isListChecked = ko.computed(() => 0 < this.listChecked().length);
|
||||||
|
|
||||||
this.focusedItem = koFocusedItem || ko.observable(null);
|
this.focusedItem = koFocusedItem || ko.observable(null);
|
||||||
this.selectedItem = koSelectedItem || ko.observable(null);
|
this.selectedItem = koSelectedItem || ko.observable(null);
|
||||||
|
|
||||||
|
this.selectedItemUseCallback = true;
|
||||||
|
|
||||||
|
this.iSelectNextHelper = 0;
|
||||||
|
this.iFocusedNextHelper = 0;
|
||||||
|
this.oContentScrollable;
|
||||||
|
|
||||||
|
this.sItemSelector = sItemSelector;
|
||||||
|
this.sItemCheckedSelector = sItemCheckedSelector;
|
||||||
|
this.sItemFocusedSelector = sItemFocusedSelector;
|
||||||
|
|
||||||
|
this.sLastUid = '';
|
||||||
|
this.oCallbacks = {};
|
||||||
|
|
||||||
const itemSelectedThrottle = (item => this.itemSelected(item)).debounce(300);
|
const itemSelectedThrottle = (item => this.itemSelected(item)).debounce(300);
|
||||||
|
|
||||||
this.listChecked.subscribe((items) => {
|
this.listChecked.subscribe((items) => {
|
||||||
|
|
@ -81,11 +70,6 @@ export class Selector {
|
||||||
this.selectedItem = this.selectedItem.extend({ toggleSubscribeProperty: [this, 'selected'] });
|
this.selectedItem = this.selectedItem.extend({ toggleSubscribeProperty: [this, 'selected'] });
|
||||||
this.focusedItem = this.focusedItem.extend({ toggleSubscribeProperty: [null, 'focused'] });
|
this.focusedItem = this.focusedItem.extend({ toggleSubscribeProperty: [null, 'focused'] });
|
||||||
|
|
||||||
this.sItemSelector = sItemSelector;
|
|
||||||
this.sItemSelectedSelector = sItemSelectedSelector;
|
|
||||||
this.sItemCheckedSelector = sItemCheckedSelector;
|
|
||||||
this.sItemFocusedSelector = sItemFocusedSelector;
|
|
||||||
|
|
||||||
this.focusedItem.subscribe(item => item && (this.sLastUid = this.getItemUid(item)), this);
|
this.focusedItem.subscribe(item => item && (this.sLastUid = this.getItemUid(item)), this);
|
||||||
|
|
||||||
let aCache = [],
|
let aCache = [],
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
export class AbstractComponent {
|
export class AbstractComponent {
|
||||||
disposable = [];
|
constructor() {
|
||||||
|
this.disposable = [];
|
||||||
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
this.disposable.forEach((funcToDispose) => {
|
this.disposable.forEach((funcToDispose) => {
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,13 @@ function typeCast(curValue, newValue) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AbstractModel {
|
export class AbstractModel {
|
||||||
subscribables = [];
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
/*
|
/*
|
||||||
if (new.target === AbstractModel) {
|
if (new.target === AbstractModel) {
|
||||||
throw new Error("Can't instantiate AbstractModel!");
|
throw new Error("Can't instantiate AbstractModel!");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
this.subscribables = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
addObservables(observables) {
|
addObservables(observables) {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
export class AbstractScreen {
|
export class AbstractScreen {
|
||||||
oCross = null;
|
|
||||||
sScreenName;
|
|
||||||
aViewModels;
|
|
||||||
|
|
||||||
constructor(screenName, viewModels = []) {
|
constructor(screenName, viewModels = []) {
|
||||||
|
this.oCross = null;
|
||||||
this.sScreenName = screenName;
|
this.sScreenName = screenName;
|
||||||
this.aViewModels = Array.isArray(viewModels) ? viewModels : [];
|
this.aViewModels = Array.isArray(viewModels) ? viewModels : [];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -261,11 +261,6 @@ class Tokenizer
|
||||||
}
|
}
|
||||||
|
|
||||||
class EmailModel extends AbstractModel {
|
class EmailModel extends AbstractModel {
|
||||||
email = '';
|
|
||||||
name = '';
|
|
||||||
dkimStatus = '';
|
|
||||||
dkimValue = '';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string=} email = ''
|
* @param {string=} email = ''
|
||||||
* @param {string=} name = ''
|
* @param {string=} name = ''
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ class ContactsPopupView extends AbstractViewPopup {
|
||||||
this.currentContact,
|
this.currentContact,
|
||||||
null,
|
null,
|
||||||
'.e-contact-item .actionHandle',
|
'.e-contact-item .actionHandle',
|
||||||
'.e-contact-item.selected',
|
|
||||||
'.e-contact-item .checkboxItem',
|
'.e-contact-item .checkboxItem',
|
||||||
'.e-contact-item.focused'
|
'.e-contact-item.focused'
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,6 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
||||||
this.selectorMessageSelected,
|
this.selectorMessageSelected,
|
||||||
this.selectorMessageFocused,
|
this.selectorMessageFocused,
|
||||||
'.messageListItem .actionHandle',
|
'.messageListItem .actionHandle',
|
||||||
'.messageListItem.selected',
|
|
||||||
'.messageListItem .checkboxMessage',
|
'.messageListItem .checkboxMessage',
|
||||||
'.messageListItem.focused'
|
'.messageListItem.focused'
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue