From 249d656ac08d02b311cac7490ff99e5714b6dbbe Mon Sep 17 00:00:00 2001 From: Ray Lothian Date: Wed, 30 Sep 2020 10:27:33 +0200 Subject: [PATCH] fixes https://github.com/ray-lothian/UserAgent-Switcher/issues/101#issuecomment-700050044 --- extension/_locales/en/messages.json | 12 ++++++++++++ extension/data/options/index.js | 5 +++-- extension/data/popup/index.css | 2 +- extension/data/popup/index.html | 4 ++-- extension/data/popup/index.js | 14 ++++++++++++++ 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json index ddf3e7b..40d5248 100644 --- a/extension/_locales/en/messages.json +++ b/extension/_locales/en/messages.json @@ -172,6 +172,9 @@ "uaPlaceholder": { "message": "Your preferred user-agent string" }, + "noMatch": { + "message": "No matching user-agent string for this query" + }, "ztoa": { "message": "Z to A" }, @@ -181,6 +184,9 @@ "filterAmong": { "message": "Filter among $1" }, + "filterAgents": { + "message": "Filter Agents" + }, "msgDefaultUA": { "message": "Default UA, press the reset button instead" }, @@ -192,5 +198,11 @@ }, "msgDisabled": { "message": "Disabled. Uses the default user-agent string." + }, + "optionsSaved": { + "message": "Options saved." + }, + "dbReset": { + "message": "Double-click to reset!" } } diff --git a/extension/data/options/index.js b/extension/data/options/index.js index 15950b7..990d3ce 100644 --- a/extension/data/options/index.js +++ b/extension/data/options/index.js @@ -89,7 +89,8 @@ function save() { protected: document.getElementById('protected').value.split(/\s*,\s*/).filter(s => s.length > 4) }, () => { restore(); - notify('Options saved.'); + notify(chrome.i18n.getMessage('optionsSaved')); + chrome.contextMenus.update(document.querySelector('[name="mode"]:checked').value, { checked: true }); @@ -174,7 +175,7 @@ document.getElementById('donate').addEventListener('click', () => { document.getElementById('reset').addEventListener('click', e => { if (e.detail === 1) { - notify('Double-click to reset!'); + notify(chrome.i18n.getMessage('dbReset')); } else { localStorage.clear(); diff --git a/extension/data/popup/index.css b/extension/data/popup/index.css index fb08204..d052d70 100644 --- a/extension/data/popup/index.css +++ b/extension/data/popup/index.css @@ -130,7 +130,7 @@ select { background-color: #f5f5f5; } #list[data-loading=false] tbody:empty::before { - content: 'No matching user-agent string for this query'; + content: attr(data-content); position: absolute; left: 0; top: 0; diff --git a/extension/data/popup/index.html b/extension/data/popup/index.html index 2786af5..d65aeaf 100644 --- a/extension/data/popup/index.html +++ b/extension/data/popup/index.html @@ -38,7 +38,7 @@ -   +