mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
isArray to native Array.isArray
isUnd(*) to native undefined === *
isFunc to native typeof * === 'function'
isObject to native typeof * === 'object'
microtime() to native Date().getTime();
noop to native ()=>{}
noopFalse to native ()=>false
noopTrue to native ()=>true
boolToAjax to native *?'1':'0'
Underscore.js to native
This commit is contained in:
parent
fa39c7ecba
commit
ea48f5060b
72 changed files with 551 additions and 775 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { settingsSaveHelperSimpleFunction, defautOptionsAfterRender, trim, boolToAjax } from 'Common/Utils';
|
||||
import { settingsSaveHelperSimpleFunction, defautOptionsAfterRender, trim } from 'Common/Utils';
|
||||
|
||||
import { SaveSettingsStep, StorageResultType, Magics } from 'Common/Enums';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
|
@ -151,13 +151,13 @@ class ContactsAdminSettings {
|
|||
|
||||
this.enableContacts.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'ContactsEnable': boolToAjax(value)
|
||||
'ContactsEnable': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.contactsSync.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'ContactsSync': boolToAjax(value)
|
||||
'ContactsSync': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import ko from 'ko';
|
|||
import {
|
||||
trim,
|
||||
pInt,
|
||||
boolToAjax,
|
||||
settingsSaveHelperSimpleFunction,
|
||||
changeTheme,
|
||||
convertThemeName,
|
||||
|
|
@ -116,49 +115,49 @@ class GeneralAdminSettings {
|
|||
|
||||
this.capaAdditionalAccounts.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaAdditionalAccounts': boolToAjax(value)
|
||||
'CapaAdditionalAccounts': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaIdentities.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaIdentities': boolToAjax(value)
|
||||
'CapaIdentities': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaTemplates.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaTemplates': boolToAjax(value)
|
||||
'CapaTemplates': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaAttachmentThumbnails.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaAttachmentThumbnails': boolToAjax(value)
|
||||
'CapaAttachmentThumbnails': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaThemes.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaThemes': boolToAjax(value)
|
||||
'CapaThemes': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaUserBackground.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaUserBackground': boolToAjax(value)
|
||||
'CapaUserBackground': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.allowLanguagesOnSettings.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'AllowLanguagesOnSettings': boolToAjax(value)
|
||||
'AllowLanguagesOnSettings': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.newMoveToFolder.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'NewMoveToFolder': boolToAjax(value)
|
||||
'NewMoveToFolder': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
}, Magics.Time50ms);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { settingsSaveHelperSimpleFunction, boolToAjax, trim } from 'Common/Utils';
|
||||
import { settingsSaveHelperSimpleFunction, trim } from 'Common/Utils';
|
||||
import { settingsGet } from 'Storage/Settings';
|
||||
|
||||
import AppStore from 'Stores/Admin/App';
|
||||
|
|
@ -24,19 +24,19 @@ class LoginAdminSettings {
|
|||
|
||||
this.determineUserLanguage.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'DetermineUserLanguage': boolToAjax(value)
|
||||
'DetermineUserLanguage': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.determineUserDomain.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'DetermineUserDomain': boolToAjax(value)
|
||||
'DetermineUserDomain': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.allowLanguagesOnLogin.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'AllowLanguagesOnLogin': boolToAjax(value)
|
||||
'AllowLanguagesOnLogin': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import ko from 'ko';
|
|||
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
import { boolToAjax } from 'Common/Utils';
|
||||
|
||||
import { settingsGet } from 'Storage/Settings';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
|
@ -59,7 +58,7 @@ class PluginsAdminSettings {
|
|||
|
||||
this.enabledPlugins.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'EnabledPlugins': boolToAjax(value)
|
||||
'EnabledPlugins': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { trim, boolToAjax } from 'Common/Utils';
|
||||
import { trim } from 'Common/Utils';
|
||||
import { StorageResultType, Magics } from 'Common/Enums';
|
||||
|
||||
import { settingsGet } from 'Storage/Settings';
|
||||
|
|
@ -126,37 +126,37 @@ class SecurityAdminSettings {
|
|||
onBuild() {
|
||||
this.capaOpenPGP.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaOpenPGP': boolToAjax(value)
|
||||
'CapaOpenPGP': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaTwoFactorAuth.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaTwoFactorAuth': boolToAjax(value)
|
||||
'CapaTwoFactorAuth': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaTwoFactorAuthForce.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaTwoFactorAuthForce': boolToAjax(value)
|
||||
'CapaTwoFactorAuthForce': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.useLocalProxyForExternalImages.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'UseLocalProxyForExternalImages': boolToAjax(value)
|
||||
'UseLocalProxyForExternalImages': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.verifySslCertificate.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'VerifySslCertificate': boolToAjax(value)
|
||||
'VerifySslCertificate': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.allowSelfSigned.subscribe((value) => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'AllowSelfSigned': boolToAjax(value)
|
||||
'AllowSelfSigned': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue