urlparams: rewrite

这个提交包含在:
louis f 2018-12-29 12:45:27 -05:00
父节点 01245c4477
当前提交 42e37585d6
共有 2 个文件被更改,包括 11 次插入6 次删除

查看文件

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

查看文件

@ -18,7 +18,7 @@
<script src="Js/Player.js"></script>
<script src="Js/Main.js"></script> -->
<script src="Js/XduPlayer.min.js"></script>
<div id="loading-container" class="centered">
<div id="loading-container" class="centered" style="z-index: 20;">
<h2 id="loading-utage">Loading Utage Data...</h2>
<h2 id="loading-font">Loading Page Data...</h2>
</div>
@ -78,4 +78,4 @@
<span style="font-family: 'SourceCodePro-Regular'">test</span> -->
</div>
</body>
</html>
</html>