mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-05 06:22:52 +08:00
Change for #864
This commit is contained in:
parent
7feb9a9f41
commit
dba125ad59
1 changed files with 3 additions and 2 deletions
|
@ -1,11 +1,12 @@
|
||||||
(doc => {
|
(doc => {
|
||||||
|
|
||||||
const
|
const
|
||||||
|
query = path => doc.location.pathname.replace(/\/+$/,'') + '/?/' + path,
|
||||||
eId = id => doc.getElementById('rl-'+id),
|
eId = id => doc.getElementById('rl-'+id),
|
||||||
app = eId('app'),
|
app = eId('app'),
|
||||||
admin = app && '1' == app.dataset.admin,
|
admin = app && '1' == app.dataset.admin,
|
||||||
layout = doc.cookie.match(/(^|;) ?rllayout=([^;]+)/) || '',
|
layout = doc.cookie.match(/(^|;) ?rllayout=([^;]+)/) || '',
|
||||||
redirect = path => doc.location.replace('./?/'+path),
|
redirect = path => doc.location.replace(query(path)),
|
||||||
|
|
||||||
showError = msg => {
|
showError = msg => {
|
||||||
let div = eId('loading-error');
|
let div = eId('loading-error');
|
||||||
|
@ -86,7 +87,7 @@ window.rl = {
|
||||||
loadScript: loadScript
|
loadScript: loadScript
|
||||||
};
|
};
|
||||||
|
|
||||||
loadScript(`./?/${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`)
|
loadScript(query(`${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`))
|
||||||
.catch(e => showError(e));
|
.catch(e => showError(e));
|
||||||
|
|
||||||
})(document);
|
})(document);
|
||||||
|
|
Loading…
Reference in a new issue