mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-28 06:46:27 +00:00
prevent creation of _defineProperty() function
This commit is contained in:
@@ -19,20 +19,6 @@ export function encodeHtml(text) {
|
||||
}
|
||||
|
||||
class HtmlEditor {
|
||||
editor;
|
||||
blurTimer = 0;
|
||||
|
||||
__resizable = false;
|
||||
__inited = false;
|
||||
|
||||
onBlur = null;
|
||||
onReady = null;
|
||||
onModeChange = null;
|
||||
|
||||
element;
|
||||
|
||||
resize;
|
||||
|
||||
/**
|
||||
* @param {Object} element
|
||||
* @param {Function=} onBlur
|
||||
@@ -40,6 +26,12 @@ class HtmlEditor {
|
||||
* @param {Function=} onModeChange
|
||||
*/
|
||||
constructor(element, onBlur = null, onReady = null, onModeChange = null) {
|
||||
this.editor;
|
||||
this.blurTimer = 0;
|
||||
|
||||
this.__resizable = false;
|
||||
this.__inited = false;
|
||||
|
||||
this.onBlur = onBlur;
|
||||
this.onReady = onReady;
|
||||
this.onModeChange = onModeChange;
|
||||
|
||||
@@ -1,33 +1,11 @@
|
||||
import ko from 'ko';
|
||||
|
||||
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} koSelectedItem
|
||||
* @param {koProperty} koFocusedItem
|
||||
* @param {string} sItemSelector
|
||||
* @param {string} sItemSelectedSelector
|
||||
* @param {string} sItemCheckedSelector
|
||||
* @param {string} sItemFocusedSelector
|
||||
*/
|
||||
@@ -36,18 +14,29 @@ export class Selector {
|
||||
koSelectedItem,
|
||||
koFocusedItem,
|
||||
sItemSelector,
|
||||
sItemSelectedSelector,
|
||||
sItemCheckedSelector,
|
||||
sItemFocusedSelector
|
||||
) {
|
||||
this.list = koList;
|
||||
|
||||
this.listChecked = ko.computed(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||
this.isListChecked = ko.computed(() => 0 < this.listChecked().length);
|
||||
|
||||
this.focusedItem = koFocusedItem || 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);
|
||||
|
||||
this.listChecked.subscribe((items) => {
|
||||
@@ -81,11 +70,6 @@ export class Selector {
|
||||
this.selectedItem = this.selectedItem.extend({ toggleSubscribeProperty: [this, 'selected'] });
|
||||
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);
|
||||
|
||||
let aCache = [],
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
export class AbstractComponent {
|
||||
disposable = [];
|
||||
constructor() {
|
||||
this.disposable = [];
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.disposable.forEach((funcToDispose) => {
|
||||
|
||||
@@ -23,14 +23,13 @@ function typeCast(curValue, newValue) {
|
||||
}
|
||||
|
||||
export class AbstractModel {
|
||||
subscribables = [];
|
||||
|
||||
constructor() {
|
||||
/*
|
||||
if (new.target === AbstractModel) {
|
||||
throw new Error("Can't instantiate AbstractModel!");
|
||||
}
|
||||
*/
|
||||
this.subscribables = [];
|
||||
}
|
||||
|
||||
addObservables(observables) {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
export class AbstractScreen {
|
||||
oCross = null;
|
||||
sScreenName;
|
||||
aViewModels;
|
||||
|
||||
constructor(screenName, viewModels = []) {
|
||||
this.oCross = null;
|
||||
this.sScreenName = screenName;
|
||||
this.aViewModels = Array.isArray(viewModels) ? viewModels : [];
|
||||
}
|
||||
|
||||
@@ -261,11 +261,6 @@ class Tokenizer
|
||||
}
|
||||
|
||||
class EmailModel extends AbstractModel {
|
||||
email = '';
|
||||
name = '';
|
||||
dkimStatus = '';
|
||||
dkimValue = '';
|
||||
|
||||
/**
|
||||
* @param {string=} email = ''
|
||||
* @param {string=} name = ''
|
||||
|
||||
@@ -76,7 +76,6 @@ class ContactsPopupView extends AbstractViewPopup {
|
||||
this.currentContact,
|
||||
null,
|
||||
'.e-contact-item .actionHandle',
|
||||
'.e-contact-item.selected',
|
||||
'.e-contact-item .checkboxItem',
|
||||
'.e-contact-item.focused'
|
||||
);
|
||||
|
||||
@@ -186,7 +186,6 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
||||
this.selectorMessageSelected,
|
||||
this.selectorMessageFocused,
|
||||
'.messageListItem .actionHandle',
|
||||
'.messageListItem.selected',
|
||||
'.messageListItem .checkboxMessage',
|
||||
'.messageListItem.focused'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user