diff --git a/dev/Common/Links.js b/dev/Common/Links.js index ec6d9175b..db157b233 100644 --- a/dev/Common/Links.js +++ b/dev/Common/Links.js @@ -1,13 +1,13 @@ import { pInt } from 'Common/Utils'; -import { Settings } from 'Common/Globals'; +import { doc, Settings } from 'Common/Globals'; const + BASE = doc.location.pathname.replace(/\/+$/,'') + '/', HASH_PREFIX = '#/', - SERVER_PREFIX = './?', adminPath = () => rl.adminArea() && !Settings.app('adminHostUse'), - prefix = () => SERVER_PREFIX + (adminPath() ? Settings.app('adminPath') : ''); + prefix = () => BASE + '?' + (adminPath() ? Settings.app('adminPath') : ''); export const SUB_QUERY_PREFIX = '&q[]=', @@ -21,7 +21,7 @@ export const /** * @returns {string} */ - logoutLink = () => adminPath() ? prefix() : './', + logoutLink = () => adminPath() ? prefix() : BASE, /** * @param {string} type @@ -30,7 +30,7 @@ export const * @returns {string} */ serverRequestRaw = (type, hash) => - SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/' + BASE + '?/Raw/' + SUB_QUERY_PREFIX + '/' + '0/' // Settings.get('AccountHash') ? + (type ? type + '/' + (hash ? SUB_QUERY_PREFIX + '/' + hash : '') @@ -45,7 +45,7 @@ export const serverRequestRaw('Download', download, customSpecSuffix), proxy = url => - SERVER_PREFIX + '/ProxyExternal/' + BASE + '?/ProxyExternal/' + btoa(url.replace(/ /g, '%20')).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''), // + b64EncodeJSONSafe(url.replace(/ /g, '%20')), @@ -55,13 +55,16 @@ export const */ serverRequest = type => prefix() + '/' + type + '/' + SUB_QUERY_PREFIX + '/0/', + // Is '?/Css/0/Admin' needed? + cssLink = theme => BASE + '?/Css/0/User/-/' + encodeURI(theme) + '/-/' + Date.now() + '/Hash/-/Json/', + /** * @param {string} lang * @param {boolean} isAdmin * @returns {string} */ langLink = (lang, isAdmin) => - SERVER_PREFIX + '/Lang/0/' + (isAdmin ? 'Admin' : 'App') + BASE + '?/Lang/0/' + (isAdmin ? 'Admin' : 'App') + '/' + encodeURI(lang) + '/' + Settings.app('version') + '/', diff --git a/dev/Stores/Theme.js b/dev/Stores/Theme.js index 4a739791b..afc8dcbba 100644 --- a/dev/Stores/Theme.js +++ b/dev/Stores/Theme.js @@ -1,7 +1,7 @@ import ko from 'ko'; import { $htmlCL, elementById, leftPanelDisabled, Settings, SettingsGet } from 'Common/Globals'; import { isArray, arrayLength } from 'Common/Utils'; -import { serverRequestRaw } from 'Common/Links'; +import { cssLink, serverRequestRaw } from 'Common/Links'; import { SaveSettingStatus } from 'Common/Enums'; let __themeTimer = 0; @@ -41,7 +41,7 @@ export const clearTimer = () => { __themeTimer = setTimeout(() => themeTrigger(SaveSettingStatus.Idle), 1000); }, - url = themeStyle.dataset.href.replace(/(Admin|User)\/-\/[^/]+\//, '$1/-/' + value + '/') + 'Json/'; + url = cssLink(value); clearTimeout(__themeTimer); diff --git a/dev/boot.js b/dev/boot.js index 1acf8ac7f..308af2848 100644 --- a/dev/boot.js +++ b/dev/boot.js @@ -1,12 +1,12 @@ (doc => { const - query = path => doc.location.pathname.replace(/\/+$/,'') + '/?/' + path, + qUri = path => doc.location.pathname.replace(/\/+$/,'') + '/?/' + path, eId = id => doc.getElementById('rl-'+id), app = eId('app'), admin = app && '1' == app.dataset.admin, layout = doc.cookie.match(/(^|;) ?rllayout=([^;]+)/) || '', - redirect = path => doc.location.replace(query(path)), + redirect = path => doc.location.replace(qUri(path)), showError = msg => { let div = eId('loading-error'); @@ -68,7 +68,7 @@ window.rl = { cb = () => rl.app.bootstart(); loadScript(url) .then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`))) - .then(() => appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve()) + .then(() => appData.PluginsLink ? loadScript(qUri(appData.PluginsLink)) : Promise.resolve()) .then(() => rl.app ? cb() : doc.addEventListener('readystatechange', () => 'complete' == doc.readyState && cb()) @@ -87,7 +87,7 @@ window.rl = { loadScript: loadScript }; -loadScript(query(`${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`)) +loadScript(qUri(`${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`)) .catch(e => showError(e)); })(document); diff --git a/integrations/nextcloud/snappymail/css/embed.css b/integrations/nextcloud/snappymail/css/embed.css index 4167e4f41..1ef4d822b 100644 --- a/integrations/nextcloud/snappymail/css/embed.css +++ b/integrations/nextcloud/snappymail/css/embed.css @@ -9,6 +9,10 @@ This stylesheet is used when SnappyMail runs in embed mode. min-height: 100%; } +#content #rl-app #rl-left, #content #rl-app #rl-right { + position: absolute; +} + .squire-wysiwyg { min-width: 100%; min-height: 100%; diff --git a/integrations/nextcloud/snappymail/lib/Controller/PageController.php b/integrations/nextcloud/snappymail/lib/Controller/PageController.php index c01981951..e2b8a5309 100644 --- a/integrations/nextcloud/snappymail/lib/Controller/PageController.php +++ b/integrations/nextcloud/snappymail/lib/Controller/PageController.php @@ -66,7 +66,6 @@ class PageController extends Controller 'BaseAppBootScriptNonce' => $sNonce, 'BaseLanguage' => $oActions->compileLanguage($sLanguage, $bAdmin), 'BaseAppBootCss' => \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot'.$sAppCssMin.'.css'), - 'BaseAppThemeCssLink' => $oActions->ThemeLink($bAdmin), 'BaseAppThemeCss' => \preg_replace( '/\\s*([:;{},]+)\\s*/s', '$1', diff --git a/integrations/nextcloud/snappymail/templates/index_embed.php b/integrations/nextcloud/snappymail/templates/index_embed.php index c51f8e355..4384bef5d 100755 --- a/integrations/nextcloud/snappymail/templates/index_embed.php +++ b/integrations/nextcloud/snappymail/templates/index_embed.php @@ -1,5 +1,5 @@ - +