diff --git a/Js/Main.js b/Js/Main.js index 55c82f7..805e612 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -54,6 +54,7 @@ function onBodyLoaded() { (function checkIsLoaded() { if(bodyLoaded) { document.getElementById('loading-font').style.cssText = "display: none;"; + loadQueryParameters(); loadLocalStorage(); } if(utageLoaded && languagesLoaded) { @@ -77,15 +78,11 @@ function onAllLoaded(success) { document.getElementById('parent-container').style.cssText = "opacity: 1;"; onWindowResize(); window.addEventListener("resize", onWindowResize); - if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { - document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; - } }, 0); } function loadLocalStorage() { try { - urlParams = commonFunctions.readQueryParameters(); //audio volume = localStorage.getItem('volume') || 0.5; volume = Number(volume); @@ -156,6 +153,14 @@ function buildLanguageList() { selectBox.value = selectedLang; } +function loadQueryParameters() { + urlParams = commonFunctions.readQueryParameters(); + if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { + document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; + } +} + + function playFromQuery(event) { missionChanged(urlParams['mstid'], urlParams['id']); document.getElementById('play-from-query').style.cssText = "display: none;"; diff --git a/Player.html b/Player.html index 32a0a3a..0e2bcb9 100644 --- a/Player.html +++ b/Player.html @@ -18,7 +18,7 @@ --> -