From bab26a4da2a2a0fdc88ec3af56909b12d822113a Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Thu, 14 Sep 2023 11:00:18 +0200 Subject: Format and update docs --- .../AccentColor.colorset/Contents.json | 10 +-- .../AppIcon.appiconset/Contents.json | 88 +++++++++++----------- safari/Junction/Assets.xcassets/Contents.json | 6 +- .../LargeIcon.imageset/Contents.json | 20 ++--- safari/Junction/Base.lproj/Main.html | 41 ++++++---- safari/Junction/Resources/Script.js | 36 +++++---- safari/Junction/Resources/Style.css | 38 +++++----- 7 files changed, 129 insertions(+), 110 deletions(-) (limited to 'safari') diff --git a/safari/Junction/Assets.xcassets/AccentColor.colorset/Contents.json b/safari/Junction/Assets.xcassets/AccentColor.colorset/Contents.json index eb87897..0afb3cf 100644 --- a/safari/Junction/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/safari/Junction/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,11 +1,11 @@ { - "colors" : [ + "colors": [ { - "idiom" : "universal" + "idiom": "universal" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/safari/Junction/Assets.xcassets/AppIcon.appiconset/Contents.json b/safari/Junction/Assets.xcassets/AppIcon.appiconset/Contents.json index 64dc11e..8815e3e 100644 --- a/safari/Junction/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/safari/Junction/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,68 +1,68 @@ { - "images" : [ + "images": [ { - "filename" : "icon_16x16.png", - "idiom" : "mac", - "scale" : "1x", - "size" : "16x16" + "filename": "icon_16x16.png", + "idiom": "mac", + "scale": "1x", + "size": "16x16" }, { - "filename" : "icon_16x16@2x.png", - "idiom" : "mac", - "scale" : "2x", - "size" : "16x16" + "filename": "icon_16x16@2x.png", + "idiom": "mac", + "scale": "2x", + "size": "16x16" }, { - "filename" : "icon_32x32.png", - "idiom" : "mac", - "scale" : "1x", - "size" : "32x32" + "filename": "icon_32x32.png", + "idiom": "mac", + "scale": "1x", + "size": "32x32" }, { - "filename" : "icon_32x32@2x.png", - "idiom" : "mac", - "scale" : "2x", - "size" : "32x32" + "filename": "icon_32x32@2x.png", + "idiom": "mac", + "scale": "2x", + "size": "32x32" }, { - "filename" : "icon_128x128.png", - "idiom" : "mac", - "scale" : "1x", - "size" : "128x128" + "filename": "icon_128x128.png", + "idiom": "mac", + "scale": "1x", + "size": "128x128" }, { - "filename" : "icon_128x128@2x.png", - "idiom" : "mac", - "scale" : "2x", - "size" : "128x128" + "filename": "icon_128x128@2x.png", + "idiom": "mac", + "scale": "2x", + "size": "128x128" }, { - "filename" : "icon_256x256.png", - "idiom" : "mac", - "scale" : "1x", - "size" : "256x256" + "filename": "icon_256x256.png", + "idiom": "mac", + "scale": "1x", + "size": "256x256" }, { - "filename" : "icon_256x256@2x.png", - "idiom" : "mac", - "scale" : "2x", - "size" : "256x256" + "filename": "icon_256x256@2x.png", + "idiom": "mac", + "scale": "2x", + "size": "256x256" }, { - "filename" : "icon_512x512.png", - "idiom" : "mac", - "scale" : "1x", - "size" : "512x512" + "filename": "icon_512x512.png", + "idiom": "mac", + "scale": "1x", + "size": "512x512" }, { - "filename" : "icon_512x512@2x.png", - "idiom" : "mac", - "scale" : "2x", - "size" : "512x512" + "filename": "icon_512x512@2x.png", + "idiom": "mac", + "scale": "2x", + "size": "512x512" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/safari/Junction/Assets.xcassets/Contents.json b/safari/Junction/Assets.xcassets/Contents.json index 73c0059..74d6a72 100644 --- a/safari/Junction/Assets.xcassets/Contents.json +++ b/safari/Junction/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/safari/Junction/Assets.xcassets/LargeIcon.imageset/Contents.json b/safari/Junction/Assets.xcassets/LargeIcon.imageset/Contents.json index a19a549..ae524e7 100644 --- a/safari/Junction/Assets.xcassets/LargeIcon.imageset/Contents.json +++ b/safari/Junction/Assets.xcassets/LargeIcon.imageset/Contents.json @@ -1,20 +1,20 @@ { - "images" : [ + "images": [ { - "idiom" : "universal", - "scale" : "1x" + "idiom": "universal", + "scale": "1x" }, { - "idiom" : "universal", - "scale" : "2x" + "idiom": "universal", + "scale": "2x" }, { - "idiom" : "universal", - "scale" : "3x" + "idiom": "universal", + "scale": "3x" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/safari/Junction/Base.lproj/Main.html b/safari/Junction/Base.lproj/Main.html index 081cc41..96adac3 100644 --- a/safari/Junction/Base.lproj/Main.html +++ b/safari/Junction/Base.lproj/Main.html @@ -1,19 +1,32 @@ - + - - - + + + - + - + - - - Junction Icon -

You can turn on Junction’s extension in Safari Extensions preferences.

-

Junction’s extension is currently on. You can turn it off in Safari Extensions preferences.

-

Junction’s extension is currently off. You can turn it on in Safari Extensions preferences.

- - + + + Junction Icon +

+ You can turn on Junction’s extension in Safari Extensions preferences. +

+

+ Junction’s extension is currently on. You can turn it off in Safari + Extensions preferences. +

+

+ Junction’s extension is currently off. You can turn it on in Safari + Extensions preferences. +

+ + 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; } -- cgit