diff --git a/dev/Common/Booter.js b/dev/Common/Booter.js index f3ca0a320..76abd5929 100644 --- a/dev/Common/Booter.js +++ b/dev/Common/Booter.js @@ -66,7 +66,17 @@ function getComputedStyle(id, name) { * @returns {void} */ function includeStyle(styles) { - window.document.write(unescape('%3Csty' + 'le%3E' + styles + '"%3E%3C/' + 'sty' + 'le%3E')); // eslint-disable-line no-useless-concat + const style = window.document.createElement('style'); + style.type = 'text/css'; + style.text = styles; + + if (style.styleSheet) { + style.styleSheet.cssText = styles; + } else { + style.appendChild(window.document.createTextNode(styles)); + } + + window.document.getElementsByTagName('head')[0].appendChild(style); } /** @@ -74,19 +84,11 @@ function includeStyle(styles) { * @returns {void} */ function includeScr(src) { - window.document.write( - unescape( - '%3Csc' + - 'ript type="text/jav' + - 'ascr' + - 'ipt" data-cfasync="false" sr' + - 'c="' + - src + - '"%3E%3C/' + - 'scr' + - 'ipt%3E' - ) - ); // eslint-disable-line no-useless-concat + const script = window.document.createElement('script'); + script.type = 'text/javascript'; + script.src = src; + + window.document.getElementsByTagName('head')[0].appendChild(script); } /** @@ -217,7 +219,6 @@ function runApp() { jassl && progressJs && appData && - appData.TemplatesLink && appData.LangLink && appData.StaticLibJsLink && appData.StaticAppJsLink && @@ -250,7 +251,7 @@ function runApp() { libs() .then(() => { p.set(20); - return window.Promise.all([jassl(appData.TemplatesLink), jassl(appData.LangLink)]); + return jassl(appData.LangLink); }) .then(() => { p.set(30); diff --git a/dev/bootstrap.js b/dev/bootstrap.js index 5106eeb5d..af0f1506c 100644 --- a/dev/bootstrap.js +++ b/dev/bootstrap.js @@ -33,17 +33,22 @@ export default (App) => { window.rl = rl; + const start = () => { + window.setTimeout(() => { + $html.removeClass('no-js rl-booted-trigger').addClass('rl-booted'); + + App.bootstart(); + }, Enums.Magics.Time10ms); + }; + window.__APP_BOOT = (fErrorCallback) => { domReady(() => { window.setTimeout(() => { - if (window.rainloopTEMPLATES && window.rainloopTEMPLATES[0]) { + if (window.document.getElementById('rainloop-templates-id')) { + start(); + } else if (window.rainloopTEMPLATES && window.rainloopTEMPLATES[0]) { window.document.getElementById('rl-templates').innerHTML = window.rainloopTEMPLATES[0]; - - window.setTimeout(() => { - $html.removeClass('no-js rl-booted-trigger').addClass('rl-booted'); - - App.bootstart(); - }, Enums.Magics.Time10ms); + start(); } else { fErrorCallback(); } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 9f7341ee4..bbf181b90 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1525,7 +1525,7 @@ class Actions /* required by Index.html and rl.js: -NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBackground PluginsLink AuthAccountHash +NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground PluginsLink AuthAccountHash */ $aResult = array( @@ -1973,7 +1973,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack $aResult['LangLink'] = './?/Lang/0/'.($bAdmin ? 'Admin' : 'App').'/'. ($bAdmin ? $aResult['LanguageAdmin'] : $aResult['Language']).'/'.$sStaticCache.'/'; - $aResult['TemplatesLink'] = './?/Templates/0/'.($bAdmin ? 'Admin' : 'App').'/'.$sStaticCache.'/'; + // $aResult['TemplatesLink'] = './?/Templates/0/'.($bAdmin ? 'Admin' : 'App').'/'.$sStaticCache.'/'; $bAppJsDebug = !!$this->Config()->Get('labs', 'use_app_debug_js', false); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php index 9d80121a1..8fffce1b6 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php @@ -213,7 +213,7 @@ class Service if (0 === \strlen($sResult)) { -// $aTemplateParameters['{{BaseTemplates}}'] = $this->oServiceActions->compileTemplates($bAdmin, false); + $aTemplateParameters['{{BaseTemplates}}'] = $this->oServiceActions->compileTemplates($bAdmin, false); $sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'), $aTemplateParameters); $sResult = \RainLoop\Utils::ClearHtmlOutput($sResult); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index 873934e81..4d8311bcd 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -1302,7 +1302,7 @@ class ServiceActions $this->oActions->Plugins()->CompileTemplate($aTemplates, $bAdmin); - $sHtml = ''; + $sHtml = ''; foreach ($aTemplates as $sName => $sFile) { $sName = \preg_replace('/[^a-zA-Z0-9]/', '', $sName); diff --git a/rainloop/v/0.0.0/app/templates/Index.html b/rainloop/v/0.0.0/app/templates/Index.html index 1a3d7d2b5..dbfe75077 100644 --- a/rainloop/v/0.0.0/app/templates/Index.html +++ b/rainloop/v/0.0.0/app/templates/Index.html @@ -1,33 +1,37 @@ - - - - - - - - - - - - {{BaseContentSecurityPolicy}} - - {{BaseAppHeadScriptLink}} - {{BaseAppFaviconPngLinkTag}} - {{BaseAppFaviconTouchLinkTag}} - - - - - -
-
- {{BaseAppBodyScript}} - - - + + + + + + + + + {{BaseContentSecurityPolicy}} + + {{BaseAppHeadScriptLink}} + {{BaseAppFaviconPngLinkTag}} + {{BaseAppFaviconTouchLinkTag}} + + + + + + +
+
+ {{BaseTemplates}} + {{BaseAppBodyScript}} + + + + \ No newline at end of file