This commit is contained in:
Tamius Han 2019-01-20 23:05:04 +01:00
parent 3336e62ae6
commit 9ec6973cc0
6 changed files with 29 additions and 29 deletions

View File

@ -334,19 +334,19 @@ class Settings {
console.log("[Settings::canStartAutoAr] ----------------\nCAN WE START THIS EXTENSION ON SITE", site,
"?\n\nsettings.active.sites[site]=", this.active.sites[site],
"\nExtension mode?", this.active.site['@global'].autoar,
"\nExtension mode?", this.active.sites['@global'].autoar,
"\nCan extension be started?", csar
);
}
// if site is not defined, we use default mode:
if (! this.active.sites[site]) {
return this.active.site['@global'].autoar === "blacklist";
return this.active.sites['@global'].autoar === "blacklist";
}
if (this.active.site['@global'].autoar === "blacklist") {
if (this.active.sites['@global'].autoar === "blacklist") {
return this.active.sites[site].arStatus !== "disabled";
} else if (this.active.site['@global'].autoar === "whitelist") {
} else if (this.active.sites['@global'].autoar === "whitelist") {
return this.active.sites[site].arStatus === "enabled";
} else {
return false;
@ -368,7 +368,7 @@ class Settings {
if (site.stretch) {
return site.stretch;
}
return this.active.site['@global'].stretch;
return this.active.sites['@global'].stretch;
}
getDefaultVideoAlignment(site) {
@ -377,7 +377,7 @@ class Settings {
if (site.videoAlignment) {
return site.videoAlignment;
}
return this.active.site['@global'].videoAlignment;
return this.active.sites['@global'].videoAlignment;
}
}

View File

@ -225,14 +225,14 @@ class CommsServer {
}
Promise.resolve(ret);
} else if (message.cmd === "autoar-enable") {
this.settings.active.site['@global'].autoar = "blacklist";
this.settings.active.sites['@global'].autoar = "blacklist";
this.settings.save();
this.sendToAll({cmd: "reload-settings", sender: "uwbg"})
if(Debug.debug){
console.log("[uw-bg] autoar set to enabled (blacklist). evidenz:", this.settings.active);
}
} else if (message.cmd === "autoar-disable") {
this.settings.active.site['@global'].autoar = "disabled";
this.settings.active.sites['@global'].autoar = "disabled";
if(message.reason){
this.settings.active.arDetect.disabledReason = message.reason;
} else {
@ -268,14 +268,14 @@ class CommsServer {
sendResponse({extensionConf: JSON.stringify(this.settings.active), site: this.getCurrentTabHostname()});
// return true;
} else if (message.cmd === "autoar-enable") {
this.settings.active.site['@global'].autoar = "blacklist";
this.settings.active.sites['@global'].autoar = "blacklist";
this.settings.save();
this.sendToAll({cmd: "reload-settings", sender: "uwbg"})
if(Debug.debug){
console.log("[uw-bg] autoar set to enabled (blacklist). evidenz:", this.settings.active);
}
} else if (message.cmd === "autoar-disable") {
this.settings.active.site['@global'].autoar = "disabled";
this.settings.active.sites['@global'].autoar = "disabled";
if(message.reason){
this.settings.active.arDetect.disabledReason = message.reason;
} else {

View File

@ -323,7 +323,7 @@ class Resizer {
computeOffsets(stretchFactors){
if (Debug.debug) {
console.log("[Resizer::_res_computeOffsets] <rid:"+this.resizerId+"> video will be aligned to ", this.settings.active.site['@global'].videoAlignment);
console.log("[Resizer::_res_computeOffsets] <rid:"+this.resizerId+"> video will be aligned to ", this.settings.active.sites['@global'].videoAlignment);
}
const wdiff = this.conf.player.dimensions.width - this.conf.video.offsetWidth;

View File

@ -31,15 +31,15 @@
</div>
<div class="flex flex-row button-box">
<Button label="Always"
:selected="settings.active.site['@global'].autoar === ExtensionMode.Enabled"
:selected="settings.active.sites['@global'].autoar === ExtensionMode.Enabled"
@click.native="setDefaultAutodetectionMode(ExtensionMode.Enabled)">
</Button>
<Button label="On whitelisted sites"
:selected="settings.active.site['@global'].autoar === ExtensionMode.Whitelist"
:selected="settings.active.sites['@global'].autoar === ExtensionMode.Whitelist"
@click.native="setDefaultAutodetectionMode(ExtensionMode.Whitelist)">
</Button>
<Button label="Never"
:selected="settings.active.site['@global'].autoar === ExtensionMode.Disabled"
:selected="settings.active.sites['@global'].autoar === ExtensionMode.Disabled"
@click.native="setDefaultAutodetectionMode('never')">
</Button>
</div>
@ -57,15 +57,15 @@
</div>
<div class="flex flex-row button-box">
<Button label="Left"
:selected="settings.active.site['@global'].videoAlignment === VideoAlignment.Left"
:selected="settings.active.sites['@global'].videoAlignment === VideoAlignment.Left"
@click.native="setDefaultvideoAlignment(VideoAlignment.Left)">
</Button>
<Button label="Center"
:selected="settings.active.site['@global'].videoAlignment === VideoAlignment.Center"
:selected="settings.active.sites['@global'].videoAlignment === VideoAlignment.Center"
@click.native="setDefaultvideoAlignment(VideoAlignment.Center)">
</Button>
<Button label="Right"
:selected="settings.active.site['@global'].videoAlignment === VideoAlignment.Right"
:selected="settings.active.sites['@global'].videoAlignment === VideoAlignment.Right"
@click.native="setDefaultvideoAlignment(VideoAlignment.Right)">
</Button>
</div>
@ -75,19 +75,19 @@
</div>
<div class="flex flex-row button-box">
<Button label="Don't stretch"
:selected="settings.active.site['@global'].stretch === StretchMode.NoStretch"
:selected="settings.active.sites['@global'].stretch === StretchMode.NoStretch"
@click.native="setDefaultStretchingMode(StretchMode.NoStretch)">
</Button>
<Button label="Basic stretch"
:selected="settings.active.site['@global'].stretch === StretchMode.Basic"
:selected="settings.active.sites['@global'].stretch === StretchMode.Basic"
@click.native="setDefaultStretchingMode(StretchMode.Basic)">
</Button>
<Button label="Hybrid stretch"
:selected="settings.active.site['@global'].stretch === StretchMode.Hybrid"
:selected="settings.active.sites['@global'].stretch === StretchMode.Hybrid"
@click.native="setDefaultStretchingMode(StretchMode.Hybrid)">
</Button>
<Button label="Thin borders only"
:selected="settings.active.site['@global'].stretch === StretchMode.Conditional"
:selected="settings.active.sites['@global'].stretch === StretchMode.Conditional"
@click.native="setDefaultStretchingMode(StretchMode.Conditional)"
>
</Button>
@ -143,7 +143,7 @@ export default {
},
methods: {
setDefaultAutodetectionMode(mode) {
this.settings.active.site['@global'].autoar = mode;
this.settings.active.sites['@global'].autoar = mode;
this.settings.save();
},
setDefaultExtensionMode(mode) {
@ -155,7 +155,7 @@ export default {
this.settings.save();
},
setDefaultStretchingMode(mode) {
this.settings.active.site['@global'].stretch = mode;
this.settings.active.sites['@global'].stretch = mode;
this.settings.save();
},
updateStretchTreshold(newTreshold) {

View File

@ -33,13 +33,13 @@ class ExecAction {
this.settings.save();
} else if (scope === 'global') {
if (cmd.action === "set-stretch") {
this.settings.active.site['@global'].stretch = cmd.arg;
this.settings.active.sites['@global'].stretch = cmd.arg;
} else if (cmd.action === "set-alignment") {
this.settings.active.site['@global'].videoAlignment = cmd.arg;
this.settings.active.sites['@global'].videoAlignment = cmd.arg;
} else if (cmd.action === "set-extension-mode") {
this.settings.active.sites['@global'] = cmd.arg;
} else if (cmd.action === "set-autoar-mode") {
this.settings.active.site['@global'].autoar.arStatus = cmd.arg;
this.settings.active.sites['@global'].autoar.arStatus = cmd.arg;
}
this.settings.save();
}

View File

@ -321,11 +321,11 @@ function configureGlobalTab() {
processButtonsForPopupCategory(GlobalPanel.elements.stretchSettings, stretchButtons);
processButtonsForPopupCategory(GlobalPanel.elements.alignmentSettings, alignButtons);
selectButton('set-stretch', settings.active.site['@global'].stretch, GlobalPanel.elements.stretchSettings.buttons);
selectButton('set-alignment', settings.active.site['@global'].videoAlignment, GlobalPanel.elements.alignmentSettings.buttons);
selectButton('set-stretch', settings.active.sites['@global'].stretch, GlobalPanel.elements.stretchSettings.buttons);
selectButton('set-alignment', settings.active.sites['@global'].videoAlignment, GlobalPanel.elements.alignmentSettings.buttons);
selectButton('set-extension-mode', settings.active.sites['@global'], GlobalPanel.elements.extensionSettings.buttons);
selectButton('set-extension-mode', settings.active.site['@global'].autoar, GlobalPanel.elements.autoarSettings.buttons);
selectButton('set-extension-mode', settings.active.sites['@global'].autoar, GlobalPanel.elements.autoarSettings.buttons);
}
function configureSitesTab(site) {