Fixed autodetection menu

This commit is contained in:
Tamius Han 2018-07-16 20:38:16 +02:00
parent d48d1d3e96
commit 5ce0c51018
3 changed files with 4 additions and 25 deletions

View File

@ -1,6 +1,6 @@
// Set prod to true when releasing // Set prod to true when releasing
_prod = true; // _prod = true;
// _prod = false; _prod = false;
Debug = { Debug = {
debug: true, debug: true,

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Ultrawidify", "name": "Ultrawidify",
"version": "3.0.0", "version": "3.0.1",
"icons": { "icons": {
"32":"res/icons/uw-32.png", "32":"res/icons/uw-32.png",

View File

@ -376,21 +376,10 @@ function toggleSite(option){
Comms.sendToBackgroundScript({cmd:"enable-for-site", option:option}); Comms.sendToBackgroundScript({cmd:"enable-for-site", option:option});
} }
function getMode(isEnabled, whitelistOnly) {
if(isEnabled) {
return whitelistOnly ? "whitelist" : "blacklist"
} else {
return "disabled";
}
}
document.addEventListener("click", (e) => { document.addEventListener("click", (e) => {
function getcmd(e){ function getcmd(e){
var command = {}; var command = {};
command.sender = "popup"; command.sender = "popup";
command.receiver = "uwbg"; command.receiver = "uwbg";
@ -533,9 +522,7 @@ document.addEventListener("click", (e) => {
return command; return command;
} }
if(e.target.classList.contains("_autoAr")){ if(e.target.classList.contains("_autoAr")){
if(e.target.classList.contains("_ar_global_options")){
var command = {};
if(e.target.classList.contains("_ext_global_options")){
command.cmd = "set-autoar-defaults"; command.cmd = "set-autoar-defaults";
if (e.target.classList.contains("_blacklist")) { if (e.target.classList.contains("_blacklist")) {
command.mode = "blacklist"; command.mode = "blacklist";
@ -546,14 +533,6 @@ document.addEventListener("click", (e) => {
} }
return command; return command;
} else if (e.target.classList.contains("_autoAr_whitelist-only")) { } else if (e.target.classList.contains("_autoAr_whitelist-only")) {
var arStatus = document.getElementById("_checkbox_autoar-enabled").checked;
var whitelist = document.getElementById("_checkbox_autoar-whitelist").checked;
if(Debug.debug) {
console.log("CHANGED CHECKMARK IN _AR-WHTIELIST:", extStatus, whitelist)
}
return { return {
cmd: "set-autoar-mode", cmd: "set-autoar-mode",
mode: getMode(arStatus, whitelist), mode: getMode(arStatus, whitelist),