Skip to content

Commit

Permalink
不能等windows.onload,太慢了
Browse files Browse the repository at this point in the history
  • Loading branch information
Mapaler committed Jan 17, 2024
1 parent 1aae6a6 commit da75974
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions doc/export-player-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@
} else {
console.error('浏览器不支持 servcie worker');
}
window.addEventListener("load", ()=>{
const langCss = document.querySelector("#language-style");
function changeLanguage(){
langCss.innerHTML = this.value == "all" ? '' : `[lang]:not(:lang(${this.value})){display: none}`;
}
const languageInputs = document.getElementsByName("language");
languageInputs.forEach(input=>{input.onchange=changeLanguage; if(input.checked) input.onchange()});
const openAllDetails = document.querySelector("#open-all-details");
openAllDetails.onclick = function(){
document.querySelectorAll("details").forEach(node=>node.open=true);
}
});
</script>
<style id="language-style" type="text/css">
</style>
Expand All @@ -86,6 +74,18 @@
<li><label><input type="radio" name="language" value="all"/><span lang="zh">同时显示中英</span><span lang="en">Show Chinese and English both</span></label></li>
<li><label><button id="open-all-details"><span lang="zh">打开所有折叠内容</span><span lang="en">Open all collapsed content</span></button></li>
</ul>
<script type="text/javascript">
const langCss = document.querySelector("#language-style");
function changeLanguage(){
langCss.innerHTML = this.value == "all" ? '' : `[lang]:not(:lang(${this.value})){display: none}`;
}
const languageInputs = document.getElementsByName("language");
languageInputs.forEach(input=>{input.onchange=changeLanguage; if(input.checked) input.onchange()});
const openAllDetails = document.querySelector("#open-all-details");
openAllDetails.onclick = function(){
document.querySelectorAll("details").forEach(node=>node.open=true);
}
</script>
<h1>
<span lang="zh">如何获取用户游戏数据</span>
<span lang="en">How to get user game data</span>
Expand Down
16 changes: 8 additions & 8 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@
} else {
console.error('浏览器不支持 servcie worker');
}
window.addEventListener("load", ()=>{
const langCss = document.querySelector("#language-style");
function changeLanguage(){
langCss.innerHTML = this.value == "all" ? '' : `[lang]:not(:lang(${this.value})){display: none}`;
}
const languageInputs = document.getElementsByName("language");
languageInputs.forEach(input=>{input.onchange=changeLanguage; if(input.checked) input.onchange()});
});
</script>
<style id="language-style" type="text/css">
</style>
Expand All @@ -81,6 +73,14 @@
<li><label><input type="radio" name="language" value="en" checked/>English</label></li>
<li><label><input type="radio" name="language" value="all"/><span lang="zh">同时显示中英</span><span lang="en">Show Chinese and English both</span></label></li>
</ul>
<script type="text/javascript">
const langCss = document.querySelector("#language-style");
function changeLanguage(){
langCss.innerHTML = this.value == "all" ? '' : `[lang]:not(:lang(${this.value})){display: none}`;
}
const languageInputs = document.getElementsByName("language");
languageInputs.forEach(input=>{input.onchange=changeLanguage; if(input.checked) input.onchange()});
</script>
<h1>
<span lang="zh"><em>智龙迷城急速阵型</em> 使用技巧</span>
<span lang="en">Tips of <em>Puzzle &amp; Dragons Dash Formation</em></span>
Expand Down
4 changes: 2 additions & 2 deletions monsters-info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ Turn on Fidder's "Allow remote computers to connet", "HTTPS decrypt", "Stream" a
* 现在你运行模拟器内的游戏,Fidder 就能够截获和解密智龙迷城的数据了。将返回的 JSON 数据保存为文件。
Now that you're running the game inside the simulator, Fidder will be able to intercept and decrypt the data from the PAD. Save the response JSON data as a file.

* [可选的]将以下代码加入 Fidder 的自定义代码的`OnBeforeResponse`中就可以每次自动保存文件了。
[Optional]Add the following code to `OnBeforeResponse` of Fidder's **Customize Rules** to save the file automatically each time.
* \[可选的\]将以下代码加入 Fidder 的自定义代码的`OnBeforeResponse`中就可以每次自动保存文件了。
\[Optional\]Add the following code to `OnBeforeResponse` of Fidder's **Customize Rules** to save the file automatically each time.

```js
//自动储存智龙迷城数据
Expand Down
4 changes: 2 additions & 2 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21907,11 +21907,11 @@ const cachesMap = new Map([
],
[
"doc/export-player-data.html",
"bab0f4066b2f9a6e193f7e271ab85184"
"73442c9b70b0578e5b7942a1cb662117"
],
[
"doc/index.html",
"eb8183f2a92811571a974b5f71dec385"
"264f1479e3b9337362b8938cab01e511"
],
[
"doc/images/bluestacks-adb-connect.webp",
Expand Down

0 comments on commit da75974

Please sign in to comment.