This repository has been archived on 2026-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
ResourceGeneratorPlugin/template/client/html/loadsplash.js

47 lines
997 B
JavaScript

$(function () {
function showSplash(bool) {
if (bool) {
$("#splashScreen").show();
} else {
$("#splashScreen").hide();
}
}
function showLoadingSplash(bool) {
if (bool) {
$("#splashScreen").show();
$("#loader").show();
} else {
$("#splashScreen").hide();
$("#loader").hide();
}
}
window.addEventListener('message', function(event) {
var item = event.data;
// Show or hide the splash screen without loading spinner
if (item.type === "showSplash") {
if (item.status == true) {
showSplash(true)
} else {
showSplash(false)
}
}
// Show or hide the loading splash screen
if (item.type === "showLoadingSplash") {
if (item.status == true) {
showLoadingSplash(true)
} else {
showLoadingSplash(false)
}
}
if (item.type === "setIMG") {
document.getElementById("bgIMG").src = item.value;
}
})
showLoadingSplash(false)
})