diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 150ba88eb..a42064b0c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -109,6 +109,11 @@ "description": "" }, + "labelForDefaultOption": { + "message": " (default)", + "description": "" + }, + "group_general": { "message": "General", "description": "" diff --git a/options/optionsGui.js b/options/optionsGui.js index 17c4db24b..0b4bcbba5 100644 --- a/options/optionsGui.js +++ b/options/optionsGui.js @@ -51,10 +51,12 @@ const option = document.createElement("option"); if (typeof value === typeof setting.defaultValue){ option.value = value; + option.text = extension.getTranslation(setting.name + "_options." + value) || value; if (setting.defaultValue === value){ option.selected = true; + option.selectedText = option.text; + option.notSelectedText = option.text + extension.getTranslation("labelForDefaultOption"); } - option.text = extension.getTranslation(setting.name + "_options." + value) || value; } else { option.disabled = true; @@ -62,12 +64,26 @@ } select.appendChild(option); }); + select.update = function(){ + Array.from(select.options).forEach(function(option){ + if (option.notSelectedText){ + option.text = option.notSelectedText; + } + }); + const selectedOption = select.options[select.selectedIndex]; + if (selectedOption.selectedText){ + selectedOption.text = selectedOption.selectedText; + } + }; return select; } const inputTypes = { all: { updateCallback: function(input, value, defaultValue){ + if (input.update){ + input.update(); + } input.classList[value === defaultValue? "remove": "add"]("changed"); } }, diff --git a/releaseNotes.txt b/releaseNotes.txt index a0c9a9789..aabd52d8a 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -5,6 +5,7 @@ Version 1.10.1: new features: - added tag search - added :changed tag + - mark default value in drop downs settings fixes: - lag and functionality loss on google sites diff --git a/versions/updates.json b/versions/updates.json index f515bc522..88cd0eff0 100644 --- a/versions/updates.json +++ b/versions/updates.json @@ -317,6 +317,22 @@ { "version": "1.10.20240330", "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.10.20240330.xpi" + }, + { + "version": "1.10.1.20240405", + "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.10.1.20240405.xpi" + }, + { + "version": "1.10.20240407", + "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.10.20240407.xpi" + }, + { + "version": "1.10.20240407.1", + "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.10.20240407.1.xpi" + }, + { + "version": "1.10.20240408", + "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.10.20240408.xpi" } ] }