mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Speedup boot.js: no need to load CKEditor/Squire when not logged in
This commit is contained in:
parent
a27c3befa8
commit
acda0e8883
2 changed files with 17 additions and 18 deletions
33
dev/boot.js
33
dev/boot.js
|
|
@ -156,6 +156,14 @@ win.__initAppData = appData => {
|
||||||
}
|
}
|
||||||
|
|
||||||
appData.IncludeCss && writeCSS(appData.IncludeCss);
|
appData.IncludeCss && writeCSS(appData.IncludeCss);
|
||||||
|
|
||||||
|
if (appData.IncludeBackground) {
|
||||||
|
const img = appData.IncludeBackground.replace('{{USER}}', rl.hash.get() || '0');
|
||||||
|
if (img) {
|
||||||
|
html.classList.add('UserBackground');
|
||||||
|
doc.body.style.backgroundImage = "url("+img+")";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -163,23 +171,11 @@ win.__initAppData = appData => {
|
||||||
appData.TemplatesLink &&
|
appData.TemplatesLink &&
|
||||||
appData.LangLink &&
|
appData.LangLink &&
|
||||||
appData.StaticLibJsLink &&
|
appData.StaticLibJsLink &&
|
||||||
appData.StaticAppJsLink &&
|
appData.StaticAppJsLink
|
||||||
appData.StaticEditorJsLink
|
|
||||||
) {
|
) {
|
||||||
p.set(5);
|
p.set(5);
|
||||||
|
|
||||||
const libs = () =>
|
loadScript(appData.StaticLibJsLink)
|
||||||
loadScript(appData.StaticLibJsLink).then(() => {
|
|
||||||
if (appData.IncludeBackground) {
|
|
||||||
const img = appData.IncludeBackground.replace('{{USER}}', rl.hash.get() || '0');
|
|
||||||
if (img) {
|
|
||||||
html.classList.add('UserBackground');
|
|
||||||
doc.body.style.backgroundImage = "url("+img+")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
libs()
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
p.set(20);
|
p.set(20);
|
||||||
return Promise.all([loadScript(appData.TemplatesLink), loadScript(appData.LangLink)]);
|
return Promise.all([loadScript(appData.TemplatesLink), loadScript(appData.LangLink)]);
|
||||||
|
|
@ -200,10 +196,13 @@ win.__initAppData = appData => {
|
||||||
runMainBoot(true);
|
runMainBoot(true);
|
||||||
throw e;
|
throw e;
|
||||||
})
|
})
|
||||||
.then(() => loadScript(appData.StaticEditorJsLink))
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
win.__initEditor && win.__initEditor();
|
if (appData.Auth) {
|
||||||
win.__initEditor = null;
|
loadScript(appData.StaticEditorJsLink).then(() => {
|
||||||
|
win.__initEditor && win.__initEditor();
|
||||||
|
win.__initEditor = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
runMainBoot(true);
|
runMainBoot(true);
|
||||||
|
|
|
||||||
2
dev/bootstrap.js
vendored
2
dev/bootstrap.js
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
import { data as GlobalsData, bMobileDevice, dropdownVisibility } from 'Common/Globals';
|
import { data as GlobalsData, dropdownVisibility } from 'Common/Globals';
|
||||||
import * as Enums from 'Common/Enums';
|
import * as Enums from 'Common/Enums';
|
||||||
import * as Plugins from 'Common/Plugins';
|
import * as Plugins from 'Common/Plugins';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue