Organized the project files.

And also fixed some bugs.
This commit is contained in:
Bruce
2025-12-08 16:06:13 +08:00
parent ed7fe3af4b
commit d1813637c5
95 changed files with 46744 additions and 36366 deletions

View File

@@ -46,7 +46,7 @@
</ul>
</nav>
</aside>
<iframe class="main right">
<iframe class="main right"></iframe>
</div>
</div>
</body>

View File

@@ -33,16 +33,37 @@
if (child.classList.contains("selected"))
child.classList.remove("selected");
}
content.src = this.getAttribute("data-page");
setTimeout(function() {
content.style.display = "";
Windows.UI.Animation.runAsync(content, [Windows.UI.Animation.Keyframes.Flyout.toLeft, Windows.UI.Animation.Keyframes.Opacity.visible]);
}, 0);
setTimeout(function(thisnode) {
content.style.display = "none";
content.src = thisnode.getAttribute("data-page");
setTimeout(function(thisnode2) {
thisnode2.style.display = "";
}, 500, content);
}, 0, this);
this.classList.add("selected");
});
list.appendChild(li);
}
content.src = guidePage.page;
eventutil.addEvent(content, "load", function() {
Windows.UI.Animation.runAsync(this, [Windows.UI.Animation.Keyframes.Flyout.toLeft, Windows.UI.Animation.Keyframes.Opacity.visible]);
this.style.display = "";
});
var jumppage = "";
try { var args = cmdargs; if (args.length > 1) jumppage = args[1]; } catch (e) {}
if (jumppage && jumppage.length > 0 && !Bridge.External.jump2) {
for (var i = 0; i < list.children.length; i++) {
var child = list.children[i];
if (Bridge.NString.equals(child.getAttribute("data-tag"), jumppage)) {
Bridge.External.jump2 = true;
setTimeout(function(thisnode) {
thisnode.click();
}, 0, child)
break;
}
}
}
global.setDisabledForOperation = function(disabled) {
var list = document.querySelector("#settingpage .guide aside ul");
for (var i = 0; i < list.children.length; i++) {

View File

@@ -27,4 +27,9 @@
}
return null;
};
Object.defineProperty(global, "cmdargs", {
get: function() {
return JSON.parse(Bridge.External.cmdArgs);
}
});
})(this);

View File

@@ -1,5 +1,6 @@
(function(global) {
"use strict";
var cmdargs = JSON.parse(Bridge.External.cmdArgs);
function ready(e) {
var page = document.querySelector("#settingpage");
@@ -15,6 +16,8 @@
var item = items[keys[i]];
var inode = document.createElement("li");
inode.setAttribute("data-page", item.page);
inode.setAttribute("data-name", item.displayName);
inode.setAttribute("data-tag", keys[i]);
inode.textContent = item.displayName;
Windows.UI.Event.Util.addEvent(inode, "click", function(e) {
window.location = "settings/" + this.getAttribute("data-page");
@@ -22,6 +25,19 @@
list.appendChild(inode);
// WinJS.UI.Animation.createAddToListAnimation(list, inode).execute();
}
var current = "";
try { if (cmdargs.length > 0) current = cmdargs[0] } catch (e) {}
if (current && current.length > 0 && !Bridge.External.jump1) {
for (var i = 0; i < list.children.length; i++) {
if (Bridge.NString.equals(list.children[i].getAttribute("data-tag"), current)) {
Bridge.External.jump1 = true;
setTimeout(function(thisnode) {
thisnode.click();
}, 0, list.children[i]);
break;
}
}
}
}
OnLoad.add(ready);
})(this);

View File

@@ -46,7 +46,7 @@
</ul>
</nav>
</aside>
<iframe class="main right">
<iframe class="main right"></iframe>
</div>
</div>
</body>

View File

@@ -42,7 +42,26 @@
});
list.appendChild(li);
}
content.src = items.general.page;
content.src = guidePage.page;
for (var i = 0; i < list.children.length; i++) {
var child = list.children[i];
child.click();
break;
}
var jumppage = "";
try { var args = cmdargs; if (args.length > 1) jumppage = args[1]; } catch (e) {}
if (jumppage && jumppage.length > 0 && !Bridge.External.jump2) {
for (var i = 0; i < list.children.length; i++) {
var child = list.children[i];
if (Bridge.NString.equals(child.getAttribute("data-tag"), jumppage)) {
Bridge.External.jump2 = true;
setTimeout(function(thisnode) {
thisnode.click();
}, 0, child)
break;
}
}
}
global.setDisabledForOperation = function(disabled) {
var list = document.querySelector("#settingpage .guide aside ul");
for (var i = 0; i < list.children.length; i++) {

View File

@@ -252,6 +252,7 @@
window.parent.setItemHighlight = function() {};
}
</script>
<script type="text/javascript" src="updateinit.js"></script>
</head>
<body>
@@ -275,7 +276,7 @@
</div>
<div class="section padding" style="">
<div class="block" id="check-update-block" style="height: 0px;">
<span id="loading-amine">123</span><span id="check-update-text" data-res-fromfile="publicRes (106)"></span><br>
<span id="loading-amine"></span><span id="check-update-text" data-res-fromfile="publicRes (106)"></span><br>
<progress id="progress" min="0" max="100"></progress>
<a target="_blank" id="doc-link" data-res-fromfile="publicRes (107)"></a>
</div>
@@ -385,6 +386,7 @@
break;
}
}
window.parent.setDisabledForOperation(false);
if (compareVersion(window.currver, window.newver) >= 0) {
checkUpdateText.textContent = getPublicRes(114);
checkUpdateBtn.textContent = getPublicRes(115);
@@ -393,8 +395,13 @@
checkUpdateText.textContent = Bridge.String.format(getPublicRes(116), window.newver);
checkUpdateBtn.textContent = getPublicRes(117);
checkUpdateBtn.setAttribute("data-action", "download");
if (autoInstallUpdate) {
setTimeout(function(thisnode) {
thisnode.click();
autoInstallUpdate = false;
}, 0, self);
}
}
window.parent.setDisabledForOperation(false);
}, function(error) {
// console.log("error", error);
var json = JSON.parse(error.responseText);
@@ -482,6 +489,22 @@
})();
</script>
</div>
<script>
(function(global) {
"use strict";
function ready(e) {
var checkButton = document.getElementById("check-update");
if (autoCheckUpdate) {
setTimeout(function(thisnode) {
thisnode.click();
autoCheckUpdate = false;
}, 0, checkButton);
}
}
OnLoad.add(ready);
})(this);
</script>
</body>
</html>

View File

@@ -0,0 +1,26 @@
(function(global) {
global.autoCheckUpdate = false;
global.autoInstallUpdate = false;
if (Bridge.External.exec1 == true) return;
var args = cmdargs;
var optionarg = "";
if (args.length > 2) {
optionarg = args[2];
} else {
return;
}
if (
Bridge.NString.equals(optionarg, "/checkupdate") ||
Bridge.NString.equals(optionarg, "-checkupdate") ||
Bridge.NString.equals(optionarg, "checkupdate")
) global.autoCheckUpdate = true;
if (
Bridge.NString.equals(optionarg, "/autoupdate") ||
Bridge.NString.equals(optionarg, "-autoupdate") ||
Bridge.NString.equals(optionarg, "autoupdate")
) {
global.autoCheckUpdate = true;
global.autoInstallUpdate = true;
}
Bridge.External.exec1 = true;
})(this);