diff --git a/lib/background.ts b/lib/background.ts index f02df87..15280dc 100644 --- a/lib/background.ts +++ b/lib/background.ts @@ -119,7 +119,7 @@ new class Action extends Handler { } try { await this.processResults( - await Prefs.get("global-turbo"), + true, await runContentJob( tab, "/bundles/content-gather.js", { type: "DTA:gather", @@ -413,8 +413,24 @@ Bus.on("do-single", () => API.singleRegular(null)); Bus.on("open-manager", () => openManager(true)); Bus.on("open-prefs", () => openPrefs()); +function adjustAction(globalTurbo: boolean) { + action.setPopup({ + popup: globalTurbo ? "" : null + }); + action.setIcon({ + path: globalTurbo ? { + 16: "/style/button-turbo.png", + 32: "/style/button-turbo@2x.png", + } : null + }); +} + (async function init() { await Prefs.set("last-run", new Date()); + Prefs.get("global-turbo", false).then(v => adjustAction(v)); + Prefs.on("global-turbo", (prefs, key, value) => { + adjustAction(value); + }); await filters(); await getManager(); })().catch(ex => { diff --git a/windows/prefs.html b/windows/prefs.html index a977425..a6f4977 100644 --- a/windows/prefs.html +++ b/windows/prefs.html @@ -43,7 +43,7 @@
UI - +
diff --git a/windows/prefs.ts b/windows/prefs.ts index 9db80ca..027e586 100644 --- a/windows/prefs.ts +++ b/windows/prefs.ts @@ -545,7 +545,7 @@ addEventListener("DOMContentLoaded", () => { localize(document.documentElement); // General - //new BoolPref("pref-global-turbo", "global-turbo"); + new BoolPref("pref-global-turbo", "global-turbo"); new BoolPref("pref-queue-notification", "queue-notification"); new BoolPref("pref-finish-notification", "finish-notification"); new BoolPref("pref-tooltip", "tooltip");