mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Improved boot.js with existing global window.rl
Put dev/Storage/Settings.js in boots.js global rl.settings
This commit is contained in:
parent
f90dbcc84b
commit
aeb5275648
57 changed files with 284 additions and 380 deletions
|
|
@ -14,7 +14,6 @@ module.exports = {
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
// RainLoop
|
// RainLoop
|
||||||
'RainLoop': "readonly",
|
|
||||||
'rainloopI18N': "readonly",
|
'rainloopI18N': "readonly",
|
||||||
'rainloopTEMPLATES': "readonly",
|
'rainloopTEMPLATES': "readonly",
|
||||||
'rl': "readonly",
|
'rl': "readonly",
|
||||||
|
|
|
||||||
22
README.md
22
README.md
|
|
@ -86,23 +86,23 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|
||||||
|
|
||||||
|js/* |1.14.0 |native |
|
|js/* |1.14.0 |native |
|
||||||
|----------- |--------: |--------: |
|
|----------- |--------: |--------: |
|
||||||
|admin.js |2.130.942 | 958.397 |
|
|admin.js |2.130.942 | 942.565 |
|
||||||
|app.js |4.184.455 |2.586.232 |
|
|app.js |4.184.455 |2.563.204 |
|
||||||
|boot.js | 671.522 | 6.782 |
|
|boot.js | 671.522 | 7.265 |
|
||||||
|libs.js | 647.614 | 312.269 |
|
|libs.js | 647.614 | 312.269 |
|
||||||
|polyfills.js | 325.834 | 0 |
|
|polyfills.js | 325.834 | 0 |
|
||||||
|TOTAL |7.960.367 |3.863.680 |
|
|TOTAL |7.960.367 |3.825.303 |
|
||||||
|
|
||||||
|js/min/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
|js/min/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
||||||
|--------------- |--------: |--------: |--------: |--------: |--------: |
|
|--------------- |--------: |--------: |--------: |--------: |--------: |
|
||||||
|admin.min.js | 252.147 | 130.128 | 73.657 | 37.783 | 32.395 |
|
|admin.min.js | 252.147 | 129.058 | 73.657 | 37.631 | 32.250 |
|
||||||
|app.min.js | 511.202 | 350.575 |140.462 | 92.070 | 73.949 |
|
|app.min.js | 511.202 | 350.074 |140.462 | 91.841 | 73.757 |
|
||||||
|boot.min.js | 66.007 | 4.081 | 22.567 | 1.837 | 1.538 |
|
|boot.min.js | 66.007 | 4.274 | 22.567 | 1.934 | 1.635 |
|
||||||
|libs.min.js | 572.545 | 295.776 |176.720 | 91.524 | 80.746 |
|
|libs.min.js | 572.545 | 295.776 |176.720 | 91.524 | 80.746 |
|
||||||
|polyfills.min.js | 32.452 | 0 | 11.312 | 0 | 0 |
|
|polyfills.min.js | 32.452 | 0 | 11.312 | 0 | 0 |
|
||||||
|TOTAL |1.434.353 | 780.560 |424.718 |223.214 |188.628 |
|
|TOTAL |1.434.353 | 779.182 |424.718 |222.930 |188.388 |
|
||||||
|
|
||||||
653.793 bytes (201.504 gzip) is not much, but it feels faster.
|
655.171 bytes (201.788 gzip) is not much, but it feels faster.
|
||||||
|
|
||||||
### CSS changes
|
### CSS changes
|
||||||
|
|
||||||
|
|
@ -127,8 +127,8 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|
||||||
|
|
||||||
|css/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
|css/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
||||||
|-------------- |-------: |-------: |------: |------: |------: |
|
|-------------- |-------: |-------: |------: |------: |------: |
|
||||||
|app.css | 340.334 | 255.627 | 46,959 | 36.929 | 31.015 |
|
|app.css | 340.334 | 255.729 | 46,959 | 36.948 | 31.049 |
|
||||||
|app.min.css | 274.791 | 208.711 | 39,618 | 32.226 | 27.364 |
|
|app.min.css | 274.791 | 208.793 | 39,618 | 32.238 | 27.339 |
|
||||||
|
|
||||||
|
|
||||||
### PHP73 branch
|
### PHP73 branch
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,8 @@ import {
|
||||||
} from 'Common/Globals';
|
} from 'Common/Globals';
|
||||||
|
|
||||||
import { KeyState } from 'Common/Enums';
|
import { KeyState } from 'Common/Enums';
|
||||||
import { root, rootAdmin, rootUser, populateAuthSuffix } from 'Common/Links';
|
import { root, rootAdmin, rootUser } from 'Common/Links';
|
||||||
import { initOnStartOrLangChange, initNotificationLanguage } from 'Common/Translator';
|
import { initOnStartOrLangChange, initNotificationLanguage } from 'Common/Translator';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import LanguageStore from 'Stores/Language';
|
import LanguageStore from 'Stores/Language';
|
||||||
import ThemeStore from 'Stores/Theme';
|
import ThemeStore from 'Stores/Theme';
|
||||||
|
|
@ -18,6 +17,8 @@ import ThemeStore from 'Stores/Theme';
|
||||||
import { routeOff, setHash } from 'Knoin/Knoin';
|
import { routeOff, setHash } from 'Knoin/Knoin';
|
||||||
import { AbstractBoot } from 'Knoin/AbstractBoot';
|
import { AbstractBoot } from 'Knoin/AbstractBoot';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
class AbstractApp extends AbstractBoot {
|
class AbstractApp extends AbstractBoot {
|
||||||
/**
|
/**
|
||||||
* @param {RemoteStorage|AdminRemoteStorage} Remote
|
* @param {RemoteStorage|AdminRemoteStorage} Remote
|
||||||
|
|
@ -57,10 +58,6 @@ class AbstractApp extends AbstractBoot {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getApplicationConfiguration(name, default_) {
|
|
||||||
return this.applicationConfiguration[name] || default_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} link
|
* @param {string} link
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
|
|
@ -79,40 +76,16 @@ class AbstractApp extends AbstractBoot {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} title
|
|
||||||
*/
|
|
||||||
setWindowTitle(title) {
|
|
||||||
title = null == title ? '' : '' + title;
|
|
||||||
if (Settings.settingsGet('Title')) {
|
|
||||||
title += (title ? ' - ' : '') + Settings.settingsGet('Title');
|
|
||||||
}
|
|
||||||
|
|
||||||
document.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
redirectToAdminPanel() {
|
redirectToAdminPanel() {
|
||||||
setTimeout(() => {
|
setTimeout(() => location.href = rootAdmin(), 100);
|
||||||
location.href = rootAdmin();
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
clearClientSideToken() {
|
|
||||||
if (RainLoop.hash.clear) {
|
|
||||||
RainLoop.hash.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} token
|
* @param {string} token
|
||||||
*/
|
*/
|
||||||
setClientSideToken(token) {
|
setClientSideToken(token) {
|
||||||
if (RainLoop.hash.set) {
|
rl.hash.set();
|
||||||
RainLoop.hash.set(token);
|
Settings.set('AuthAccountHash', token);
|
||||||
|
|
||||||
Settings.settingsSet('AuthAccountHash', token);
|
|
||||||
populateAuthSuffix();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -121,11 +94,11 @@ class AbstractApp extends AbstractBoot {
|
||||||
* @param {boolean=} close = false
|
* @param {boolean=} close = false
|
||||||
*/
|
*/
|
||||||
loginAndLogoutReload(admin = false, logout = false, close = false) {
|
loginAndLogoutReload(admin = false, logout = false, close = false) {
|
||||||
const inIframe = !!Settings.appSettingsGet('inIframe'),
|
const inIframe = !!Settings.app('inIframe'),
|
||||||
logoutLink = admin ? rootAdmin() : rootUser();
|
logoutLink = admin ? rootAdmin() : rootUser();
|
||||||
|
|
||||||
if (logout) {
|
if (logout) {
|
||||||
this.clearClientSideToken();
|
rl.hash.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logout && close && window.close) {
|
if (logout && close && window.close) {
|
||||||
|
|
@ -155,19 +128,15 @@ class AbstractApp extends AbstractBoot {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
historyBack() {
|
|
||||||
history.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstart() {
|
bootstart() {
|
||||||
const mobile = Settings.appSettingsGet('mobile');
|
const mobile = Settings.app('mobile');
|
||||||
|
|
||||||
ko.components.register('SaveTrigger', require('Component/SaveTrigger').default);
|
ko.components.register('SaveTrigger', require('Component/SaveTrigger').default);
|
||||||
ko.components.register('Input', require('Component/Input').default);
|
ko.components.register('Input', require('Component/Input').default);
|
||||||
ko.components.register('Select', require('Component/Select').default);
|
ko.components.register('Select', require('Component/Select').default);
|
||||||
ko.components.register('TextArea', require('Component/TextArea').default);
|
ko.components.register('TextArea', require('Component/TextArea').default);
|
||||||
|
|
||||||
if (Settings.appSettingsGet('materialDesign') && !bMobileDevice) {
|
if (Settings.app('materialDesign') && !bMobileDevice) {
|
||||||
ko.components.register('Checkbox', require('Component/MaterialDesign/Checkbox').default);
|
ko.components.register('Checkbox', require('Component/MaterialDesign/Checkbox').default);
|
||||||
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ import ko from 'ko';
|
||||||
import { root } from 'Common/Links';
|
import { root } from 'Common/Links';
|
||||||
import { StorageResultType } from 'Common/Enums';
|
import { StorageResultType } from 'Common/Enums';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import AppStore from 'Stores/Admin/App';
|
import AppStore from 'Stores/Admin/App';
|
||||||
import CapaStore from 'Stores/Admin/Capa';
|
import CapaStore from 'Stores/Admin/Capa';
|
||||||
import DomainStore from 'Stores/Admin/Domain';
|
import DomainStore from 'Stores/Admin/Domain';
|
||||||
|
|
@ -113,7 +111,7 @@ class AdminApp extends AbstractApp {
|
||||||
|
|
||||||
hideLoading();
|
hideLoading();
|
||||||
|
|
||||||
if (!Settings.appSettingsGet('allowAdminPanel')) {
|
if (!rl.settings.app('allowAdminPanel')) {
|
||||||
routeOff();
|
routeOff();
|
||||||
setHash(root(), true);
|
setHash(root(), true);
|
||||||
routeOff();
|
routeOff();
|
||||||
|
|
@ -122,7 +120,7 @@ class AdminApp extends AbstractApp {
|
||||||
location.href = '/'
|
location.href = '/'
|
||||||
, 1);
|
, 1);
|
||||||
} else {
|
} else {
|
||||||
if (Settings.settingsGet('Auth')) {
|
if (rl.settings.get('Auth')) {
|
||||||
startScreens([SettingsAdminScreen]);
|
startScreens([SettingsAdminScreen]);
|
||||||
} else {
|
} else {
|
||||||
startScreens([LoginAdminScreen]);
|
startScreens([LoginAdminScreen]);
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ import MessageStore from 'Stores/User/Message';
|
||||||
import QuotaStore from 'Stores/User/Quota';
|
import QuotaStore from 'Stores/User/Quota';
|
||||||
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
import Promises from 'Promises/User/Ajax';
|
import Promises from 'Promises/User/Ajax';
|
||||||
|
|
@ -75,7 +74,7 @@ import { hideLoading, routeOff, routeOn, setHash, startScreens, showScreenPopup
|
||||||
|
|
||||||
import { AbstractApp } from 'App/Abstract';
|
import { AbstractApp } from 'App/Abstract';
|
||||||
|
|
||||||
const doc = document;
|
const doc = document, Settings = rl.settings;
|
||||||
|
|
||||||
class AppUser extends AbstractApp {
|
class AppUser extends AbstractApp {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -94,25 +93,25 @@ class AppUser extends AbstractApp {
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const currentTime = (new Date()).getTime();
|
const currentTime = (new Date()).getTime();
|
||||||
if (currentTime > (lastTime + interval + 1000)) {
|
if (currentTime > (lastTime + interval + 1000)) {
|
||||||
if (RainLoop.hash.check()) {
|
if (rl.hash.check()) {
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
Remote.jsVersion((sResult, oData) => {
|
Remote.jsVersion((sResult, oData) => {
|
||||||
if (StorageResultType.Success === sResult && oData && !oData.Result) {
|
if (StorageResultType.Success === sResult && oData && !oData.Result) {
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
}, Settings.appSettingsGet('version'));
|
}, Settings.app('version'));
|
||||||
}
|
}
|
||||||
lastTime = currentTime;
|
lastTime = currentTime;
|
||||||
}, interval);
|
}, interval);
|
||||||
|
|
||||||
if (RainLoop.hash.check()) {
|
if (rl.hash.check()) {
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.settingsGet('UserBackgroundHash')) {
|
if (Settings.get('UserBackgroundHash')) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const img = userBackground(Settings.settingsGet('UserBackgroundHash'));
|
const img = userBackground(Settings.get('UserBackgroundHash'));
|
||||||
if (img) {
|
if (img) {
|
||||||
$htmlCL.add('UserBackground');
|
$htmlCL.add('UserBackground');
|
||||||
doc.body.style.backgroundImage = "url("+img+")";
|
doc.body.style.backgroundImage = "url("+img+")";
|
||||||
|
|
@ -126,7 +125,7 @@ class AppUser extends AbstractApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
if (parent && !!Settings.appSettingsGet('inIframe')) {
|
if (parent && !!Settings.app('inIframe')) {
|
||||||
parent.location.reload();
|
parent.location.reload();
|
||||||
} else {
|
} else {
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
@ -489,7 +488,7 @@ class AppUser extends AbstractApp {
|
||||||
if (StorageResultType.Success === sResult && oData.Result) {
|
if (StorageResultType.Success === sResult && oData.Result) {
|
||||||
const counts = {},
|
const counts = {},
|
||||||
sAccountEmail = AccountStore.email();
|
sAccountEmail = AccountStore.email();
|
||||||
let parentEmail = Settings.settingsGet('ParentEmail') || sAccountEmail;
|
let parentEmail = Settings.get('ParentEmail') || sAccountEmail;
|
||||||
|
|
||||||
if (Array.isArray(oData.Result.Accounts)) {
|
if (Array.isArray(oData.Result.Accounts)) {
|
||||||
AccountStore.accounts().forEach(oAccount => {
|
AccountStore.accounts().forEach(oAccount => {
|
||||||
|
|
@ -901,7 +900,7 @@ class AppUser extends AbstractApp {
|
||||||
this.loginAndLogoutReload(
|
this.loginAndLogoutReload(
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
0 < (Settings.settingsGet('ParentEmail')||{length:0}).length
|
0 < (Settings.get('ParentEmail')||{length:0}).length
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -932,27 +931,27 @@ class AppUser extends AbstractApp {
|
||||||
AccountStore.populate();
|
AccountStore.populate();
|
||||||
ContactStore.populate();
|
ContactStore.populate();
|
||||||
|
|
||||||
let contactsSyncInterval = pInt(Settings.settingsGet('ContactsSyncInterval'));
|
let contactsSyncInterval = pInt(Settings.get('ContactsSyncInterval'));
|
||||||
|
|
||||||
const startupUrl = pString(Settings.settingsGet('StartupUrl'));
|
const startupUrl = pString(Settings.get('StartupUrl'));
|
||||||
|
|
||||||
if (window.progressJs) {
|
if (window.progressJs) {
|
||||||
progressJs.set(90);
|
progressJs.set(90);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setWindowTitle('');
|
rl.setWindowTitle();
|
||||||
if (Settings.settingsGet('Auth')) {
|
if (Settings.get('Auth')) {
|
||||||
$htmlCL.add('rl-user-auth');
|
$htmlCL.add('rl-user-auth');
|
||||||
|
|
||||||
if (
|
if (
|
||||||
Settings.capa(Capa.TwoFactor) &&
|
Settings.capa(Capa.TwoFactor) &&
|
||||||
Settings.capa(Capa.TwoFactorForce) &&
|
Settings.capa(Capa.TwoFactorForce) &&
|
||||||
Settings.settingsGet('RequireTwoFactor')
|
Settings.get('RequireTwoFactor')
|
||||||
) {
|
) {
|
||||||
this.bootend();
|
this.bootend();
|
||||||
this.bootstartTwoFactorScreen();
|
this.bootstartTwoFactorScreen();
|
||||||
} else {
|
} else {
|
||||||
this.setWindowTitle(i18n('TITLES/LOADING'));
|
rl.setWindowTitle(i18n('TITLES/LOADING'));
|
||||||
|
|
||||||
// require.ensure([], function() { // require code splitting
|
// require.ensure([], function() { // require code splitting
|
||||||
|
|
||||||
|
|
@ -1041,7 +1040,7 @@ class AppUser extends AbstractApp {
|
||||||
addEventListener('rl.auto-logout', () => this.logout());
|
addEventListener('rl.auto-logout', () => this.logout());
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!!Settings.settingsGet('AccountSignMe') &&
|
!!Settings.get('AccountSignMe') &&
|
||||||
navigator.registerProtocolHandler &&
|
navigator.registerProtocolHandler &&
|
||||||
Settings.capa(Capa.Composer)
|
Settings.capa(Capa.Composer)
|
||||||
) {
|
) {
|
||||||
|
|
@ -1050,12 +1049,12 @@ class AppUser extends AbstractApp {
|
||||||
navigator.registerProtocolHandler(
|
navigator.registerProtocolHandler(
|
||||||
'mailto',
|
'mailto',
|
||||||
location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s',
|
location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s',
|
||||||
'' + (Settings.settingsGet('Title') || 'RainLoop')
|
'' + (Settings.get('Title') || 'RainLoop')
|
||||||
);
|
);
|
||||||
} catch (e) {} // eslint-disable-line no-empty
|
} catch (e) {} // eslint-disable-line no-empty
|
||||||
|
|
||||||
if (Settings.settingsGet('MailToEmail')) {
|
if (Settings.get('MailToEmail')) {
|
||||||
mailToHelper(Settings.settingsGet('MailToEmail'), require('View/Popup/Compose'));
|
mailToHelper(Settings.get('MailToEmail'), require('View/Popup/Compose'));
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { EventKeyCode } from 'Common/Enums';
|
import { EventKeyCode } from 'Common/Enums';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
|
|
@ -269,9 +268,9 @@ class HtmlEditor {
|
||||||
if (this.element && !this.editor) {
|
if (this.element && !this.editor) {
|
||||||
const initFunc = () => {
|
const initFunc = () => {
|
||||||
const config = htmlEditorDefaultConfig,
|
const config = htmlEditorDefaultConfig,
|
||||||
language = Settings.settingsGet('Language'),
|
language = rl.settings.get('Language'),
|
||||||
allowSource = !!Settings.appSettingsGet('allowHtmlEditorSourceButton'),
|
allowSource = !!rl.settings.app('allowHtmlEditorSourceButton'),
|
||||||
biti = !!Settings.appSettingsGet('allowHtmlEditorBitiButtons');
|
biti = !!rl.settings.app('allowHtmlEditorBitiButtons');
|
||||||
|
|
||||||
if ((allowSource || !biti) && !config.toolbarGroups.__cfgInited) {
|
if ((allowSource || !biti) && !config.toolbarGroups.__cfgInited) {
|
||||||
config.toolbarGroups.__cfgInited = true;
|
config.toolbarGroups.__cfgInited = true;
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,19 @@
|
||||||
import { pString, pInt } from 'Common/Utils';
|
import { pString, pInt } from 'Common/Utils';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
const ROOT = './',
|
const
|
||||||
|
Settings = rl.settings,
|
||||||
|
ROOT = './',
|
||||||
HASH_PREFIX = '#/',
|
HASH_PREFIX = '#/',
|
||||||
SERVER_PREFIX = './?',
|
SERVER_PREFIX = './?',
|
||||||
SUB_QUERY_PREFIX = '&q[]=',
|
SUB_QUERY_PREFIX = '&q[]=',
|
||||||
VERSION = Settings.appSettingsGet('version'),
|
VERSION = Settings.app('version'),
|
||||||
WEB_PREFIX = Settings.appSettingsGet('webPath') || '',
|
WEB_PREFIX = Settings.app('webPath') || '',
|
||||||
VERSION_PREFIX = Settings.appSettingsGet('webVersionPath') || 'rainloop/v/' + VERSION + '/',
|
VERSION_PREFIX = Settings.app('webVersionPath') || 'rainloop/v/' + VERSION + '/',
|
||||||
STATIC_PREFIX = VERSION_PREFIX + 'static/',
|
STATIC_PREFIX = VERSION_PREFIX + 'static/',
|
||||||
ADMIN_HOST_USE = !!Settings.appSettingsGet('adminHostUse'),
|
ADMIN_HOST_USE = !!Settings.app('adminHostUse'),
|
||||||
ADMIN_PATH = Settings.appSettingsGet('adminPath') || 'admin';
|
ADMIN_PATH = Settings.app('adminPath') || 'admin',
|
||||||
|
|
||||||
let AUTH_PREFIX = Settings.settingsGet('AuthAccountHash') || '0';
|
getHash = () => Settings.get('AuthAccountHash') || '0';
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
export function populateAuthSuffix() {
|
|
||||||
AUTH_PREFIX = Settings.settingsGet('AuthAccountHash') || '0';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
|
@ -57,7 +51,7 @@ export function rootUser() {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function attachmentRaw(type, download, customSpecSuffix) {
|
export function attachmentRaw(type, download, customSpecSuffix) {
|
||||||
customSpecSuffix = undefined === customSpecSuffix ? AUTH_PREFIX : customSpecSuffix;
|
customSpecSuffix = undefined === customSpecSuffix ? getHash() : customSpecSuffix;
|
||||||
return (
|
return (
|
||||||
SERVER_PREFIX +
|
SERVER_PREFIX +
|
||||||
'/Raw/' +
|
'/Raw/' +
|
||||||
|
|
@ -123,7 +117,7 @@ export function attachmentFramed(download, customSpecSuffix) {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function serverRequest(type) {
|
export function serverRequest(type) {
|
||||||
return SERVER_PREFIX + '/' + type + '/' + SUB_QUERY_PREFIX + '/' + AUTH_PREFIX + '/';
|
return SERVER_PREFIX + '/' + type + '/' + SUB_QUERY_PREFIX + '/' + getHash() + '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -180,7 +174,7 @@ export function messageViewLink(requestHash) {
|
||||||
'/Raw/' +
|
'/Raw/' +
|
||||||
SUB_QUERY_PREFIX +
|
SUB_QUERY_PREFIX +
|
||||||
'/' +
|
'/' +
|
||||||
AUTH_PREFIX +
|
getHash() +
|
||||||
'/ViewAsPlain/' +
|
'/ViewAsPlain/' +
|
||||||
SUB_QUERY_PREFIX +
|
SUB_QUERY_PREFIX +
|
||||||
'/' +
|
'/' +
|
||||||
|
|
@ -194,7 +188,7 @@ export function messageViewLink(requestHash) {
|
||||||
*/
|
*/
|
||||||
export function messageDownloadLink(requestHash) {
|
export function messageDownloadLink(requestHash) {
|
||||||
return (
|
return (
|
||||||
SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + AUTH_PREFIX + '/Download/' + SUB_QUERY_PREFIX + '/' + requestHash
|
SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + getHash() + '/Download/' + SUB_QUERY_PREFIX + '/' + requestHash
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -220,7 +214,7 @@ export function publicLink(hash) {
|
||||||
*/
|
*/
|
||||||
export function userBackground(hash) {
|
export function userBackground(hash) {
|
||||||
return (
|
return (
|
||||||
SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + AUTH_PREFIX + '/UserBackground/' + SUB_QUERY_PREFIX + '/' + hash
|
SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + getHash() + '/UserBackground/' + SUB_QUERY_PREFIX + '/' + hash
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -237,14 +231,14 @@ export function langLink(lang, isAdmin) {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function exportContactsVcf() {
|
export function exportContactsVcf() {
|
||||||
return SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + AUTH_PREFIX + '/ContactsVcf/';
|
return SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + getHash() + '/ContactsVcf/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function exportContactsCsv() {
|
export function exportContactsCsv() {
|
||||||
return SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + AUTH_PREFIX + '/ContactsCsv/';
|
return SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + getHash() + '/ContactsCsv/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { data as GlobalsData } from 'Common/Globals';
|
import { data as GlobalsData } from 'Common/Globals';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
const USER_VIEW_MODELS_HOOKS = [],
|
const USER_VIEW_MODELS_HOOKS = [],
|
||||||
ADMIN_VIEW_MODELS_HOOKS = [];
|
ADMIN_VIEW_MODELS_HOOKS = [];
|
||||||
|
|
@ -9,7 +8,7 @@ const USER_VIEW_MODELS_HOOKS = [],
|
||||||
* @returns {?}
|
* @returns {?}
|
||||||
*/
|
*/
|
||||||
export function mainSettingsGet(name) {
|
export function mainSettingsGet(name) {
|
||||||
return Settings.settingsGet(name);
|
return rl.settings.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -60,7 +59,7 @@ export function runSettingsViewModelHooks(admin) {
|
||||||
* @returns {?}
|
* @returns {?}
|
||||||
*/
|
*/
|
||||||
export function settingsGet(pluginSection, name) {
|
export function settingsGet(pluginSection, name) {
|
||||||
let plugins = Settings.settingsGet('Plugins');
|
let plugins = rl.settings.get('Plugins');
|
||||||
plugins = plugins && null != plugins[pluginSection] ? plugins[pluginSection] : null;
|
plugins = plugins && null != plugins[pluginSection] ? plugins[pluginSection] : null;
|
||||||
return plugins ? (null == plugins[name] ? null : plugins[name]) : null;
|
return plugins ? (null == plugins[name] ? null : plugins[name]) : null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { pInt, pString } from 'Common/Utils';
|
||||||
import { DEFAULT_AJAX_TIMEOUT, TOKEN_ERROR_LIMIT, AJAX_ERROR_LIMIT } from 'Common/Consts';
|
import { DEFAULT_AJAX_TIMEOUT, TOKEN_ERROR_LIMIT, AJAX_ERROR_LIMIT } from 'Common/Consts';
|
||||||
import { Notification } from 'Common/Enums';
|
import { Notification } from 'Common/Enums';
|
||||||
import { data as GlobalsData } from 'Common/Globals';
|
import { data as GlobalsData } from 'Common/Globals';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { AbstractBasicPromises } from 'Promises/AbstractBasic';
|
import { AbstractBasicPromises } from 'Promises/AbstractBasic';
|
||||||
|
|
||||||
|
|
@ -51,7 +50,7 @@ class AbstractAjaxPromises extends AbstractBasicPromises {
|
||||||
// 'Content-Type': 'application/json'
|
// 'Content-Type': 'application/json'
|
||||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||||
};
|
};
|
||||||
params.XToken = Settings.appSettingsGet('token');
|
params.XToken = rl.settings.app('token');
|
||||||
// init.body = JSON.stringify(params);
|
// init.body = JSON.stringify(params);
|
||||||
const formData = new FormData(),
|
const formData = new FormData(),
|
||||||
buildFormData = (formData, data, parentKey) => {
|
buildFormData = (formData, data, parentKey) => {
|
||||||
|
|
@ -86,8 +85,9 @@ class AbstractAjaxPromises extends AbstractBasicPromises {
|
||||||
return Promise.reject(Notification.AjaxParse);
|
return Promise.reject(Notification.AjaxParse);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.UpdateToken && GlobalsData.__APP__ && GlobalsData.__APP__.setClientSideToken) {
|
if (data.UpdateToken) {
|
||||||
GlobalsData.__APP__.setClientSideToken(data.UpdateToken);
|
rl.hash.set();
|
||||||
|
rl.settings.set('AuthAccountHash', data.UpdateToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -136,12 +136,12 @@ class AbstractAjaxPromises extends AbstractBasicPromises {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.ClearAuth || data.Logout || AJAX_ERROR_LIMIT < GlobalsData.iAjaxErrorCount) {
|
if (data.ClearAuth || data.Logout || AJAX_ERROR_LIMIT < GlobalsData.iAjaxErrorCount) {
|
||||||
if (GlobalsData.__APP__ && GlobalsData.__APP__.clearClientSideToken) {
|
if (GlobalsData.__APP__) {
|
||||||
GlobalsData.__APP__.clearClientSideToken();
|
rl.hash.clear();
|
||||||
}
|
|
||||||
|
|
||||||
if (GlobalsData.__APP__ && !data.ClearAuth && GlobalsData.__APP__.loginAndLogoutReload) {
|
if (!data.ClearAuth && GlobalsData.__APP__.loginAndLogoutReload) {
|
||||||
GlobalsData.__APP__.loginAndLogoutReload(false, true);
|
GlobalsData.__APP__.loginAndLogoutReload(false, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { pInt } from 'Common/Utils';
|
||||||
import { ClientSideKeyName, ServerFolderType } from 'Common/Enums';
|
import { ClientSideKeyName, ServerFolderType } from 'Common/Enums';
|
||||||
import * as Cache from 'Common/Cache';
|
import * as Cache from 'Common/Cache';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
|
|
@ -14,6 +13,8 @@ import Remote from 'Remote/User/Ajax';
|
||||||
import { FolderModel } from 'Model/Folder';
|
import { FolderModel } from 'Model/Folder';
|
||||||
import { AbstractBasicPromises } from 'Promises/AbstractBasic';
|
import { AbstractBasicPromises } from 'Promises/AbstractBasic';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
class PromisesUserPopulator extends AbstractBasicPromises {
|
class PromisesUserPopulator extends AbstractBasicPromises {
|
||||||
/**
|
/**
|
||||||
* @param {string} sFullNameHash
|
* @param {string} sFullNameHash
|
||||||
|
|
@ -109,7 +110,7 @@ class PromisesUserPopulator extends AbstractBasicPromises {
|
||||||
const expandedFolders = Local.get(ClientSideKeyName.ExpandedFolders),
|
const expandedFolders = Local.get(ClientSideKeyName.ExpandedFolders),
|
||||||
cnt = pInt(oData.CountRec);
|
cnt = pInt(oData.CountRec);
|
||||||
|
|
||||||
let limit = pInt(Settings.appSettingsGet('folderSpecLimit'));
|
let limit = pInt(Settings.app('folderSpecLimit'));
|
||||||
limit = 100 < limit ? 100 : 10 > limit ? 10 : limit;
|
limit = 100 < limit ? 100 : 10 > limit ? 10 : limit;
|
||||||
|
|
||||||
FolderStore.displaySpecSetting(0 >= cnt || limit < cnt);
|
FolderStore.displaySpecSetting(0 >= cnt || limit < cnt);
|
||||||
|
|
@ -136,7 +137,7 @@ class PromisesUserPopulator extends AbstractBasicPromises {
|
||||||
FolderStore.namespace = oData.Namespace;
|
FolderStore.namespace = oData.Namespace;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppStore.threadsAllowed(!!Settings.appSettingsGet('useImapThread') && oData.IsThreadsSupported && true);
|
AppStore.threadsAllowed(!!Settings.app('useImapThread') && oData.IsThreadsSupported && true);
|
||||||
|
|
||||||
FolderStore.folderList.optimized(!!oData.Optimized);
|
FolderStore.folderList.optimized(!!oData.Optimized);
|
||||||
|
|
||||||
|
|
@ -145,27 +146,27 @@ class PromisesUserPopulator extends AbstractBasicPromises {
|
||||||
if (
|
if (
|
||||||
oData.SystemFolders &&
|
oData.SystemFolders &&
|
||||||
!('' +
|
!('' +
|
||||||
Settings.settingsGet('SentFolder') +
|
Settings.get('SentFolder') +
|
||||||
Settings.settingsGet('DraftFolder') +
|
Settings.get('DraftFolder') +
|
||||||
Settings.settingsGet('SpamFolder') +
|
Settings.get('SpamFolder') +
|
||||||
Settings.settingsGet('TrashFolder') +
|
Settings.get('TrashFolder') +
|
||||||
Settings.settingsGet('ArchiveFolder') +
|
Settings.get('ArchiveFolder') +
|
||||||
Settings.settingsGet('NullFolder'))
|
Settings.get('NullFolder'))
|
||||||
) {
|
) {
|
||||||
Settings.settingsSet('SentFolder', oData.SystemFolders[ServerFolderType.SENT] || null);
|
Settings.set('SentFolder', oData.SystemFolders[ServerFolderType.SENT] || null);
|
||||||
Settings.settingsSet('DraftFolder', oData.SystemFolders[ServerFolderType.DRAFTS] || null);
|
Settings.set('DraftFolder', oData.SystemFolders[ServerFolderType.DRAFTS] || null);
|
||||||
Settings.settingsSet('SpamFolder', oData.SystemFolders[ServerFolderType.JUNK] || null);
|
Settings.set('SpamFolder', oData.SystemFolders[ServerFolderType.JUNK] || null);
|
||||||
Settings.settingsSet('TrashFolder', oData.SystemFolders[ServerFolderType.TRASH] || null);
|
Settings.set('TrashFolder', oData.SystemFolders[ServerFolderType.TRASH] || null);
|
||||||
Settings.settingsSet('ArchiveFolder', oData.SystemFolders[ServerFolderType.ALL] || null);
|
Settings.set('ArchiveFolder', oData.SystemFolders[ServerFolderType.ALL] || null);
|
||||||
|
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FolderStore.sentFolder(this.normalizeFolder(Settings.settingsGet('SentFolder')));
|
FolderStore.sentFolder(this.normalizeFolder(Settings.get('SentFolder')));
|
||||||
FolderStore.draftFolder(this.normalizeFolder(Settings.settingsGet('DraftFolder')));
|
FolderStore.draftFolder(this.normalizeFolder(Settings.get('DraftFolder')));
|
||||||
FolderStore.spamFolder(this.normalizeFolder(Settings.settingsGet('SpamFolder')));
|
FolderStore.spamFolder(this.normalizeFolder(Settings.get('SpamFolder')));
|
||||||
FolderStore.trashFolder(this.normalizeFolder(Settings.settingsGet('TrashFolder')));
|
FolderStore.trashFolder(this.normalizeFolder(Settings.get('TrashFolder')));
|
||||||
FolderStore.archiveFolder(this.normalizeFolder(Settings.settingsGet('ArchiveFolder')));
|
FolderStore.archiveFolder(this.normalizeFolder(Settings.get('ArchiveFolder')));
|
||||||
|
|
||||||
if (update) {
|
if (update) {
|
||||||
Remote.saveSystemFolders(()=>{}, {
|
Remote.saveSystemFolders(()=>{}, {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { pInt, pString } from 'Common/Utils';
|
||||||
import { data as GlobalsData } from 'Common/Globals';
|
import { data as GlobalsData } from 'Common/Globals';
|
||||||
import { ajax } from 'Common/Links';
|
import { ajax } from 'Common/Links';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class AbstractAjaxRemote {
|
class AbstractAjaxRemote {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -67,8 +66,8 @@ class AbstractAjaxRemote {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oData.ClearAuth || oData.Logout || AJAX_ERROR_LIMIT < GlobalsData.iAjaxErrorCount) {
|
if (oData.ClearAuth || oData.Logout || AJAX_ERROR_LIMIT < GlobalsData.iAjaxErrorCount) {
|
||||||
if (GlobalsData.__APP__ && GlobalsData.__APP__.clearClientSideToken) {
|
if (GlobalsData.__APP__) {
|
||||||
GlobalsData.__APP__.clearClientSideToken();
|
rl.hash.clear();
|
||||||
|
|
||||||
if (!oData.ClearAuth && GlobalsData.__APP__.loginAndLogoutReload) {
|
if (!oData.ClearAuth && GlobalsData.__APP__.loginAndLogoutReload) {
|
||||||
GlobalsData.__APP__.loginAndLogoutReload(false, true);
|
GlobalsData.__APP__.loginAndLogoutReload(false, true);
|
||||||
|
|
@ -140,7 +139,7 @@ class AbstractAjaxRemote {
|
||||||
// 'Content-Type': 'application/json'
|
// 'Content-Type': 'application/json'
|
||||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||||
};
|
};
|
||||||
params.XToken = Settings.appSettingsGet('token');
|
params.XToken = rl.settings.app('token');
|
||||||
// init.body = JSON.stringify(params);
|
// init.body = JSON.stringify(params);
|
||||||
const formData = new FormData(),
|
const formData = new FormData(),
|
||||||
buildFormData = (formData, data, parentKey) => {
|
buildFormData = (formData, data, parentKey) => {
|
||||||
|
|
@ -175,9 +174,8 @@ class AbstractAjaxRemote {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oData && oData.UpdateToken) {
|
if (oData && oData.UpdateToken) {
|
||||||
if (GlobalsData.__APP__ && GlobalsData.__APP__.setClientSideToken) {
|
rl.hash.set();
|
||||||
GlobalsData.__APP__.setClientSideToken(oData.UpdateToken);
|
rl.settings.set('AuthAccountHash', oData.UpdateToken);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let sType = 'success';
|
let sType = 'success';
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import {
|
||||||
} from 'Common/Cache';
|
} from 'Common/Cache';
|
||||||
|
|
||||||
import { subQueryPrefix } from 'Common/Links';
|
import { subQueryPrefix } from 'Common/Links';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
import SettingsStore from 'Stores/User/Settings';
|
import SettingsStore from 'Stores/User/Settings';
|
||||||
|
|
@ -44,15 +43,16 @@ class RemoteUserAjax extends AbstractAjaxRemote {
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
folders(fCallback) {
|
folders(fCallback) {
|
||||||
|
const settingsGet = rl.settings.get;
|
||||||
this.defaultRequest(
|
this.defaultRequest(
|
||||||
fCallback,
|
fCallback,
|
||||||
'Folders',
|
'Folders',
|
||||||
{
|
{
|
||||||
SentFolder: Settings.settingsGet('SentFolder'),
|
SentFolder: settingsGet('SentFolder'),
|
||||||
DraftFolder: Settings.settingsGet('DraftFolder'),
|
DraftFolder: settingsGet('DraftFolder'),
|
||||||
SpamFolder: Settings.settingsGet('SpamFolder'),
|
SpamFolder: settingsGet('SpamFolder'),
|
||||||
TrashFolder: Settings.settingsGet('TrashFolder'),
|
TrashFolder: settingsGet('TrashFolder'),
|
||||||
ArchiveFolder: Settings.settingsGet('ArchiveFolder')
|
ArchiveFolder: settingsGet('ArchiveFolder')
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
'',
|
'',
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
|
||||||
|
|
||||||
import { LoginAdminView } from 'View/Admin/Login';
|
import { LoginAdminView } from 'View/Admin/Login';
|
||||||
|
|
||||||
class LoginAdminScreen extends AbstractScreen {
|
class LoginAdminScreen extends AbstractScreen {
|
||||||
|
|
@ -10,7 +8,7 @@ class LoginAdminScreen extends AbstractScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
getApp().setWindowTitle('');
|
rl.setWindowTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ import { PluginsAdminSettings } from 'Settings/Admin/Plugins';
|
||||||
import { PackagesAdminSettings } from 'Settings/Admin/Packages';
|
import { PackagesAdminSettings } from 'Settings/Admin/Packages';
|
||||||
import { AboutAdminSettings } from 'Settings/Admin/About';
|
import { AboutAdminSettings } from 'Settings/Admin/About';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
|
||||||
|
|
||||||
import { MenuSettingsAdminView } from 'View/Admin/Settings/Menu';
|
import { MenuSettingsAdminView } from 'View/Admin/Settings/Menu';
|
||||||
import { PaneSettingsAdminView } from 'View/Admin/Settings/Pane';
|
import { PaneSettingsAdminView } from 'View/Admin/Settings/Pane';
|
||||||
|
|
||||||
|
|
@ -60,7 +58,7 @@ class SettingsAdminScreen extends AbstractSettingsScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
getApp().setWindowTitle('');
|
rl.setWindowTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,13 @@ import { AbstractScreen } from 'Knoin/AbstractScreen';
|
||||||
|
|
||||||
import { LoginUserView } from 'View/User/Login';
|
import { LoginUserView } from 'View/User/Login';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
|
||||||
|
|
||||||
class LoginUserScreen extends AbstractScreen {
|
class LoginUserScreen extends AbstractScreen {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('login', [LoginUserView]);
|
super('login', [LoginUserView]);
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
getApp().setWindowTitle('');
|
rl.setWindowTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ import { pString, pInt } from 'Common/Utils';
|
||||||
import { getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName } from 'Common/Cache';
|
import { getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName } from 'Common/Cache';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
import AccountStore from 'Stores/User/Account';
|
import AccountStore from 'Stores/User/Account';
|
||||||
import SettingsStore from 'Stores/User/Settings';
|
import SettingsStore from 'Stores/User/Settings';
|
||||||
|
|
@ -23,6 +21,8 @@ import { warmUpScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
class MailBoxUserScreen extends AbstractScreen {
|
class MailBoxUserScreen extends AbstractScreen {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('mailbox', [
|
super('mailbox', [
|
||||||
|
|
@ -40,11 +40,11 @@ class MailBoxUserScreen extends AbstractScreen {
|
||||||
let foldersInboxUnreadCount = FolderStore.foldersInboxUnreadCount();
|
let foldersInboxUnreadCount = FolderStore.foldersInboxUnreadCount();
|
||||||
const email = AccountStore.email();
|
const email = AccountStore.email();
|
||||||
|
|
||||||
if (Settings.appSettingsGet('listPermanentFiltered')) {
|
if (Settings.app('listPermanentFiltered')) {
|
||||||
foldersInboxUnreadCount = 0;
|
foldersInboxUnreadCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getApp().setWindowTitle(
|
rl.setWindowTitle(
|
||||||
(email
|
(email
|
||||||
? '' + (0 < foldersInboxUnreadCount ? '(' + foldersInboxUnreadCount + ') ' : ' ') + email + ' - '
|
? '' + (0 < foldersInboxUnreadCount ? '(' + foldersInboxUnreadCount + ') ' : ' ') + email + ' - '
|
||||||
: ''
|
: ''
|
||||||
|
|
@ -61,7 +61,7 @@ class MailBoxUserScreen extends AbstractScreen {
|
||||||
AppStore.focusedState(Focused.None);
|
AppStore.focusedState(Focused.None);
|
||||||
AppStore.focusedState(Focused.MessageList);
|
AppStore.focusedState(Focused.MessageList);
|
||||||
|
|
||||||
if (Settings.appSettingsGet('mobile')) {
|
if (Settings.app('mobile')) {
|
||||||
leftPanelDisabled(true);
|
leftPanelDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,7 +122,7 @@ class MailBoxUserScreen extends AbstractScreen {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
onBuild() {
|
onBuild() {
|
||||||
if (!bMobileDevice && !Settings.appSettingsGet('mobile')) {
|
if (!bMobileDevice && !Settings.app('mobile')) {
|
||||||
setTimeout(() =>
|
setTimeout(() =>
|
||||||
getApp().initHorizontalLayoutResizer(ClientSideKeyName.MessageListSize)
|
getApp().initHorizontalLayoutResizer(ClientSideKeyName.MessageListSize)
|
||||||
, 1);
|
, 1);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
import AccountStore from 'Stores/User/Account';
|
import AccountStore from 'Stores/User/Account';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
import { addSettingsViewModel } from 'Knoin/Knoin';
|
import { addSettingsViewModel } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import { AbstractSettingsScreen } from 'Screen/AbstractSettings';
|
import { AbstractSettingsScreen } from 'Screen/AbstractSettings';
|
||||||
|
|
@ -25,7 +24,7 @@ import { SystemDropDownSettingsUserView } from 'View/User/Settings/SystemDropDow
|
||||||
import { MenuSettingsUserView } from 'View/User/Settings/Menu';
|
import { MenuSettingsUserView } from 'View/User/Settings/Menu';
|
||||||
import { PaneSettingsUserView } from 'View/User/Settings/Pane';
|
import { PaneSettingsUserView } from 'View/User/Settings/Pane';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
const Settings = rl.settings;
|
||||||
|
|
||||||
class SettingsUserScreen extends AbstractSettingsScreen {
|
class SettingsUserScreen extends AbstractSettingsScreen {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -113,14 +112,14 @@ class SettingsUserScreen extends AbstractSettingsScreen {
|
||||||
keyScope(KeyState.Settings);
|
keyScope(KeyState.Settings);
|
||||||
leftPanelType('');
|
leftPanelType('');
|
||||||
|
|
||||||
if (Settings.appSettingsGet('mobile')) {
|
if (Settings.app('mobile')) {
|
||||||
leftPanelDisabled(true);
|
leftPanelDisabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setSettingsTitle() {
|
setSettingsTitle() {
|
||||||
const sEmail = AccountStore.email();
|
const sEmail = AccountStore.email();
|
||||||
getApp().setWindowTitle((sEmail ? sEmail + ' - ' : '') + this.sSettingsTitle);
|
rl.setWindowTitle((sEmail ? sEmail + ' - ' : '') + this.sSettingsTitle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import { appSettingsGet } from 'Storage/Settings';
|
|
||||||
|
|
||||||
class AboutAdminSettings {
|
class AboutAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.version = ko.observable(appSettingsGet('version'));
|
this.version = ko.observable(rl.settings.app('version'));
|
||||||
this.coreType = ko.observable('djmaze');
|
this.coreType = ko.observable('djmaze');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,9 @@ import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Ajax';
|
||||||
|
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
|
|
||||||
class BrandingAdminSettings {
|
class BrandingAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
const settingsGet = rl.settings.get;
|
||||||
this.title = ko.observable(settingsGet('Title')).idleTrigger();
|
this.title = ko.observable(settingsGet('Title')).idleTrigger();
|
||||||
this.loadingDesc = ko.observable(settingsGet('LoadingDescription')).idleTrigger();
|
this.loadingDesc = ko.observable(settingsGet('LoadingDescription')).idleTrigger();
|
||||||
this.faviconUrl = ko.observable(settingsGet('FaviconUrl')).idleTrigger();
|
this.faviconUrl = ko.observable(settingsGet('FaviconUrl')).idleTrigger();
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@ import { settingsSaveHelperSimpleFunction, defautOptionsAfterRender } from 'Comm
|
||||||
|
|
||||||
import { SaveSettingsStep, StorageResultType } from 'Common/Enums';
|
import { SaveSettingsStep, StorageResultType } from 'Common/Enums';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Ajax';
|
||||||
import { command } from 'Knoin/Knoin';
|
import { command } from 'Knoin/Knoin';
|
||||||
|
|
||||||
|
const settingsGet = rl.settings.get;
|
||||||
|
|
||||||
class ContactsAdminSettings {
|
class ContactsAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.defautOptionsAfterRender = defautOptionsAfterRender;
|
this.defautOptionsAfterRender = defautOptionsAfterRender;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import {
|
||||||
import { SaveSettingsStep } from 'Common/Enums';
|
import { SaveSettingsStep } from 'Common/Enums';
|
||||||
import { reload as translatorReload } from 'Common/Translator';
|
import { reload as translatorReload } from 'Common/Translator';
|
||||||
|
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
import { showScreenPopup } from 'Knoin/Knoin';
|
import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Ajax';
|
||||||
|
|
@ -21,6 +20,8 @@ import LanguageStore from 'Stores/Language';
|
||||||
import AppAdminStore from 'Stores/Admin/App';
|
import AppAdminStore from 'Stores/Admin/App';
|
||||||
import CapaAdminStore from 'Stores/Admin/Capa';
|
import CapaAdminStore from 'Stores/Admin/Capa';
|
||||||
|
|
||||||
|
const settingsGet = rl.settings.get;
|
||||||
|
|
||||||
class GeneralAdminSettings {
|
class GeneralAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.language = LanguageStore.language;
|
this.language = LanguageStore.language;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
|
|
||||||
import AppStore from 'Stores/Admin/App';
|
import AppStore from 'Stores/Admin/App';
|
||||||
|
|
||||||
|
|
@ -12,7 +11,7 @@ class LoginAdminSettings {
|
||||||
this.determineUserLanguage = AppStore.determineUserLanguage;
|
this.determineUserLanguage = AppStore.determineUserLanguage;
|
||||||
this.determineUserDomain = AppStore.determineUserDomain;
|
this.determineUserDomain = AppStore.determineUserDomain;
|
||||||
|
|
||||||
this.defaultDomain = ko.observable(settingsGet('LoginDefaultDomain')).idleTrigger();
|
this.defaultDomain = ko.observable(rl.settings.get('LoginDefaultDomain')).idleTrigger();
|
||||||
this.allowLanguagesOnLogin = AppStore.allowLanguagesOnLogin;
|
this.allowLanguagesOnLogin = AppStore.allowLanguagesOnLogin;
|
||||||
|
|
||||||
this.dummy = ko.observable(false);
|
this.dummy = ko.observable(false);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import ko from 'ko';
|
||||||
import { StorageResultType, Notification } from 'Common/Enums';
|
import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
import { showScreenPopup } from 'Knoin/Knoin';
|
import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import PluginStore from 'Stores/Admin/Plugin';
|
import PluginStore from 'Stores/Admin/Plugin';
|
||||||
|
|
@ -14,7 +13,7 @@ import { getApp } from 'Helper/Apps/Admin';
|
||||||
|
|
||||||
class PluginsAdminSettings {
|
class PluginsAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.enabledPlugins = ko.observable(!!settingsGet('EnabledPlugins'));
|
this.enabledPlugins = ko.observable(!!rl.settings.get('EnabledPlugins'));
|
||||||
|
|
||||||
this.plugins = PluginStore.plugins;
|
this.plugins = PluginStore.plugins;
|
||||||
this.pluginsError = PluginStore.plugins.error;
|
this.pluginsError = PluginStore.plugins.error;
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ import ko from 'ko';
|
||||||
|
|
||||||
import { StorageResultType } from 'Common/Enums';
|
import { StorageResultType } from 'Common/Enums';
|
||||||
|
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
|
|
||||||
import AppAdminStore from 'Stores/Admin/App';
|
import AppAdminStore from 'Stores/Admin/App';
|
||||||
import CapaAdminStore from 'Stores/Admin/Capa';
|
import CapaAdminStore from 'Stores/Admin/Capa';
|
||||||
|
|
||||||
|
|
@ -11,6 +9,8 @@ import Remote from 'Remote/Admin/Ajax';
|
||||||
|
|
||||||
import { command } from 'Knoin/Knoin';
|
import { command } from 'Knoin/Knoin';
|
||||||
|
|
||||||
|
const settingsGet = rl.settings.get;
|
||||||
|
|
||||||
class SecurityAdminSettings {
|
class SecurityAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.useLocalProxyForExternalImages = AppAdminStore.useLocalProxyForExternalImages;
|
this.useLocalProxyForExternalImages = AppAdminStore.useLocalProxyForExternalImages;
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ import ko from 'ko';
|
||||||
import { Capa, StorageResultType } from 'Common/Enums';
|
import { Capa, StorageResultType } from 'Common/Enums';
|
||||||
import { root } from 'Common/Links';
|
import { root } from 'Common/Links';
|
||||||
|
|
||||||
import { capa } from 'Storage/Settings';
|
|
||||||
|
|
||||||
import AccountStore from 'Stores/User/Account';
|
import AccountStore from 'Stores/User/Account';
|
||||||
import IdentityStore from 'Stores/User/Identity';
|
import IdentityStore from 'Stores/User/Identity';
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
@ -15,8 +13,8 @@ import { showScreenPopup, routeOff, setHash } from 'Knoin/Knoin';
|
||||||
|
|
||||||
class AccountsUserSettings {
|
class AccountsUserSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.allowAdditionalAccount = capa(Capa.AdditionalAccounts);
|
this.allowAdditionalAccount = rl.settings.capa(Capa.AdditionalAccounts);
|
||||||
this.allowIdentities = capa(Capa.Identities);
|
this.allowIdentities = rl.settings.capa(Capa.Identities);
|
||||||
|
|
||||||
this.accounts = AccountStore.accounts;
|
this.accounts = AccountStore.accounts;
|
||||||
this.identities = IdentityStore.identities;
|
this.identities = IdentityStore.identities;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import { getNotification, i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import { removeFolderFromCacheList } from 'Common/Cache';
|
import { removeFolderFromCacheList } from 'Common/Cache';
|
||||||
|
|
||||||
import { appSettingsGet } from 'Storage/Settings';
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
|
|
@ -37,7 +36,7 @@ class FoldersUserSettings {
|
||||||
|
|
||||||
this.folderForEdit = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'edited'] });
|
this.folderForEdit = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'edited'] });
|
||||||
|
|
||||||
this.useImapSubscribe = !!appSettingsGet('useImapSubscribe');
|
this.useImapSubscribe = !!rl.settings.app('useImapSubscribe');
|
||||||
}
|
}
|
||||||
|
|
||||||
folderEditOnEnter(folder) {
|
folderEditOnEnter(folder) {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ import { pInt, settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||||
import { Capa, SaveSettingsStep } from 'Common/Enums';
|
import { Capa, SaveSettingsStep } from 'Common/Enums';
|
||||||
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
||||||
|
|
||||||
import { capa } from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { showScreenPopup } from 'Knoin/Knoin';
|
import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import SettinsStore from 'Stores/User/Settings';
|
import SettinsStore from 'Stores/User/Settings';
|
||||||
|
|
@ -14,8 +12,8 @@ import Remote from 'Remote/User/Ajax';
|
||||||
|
|
||||||
class SecurityUserSettings {
|
class SecurityUserSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.capaAutoLogout = capa(Capa.AutoLogout);
|
this.capaAutoLogout = rl.settings.capa(Capa.AutoLogout);
|
||||||
this.capaTwoFactor = capa(Capa.TwoFactor);
|
this.capaTwoFactor = rl.settings.capa(Capa.TwoFactor);
|
||||||
|
|
||||||
this.autoLogout = SettinsStore.autoLogout;
|
this.autoLogout = SettinsStore.autoLogout;
|
||||||
this.autoLogout.trigger = ko.observable(SaveSettingsStep.Idle);
|
this.autoLogout.trigger = ko.observable(SaveSettingsStep.Idle);
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ import { changeTheme, convertThemeName } from 'Common/Utils';
|
||||||
import { userBackground, themePreviewLink, uploadBackground } from 'Common/Links';
|
import { userBackground, themePreviewLink, uploadBackground } from 'Common/Links';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import { capa } from 'Storage/Settings';
|
|
||||||
|
|
||||||
import ThemeStore from 'Stores/Theme';
|
import ThemeStore from 'Stores/Theme';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
@ -24,7 +22,7 @@ class ThemesUserSettings {
|
||||||
this.background.loading = ko.observable(false);
|
this.background.loading = ko.observable(false);
|
||||||
this.background.error = ko.observable('');
|
this.background.error = ko.observable('');
|
||||||
|
|
||||||
this.capaUserBackground = ko.observable(capa(Capa.UserBackground));
|
this.capaUserBackground = ko.observable(rl.settings.capa(Capa.UserBackground));
|
||||||
|
|
||||||
this.themeTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: 100 });
|
this.themeTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: 100 });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
let SETTINGS = RainLoop.data() || null;
|
|
||||||
SETTINGS = null != SETTINGS ? SETTINGS : {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} name
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export function settingsGet(name) {
|
|
||||||
return null == SETTINGS[name] ? null : SETTINGS[name];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} name
|
|
||||||
* @param {*} value
|
|
||||||
*/
|
|
||||||
export function settingsSet(name, value) {
|
|
||||||
SETTINGS[name] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} name
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export function appSettingsGet(name) {
|
|
||||||
const APP_SETTINGS = SETTINGS.System || {};
|
|
||||||
return null == APP_SETTINGS[name] ? null : APP_SETTINGS[name];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} name
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
export function capa(name) {
|
|
||||||
const values = SETTINGS.Capa;
|
|
||||||
return Array.isArray(values) && null != name && values.includes(name);
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class AbstractAppStore {
|
class AbstractAppStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -9,9 +8,9 @@ class AbstractAppStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
|
this.allowLanguagesOnLogin(!!rl.settings.get('AllowLanguagesOnLogin'));
|
||||||
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
this.allowLanguagesOnSettings(!!rl.settings.get('AllowLanguagesOnSettings'));
|
||||||
this.newMoveToFolder(!!Settings.settingsGet('NewMoveToFolder'));
|
this.newMoveToFolder(!!rl.settings.get('NewMoveToFolder'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
import { AbstractAppStore } from 'Stores/AbstractApp';
|
import { AbstractAppStore } from 'Stores/AbstractApp';
|
||||||
|
|
||||||
class AppAdminStore extends AbstractAppStore {
|
class AppAdminStore extends AbstractAppStore {
|
||||||
|
|
@ -18,6 +17,7 @@ class AppAdminStore extends AbstractAppStore {
|
||||||
populate() {
|
populate() {
|
||||||
super.populate();
|
super.populate();
|
||||||
|
|
||||||
|
const settingsGet = rl.settings
|
||||||
this.determineUserLanguage(!!settingsGet('DetermineUserLanguage'));
|
this.determineUserLanguage(!!settingsGet('DetermineUserLanguage'));
|
||||||
this.determineUserDomain(!!settingsGet('DetermineUserDomain'));
|
this.determineUserDomain(!!settingsGet('DetermineUserDomain'));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { Capa } from 'Common/Enums';
|
import { Capa } from 'Common/Enums';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class CapaAdminStore {
|
class CapaAdminStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -18,17 +17,18 @@ class CapaAdminStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
this.additionalAccounts(Settings.capa(Capa.AdditionalAccounts));
|
let capa = rl.settings.capa;
|
||||||
this.identities(Settings.capa(Capa.Identities));
|
this.additionalAccounts(capa(Capa.AdditionalAccounts));
|
||||||
this.attachmentThumbnails(Settings.capa(Capa.AttachmentThumbnails));
|
this.identities(capa(Capa.Identities));
|
||||||
this.sieve(Settings.capa(Capa.Sieve));
|
this.attachmentThumbnails(capa(Capa.AttachmentThumbnails));
|
||||||
this.filters(Settings.capa(Capa.Filters));
|
this.sieve(capa(Capa.Sieve));
|
||||||
this.themes(Settings.capa(Capa.Themes));
|
this.filters(capa(Capa.Filters));
|
||||||
this.userBackground(Settings.capa(Capa.UserBackground));
|
this.themes(capa(Capa.Themes));
|
||||||
this.openPGP(Settings.capa(Capa.OpenPGP));
|
this.userBackground(capa(Capa.UserBackground));
|
||||||
this.twoFactorAuth(Settings.capa(Capa.TwoFactor));
|
this.openPGP(capa(Capa.OpenPGP));
|
||||||
this.twoFactorAuthForce(Settings.capa(Capa.TwoFactorForce));
|
this.twoFactorAuth(capa(Capa.TwoFactor));
|
||||||
this.templates(Settings.capa(Capa.Templates));
|
this.twoFactorAuthForce(capa(Capa.TwoFactorForce));
|
||||||
|
this.templates(capa(Capa.Templates));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class LanguageStore {
|
class LanguageStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -21,17 +20,18 @@ class LanguageStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
const aLanguages = Settings.appSettingsGet('languages'),
|
const Settings = rl.settings,
|
||||||
aLanguagesAdmin = Settings.appSettingsGet('languagesAdmin');
|
aLanguages = Settings.app('languages'),
|
||||||
|
aLanguagesAdmin = Settings.app('languagesAdmin');
|
||||||
|
|
||||||
this.languages(Array.isArray(aLanguages) ? aLanguages : []);
|
this.languages(Array.isArray(aLanguages) ? aLanguages : []);
|
||||||
this.languagesAdmin(Array.isArray(aLanguagesAdmin) ? aLanguagesAdmin : []);
|
this.languagesAdmin(Array.isArray(aLanguagesAdmin) ? aLanguagesAdmin : []);
|
||||||
|
|
||||||
this.language(Settings.settingsGet('Language'));
|
this.language(Settings.get('Language'));
|
||||||
this.languageAdmin(Settings.settingsGet('LanguageAdmin'));
|
this.languageAdmin(Settings.get('LanguageAdmin'));
|
||||||
|
|
||||||
this.userLanguage(Settings.settingsGet('UserLanguage'));
|
this.userLanguage(Settings.get('UserLanguage'));
|
||||||
this.userLanguageAdmin(Settings.settingsGet('UserLanguageAdmin'));
|
this.userLanguageAdmin(Settings.get('UserLanguageAdmin'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class ThemeStore {
|
class ThemeStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -11,12 +10,13 @@ class ThemeStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
const themes = Settings.appSettingsGet('themes');
|
const Settings = rl.settings,
|
||||||
|
themes = Settings.app('themes');
|
||||||
|
|
||||||
this.themes(Array.isArray(themes) ? themes : []);
|
this.themes(Array.isArray(themes) ? themes : []);
|
||||||
this.theme(Settings.settingsGet('Theme'));
|
this.theme(Settings.get('Theme'));
|
||||||
this.themeBackgroundName(Settings.settingsGet('UserBackgroundName'));
|
this.themeBackgroundName(Settings.get('UserBackgroundName'));
|
||||||
this.themeBackgroundHash(Settings.settingsGet('UserBackgroundHash'));
|
this.themeBackgroundHash(Settings.get('UserBackgroundHash'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class AccountUserStore {
|
class AccountUserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -33,8 +32,8 @@ class AccountUserStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
this.email(Settings.settingsGet('Email'));
|
this.email(rl.settings.get('Email'));
|
||||||
this.parentEmail(Settings.settingsGet('ParentEmail'));
|
this.parentEmail(rl.settings.get('ParentEmail'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ import { Focused, KeyState } from 'Common/Enums';
|
||||||
import { keyScope, leftPanelDisabled } from 'Common/Globals';
|
import { keyScope, leftPanelDisabled } from 'Common/Globals';
|
||||||
import { isNonEmptyArray } from 'Common/Utils';
|
import { isNonEmptyArray } from 'Common/Utils';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { AbstractAppStore } from 'Stores/AbstractApp';
|
import { AbstractAppStore } from 'Stores/AbstractApp';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
class AppUserStore extends AbstractAppStore {
|
class AppUserStore extends AbstractAppStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
@ -16,7 +16,7 @@ class AppUserStore extends AbstractAppStore {
|
||||||
|
|
||||||
this.focusedState = ko.observable(Focused.None);
|
this.focusedState = ko.observable(Focused.None);
|
||||||
|
|
||||||
const isMobile = Settings.appSettingsGet('mobile');
|
const isMobile = Settings.app('mobile');
|
||||||
|
|
||||||
this.focusedState.subscribe((value) => {
|
this.focusedState.subscribe((value) => {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
|
|
@ -62,18 +62,18 @@ class AppUserStore extends AbstractAppStore {
|
||||||
populate() {
|
populate() {
|
||||||
super.populate();
|
super.populate();
|
||||||
|
|
||||||
this.projectHash(Settings.settingsGet('ProjectHash'));
|
this.projectHash(Settings.get('ProjectHash'));
|
||||||
|
|
||||||
this.contactsAutosave(!!Settings.settingsGet('ContactsAutosave'));
|
this.contactsAutosave(!!Settings.get('ContactsAutosave'));
|
||||||
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
|
this.useLocalProxyForExternalImages(!!Settings.get('UseLocalProxyForExternalImages'));
|
||||||
|
|
||||||
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
|
this.contactsIsAllowed(!!Settings.get('ContactsIsAllowed'));
|
||||||
|
|
||||||
const attachmentsActions = Settings.appSettingsGet('attachmentsActions');
|
const attachmentsActions = Settings.app('attachmentsActions');
|
||||||
this.attachmentsActions(isNonEmptyArray(attachmentsActions) ? attachmentsActions : []);
|
this.attachmentsActions(isNonEmptyArray(attachmentsActions) ? attachmentsActions : []);
|
||||||
|
|
||||||
this.devEmail = Settings.settingsGet('DevEmail');
|
this.devEmail = Settings.get('DevEmail');
|
||||||
this.devPassword = Settings.settingsGet('DevPassword');
|
this.devPassword = Settings.get('DevPassword');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class ContactUserStore {
|
class ContactUserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -18,12 +17,13 @@ class ContactUserStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
this.allowContactsSync(!!Settings.settingsGet('ContactsSyncIsAllowed'));
|
const settingsGet = rl.settings.get;
|
||||||
this.enableContactsSync(!!Settings.settingsGet('EnableContactsSync'));
|
this.allowContactsSync(!!settingsGet('ContactsSyncIsAllowed'));
|
||||||
|
this.enableContactsSync(!!settingsGet('EnableContactsSync'));
|
||||||
|
|
||||||
this.contactsSyncUrl(Settings.settingsGet('ContactsSyncUrl'));
|
this.contactsSyncUrl(settingsGet('ContactsSyncUrl'));
|
||||||
this.contactsSyncUser(Settings.settingsGet('ContactsSyncUser'));
|
this.contactsSyncUser(settingsGet('ContactsSyncUser'));
|
||||||
this.contactsSyncPass(Settings.settingsGet('ContactsSyncPassword'));
|
this.contactsSyncPass(settingsGet('ContactsSyncPassword'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import { settingsGet } from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { FolderType } from 'Common/Enums';
|
import { FolderType } from 'Common/Enums';
|
||||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||||
import { folderListOptionsBuilder } from 'Common/Utils';
|
import { folderListOptionsBuilder } from 'Common/Utils';
|
||||||
|
|
@ -32,7 +30,7 @@ class FolderUserStore {
|
||||||
|
|
||||||
this.currentFolder = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'selected'] });
|
this.currentFolder = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'selected'] });
|
||||||
|
|
||||||
this.sieveAllowFileintoInbox = !!settingsGet('SieveAllowFileintoInbox');
|
this.sieveAllowFileintoInbox = !!rl.settings.get('SieveAllowFileintoInbox');
|
||||||
|
|
||||||
this.computers();
|
this.computers();
|
||||||
this.subscribers();
|
this.subscribers();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import ko from 'ko';
|
||||||
import { DesktopNotification } from 'Common/Enums';
|
import { DesktopNotification } from 'Common/Enums';
|
||||||
import Audio from 'Common/Audio';
|
import Audio from 'Common/Audio';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class NotificationUserStore {
|
class NotificationUserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -159,8 +158,8 @@ class NotificationUserStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
this.enableSoundNotification(!!Settings.settingsGet('SoundNotification'));
|
this.enableSoundNotification(!!rl.settings.get('SoundNotification'));
|
||||||
this.enableDesktopNotification(!!Settings.settingsGet('DesktopNotifications'));
|
this.enableDesktopNotification(!!rl.settings.get('DesktopNotifications'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ import { MESSAGES_PER_PAGE, MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
||||||
import { Layout, EditorDefaultType } from 'Common/Enums';
|
import { Layout, EditorDefaultType } from 'Common/Enums';
|
||||||
import { pInt } from 'Common/Utils';
|
import { pInt } from 'Common/Utils';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
class SettingsUserStore {
|
class SettingsUserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.iAutoLogoutTimer = 0;
|
this.iAutoLogoutTimer = 0;
|
||||||
|
|
@ -52,21 +50,22 @@ class SettingsUserStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
populate() {
|
populate() {
|
||||||
this.layout(pInt(Settings.settingsGet('Layout')));
|
const settingsGet = rl.settings.get;
|
||||||
this.editorDefaultType(Settings.settingsGet('EditorDefaultType'));
|
this.layout(pInt(settingsGet('Layout')));
|
||||||
|
this.editorDefaultType(settingsGet('EditorDefaultType'));
|
||||||
|
|
||||||
this.autoLogout(pInt(Settings.settingsGet('AutoLogout')));
|
this.autoLogout(pInt(settingsGet('AutoLogout')));
|
||||||
this.messagesPerPage(Settings.settingsGet('MPP'));
|
this.messagesPerPage(settingsGet('MPP'));
|
||||||
|
|
||||||
this.showImages(!!Settings.settingsGet('ShowImages'));
|
this.showImages(!!settingsGet('ShowImages'));
|
||||||
this.useCheckboxesInList(!!Settings.settingsGet('UseCheckboxesInList'));
|
this.useCheckboxesInList(!!settingsGet('UseCheckboxesInList'));
|
||||||
this.allowDraftAutosave(!!Settings.settingsGet('AllowDraftAutosave'));
|
this.allowDraftAutosave(!!settingsGet('AllowDraftAutosave'));
|
||||||
this.useThreads(!!Settings.settingsGet('UseThreads'));
|
this.useThreads(!!settingsGet('UseThreads'));
|
||||||
this.replySameFolder(!!Settings.settingsGet('ReplySameFolder'));
|
this.replySameFolder(!!settingsGet('ReplySameFolder'));
|
||||||
|
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
clearTimeout(this.iAutoLogoutTimer);
|
clearTimeout(this.iAutoLogoutTimer);
|
||||||
if (0 < this.autoLogout() && !Settings.settingsGet('AccountSignMe')) {
|
if (0 < this.autoLogout() && !settingsGet('AccountSignMe')) {
|
||||||
this.iAutoLogoutTimer = setTimeout(() =>
|
this.iAutoLogoutTimer = setTimeout(() =>
|
||||||
dispatchEvent(new CustomEvent('rl.auto-logout'))
|
dispatchEvent(new CustomEvent('rl.auto-logout'))
|
||||||
, this.autoLogout() * 60000);
|
, this.autoLogout() * 60000);
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ import ko from 'ko';
|
||||||
import { StorageResultType, Notification } from 'Common/Enums';
|
import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Ajax';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
import { getApp } from 'Helper/Apps/Admin';
|
||||||
|
|
@ -21,10 +19,11 @@ class LoginAdminView extends AbstractViewNext {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.mobile = !!Settings.appSettingsGet('mobile');
|
const appSettingsGet = rl.settings.app;
|
||||||
this.mobileDevice = !!Settings.appSettingsGet('mobileDevice');
|
this.mobile = !!appSettingsGet('mobile');
|
||||||
|
this.mobileDevice = !!appSettingsGet('mobileDevice');
|
||||||
|
|
||||||
this.hideSubmitButton = Settings.appSettingsGet('hideSubmitButton') ? '' : null;
|
this.hideSubmitButton = appSettingsGet('hideSubmitButton') ? '' : null;
|
||||||
|
|
||||||
this.login = ko.observable('');
|
this.login = ko.observable('');
|
||||||
this.password = ko.observable('');
|
this.password = ko.observable('');
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Ajax';
|
||||||
|
|
||||||
import DomainStore from 'Stores/Admin/Domain';
|
import DomainStore from 'Stores/Admin/Domain';
|
||||||
|
|
@ -22,7 +20,7 @@ class PaneSettingsAdminView extends AbstractViewNext {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.version = ko.observable(Settings.appSettingsGet('version'));
|
this.version = ko.observable(rl.settings.app('version'));
|
||||||
|
|
||||||
this.adminManLoading = ko.computed(
|
this.adminManLoading = ko.computed(
|
||||||
() =>
|
() =>
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@ import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
|
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
@ -48,6 +46,8 @@ import { getApp } from 'Helper/Apps/User';
|
||||||
import { popup, command, isPopupVisible, showScreenPopup, hideScreenPopup, routeOn, routeOff } from 'Knoin/Knoin';
|
import { popup, command, isPopupVisible, showScreenPopup, hideScreenPopup, routeOn, routeOff } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
@popup({
|
@popup({
|
||||||
name: 'View/Popup/Compose',
|
name: 'View/Popup/Compose',
|
||||||
templateID: 'PopupsCompose'
|
templateID: 'PopupsCompose'
|
||||||
|
|
@ -1138,7 +1138,7 @@ class ComposePopupView extends AbstractViewNext {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.appSettingsGet('allowCtrlEnterOnCompose')) {
|
if (Settings.app('allowCtrlEnterOnCompose')) {
|
||||||
key('ctrl+enter, command+enter', KeyState.Compose, () => {
|
key('ctrl+enter, command+enter', KeyState.Compose, () => {
|
||||||
this.sendCommand();
|
this.sendCommand();
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1184,7 +1184,7 @@ class ComposePopupView extends AbstractViewNext {
|
||||||
initUploader() {
|
initUploader() {
|
||||||
if (this.composeUploaderButton()) {
|
if (this.composeUploaderButton()) {
|
||||||
const uploadCache = {},
|
const uploadCache = {},
|
||||||
attachmentSizeLimit = pInt(Settings.settingsGet('AttachmentLimit')),
|
attachmentSizeLimit = pInt(Settings.get('AttachmentLimit')),
|
||||||
oJua = new Jua({
|
oJua = new Jua({
|
||||||
action: upload(),
|
action: upload(),
|
||||||
name: 'uploader',
|
name: 'uploader',
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,6 @@ import ContactStore from 'Stores/User/Contact';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { EmailModel } from 'Model/Email';
|
import { EmailModel } from 'Model/Email';
|
||||||
import { ContactModel } from 'Model/Contact';
|
import { ContactModel } from 'Model/Contact';
|
||||||
import { ContactPropertyModel } from 'Model/ContactProperty';
|
import { ContactPropertyModel } from 'Model/ContactProperty';
|
||||||
|
|
@ -221,7 +219,7 @@ class ContactsPopupView extends AbstractViewNext {
|
||||||
|
|
||||||
@command((self) => 0 < self.contactsCheckedOrSelected().length)
|
@command((self) => 0 < self.contactsCheckedOrSelected().length)
|
||||||
newMessageCommand() {
|
newMessageCommand() {
|
||||||
if (!Settings.capa(Capa.Composer)) {
|
if (!rl.settings.capa(Capa.Composer)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -658,7 +656,7 @@ class ContactsPopupView extends AbstractViewNext {
|
||||||
if (this.bBackToCompose) {
|
if (this.bBackToCompose) {
|
||||||
this.bBackToCompose = false;
|
this.bBackToCompose = false;
|
||||||
|
|
||||||
if (Settings.capa(Capa.Composer)) {
|
if (rl.settings.capa(Capa.Composer)) {
|
||||||
showScreenPopup(require('View/Popup/Compose'));
|
showScreenPopup(require('View/Popup/Compose'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
||||||
import { popup } from 'Knoin/Knoin';
|
import { popup } from 'Knoin/Knoin';
|
||||||
|
|
@ -55,12 +54,13 @@ class FolderSystemPopupView extends AbstractViewNext {
|
||||||
this.trashFolder = FolderStore.trashFolder;
|
this.trashFolder = FolderStore.trashFolder;
|
||||||
this.archiveFolder = FolderStore.archiveFolder;
|
this.archiveFolder = FolderStore.archiveFolder;
|
||||||
|
|
||||||
const fSetSystemFolders = () => {
|
const settingsSet = rl.settings.set,
|
||||||
Settings.settingsSet('SentFolder', FolderStore.sentFolder());
|
fSetSystemFolders = () => {
|
||||||
Settings.settingsSet('DraftFolder', FolderStore.draftFolder());
|
settingsSet('SentFolder', FolderStore.sentFolder());
|
||||||
Settings.settingsSet('SpamFolder', FolderStore.spamFolder());
|
settingsSet('DraftFolder', FolderStore.draftFolder());
|
||||||
Settings.settingsSet('TrashFolder', FolderStore.trashFolder());
|
settingsSet('SpamFolder', FolderStore.spamFolder());
|
||||||
Settings.settingsSet('ArchiveFolder', FolderStore.archiveFolder());
|
settingsSet('TrashFolder', FolderStore.trashFolder());
|
||||||
|
settingsSet('ArchiveFolder', FolderStore.archiveFolder());
|
||||||
},
|
},
|
||||||
fSaveSystemFolders = (()=>{
|
fSaveSystemFolders = (()=>{
|
||||||
fSetSystemFolders();
|
fSetSystemFolders();
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ import { Capa, StorageResultType } from 'Common/Enums';
|
||||||
import { pString } from 'Common/Utils';
|
import { pString } from 'Common/Utils';
|
||||||
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
@ -23,7 +21,7 @@ class TwoFactorConfigurationPopupView extends AbstractViewNext {
|
||||||
|
|
||||||
this.lock = ko.observable(false);
|
this.lock = ko.observable(false);
|
||||||
|
|
||||||
this.capaTwoFactor = Settings.capa(Capa.TwoFactor);
|
this.capaTwoFactor = rl.settings.capa(Capa.TwoFactor);
|
||||||
|
|
||||||
this.processing = ko.observable(false);
|
this.processing = ko.observable(false);
|
||||||
this.clearing = ko.observable(false);
|
this.clearing = ko.observable(false);
|
||||||
|
|
|
||||||
|
|
@ -7,22 +7,23 @@ import MessageStore from 'Stores/User/Message';
|
||||||
import { Capa, KeyState } from 'Common/Enums';
|
import { Capa, KeyState } from 'Common/Enums';
|
||||||
import { settings } from 'Common/Links';
|
import { settings } from 'Common/Links';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
import { showScreenPopup, setHash } from 'Knoin/Knoin';
|
import { showScreenPopup, setHash } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
class AbstractSystemDropDownUserView extends AbstractViewNext {
|
class AbstractSystemDropDownUserView extends AbstractViewNext {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.logoImg = (Settings.settingsGet('UserLogo')||'').trim();
|
this.logoImg = (Settings.get('UserLogo')||'').trim();
|
||||||
this.logoTitle = (Settings.settingsGet('UserLogoTitle')||'').trim();
|
this.logoTitle = (Settings.get('UserLogoTitle')||'').trim();
|
||||||
|
|
||||||
this.mobile = !!Settings.appSettingsGet('mobile');
|
this.mobile = !!Settings.app('mobile');
|
||||||
this.mobileDevice = !!Settings.appSettingsGet('mobileDevice');
|
this.mobileDevice = !!Settings.app('mobileDevice');
|
||||||
|
|
||||||
this.allowSettings = !!Settings.capa(Capa.Settings);
|
this.allowSettings = !!Settings.capa(Capa.Settings);
|
||||||
this.allowHelp = !!Settings.capa(Capa.Help);
|
this.allowHelp = !!Settings.capa(Capa.Help);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import { getNotification, getNotificationFromResponse, reload as translatorReloa
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
import LanguageStore from 'Stores/Language';
|
import LanguageStore from 'Stores/Language';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
@ -25,6 +24,8 @@ import { getApp } from 'Helper/Apps/User';
|
||||||
import { view, command, ViewType, routeOff, showScreenPopup } from 'Knoin/Knoin';
|
import { view, command, ViewType, routeOff, showScreenPopup } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
@view({
|
@view({
|
||||||
name: ['View/App/Login', 'View/User/Login'],
|
name: ['View/App/Login', 'View/User/Login'],
|
||||||
type: ViewType.Center,
|
type: ViewType.Center,
|
||||||
|
|
@ -34,9 +35,9 @@ class LoginUserView extends AbstractViewNext {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.hideSubmitButton = Settings.appSettingsGet('hideSubmitButton') ? '' : null;
|
this.hideSubmitButton = Settings.app('hideSubmitButton') ? '' : null;
|
||||||
|
|
||||||
this.welcome = ko.observable(!!Settings.settingsGet('UseLoginWelcomePage'));
|
this.welcome = ko.observable(!!Settings.get('UseLoginWelcomePage'));
|
||||||
|
|
||||||
this.email = ko.observable('');
|
this.email = ko.observable('');
|
||||||
this.password = ko.observable('');
|
this.password = ko.observable('');
|
||||||
|
|
@ -48,14 +49,14 @@ class LoginUserView extends AbstractViewNext {
|
||||||
this.additionalCode.visibility = ko.observable(false);
|
this.additionalCode.visibility = ko.observable(false);
|
||||||
this.additionalCodeSignMe = ko.observable(false);
|
this.additionalCodeSignMe = ko.observable(false);
|
||||||
|
|
||||||
this.logoImg = (Settings.settingsGet('LoginLogo')||'').trim();
|
this.logoImg = (Settings.get('LoginLogo')||'').trim();
|
||||||
this.loginDescription = (Settings.settingsGet('LoginDescription')||'').trim();
|
this.loginDescription = (Settings.get('LoginDescription')||'').trim();
|
||||||
|
|
||||||
this.mobile = !!Settings.appSettingsGet('mobile');
|
this.mobile = !!Settings.app('mobile');
|
||||||
this.mobileDevice = !!Settings.appSettingsGet('mobileDevice');
|
this.mobileDevice = !!Settings.app('mobileDevice');
|
||||||
|
|
||||||
this.forgotPasswordLinkUrl = Settings.appSettingsGet('forgotPasswordLinkUrl');
|
this.forgotPasswordLinkUrl = Settings.app('forgotPasswordLinkUrl');
|
||||||
this.registrationLinkUrl = Settings.appSettingsGet('registrationLinkUrl');
|
this.registrationLinkUrl = Settings.app('registrationLinkUrl');
|
||||||
|
|
||||||
this.emailError = ko.observable(false);
|
this.emailError = ko.observable(false);
|
||||||
this.passwordError = ko.observable(false);
|
this.passwordError = ko.observable(false);
|
||||||
|
|
@ -130,8 +131,8 @@ class LoginUserView extends AbstractViewNext {
|
||||||
|
|
||||||
this.signMeVisibility = ko.computed(() => LoginSignMeType.Unused !== this.signMeType());
|
this.signMeVisibility = ko.computed(() => LoginSignMeType.Unused !== this.signMeType());
|
||||||
|
|
||||||
if (Settings.settingsGet('AdditionalLoginError') && !this.submitError()) {
|
if (Settings.get('AdditionalLoginError') && !this.submitError()) {
|
||||||
this.submitError(Settings.settingsGet('AdditionalLoginError'));
|
this.submitError(Settings.get('AdditionalLoginError'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -231,7 +232,7 @@ class LoginUserView extends AbstractViewNext {
|
||||||
|
|
||||||
onBuild() {
|
onBuild() {
|
||||||
const signMeLocal = Local.get(ClientSideKeyName.LastSignMe),
|
const signMeLocal = Local.get(ClientSideKeyName.LastSignMe),
|
||||||
signMe = (Settings.settingsGet('SignMe') || 'unused').toLowerCase();
|
signMe = (Settings.get('SignMe') || 'unused').toLowerCase();
|
||||||
|
|
||||||
switch (signMe) {
|
switch (signMe) {
|
||||||
case LoginSignMeTypeAsString.DefaultOff:
|
case LoginSignMeTypeAsString.DefaultOff:
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ import SettingsStore from 'Stores/User/Settings';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
import { view, ViewType, showScreenPopup, setHash } from 'Knoin/Knoin';
|
import { view, ViewType, showScreenPopup, setHash } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
@view({
|
@view({
|
||||||
name: 'View/User/MailBox/FolderList',
|
name: 'View/User/MailBox/FolderList',
|
||||||
type: ViewType.Left,
|
type: ViewType.Left,
|
||||||
|
|
@ -60,7 +60,7 @@ class FolderListMailBoxUserView extends AbstractViewNext {
|
||||||
onBuild(dom) {
|
onBuild(dom) {
|
||||||
const qs = s => dom.querySelector(s),
|
const qs = s => dom.querySelector(s),
|
||||||
eqs = (ev, s) => ev.target.closestWithin(s, dom),
|
eqs = (ev, s) => ev.target.closestWithin(s, dom),
|
||||||
isMobile = Settings.appSettingsGet('mobile'),
|
isMobile = Settings.app('mobile'),
|
||||||
fSelectFolder = (el, event, starred) => {
|
fSelectFolder = (el, event, starred) => {
|
||||||
const isMove = moveAction();
|
const isMove = moveAction();
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import SettingsStore from 'Stores/User/Settings';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
@ -44,6 +43,7 @@ import { view, command, ViewType, showScreenPopup, setHash, popupVisibility } fr
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
const
|
const
|
||||||
|
Settings = rl.settings,
|
||||||
canBeMovedHelper = (self) => self.canBeMoved(),
|
canBeMovedHelper = (self) => self.canBeMoved(),
|
||||||
ifvisible = window.ifvisible;
|
ifvisible = window.ifvisible;
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
||||||
|
|
||||||
this.iGoToUpUpOrDownDownTimeout = 0;
|
this.iGoToUpUpOrDownDownTimeout = 0;
|
||||||
|
|
||||||
this.mobile = !!Settings.appSettingsGet('mobile');
|
this.mobile = !!Settings.app('mobile');
|
||||||
this.newMoveToFolder = AppStore.newMoveToFolder;
|
this.newMoveToFolder = AppStore.newMoveToFolder;
|
||||||
|
|
||||||
this.allowReload = !!Settings.capa(Capa.Reload);
|
this.allowReload = !!Settings.capa(Capa.Reload);
|
||||||
|
|
@ -944,7 +944,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
||||||
}
|
}
|
||||||
|
|
||||||
initUploaderForAppend() {
|
initUploaderForAppend() {
|
||||||
if (!Settings.appSettingsGet('allowAppendMessage') || !this.dragOverArea()) {
|
if (!Settings.app('allowAppendMessage') || !this.dragOverArea()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Ajax';
|
||||||
import Promises from 'Promises/User/Ajax';
|
import Promises from 'Promises/User/Ajax';
|
||||||
|
|
@ -48,6 +47,8 @@ import { getApp } from 'Helper/Apps/User';
|
||||||
import { view, command, ViewType, showScreenPopup, createCommand } from 'Knoin/Knoin';
|
import { view, command, ViewType, showScreenPopup, createCommand } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
|
const Settings = rl.settings;
|
||||||
|
|
||||||
@view({
|
@view({
|
||||||
name: 'View/User/MailBox/MessageView',
|
name: 'View/User/MailBox/MessageView',
|
||||||
type: ViewType.Right,
|
type: ViewType.Right,
|
||||||
|
|
@ -87,10 +88,10 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
||||||
this.allowMessageActions = !!Settings.capa(Capa.MessageActions);
|
this.allowMessageActions = !!Settings.capa(Capa.MessageActions);
|
||||||
this.allowMessageListActions = !!Settings.capa(Capa.MessageListActions);
|
this.allowMessageListActions = !!Settings.capa(Capa.MessageListActions);
|
||||||
|
|
||||||
this.logoImg = (Settings.settingsGet('UserLogoMessage')||'').trim();
|
this.logoImg = (Settings.get('UserLogoMessage')||'').trim();
|
||||||
this.logoIframe = (Settings.settingsGet('UserIframeMessage')||'').trim();
|
this.logoIframe = (Settings.get('UserIframeMessage')||'').trim();
|
||||||
|
|
||||||
this.mobile = !!Settings.appSettingsGet('mobile');
|
this.mobile = !!Settings.app('mobile');
|
||||||
|
|
||||||
this.attachmentsActions = AppStore.attachmentsActions;
|
this.attachmentsActions = AppStore.attachmentsActions;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ import { leftPanelDisabled } from 'Common/Globals';
|
||||||
import { settings, inbox } from 'Common/Links';
|
import { settings, inbox } from 'Common/Links';
|
||||||
import { getFolderInboxName } from 'Common/Cache';
|
import { getFolderInboxName } from 'Common/Cache';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import { view, ViewType, setHash, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
import { view, ViewType, setHash, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
|
|
@ -22,7 +20,7 @@ class MenuSettingsUserView extends AbstractViewNext {
|
||||||
|
|
||||||
this.leftPanelDisabled = leftPanelDisabled;
|
this.leftPanelDisabled = leftPanelDisabled;
|
||||||
|
|
||||||
this.mobile = Settings.appSettingsGet('mobile');
|
this.mobile = rl.settings.app('mobile');
|
||||||
|
|
||||||
this.menu = screen.menu;
|
this.menu = screen.menu;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ import { inbox } from 'Common/Links';
|
||||||
import { getFolderInboxName } from 'Common/Cache';
|
import { getFolderInboxName } from 'Common/Cache';
|
||||||
import { leftPanelDisabled } from 'Common/Globals';
|
import { leftPanelDisabled } from 'Common/Globals';
|
||||||
|
|
||||||
import * as Settings from 'Storage/Settings';
|
|
||||||
|
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import { view, ViewType, setHash } from 'Knoin/Knoin';
|
import { view, ViewType, setHash } from 'Knoin/Knoin';
|
||||||
|
|
@ -18,7 +16,7 @@ class PaneSettingsUserView extends AbstractViewNext {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.mobile = Settings.appSettingsGet('mobile');
|
this.mobile = rl.settings.app('mobile');
|
||||||
|
|
||||||
this.leftPanelDisabled = leftPanelDisabled;
|
this.leftPanelDisabled = leftPanelDisabled;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
47
dev/boot.js
47
dev/boot.js
|
|
@ -4,7 +4,7 @@
|
||||||
const
|
const
|
||||||
doc = win.document,
|
doc = win.document,
|
||||||
app = doc.getElementById('rl-app'),
|
app = doc.getElementById('rl-app'),
|
||||||
setPercentWidth = percent => setTimeout(() => progress.style.width = parseInt(Math.min(percent, 100)) + '%', 50),
|
options = app && app.dataset.boot && JSON.parse(app.dataset.boot) || {},
|
||||||
|
|
||||||
Storage = type => {
|
Storage = type => {
|
||||||
let name = type+'Storage';
|
let name = type+'Storage';
|
||||||
|
|
@ -85,10 +85,10 @@ const
|
||||||
},
|
},
|
||||||
|
|
||||||
p = win.progressJs = {
|
p = win.progressJs = {
|
||||||
set: percent => setPercentWidth(percent),
|
set: percent => progress.style.width = Math.min(percent, 100) + '%',
|
||||||
end: () => {
|
end: () => {
|
||||||
if (container) {
|
if (container) {
|
||||||
setPercentWidth(100);
|
p.set(100);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
container.remove();
|
container.remove();
|
||||||
container = progress = null;
|
container = progress = null;
|
||||||
|
|
@ -100,19 +100,19 @@ const
|
||||||
let container = doc.createElement('div'),
|
let container = doc.createElement('div'),
|
||||||
progress = container.appendChild(doc.createElement("div")),
|
progress = container.appendChild(doc.createElement("div")),
|
||||||
|
|
||||||
RL_APP_DATA_STORAGE = null;
|
RL_APP_DATA_STORAGE = {};
|
||||||
|
|
||||||
container.className = 'progressjs-progress progressjs-theme-rainloop';
|
container.className = 'progressjs-progress progressjs-theme-rainloop';
|
||||||
progress.className = "progressjs-inner";
|
progress.className = "progressjs-inner";
|
||||||
progress.appendChild(doc.createElement('div')).className = "progressjs-percent";
|
progress.appendChild(doc.createElement('div')).className = "progressjs-percent";
|
||||||
|
|
||||||
setPercentWidth(1);
|
p.set(1);
|
||||||
doc.body.append(container);
|
doc.body.append(container);
|
||||||
|
|
||||||
Storage('local');
|
Storage('local');
|
||||||
Storage('session');
|
Storage('session');
|
||||||
|
|
||||||
win.RainLoop = {
|
win.rl = {
|
||||||
hash: {
|
hash: {
|
||||||
// getHash
|
// getHash
|
||||||
get: () => storage().getItem(STORAGE_KEY) || null,
|
get: () => storage().getItem(STORAGE_KEY) || null,
|
||||||
|
|
@ -131,13 +131,30 @@ win.RainLoop = {
|
||||||
check: () => {
|
check: () => {
|
||||||
if (timestamp() > (parseInt(storage().getItem(TIME_KEY) || 0, 10) || 0) + 3600000) {
|
if (timestamp() > (parseInt(storage().getItem(TIME_KEY) || 0, 10) || 0) + 3600000) {
|
||||||
// 60m
|
// 60m
|
||||||
RainLoop.hash.clear();
|
rl.hash.clear();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: () => RL_APP_DATA_STORAGE
|
data: () => RL_APP_DATA_STORAGE,
|
||||||
|
adminArea: () => options.admin,
|
||||||
|
settings: {
|
||||||
|
get: name => null == RL_APP_DATA_STORAGE[name] ? null : RL_APP_DATA_STORAGE[name],
|
||||||
|
set: (name, value) => RL_APP_DATA_STORAGE[name] = value,
|
||||||
|
app: name => {
|
||||||
|
const APP_SETTINGS = RL_APP_DATA_STORAGE.System || {};
|
||||||
|
return null == APP_SETTINGS[name] ? null : APP_SETTINGS[name];
|
||||||
|
},
|
||||||
|
capa: name => null != name && Array.isArray(RL_APP_DATA_STORAGE.Capa) && RL_APP_DATA_STORAGE.Capa.includes(name)
|
||||||
|
},
|
||||||
|
setWindowTitle: title => {
|
||||||
|
title = null == title ? '' : '' + title;
|
||||||
|
if (RL_APP_DATA_STORAGE.Title) {
|
||||||
|
title += (title ? ' - ' : '') + RL_APP_DATA_STORAGE.Title;
|
||||||
|
}
|
||||||
|
document.title = null == title ? '' : '' + title;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// init section
|
// init section
|
||||||
|
|
@ -150,7 +167,7 @@ setInterval(setTimestamp, 60000); // 1m
|
||||||
win.__initAppData = appData => {
|
win.__initAppData = appData => {
|
||||||
RL_APP_DATA_STORAGE = appData;
|
RL_APP_DATA_STORAGE = appData;
|
||||||
|
|
||||||
RainLoop.hash.set();
|
rl.hash.set();
|
||||||
|
|
||||||
if (appData) {
|
if (appData) {
|
||||||
const css = appData.IncludeCss,
|
const css = appData.IncludeCss,
|
||||||
|
|
@ -188,7 +205,7 @@ win.__initAppData = appData => {
|
||||||
loadScript(appData.StaticLibJsLink).then(() => {
|
loadScript(appData.StaticLibJsLink).then(() => {
|
||||||
doc.getElementById('rl-check').remove();
|
doc.getElementById('rl-check').remove();
|
||||||
if (appData.IncludeBackground) {
|
if (appData.IncludeBackground) {
|
||||||
const img = appData.IncludeBackground.replace('{{USER}}', RainLoop.hash.get() || '0');
|
const img = appData.IncludeBackground.replace('{{USER}}', rl.hash.get() || '0');
|
||||||
if (img) {
|
if (img) {
|
||||||
doc.documentElement.classList.add('UserBackground');
|
doc.documentElement.classList.add('UserBackground');
|
||||||
doc.body.style.backgroundImage = "url("+img+")";
|
doc.body.style.backgroundImage = "url("+img+")";
|
||||||
|
|
@ -236,10 +253,6 @@ if (!navigator || !navigator.cookieEnabled) {
|
||||||
writeCSS('#rl-content{display:none;}.internal-hiddden{display:none !important;}');
|
writeCSS('#rl-content{display:none;}.internal-hiddden{display:none !important;}');
|
||||||
|
|
||||||
if (app) {
|
if (app) {
|
||||||
const
|
|
||||||
meta = doc.getElementById('app-boot-data'),
|
|
||||||
options = meta ? JSON.parse(meta.getAttribute('content')) || {} : {};
|
|
||||||
|
|
||||||
app.innerHTML = '<div id="rl-loading" class="thm-loading" style="opacity:0">\
|
app.innerHTML = '<div id="rl-loading" class="thm-loading" style="opacity:0">\
|
||||||
<div id="rl-loading-desc"></div>\
|
<div id="rl-loading-desc"></div>\
|
||||||
<div class="e-spinner">\
|
<div class="e-spinner">\
|
||||||
|
|
@ -248,9 +261,7 @@ if (app) {
|
||||||
<div class="e-bounce bounce3"></div>\
|
<div class="e-bounce bounce3"></div>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>\
|
</div>\
|
||||||
<div id="rl-loading-error" class="thm-loading">\
|
<div id="rl-loading-error" class="thm-loading">An error occurred.<br/>Please refresh the page and try again.</div>\
|
||||||
An error occurred. <br /> Please refresh the page and try again.\
|
|
||||||
</div>\
|
|
||||||
<div id="rl-content">\
|
<div id="rl-content">\
|
||||||
<div id="rl-popups"></div>\
|
<div id="rl-popups"></div>\
|
||||||
<div id="rl-center">\
|
<div id="rl-center">\
|
||||||
|
|
@ -268,7 +279,7 @@ if (app) {
|
||||||
+ (options.mobile ? 'mobile' : 'no-mobile')
|
+ (options.mobile ? 'mobile' : 'no-mobile')
|
||||||
+ (options.mobileDevice ? '-1' : '-0')
|
+ (options.mobileDevice ? '-1' : '-0')
|
||||||
+ '/'
|
+ '/'
|
||||||
+ (RainLoop.hash.get() || '0')
|
+ (rl.hash.get() || '0')
|
||||||
+ '/'
|
+ '/'
|
||||||
+ Math.random().toString().substr(2)
|
+ Math.random().toString().substr(2)
|
||||||
+ '/').then(() => {});
|
+ '/').then(() => {});
|
||||||
|
|
|
||||||
7
dev/bootstrap.js
vendored
7
dev/bootstrap.js
vendored
|
|
@ -64,12 +64,7 @@ export default (App) => {
|
||||||
cb = () => setTimeout(() => {
|
cb = () => setTimeout(() => {
|
||||||
if (window.rainloopTEMPLATES && rainloopTEMPLATES[0]) {
|
if (window.rainloopTEMPLATES && rainloopTEMPLATES[0]) {
|
||||||
doc.getElementById('rl-templates').innerHTML = rainloopTEMPLATES[0];
|
doc.getElementById('rl-templates').innerHTML = rainloopTEMPLATES[0];
|
||||||
setTimeout(() => {
|
setTimeout(() => App.bootstart(), 10);
|
||||||
$htmlCL.remove('no-js', 'rl-booted-trigger');
|
|
||||||
$htmlCL.add('rl-booted');
|
|
||||||
|
|
||||||
App.bootstart();
|
|
||||||
}, 10);
|
|
||||||
} else {
|
} else {
|
||||||
fErrorCallback();
|
fErrorCallback();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html class="no-js rl-booted-trigger rl-started-trigger glass" dir="{{BaseDir}}">
|
<html class="rl-started-trigger glass" dir="{{BaseDir}}">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<meta name="google" content="notranslate" />
|
<meta name="google" content="notranslate" />
|
||||||
<meta name="robots" content="noindex,nofollow,noodp" />
|
<meta name="robots" content="noindex,nofollow,noodp" />
|
||||||
<meta name="AppBootData" content='{{RainloopBootData}}' id="app-boot-data" />
|
|
||||||
<title></title>
|
<title></title>
|
||||||
{{BaseAppFaviconPngLinkTag}}
|
{{BaseAppFaviconPngLinkTag}}
|
||||||
{{BaseAppFaviconTouchLinkTag}}
|
{{BaseAppFaviconTouchLinkTag}}
|
||||||
|
|
@ -20,7 +19,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="thm-body">
|
<body class="thm-body">
|
||||||
<div id="rl-app"></div>
|
<div id="rl-app" data-boot='{{RainloopBootData}}'></div>
|
||||||
<div id="rl-check"></div>
|
<div id="rl-check"></div>
|
||||||
<script type="text/javascript" data-cfasync="false" src="{{BaseAppBootScriptLink}}"></script>
|
<script type="text/javascript" data-cfasync="false" src="{{BaseAppBootScriptLink}}"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
10
vendors/bootstrap/less/mixins.less
vendored
10
vendors/bootstrap/less/mixins.less
vendored
|
|
@ -36,6 +36,16 @@
|
||||||
// FORMS
|
// FORMS
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
// Block level inputs
|
||||||
|
.input-block-level {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 30px; // Make inputs at least the height of their button counterpart
|
||||||
|
box-sizing: border-box; // Makes inputs behave like true block-level elements
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Mixin for form field states
|
// Mixin for form field states
|
||||||
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
|
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
|
||||||
// Set the text color
|
// Set the text color
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue