]> git.r.bdr.sh - rbdr/junction/blobdiff - safari/Junction/Resources/Script.js
Address issues with App Store Review
[rbdr/junction] / safari / Junction / Resources / Script.js
index f551e6b49c103d00f8f6166e380707c693d8c3b7..9bdbda7460961009a90e49138f69878506ff163a 100644 (file)
@@ -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);