This commit is contained in:
the-djmaze 2023-01-19 15:49:49 +01:00
parent 7feb9a9f41
commit dba125ad59

View file

@ -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);