aktueller stand
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
(function gateAssets() {
|
||||
const API_URL = 'https://fb.srv.medeba-media.de/api';
|
||||
const LOGIN_PAGE = 'login.html';
|
||||
const ASSET_VERSION = '__ASSET_VERSION__';
|
||||
const cssFiles = [
|
||||
{ href: 'style.css' },
|
||||
{ href: 'dashboard.css' },
|
||||
@@ -33,6 +34,14 @@
|
||||
'daily-bookmarks.js'
|
||||
];
|
||||
|
||||
function withVersion(value) {
|
||||
if (!ASSET_VERSION) {
|
||||
return value;
|
||||
}
|
||||
const joiner = value.includes('?') ? '&' : '?';
|
||||
return `${value}${joiner}v=${ASSET_VERSION}`;
|
||||
}
|
||||
|
||||
function redirectToLogin() {
|
||||
try {
|
||||
const redirect = encodeURIComponent(window.location.href);
|
||||
@@ -46,7 +55,7 @@
|
||||
cssFiles.forEach(({ href, id, disabled }) => {
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = href;
|
||||
link.href = withVersion(href);
|
||||
if (id) link.id = id;
|
||||
if (disabled) link.disabled = true;
|
||||
document.head.appendChild(link);
|
||||
@@ -60,7 +69,7 @@
|
||||
return;
|
||||
}
|
||||
const script = document.createElement('script');
|
||||
script.src = list[index];
|
||||
script.src = withVersion(list[index]);
|
||||
script.onload = () => loadScriptsSequentially(list, index + 1).then(resolve).catch(reject);
|
||||
script.onerror = reject;
|
||||
document.body.appendChild(script);
|
||||
|
||||
Reference in New Issue
Block a user