mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 04:40:20 +01:00
parent
d159769997
commit
acce01bfeb
@ -109,6 +109,11 @@
|
|||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labelForDefaultOption": {
|
||||||
|
"message": " (default)",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
|
||||||
"group_general": {
|
"group_general": {
|
||||||
"message": "General",
|
"message": "General",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
@ -51,10 +51,12 @@
|
|||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
if (typeof value === typeof setting.defaultValue){
|
if (typeof value === typeof setting.defaultValue){
|
||||||
option.value = value;
|
option.value = value;
|
||||||
|
option.text = extension.getTranslation(setting.name + "_options." + value) || value;
|
||||||
if (setting.defaultValue === value){
|
if (setting.defaultValue === value){
|
||||||
option.selected = true;
|
option.selected = true;
|
||||||
|
option.selectedText = option.text;
|
||||||
|
option.notSelectedText = option.text + extension.getTranslation("labelForDefaultOption");
|
||||||
}
|
}
|
||||||
option.text = extension.getTranslation(setting.name + "_options." + value) || value;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
option.disabled = true;
|
option.disabled = true;
|
||||||
@ -62,12 +64,26 @@
|
|||||||
}
|
}
|
||||||
select.appendChild(option);
|
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;
|
return select;
|
||||||
}
|
}
|
||||||
|
|
||||||
const inputTypes = {
|
const inputTypes = {
|
||||||
all: {
|
all: {
|
||||||
updateCallback: function(input, value, defaultValue){
|
updateCallback: function(input, value, defaultValue){
|
||||||
|
if (input.update){
|
||||||
|
input.update();
|
||||||
|
}
|
||||||
input.classList[value === defaultValue? "remove": "add"]("changed");
|
input.classList[value === defaultValue? "remove": "add"]("changed");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,6 +5,7 @@ Version 1.10.1:
|
|||||||
new features:
|
new features:
|
||||||
- added tag search
|
- added tag search
|
||||||
- added :changed tag
|
- added :changed tag
|
||||||
|
- mark default value in drop downs settings
|
||||||
|
|
||||||
fixes:
|
fixes:
|
||||||
- lag and functionality loss on google sites
|
- lag and functionality loss on google sites
|
||||||
|
@ -317,6 +317,22 @@
|
|||||||
{
|
{
|
||||||
"version": "1.10.20240330",
|
"version": "1.10.20240330",
|
||||||
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.10.20240330.xpi"
|
"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"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user