diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-09-14 11:00:18 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-09-14 11:00:18 +0200 |
| commit | bab26a4da2a2a0fdc88ec3af56909b12d822113a (patch) | |
| tree | 26e44cf134cc4726338cce9c6896dd89f479ce5a /safari/Junction/Resources | |
| parent | 5685e249653cae8c2ba97c0c59c45e3221d8ffa2 (diff) | |
Format and update docs
Diffstat (limited to 'safari/Junction/Resources')
| -rw-r--r-- | safari/Junction/Resources/Script.js | 36 | ||||
| -rw-r--r-- | safari/Junction/Resources/Style.css | 38 |
2 files changed, 40 insertions, 34 deletions
diff --git a/safari/Junction/Resources/Script.js b/safari/Junction/Resources/Script.js index f551e6b..9bdbda7 100644 --- a/safari/Junction/Resources/Script.js +++ b/safari/Junction/Resources/Script.js @@ -1,22 +1,28 @@ function show(enabled, useSettingsInsteadOfPreferences) { - if (useSettingsInsteadOfPreferences) { - document.getElementsByClassName('state-on')[0].innerText = "Junction’s extension is currently on. You can turn it off in the Extensions section of Safari Settings."; - document.getElementsByClassName('state-off')[0].innerText = "Junction’s extension is currently off. You can turn it on in the Extensions section of Safari Settings."; - document.getElementsByClassName('state-unknown')[0].innerText = "You can turn on Junction’s extension in the Extensions section of Safari Settings."; - document.getElementsByClassName('open-preferences')[0].innerText = "Quit and Open Safari Settings…"; - } + if (useSettingsInsteadOfPreferences) { + document.getElementsByClassName("state-on")[0].innerText = + "Junction’s extension is currently on. You can turn it off in the Extensions section of Safari Settings."; + document.getElementsByClassName("state-off")[0].innerText = + "Junction’s extension is currently off. You can turn it on in the Extensions section of Safari Settings."; + document.getElementsByClassName("state-unknown")[0].innerText = + "You can turn on Junction’s extension in the Extensions section of Safari Settings."; + document.getElementsByClassName("open-preferences")[0].innerText = + "Quit and Open Safari Settings…"; + } - if (typeof enabled === "boolean") { - document.body.classList.toggle(`state-on`, enabled); - document.body.classList.toggle(`state-off`, !enabled); - } else { - document.body.classList.remove(`state-on`); - document.body.classList.remove(`state-off`); - } + if (typeof enabled === "boolean") { + document.body.classList.toggle(`state-on`, enabled); + document.body.classList.toggle(`state-off`, !enabled); + } else { + document.body.classList.remove(`state-on`); + document.body.classList.remove(`state-off`); + } } function openPreferences() { - webkit.messageHandlers.controller.postMessage("open-preferences"); + webkit.messageHandlers.controller.postMessage("open-preferences"); } -document.querySelector("button.open-preferences").addEventListener("click", openPreferences); +document + .querySelector("button.open-preferences") + .addEventListener("click", openPreferences); diff --git a/safari/Junction/Resources/Style.css b/safari/Junction/Resources/Style.css index cbde9e6..ef4dcde 100644 --- a/safari/Junction/Resources/Style.css +++ b/safari/Junction/Resources/Style.css @@ -1,45 +1,45 @@ * { - -webkit-user-select: none; - -webkit-user-drag: none; - cursor: default; + -webkit-user-select: none; + -webkit-user-drag: none; + cursor: default; } :root { - color-scheme: light dark; + color-scheme: light dark; - --spacing: 20px; + --spacing: 20px; } html { - height: 100%; + height: 100%; } body { - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; - gap: var(--spacing); - margin: 0 calc(var(--spacing) * 2); - height: 100%; + gap: var(--spacing); + margin: 0 calc(var(--spacing) * 2); + height: 100%; - font: -apple-system-short-body; - text-align: center; + font: -apple-system-short-body; + text-align: center; } body:not(.state-on, .state-off) :is(.state-on, .state-off) { - display: none; + display: none; } body.state-on :is(.state-off, .state-unknown) { - display: none; + display: none; } body.state-off :is(.state-on, .state-unknown) { - display: none; + display: none; } button { - font-size: 1em; + font-size: 1em; } |