mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Use jassl lib
This commit is contained in:
parent
e451b2aaf9
commit
acd271974d
7 changed files with 601 additions and 39 deletions
|
|
@ -1280,7 +1280,7 @@ class AppUser extends AbstractApp
|
|||
kn.routeOn();
|
||||
}
|
||||
|
||||
if (window.jsloader && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
|
||||
if (window.jassl && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
|
||||
{
|
||||
const openpgpCallback = (openpgp) => {
|
||||
|
||||
|
|
@ -1312,7 +1312,7 @@ class AppUser extends AbstractApp
|
|||
}
|
||||
else
|
||||
{
|
||||
window.jsloader(Links.openPgpJs()).then(() => {
|
||||
window.jassl(Links.openPgpJs()).then(() => {
|
||||
if (window.openpgp)
|
||||
{
|
||||
openpgpCallback(window.openpgp);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
import window from 'window';
|
||||
import $ from '$';
|
||||
import progressJs from 'progressJs';
|
||||
|
||||
import rainLoopStorage from 'Storage/RainLoop';
|
||||
|
|
@ -152,7 +151,7 @@ function runApp()
|
|||
{
|
||||
const appData = window.__rlah_data();
|
||||
|
||||
if (window.jsloader && progressJs && appData && appData.TemplatesLink && appData.LangLink &&
|
||||
if (window.jassl && progressJs && appData && appData.TemplatesLink && appData.LangLink &&
|
||||
appData.StaticLibJsLink && appData.StaticAppJsLink && appData.StaticEditorJsLink)
|
||||
{
|
||||
const p = progressJs;
|
||||
|
|
@ -161,7 +160,7 @@ function runApp()
|
|||
p.start().set(5);
|
||||
|
||||
const
|
||||
libs = window.jsloader(appData.StaticLibJsLink).then(() => {
|
||||
libs = window.jassl(appData.StaticLibJsLink).then(() => {
|
||||
if (window.$)
|
||||
{
|
||||
if (!window.$('#rl-check').is(':visible'))
|
||||
|
|
@ -183,18 +182,18 @@ function runApp()
|
|||
}
|
||||
}),
|
||||
common = window.Promise.all([
|
||||
window.jsloader(appData.TemplatesLink),
|
||||
window.jsloader(appData.LangLink)
|
||||
window.jassl(appData.TemplatesLink),
|
||||
window.jassl(appData.LangLink)
|
||||
])
|
||||
;
|
||||
|
||||
window.Promise.all([libs, common])
|
||||
.then(() => {
|
||||
p.set(30);
|
||||
return window.jsloader(appData.StaticAppJsLink);
|
||||
return window.jassl(appData.StaticAppJsLink);
|
||||
}).then(() => {
|
||||
p.set(50);
|
||||
return appData.PluginsLink ? window.jsloader(appData.PluginsLink) : window.Promise.resolve();
|
||||
return appData.PluginsLink ? window.jassl(appData.PluginsLink) : window.Promise.resolve();
|
||||
}).then(() => {
|
||||
p.set(70);
|
||||
runMainBoot(false);
|
||||
|
|
@ -202,7 +201,7 @@ function runApp()
|
|||
runMainBoot(true);
|
||||
throw e;
|
||||
}).then(() => {
|
||||
return window.jsloader(appData.StaticEditorJsLink);
|
||||
return window.jassl(appData.StaticEditorJsLink);
|
||||
}).then(() => {
|
||||
if (window.CKEDITOR && window.__initEditor) {
|
||||
window.__initEditor();
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
|
||||
import window from 'window';
|
||||
import {Promise} from 'es6-promise-polyfill/promise.js';
|
||||
|
||||
window.Promise = window.Promise || Promise;
|
||||
|
||||
export default (url) => {
|
||||
return new window.Promise((resolve, reject) => {
|
||||
|
||||
const element = document.createElement('script');
|
||||
|
||||
element.onload = () => {
|
||||
resolve(url);
|
||||
};
|
||||
|
||||
element.onerror = () => {
|
||||
reject(new Error(url));
|
||||
};
|
||||
|
||||
element.async = true;
|
||||
element.src = url;
|
||||
|
||||
document.body.appendChild(element);
|
||||
});
|
||||
};
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
|
||||
import window from 'window';
|
||||
import jsloader from 'Common/Loader';
|
||||
import {Promise} from 'es6-promise-polyfill/promise.js';
|
||||
import {progressJs} from 'progress.js/src/progress.js';
|
||||
import jassl from 'jassl';
|
||||
|
||||
window.jsloader = jsloader;
|
||||
window.Promise = window.Promise || Promise;
|
||||
window.progressJs = window.progressJs || progressJs();
|
||||
window.jassl = jassl;
|
||||
|
||||
window.progressJs.onbeforeend(() => {
|
||||
if (window.$)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue