urlparams: rewrite
这个提交包含在:
父节点
01245c4477
当前提交
42e37585d6
13
Js/Main.js
13
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;";
|
||||
|
@ -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>
|
||||
|
正在加载...
x
在新工单中引用
屏蔽一个用户