mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-05-19 19:02:21 +02:00
parent
e510f78f87
commit
27ddc8a683
@ -122,9 +122,14 @@
|
|||||||
listener(value);
|
listener(value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
settingDefinition.getExpandByName = function(name){
|
settingDefinition.getExpandByName = function(name, defaultValue = false){
|
||||||
const expandStore = settingDefinition.get();
|
const expandStore = settingDefinition.get();
|
||||||
|
if ((typeof expandStore[name]) !== "undefined"){
|
||||||
return expandStore[name] || false;
|
return expandStore[name] || false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
settingDefinition.onExpandChange = function(name, listener){
|
settingDefinition.onExpandChange = function(name, listener){
|
||||||
if (!changeListeners[name]){
|
if (!changeListeners[name]){
|
||||||
|
@ -42,11 +42,32 @@ header .bookmarkNotice .dontShowOptionsOnUpdate input {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings .collapsed .settingRow {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.settings .section h2 {
|
.settings .section h2 {
|
||||||
border: 1px #c1c1c1 solid;
|
border: 1px #c1c1c1 solid;
|
||||||
border-radius: 0.5em ;
|
border-radius: 0.5em ;
|
||||||
padding: 0.2em 0.5em;
|
padding: 0.2em 2em 0.2em 0.5em;
|
||||||
margin: 0.7em 1px 0.2em;
|
margin: 0.7em 1px 0.2em;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.settings .section .collapser {
|
||||||
|
cursor: pointer;
|
||||||
|
position: absolute;
|
||||||
|
right: 0.8em;
|
||||||
|
}
|
||||||
|
.settings .section .collapser::before {
|
||||||
|
content: "\25BC";
|
||||||
|
}
|
||||||
|
.settings .collapsed .section .collapser::before {
|
||||||
|
content: "\25B6";
|
||||||
|
}
|
||||||
|
.searching .settings .section .collapser {
|
||||||
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings .settingRow .content {
|
.settings .settingRow .content {
|
||||||
|
@ -244,18 +244,40 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const {hide: hideContainer, expand: expandContainer} = settings.getContainers();
|
||||||
|
|
||||||
let lastSection = null;
|
let lastSection = null;
|
||||||
let addSection = function addSection(name){
|
const addSection = function addSection(name){
|
||||||
let body = document.createElement("tbody");
|
const body = document.createElement("tbody");
|
||||||
if (name){
|
if (name){
|
||||||
let row = document.createElement("tr");
|
const row = document.createElement("tr");
|
||||||
row.className = "section";
|
row.className = "section";
|
||||||
let cell = document.createElement("td");
|
|
||||||
|
const cell = document.createElement("td");
|
||||||
cell.colSpan = 3;
|
cell.colSpan = 3;
|
||||||
row.appendChild(cell);
|
row.appendChild(cell);
|
||||||
let heading = document.createElement("h2");
|
|
||||||
heading.textContent = extension.getTranslation("section_" + name);
|
const id = "section_" + name;
|
||||||
|
|
||||||
|
const heading = document.createElement("h2");
|
||||||
|
heading.textContent = extension.getTranslation(id);
|
||||||
cell.appendChild(heading);
|
cell.appendChild(heading);
|
||||||
|
|
||||||
|
if (expandContainer){
|
||||||
|
const collapser = document.createElement("span");
|
||||||
|
collapser.className = "collapser";
|
||||||
|
collapser.addEventListener("click", function(){
|
||||||
|
expandContainer.setExpandByName(id, !expandContainer.getExpandByName(id, true));
|
||||||
|
});
|
||||||
|
expandContainer.onExpandChange(id, function(value){
|
||||||
|
body.classList[value? "remove": "add"]("collapsed");
|
||||||
|
});
|
||||||
|
if (!expandContainer.getExpandByName(id, true)){
|
||||||
|
body.classList.add("collapsed");
|
||||||
|
}
|
||||||
|
heading.appendChild(collapser);
|
||||||
|
}
|
||||||
|
|
||||||
body.appendChild(row);
|
body.appendChild(row);
|
||||||
}
|
}
|
||||||
table.appendChild(body);
|
table.appendChild(body);
|
||||||
@ -295,8 +317,6 @@
|
|||||||
addSection();
|
addSection();
|
||||||
|
|
||||||
const beforeChangeEventListeners = {};
|
const beforeChangeEventListeners = {};
|
||||||
|
|
||||||
const {hide: hideContainer, expand: expandContainer} = settings.getContainers();
|
|
||||||
settingsDisplay.forEach(function(display){
|
settingsDisplay.forEach(function(display){
|
||||||
if (typeof display === "string"){
|
if (typeof display === "string"){
|
||||||
addSection(display);
|
addSection(display);
|
||||||
|
@ -4,6 +4,7 @@ Version 0.5.11:
|
|||||||
|
|
||||||
new features:
|
new features:
|
||||||
- added auto update for beta versions
|
- added auto update for beta versions
|
||||||
|
- options: made sections collapsible
|
||||||
|
|
||||||
fixes:
|
fixes:
|
||||||
- improved protection of (i)frame properties
|
- improved protection of (i)frame properties
|
||||||
|
@ -9,6 +9,10 @@
|
|||||||
{
|
{
|
||||||
"version": "0.5.11Alpha20190609",
|
"version": "0.5.11Alpha20190609",
|
||||||
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-0.5.11Alpha20190609-an+fx.xpi"
|
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-0.5.11Alpha20190609-an+fx.xpi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.5.11Alpha20190611",
|
||||||
|
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-0.5.11Alpha20190611-an+fx.xpi"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user