From 4e1f6b579ca0348fa2bbbea66e04f65ff79b2fb3 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 20 Feb 2025 11:58:38 +1100 Subject: [PATCH] option to refresh by pressing '!' --- js/image_filter.js | 6 ++++++ js/popup.js | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/js/image_filter.js b/js/image_filter.js index f2f0bae..c347c6c 100644 --- a/js/image_filter.js +++ b/js/image_filter.js @@ -13,6 +13,12 @@ app.registerExtension({ type: "boolean", defaultValue: true }, + { + id: "ImageFilter.ReshowWindow", + name: "Pressing '!' reshows the window", + type: "boolean", + defaultValue: true + }, ], setup() { create('link', null, document.getElementsByTagName('HEAD')[0], diff --git a/js/popup.js b/js/popup.js index 6fac723..6a3df58 100644 --- a/js/popup.js +++ b/js/popup.js @@ -237,12 +237,13 @@ class Popup extends HTMLSpanElement { } on_keypress(e) { - if (e.key=='!') { + if (e.key=='!' && app.ui.settings.getSettingValue("ImageFilter.ReshowWindow") && !this.contains(document.activeElement)) { this.reshow_window() return } - if (!this.active) return - if (this.doing_text) return + + if (this.doing_text || !this.active) return + if (e.key=='x') { e.stopPropagation() e.preventDefault()