Compare commits

...

2 Commits

Author SHA1 Message Date
d38713e7ed - introduced version number
- introduced option to disable reload for this session
2023-07-07 15:29:46 +02:00
5584cc5c41 - introduced a version inducator in the sidebar 2023-07-07 15:25:06 +02:00
3 changed files with 26 additions and 0 deletions

View File

@ -177,6 +177,7 @@
}); });
</script> </script>
</ul> </ul>
<div onclick="toggleAutoReload();" class="text-secondary versionInfo nav flex-column position-absolute bottom-0 align-items-center w-100">AssetFlow Alpha V0.0.1 </div>
</nav> </nav>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4" style="min-height: 100%"> <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4" style="min-height: 100%">

View File

@ -12,6 +12,10 @@ body {
} }
} }
.versionInfo {
font-size: 0.75rem;
}
/** Safari */ /** Safari */
@media not all and (min-resolution:.001dpcm) { @media not all and (min-resolution:.001dpcm) {

View File

@ -1,5 +1,12 @@
currentToasts = []; currentToasts = [];
var forceSkipReload = false; var forceSkipReload = false;
forceSkipReload = localStorage.getItem('forceSkipReload') === 'true';
if(forceSkipReload) {
setTimeout(() => {
createNewToast('Auto reload still disabled, click version number to reenable.', 'text-bg-warning', 3000, false);
}, 1000);
}
/** /**
* Generic function to create a new toast * Generic function to create a new toast
* @param {String} message The message to be displayed * @param {String} message The message to be displayed
@ -48,3 +55,17 @@ function normalizeToast() {
$('#generalToast').removeClass('text-bg-warning'); $('#generalToast').removeClass('text-bg-warning');
$('#generalToast').removeClass('text-bg-info'); $('#generalToast').removeClass('text-bg-info');
} }
/**
* Function to handle the "secret" function to globally disable auto reload
*/
function toggleAutoReload() {
forceSkipReload = !forceSkipReload;
if(forceSkipReload) {
createNewToast('Auto reload disabled', 'text-bg-warning', 1500, false);
} else {
createNewToast('Auto reload enabled', 'text-bg-success', 1500, false);
}
// Store the value in local storage
localStorage.setItem('forceSkipReload', forceSkipReload);
}