|
| 1 | +<!DOCTYPE html> |
| 2 | +<html |
| 3 | + lang="en" |
| 4 | + window-alignment="5" |
| 5 | + window-corners="round" |
| 6 | + window-maximizable="true" |
| 7 | + window-min-width="800px" |
| 8 | + window-min-height="600px" |
| 9 | + window-icon="./Celemod.b5f3f7f9.png" |
| 10 | + window-frame="solid" |
| 11 | +> |
| 12 | + <head> |
| 13 | + <meta charset="utf-8" /> |
| 14 | + <meta |
| 15 | + name="viewport" |
| 16 | + content="width=device-width, initial-scale=1, shrink-to-fit=no" |
| 17 | + /> |
| 18 | + <title>CeleMod</title> |
| 19 | + </head> |
| 20 | + |
| 21 | + <script> |
| 22 | + padding("padding for sciter-specific.js"); |
| 23 | + </script> |
| 24 | + |
| 25 | + <body> |
| 26 | + <div class="dummy"></div> |
| 27 | + <span class="celemod-version" title="点击检查更新 / Check Update"> |
| 28 | + <div class="caption-hash"></div> |
| 29 | + <div class="caption-version"></div> |
| 30 | + </span> |
| 31 | + <div role="window-caption"> |
| 32 | + CeleMod |
| 33 | + |
| 34 | + <script> |
| 35 | + document.querySelector(".celemod-version").onclick = () => { |
| 36 | + if (!document.querySelector(".popup-container")) _checkUpdate(); |
| 37 | + }; |
| 38 | + document |
| 39 | + .querySelector(".celemod-version") |
| 40 | + .on("contextmenu", () => Window.this.xcall("show_log_window")); |
| 41 | + |
| 42 | + document.querySelector(".caption-version").innerText = |
| 43 | + Window.this.xcall("celemod_version"); |
| 44 | + document.querySelector(".caption-hash").innerText = Window.this |
| 45 | + .xcall("celemod_hash") |
| 46 | + .substr(0, 6); |
| 47 | + |
| 48 | + const [x, y, w, h] = Window.this.box("xywh", "border", "desktop"); |
| 49 | + if (w < 800 || h < 600) |
| 50 | + Window.this.move(x, y, 800 * (800 / w), 600 * (600 / h)); |
| 51 | + </script> |
| 52 | + </div> |
| 53 | + <span class="win-ctrl"> |
| 54 | + <button role="window-minimize"> |
| 55 | + <icon|minus /> |
| 56 | + </button> |
| 57 | + <button role="window-maximize"> |
| 58 | + <icon|landscape /> |
| 59 | + </button> |
| 60 | + <button class="close" role="window-close"> |
| 61 | + <icon|cancel /> |
| 62 | + </button> |
| 63 | + </span> |
| 64 | + |
| 65 | + <div id="root"></div> |
| 66 | + <link rel="stylesheet" href="./index.scss" /> |
| 67 | + <link rel="stylesheet" href="i2.css" /> |
| 68 | + <script> |
| 69 | + if (env.PLATFORM !== "Windows") { |
| 70 | + document.querySelector(".win-ctrl").style.display = "none"; |
| 71 | + } else { |
| 72 | + document.body.parentElement.setAttribute('window-frame', 'solid'); |
| 73 | + } |
| 74 | + document.body.parentElement.setAttribute('platform', env.PLATFORM); |
| 75 | + |
| 76 | + Window.this.isResizable = true; |
| 77 | + window.isMaximizable = true; |
| 78 | + |
| 79 | + async function updateStyles() { |
| 80 | + for (const style of document.querySelectorAll("style")) { |
| 81 | + const url = style.getAttribute("src"); |
| 82 | + const response = await fetch(url); |
| 83 | + const text = await response.text(); |
| 84 | + if (text === style.textContent) continue; |
| 85 | + style.state.disabled = true; |
| 86 | + style.textContent = text; |
| 87 | + style.state.disabled = false; |
| 88 | + } |
| 89 | + } |
| 90 | + |
| 91 | + console.clear = () => { |
| 92 | + console.log("------- Cleared --------"); |
| 93 | + updateStyles(); |
| 94 | + // location.reload(); |
| 95 | + }; |
| 96 | + |
| 97 | + location.reload = function () { |
| 98 | + setTimeout(() => { |
| 99 | + console.log("location.reload1"); |
| 100 | + Window.this.load(location.href); |
| 101 | + }); |
| 102 | + }; |
| 103 | + |
| 104 | + document.on("keyup", function (evt) { |
| 105 | + if (evt.code == "F5") { |
| 106 | + location.reload(); |
| 107 | + } |
| 108 | + }); |
| 109 | + </script> |
| 110 | + <script src="./index.tsx" type="module"></script> |
| 111 | + </body> |
| 112 | +</html> |
0 commit comments