1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-01-03 10:31:54 +01:00

Settings rearrangement

For #251
This commit is contained in:
kkapsner 2018-09-12 09:21:52 +02:00
parent c16aea3d6e
commit 19a9035bed
5 changed files with 166 additions and 110 deletions

View File

@ -93,6 +93,10 @@
"message": "Einstellungen", "message": "Einstellungen",
"description": "" "description": ""
}, },
"section_canvas-api":{
"message": "Canvas API",
"description": ""
},
"section_audio-api":{ "section_audio-api":{
"message": "Audio API", "message": "Audio API",
"description": "" "description": ""

View File

@ -93,6 +93,10 @@
"message": "Settings", "message": "Settings",
"description": "" "description": ""
}, },
"section_canvas-api":{
"message": "Canvas API",
"description": ""
},
"section_audio-api":{ "section_audio-api":{
"message": "Audio API", "message": "Audio API",
"description": "" "description": ""

View File

@ -247,6 +247,7 @@
} }
} }
if (setting){ if (setting){
setting.display = display;
let hideChangeListeners = []; let hideChangeListeners = [];
setting.setHide = function setHide(value){ setting.setHide = function setHide(value){
if (hideContainer){ if (hideContainer){

View File

@ -129,7 +129,19 @@
} }
else if (setting.keys){ else if (setting.keys){
input = document.createElement("table"); input = document.createElement("table");
let inSection = false;
setting.keys.forEach(function(key){ setting.keys.forEach(function(key){
if (setting.display.displayedSection){
if (typeof key === "object"){
if (key.level === 1){
inSection = key.name === setting.display.displayedSection;
return;
}
}
if (!inSection){
return;
}
}
let row = document.createElement("tr"); let row = document.createElement("tr");
if (typeof key === "object"){ if (typeof key === "object"){
let cell = document.createElement("td"); let cell = document.createElement("td");

View File

@ -36,34 +36,6 @@
} }
}, },
"faking", "faking",
{
"name": "minFakeSize",
"displayDependencies": [
{
"blockMode": ["fakeReadout", "fakeInput"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "maxFakeSize",
"displayDependencies": [
{
"blockMode": ["fakeReadout", "fakeInput"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{ {
"name": "rng", "name": "rng",
"displayDependencies": [ "displayDependencies": [
@ -127,70 +99,6 @@
} }
] ]
}, },
{
"name": "ignoreFrequentColors",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "minColors",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "fakeAlphaChannel",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "useCanvasCache",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "protectedAPIFeatures",
"displayDependencies": [
{
"displayAdvancedSettings": [true]
}
]
},
"notifications", "notifications",
{ {
"name": "showNotifications" "name": "showNotifications"
@ -218,16 +126,6 @@
} }
] ]
}, },
{
"name": "storeImageForInspection",
"displayDependencies": [
{
"showNotifications": [true],
"storeNotificationData": [true],
"displayAdvancedSettings": [true]
}
]
},
{ {
"name": "ignoreList", "name": "ignoreList",
"displayDependencies": [ "displayDependencies": [
@ -314,10 +212,124 @@
"displayAdvancedSettings": [true] "displayAdvancedSettings": [true]
} }
}, },
"Canvas-API",
{
"name": "protectedAPIFeatures",
"displayedSection": "Canvas-API",
"displayDependencies": [
{
"displayAdvancedSettings": [true]
}
]
},
{
"name": "minFakeSize",
"displayDependencies": [
{
"blockMode": ["fakeReadout", "fakeInput"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "maxFakeSize",
"displayDependencies": [
{
"blockMode": ["fakeReadout", "fakeInput"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "ignoreFrequentColors",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "minColors",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "fakeAlphaChannel",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "useCanvasCache",
"displayDependencies": [
{
"blockMode": ["fakeReadout"],
"displayAdvancedSettings": [true]
},
{
"blockMode": ["askReadout", "ask"],
"askDenyMode": ["fake"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "storeImageForInspection",
"displayDependencies": [
{
"showNotifications": [true],
"storeNotificationData": [true],
"displayAdvancedSettings": [true]
}
]
},
"Audio-API", "Audio-API",
{ {
"name": "protectAudio" "name": "protectAudio"
}, },
{
"name": "protectedAPIFeatures",
"displayedSection": "Audio-API",
"displayDependencies": [
{
"protectAudio": [true],
"displayAdvancedSettings": [true]
}
]
},
{ {
"name": "audioFakeRate", "name": "audioFakeRate",
"displayDependencies": [ "displayDependencies": [
@ -401,6 +413,15 @@
] ]
}, },
"History-API", "History-API",
{
"name": "protectedAPIFeatures",
"displayedSection": "History-API",
"displayDependencies": [
{
"displayAdvancedSettings": [true]
}
]
},
{ {
"name": "historyLengthThreshold", "name": "historyLengthThreshold",
"displayDependencies": { "displayDependencies": {
@ -409,17 +430,31 @@
}, },
"Window-API", "Window-API",
{ {
"name": "protectWindow", "name": "protectWindow"
"displayDependencies": { },
"displayAdvancedSettings": [true] {
} "name": "protectedAPIFeatures",
"displayedSection": "Window-API",
"displayDependencies": [
{
"protectWindow": [true],
"displayAdvancedSettings": [true]
}
]
}, },
"DOMRect-API", "DOMRect-API",
{ {
"name": "protectDOMRect", "name": "protectDOMRect"
"displayDependencies": { },
"displayAdvancedSettings": [true] {
} "name": "protectedAPIFeatures",
"displayedSection": "DOMRect-API",
"displayDependencies": [
{
"protectDOMRect": [true],
"displayAdvancedSettings": [true]
}
]
}, },
{ {
"name": "domRectIntegerFactor", "name": "domRectIntegerFactor",