From 1becb5eb593f597bf2cbe9e31162bd6344a7a7bd Mon Sep 17 00:00:00 2001 From: Umit Altintas Date: Wed, 15 Mar 2023 19:14:12 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20feat:=20adds=20shortcut=20for?= =?UTF-8?q?=20firefox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/firefox_extension/background.js | 6 ++++++ src/firefox_extension/manifest.json | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/firefox_extension/background.js b/src/firefox_extension/background.js index 50a69c4..c585bc4 100644 --- a/src/firefox_extension/background.js +++ b/src/firefox_extension/background.js @@ -177,3 +177,9 @@ chrome.contextMenus.create({ Deasciifier.onPatternListLoaded = function(patternListV2) { Deasciifier.init(patternListV2); } + +browser.commands.onCommand.addListener(function (command) { + if (command === "DEASCIIFY_SHORTCUT") { + ConvertTurkishChars(); + } +}); \ No newline at end of file diff --git a/src/firefox_extension/manifest.json b/src/firefox_extension/manifest.json index 62b3b7e..1799fd1 100644 --- a/src/firefox_extension/manifest.json +++ b/src/firefox_extension/manifest.json @@ -34,5 +34,15 @@ "id": "firefox@deasciifier.com", "strict_min_version": "55.0" } + }, + + "commands": { + "DEASCIIFY_SHORTCUT": { + "suggested_key": { + "default": "Alt+Shift+D", + "mac": "Command+Alt+D" + }, + "description": "Deasciify the selected text" + } } } From 8bb028147a64cba0e3b1d308bb5da7b69efa585c Mon Sep 17 00:00:00 2001 From: Umit Altintas Date: Wed, 15 Mar 2023 19:51:44 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20feat:=20adds=20auto=20deascify?= =?UTF-8?q?=20shortcut=20for=20firefox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/firefox_extension/background.js | 8 +++++++- src/firefox_extension/manifest.json | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/firefox_extension/background.js b/src/firefox_extension/background.js index c585bc4..b22659a 100644 --- a/src/firefox_extension/background.js +++ b/src/firefox_extension/background.js @@ -179,7 +179,13 @@ Deasciifier.onPatternListLoaded = function(patternListV2) { } browser.commands.onCommand.addListener(function (command) { - if (command === "DEASCIIFY_SHORTCUT") { + if (command === "DEASCIIFY_SELECTED_TOGGLE") { ConvertTurkishChars(); } + + if (command === "AUTO_DEASCIIFY_TOGGLE") { + browser.tabs.executeScript({ file: "execute.js" }, function () { + browser.tabs.executeScript({ code: "toggleAutoDeasciify();" }); + }); + } }); \ No newline at end of file diff --git a/src/firefox_extension/manifest.json b/src/firefox_extension/manifest.json index 1799fd1..bf2f519 100644 --- a/src/firefox_extension/manifest.json +++ b/src/firefox_extension/manifest.json @@ -37,12 +37,19 @@ }, "commands": { - "DEASCIIFY_SHORTCUT": { + "DEASCIIFY_SELECTED_TOGGLE": { "suggested_key": { "default": "Alt+Shift+D", "mac": "Command+Alt+D" }, "description": "Deasciify the selected text" + }, + "AUTO_DEASCIIFY_TOGGLE": { + "suggested_key": { + "default": "Alt+Shift+A", + "mac": "Command+Alt+A" + }, + "description": "Toggle auto-deasciify" } } }