Remove unused code

This commit is contained in:
Tamius Han 2019-05-21 22:21:46 +02:00
parent b4ee166bd7
commit 4227a4abc0
9 changed files with 0 additions and 1693 deletions

View File

@ -1,92 +0,0 @@
html, body {
width: 780px !important;
max-width: 800px !important;
padding: 0px;
margin: 0px;
}
.header {
background-color: #7f1416;
color: #fff;
margin: 0px;
margin-top: 0px;
padding-top: 8px;
padding-left: 15px;
padding-bottom: 1px;
font-size: 2.7em;
}
.menu-item-inline-desc{
font-size: 0.60em;
font-weight: 300;
font-variant: normal;
}
.left-side {
display: inline-block;
width: 39%;
float: left;
font-size: 1.6em;
}
.right-side {
display: inline-block;
width: 60%;
float: right;
}
.menu-item {
padding-left: 15px;
padding-top: 5px;
padding-bottom: 5px;
font-variant: small-caps;
border-left: transparent 5px solid;
}
.suboption {
display: block;
padding-left: 15px;
padding-right: 15px;
padding-top: 5px;
padding-bottom: 20px;
min-height: 250px;
}
#no-videos-display {
height: 100%;
padding-top: 50px;
/* text-align: center; */
}
.tabitem-container {
padding-top: 0.5em;
}
#tablist .selected {
background-color: initial;
border-left: #f18810 5px solid;
}
.tabitem {
font-variant: normal;
font-size: 0.69em;
margin-left: 1em;
border-left: transparent 3px solid;
padding-left: 12px;
margin-left: -10px;
}
.tabitem-selected {
color: #fff !important;
background-color: initial;
border-left: #f0c089 3px solid !important;
}
.tabitem-selected::before {
padding-right: 0.5em;
}
.tabitem-iframe::after {
content: "</>";
padding-left: 0.33em;
}

View File

@ -1,634 +0,0 @@
if(Debug.debug)
console.log("[popup.js] loading popup script!");
document.getElementById("uw-version").textContent = browser.runtime.getManifest().version;
var selectedMenu = "";
var selectedSubitem = {
'siteSettings': undefined,
'videoSettings': undefined,
}
var hasVideos = false;
var zoom_videoScale = 1;
var _config;
var _changeAr_button_shortcuts = { "autoar":"none", 'reset':"none", "219":"none", "189":"none", "169":"none", "custom":"none" }
var comms = new Comms();
var settings = new Settings(undefined, () => updateConfig());
var frameStore = {};
var frameStoreCount = 0;
var site = undefined;
// aside from hostname, this can have two additional values:
// __playing — commands get sent to all frames with videos of status 'playing'
// __all — commands get sent to all frames
var selectedFrame = '__all';
var port = browser.runtime.connect({name: 'popup-port'});
port.onMessage.addListener( (m,p) => processReceivedMessage(m,p));
var _video_settings_tab_items = [];
var selectedSubitemLoaded = false;
var tablist = {
'extensionSettings': {
tab: new MenuItem('_menu_item_settings_ext', 'Extension settings', '', () => showMenu('extensionSettings')),
container: GlobalPanel.container,
},
'siteSettings': {
tab: new MenuItem('_menu_item_settings_site', 'Site settings', 'Settings for current site', () => showMenu('siteSettings')),
container: SitePanel.container
},
'videoSettings': {
tab: new MenuItem('_menu_item_settings_video', 'Video settings', 'Crop & stretch options for videos on current page', () => showMenu('videoSettings')),
container: VideoPanel.container
},
'about': {
tab: new MenuItem('_menu_item_about', 'About Ultrawidify', '', () => showMenu('about')),
container: AboutPanel.container
}
};
for (let t in tablist) {
tablist[t].tab.appendTo(document.getElementById('tablist'));
}
function loadFrames(videoTab) {
tablist['siteSettings'].tab.removeSubitems();
tablist['videoSettings'].tab.removeSubitems();
if (!selectedSubitemLoaded) {
if (videoTab.selected) {
selectedSubitem = videoTab.selected;
selectedSubitemLoaded = true;
}
}
if (videoTab.frames.length < 2) {
return;
}
function onTabitemClick(item) {
tablist[selectedMenu].tab.selectSubitem(item);
selectedSubitem[selectedMenu] = item;
port.postMessage({cmd: 'popup-set-selected-tab', selectedMenu: selectedMenu, selectedSubitem: item});
}
for (var option of [{id: '__all', label: 'All'},{id: '__playing', label: 'Currently playing'}]) {
const id = option.id;
var newItem = new TabItem(
undefined,
option.id,
option.label,
false,
() => onTabitemClick(id)
);
tablist['siteSettings'].tab.insertSubitem(newItem);
tablist['videoSettings'].tab.insertSubitem(newItem);
}
for (var frame in videoTab.frames) {
if (frame && !frameStore[frame]) {
var fs = {
name: frameStoreCount++,
color: this.getRandomColor()
}
frameStore[frame] = fs;
port.postMessage({
cmd: 'mark-player',
targetTab: videoTab.id,
targetFrame: frame,
name: fs.name,
color: fs.color
});
}
const nid = `${videoTab.id}-${videoTab.frames[frame].id}`;
var newItem = new TabItem(
undefined,
nid,
videoTab.frames[frame].host,
videoTab.frames[frame].url != videoTab.url,
(click) => onTabitemClick(nid),
frameStore[frame]
);
tablist['siteSettings'].tab.insertSubitem(newItem);
tablist['videoSettings'].tab.insertSubitem(newItem);
}
if (! selectedSubitem.siteSettings || !tablist['siteSettings'].tab.existsSubitem(selectedSubitem.siteSettings)) {
selectedSubitem['siteSettings'] = tablist['siteSettings'].tab.selectFirstSubitem();
console.log("selected first subitem!")
} else {
tablist['siteSettings'].tab.selectSubitem(selectedSubitem.siteSettings)
}
if (! selectedSubitem.videoSettings || !tablist['videoSettings'].tab.existsSubitem(selectedSubitem.videoSettings)) {
selectedSubitem['videoSettings'] = tablist['videoSettings'].tab.selectFirstSubitem();
console.log("selected first subitem (vs)!")
} else {
tablist['videoSettings'].tab.selectSubitem(selectedSubitem.videoSettings);
}
}
async function processReceivedMessage(message, port){
if (Debug.debug) {
console.log("[popup.js] received message", message)
}
if(message.cmd === 'set-current-site'){
if (site) {
if (!site.host) {
// dunno why this fix is needed, but sometimes it is
site.host = site.tabHostname;
}
}
if (!site || site.host !== message.site.host) {
port.postMessage({cmd: 'get-current-zoom'});
}
site = message.site;
loadConfig(site.host);
loadFrames(site);
} else if (message.cmd === 'set-current-zoom') {
setCurrentZoom(message.zoom);
}
}
async function updateConfig() {
if (Debug.debug) {
console.log("[popup.js] settings changed. updating popup if site exists. Site:", site.host);
}
if (site && site.host) {
loadConfig(site.host);
}
}
async function setCurrentZoom(scale) {
zoom_videoScale = scale;
if(Debug.debug) {
console.log("[popup.js::setCurrentZoom] we're setting zoom:", zoom_videoScale);
}
VideoPanel.inputs.zoomSlider.value = Math.log2(zoom_videoScale);
VideoPanel.labels.zoomLevel.textContent = (zoom_videoScale * 100).toFixed();
}
function hideWarning(warn){
// document.getElementById(warn).classList.add("hidden");
}
function stringToKeyCombo(key_in){
var keys_in = key_in.split("_");
var keys_out = "";
for(key of keys_in){
if(key == "ctrlKey")
keys_out += "ctrl + ";
else if(key == "shiftKey")
keys_out += "shift + ";
else if(key == "altKey")
keys_out += "alt + ";
else
keys_out += key;
}
return keys_out;
}
function configurePopupTabs(site) {
if (!selectedMenu) {
showMenu('videoSettings');
} else {
showMenu(selectedMenu);
}
return;
}
function getRandomColor() {
return `rgb(${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)})`;
}
function basicCommandHandler(cmdArray, scope) {
for (cmd of cmdArray) {
port.postMessage({
cmd: cmd.action,
arg: cmd.arg,
targetFrame: selectedSubitem[selectedMenu],
scope: scope
});
}
}
function buildKeyboardShortcutString(keypress) {
var shortcutCombo = '';
if (keypress.ctrlKey) {
shortcutCombo += 'Ctrl + ';
}
if (keypress.shiftKey) {
shortcutCombo += 'Shift + ';
}
if (keypress.metaKey) {
shortcutCombo += 'Meta + ';
}
if (keypress.altKey) {
shortcutCombo += 'Alt + ';
}
shortcutCombo += keypress.key.toUpperCase();
return shortcutCombo;
}
function processButtonsForPopupCategory(category, buttons, scope) {
if (buttons.length === 0) {
category.container.hide();
} else {
category.buttons = {};
category.buttonContainer.removeChildren();
category.container.show();
category.buttonContainer.show();
for (var button of buttons) {
var shortcutCombo = '';
if (button.shortcut && button.shortcut[0].key) {
shortcutCombo = buildKeyboardShortcutString(button.shortcut[0]);
}
const cmd = button.cmd;
var nb = new ShortcutButton(
'',
button.label,
shortcutCombo,
() => basicCommandHandler(cmd, scope),
['w24']
)
nb.appendTo(category.buttonContainer);
var buttonId = '';
for (var c in cmd) {
buttonId += `${c > 0 ? ';' : ''}${cmd[c].action}:${cmd[c].arg}`;
}
category.buttons[buttonId] = nb;
}
}
}
function selectButton(action, arg, buttons) {
for (var b in buttons) {
buttons[b].unselect();
}
const cmd=`${action}:${arg}`
if (buttons[cmd]) {
buttons[cmd].select();
}
}
function configureGlobalTab() {
const popupButtons = settings.getActionsForSite(site).filter(action => action.popup_global === true);
const extensionButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-extension-mode');
const autoarButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-autoar-mode');
const stretchButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-stretch');
const alignButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-alignment');
processButtonsForPopupCategory(GlobalPanel.elements.extensionSettings, extensionButtons, 'site');
processButtonsForPopupCategory(GlobalPanel.elements.autoarSettings, autoarButtons, 'site');
processButtonsForPopupCategory(GlobalPanel.elements.stretchSettings, stretchButtons);
processButtonsForPopupCategory(GlobalPanel.elements.alignmentSettings, alignButtons);
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.sites['@global'].autoar, GlobalPanel.elements.autoarSettings.buttons);
}
function configureSitesTab(site) {
const popupButtons = settings.getActionsForSite(site).filter(action => action.popup_site === true);
const extensionButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-extension-mode');
const autoarButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-autoar-mode');
const stretchButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-stretch');
const alignButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-alignment');
processButtonsForPopupCategory(SitePanel.elements.extensionSettings, extensionButtons, 'site');
processButtonsForPopupCategory(SitePanel.elements.autoarSettings, autoarButtons, 'site');
processButtonsForPopupCategory(SitePanel.elements.stretchSettings, stretchButtons, 'site');
processButtonsForPopupCategory(SitePanel.elements.alignmentSettings, alignButtons, 'site');
if (settings.active.sites[site.host] && settings.active.sites[site.host]) {
selectButton('set-extension-mode', settings.active.sites[site.host].status, SitePanel.elements.extensionSettings.buttons);
selectButton('set-autoar-mode', settings.active.sites[site.host].arStatus, SitePanel.elements.extensionSettings.buttons);
} else {
selectButton('set-extension-mode', 'default', SitePanel.elements.extensionSettings.buttons);
selectButton('set-autoar-mode', 'default', SitePanel.elements.extensionSettings.buttons);
}
// optional settings:
if(settings.active.sites[site.host] && settings.active.sites[site.host].stretch !== undefined) { // can be 0
selectButton('set-stretch', settings.active.sites[site.host].stretch, SitePanel.elements.stretchSettings.buttons)
} else {
selectButton('set-stretch', -1, SitePanel.elements.stretchSettings.buttons)
}
if (settings.active.sites[site.host] && settings.active.sites[site.host].videoAlignment) {
selectButton('set-alignment', settings.active.sites[site.host].videoAlignment, SitePanel.elements.alignmentSettings.buttons);
} else {
selectButton('set-alignment', 'default', SitePanel.elements.alignmentSettings.buttons);
}
}
function configureVideoTab(site) {
const popupButtons = settings.getActionsForSite(site).filter(action => action.popup === true);
const cropButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-ar');
const stretchButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-stretch');
const alignButtons = popupButtons.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-alignment');
processButtonsForPopupCategory(VideoPanel.elements.cropSettings, cropButtons);
processButtonsForPopupCategory(VideoPanel.elements.stretchSettings, stretchButtons);
processButtonsForPopupCategory(VideoPanel.elements.alignmentSettings, alignButtons);
// todo: get min, max from settings
VideoPanel.inputs.zoomSlider.min = Math.log2(0.5);
VideoPanel.inputs.zoomSlider.max = Math.log2(8);
VideoPanel.inputs.zoomSlider.value = Math.log2(zoom_videoScale);
VideoPanel.inputs.zoomSlider.addEventListener('input', (event) => {
var newZoom = Math.pow(2, VideoPanel.inputs.zoomSlider.value);
// save value so it doesn't get reset next time the popup updates
zoom_videoScale = newZoom;
// update zoom% label
VideoPanel.labels.zoomLevel.textContent = (newZoom * 100).toFixed();
// send the command to bg script
var command = {
cmd: 'set-zoom',
zoom: newZoom,
targetFrame: selectedSubitem[selectedMenu]
};
port.postMessage(command);
});
}
async function loadConfig(site){
if (Debug.debug) {
console.log("\n\n-------------------------------------\n[popup.js::loadConfig] loading config. conf object:", settings.active);
}
configurePopupTabs(site);
configureGlobalTab();
configureSitesTab(site);
configureVideoTab(site);
if (Debug.debug) {
console.log("[popup.js::loadConfig] config loaded\n-----------------------\n\n");
}
}
function removeAll(itemArray) {
for(item of itemArray) {
item.remove();
}
}
function unselect(itemArray, extraClasses) {
for(item of itemArray) {
item.classList.remove('selected');
if (extraClasses) {
item.classList.remove(extraClasses);
}
}
}
async function getSite(){
if (Debug.debug) {
console.log("[popup.js] requesting current site");
}
try {
port.postMessage({cmd: 'get-current-site'});
} catch (e) {
console.log("[popup::getSite] sending get-current-site failed for some reason. Reason:", e)
}
}
function openMenu(menu){
if(Debug.debug){
console.log("[popup.js::openMenu] trying to open menu", menu, "\n element: ", Menu[menu]);
}
for(var m in Menu){
if(Menu[m])
Menu[m].classList.add("hidden");
}
for(var m in MenuTab){
if(MenuTab[m])
MenuTab[m].classList.remove("selected");
}
Menu[menu].classList.remove("hidden");
MenuTab[menu].classList.add("selected");
selectedMenu = menu;
}
function showMenu(tab) {
if(Debug.debug) {
console.log("[popup.js::showMenu] opening menu", tab, "tablist?", tablist)
}
if (!tablist) {
// todo: fix & remove this
return;
}
for (const i in tablist) {
tablist[i].tab.unselect();
tablist[i].tab.hideSubitems();
tablist[i].container.hide();
}
tablist[tab].tab.select();
tablist[tab].tab.showSubitems();
tablist[tab].container.show();
// todo: display the correct tab
selectedMenu = tab;
}
function getCustomAspectRatio() {
var textBox_value = document.getElementById("_input_custom_ar").value.trim();
// validate value - this spaghett will match the following stuff
// [int]/[int]
// 1:[float]
// [float]
if (! /(^[0-9]+\/[0-9]+$|^(1:)?[0-9]+\.?[0-9]*$)/.test(textBox_value)) {
return false; // validation failed!
}
if (! isNaN(parseFloat(textBox_value))) {
return parseFloat(textBox_value);
}
if (/\//.test(textBox_value)) {
const vars = textBox_value.split('/');
return parseInt(vars[0])/parseInt(vars[1]); // non-ints shouldn't make it past regex
}
if (/:/.test(textBox_value)) {
const vars = textBox_value.split(':');
return parseFloat(vars[1]);
}
// we should never come this far.
// If we do, then there's something wrong with the input and our regex
return false;
}
function validateCustomAr(){
const valid = getCustomAspectRatio() !== false;
const inputField = document.getElementById("_input_custom_ar");
const valueSaveButton = document.getElementById("_b_changeAr_save_custom_ar");
if (valid) {
inputField.classList.remove("invalid-input");
valueSaveButton.classList.remove("disabled-button");
} else {
inputField.classList.add("invalid-input");
valueSaveButton.classList.add("disabled-button");
}
}
function validateAutoArTimeout(){
const inputField = document.getElementById("_input_autoAr_timer");
const valueSaveButton = document.getElementById("_b_autoar_save_autoar_timer");
if (! isNaN(parseInt(inputField.value.trim().value()))) {
inputField.classList.remove("invalid-input");
valueSaveButton.classList.remove("disabled-button");
} else {
inputField.classList.add("invalid-input");
valueSaveButton.classList.add("disabled-button");
}
}
document.addEventListener("click", (e) => {
if(Debug.debug) {
console.log("[popup.js] something clicked. event:", e, JSON.stringify(e));
}
function getcmd(e){
var command = {};
command.sender = "popup";
command.receiver = "uwbg";
//#region zoom buttons
if (e.target.classList.contains("_zoom_show_shortcuts")) {
VideoPanel.misc.zoomShortcuts.classList.remove("hidden");
VideoPanel.buttons.zoom.hideShortcuts.classList.remove("hidden");
VideoPanel.buttons.zoom.showShortcuts.classList.add("hidden");
return;
}
if (e.target.classList.contains("_zoom_hide_shortcuts")) {
VideoPanel.misc.zoomShortcuts.classList.add("hidden");
VideoPanel.buttons.zoom.hideShortcuts.classList.add("hidden");
VideoPanel.buttons.zoom.showShortcuts.classList.remove("hidden");
return;
}
if (e.target.classList.contains("_zoom_reset")) {
zoom_videoScale = scale;
VideoPanel.labels.zoomLevel.textContent = 100;
VideoPanel.inputs.zoomSlider.value = 0; // log₂(1)
command.cmd = 'set-zoom';
command.zoom = 1;
return command;
}
//#endregion
}
var command = getcmd(e);
if (!command)
return;
command.targetFrame = selectedSubitem[selectedMenu]
if(Debug.debug) {
console.log("[popup.js] Got command (can be undefined):", command, JSON.stringify(command))
}
if(command)
port.postMessage(command);
return true;
});
async function sleep(t) {
return new Promise( (resolve,reject) => {
setTimeout(() => resolve(), t);
});
}
async function popup_init() {
// let's init settings and check if they're loaded
await settings.init();
if (Debug.debug) {
console.log("[popup] Are settings loaded?", settings)
}
// autoarFrequencyInputField.addEventListener("blur", (event) => {
// validateAutoArTimeout();
// });
// autoarFrequencyInputField.addEventListener("mouseleave", (event) => {
// validateAutoArTimeout();
// });
hideWarning("script-not-running-warning");
while (true) {
getSite();
await sleep(5000);
}
}
popup_init();
window.addEventListener("unload", () => {
console.log("SENDING UNMARK COMMAND")
port.postMessage({
cmd: 'unmark-player',
});
});

View File

@ -1,105 +0,0 @@
//#region GlobalPanel
var GlobalPanel = {};
GlobalPanel.container = BaseElement.fromExisting(document.getElementById('_menu_settings_global'))
GlobalPanel.elements = {};
GlobalPanel.elements.extensionSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_global_status')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_global_status_buttons'))
}
GlobalPanel.elements.autoarSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_global_autoar')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_global_autoar_buttons'))
}
GlobalPanel.elements.stretchSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_global_crop')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_global_stretch_buttons'))
}
GlobalPanel.elements.alignmentSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_global_alignment')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_global_alignment_buttons'))
}
//#endregion
//#region SitePanel
var SitePanel = {};
SitePanel.elements = {};
SitePanel.container = BaseElement.fromExisting(document.getElementById('_menu_settings_site'))
SitePanel.elements.extensionSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_site_status')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_site_status_buttons'))
}
SitePanel.elements.autoarSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_site_autoar')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_site_autoar_buttons'))
}
SitePanel.elements.stretchSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_site_stretch')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_site_stretch_buttons'))
};
SitePanel.elements.alignmentSettings = {
container: BaseElement.fromExisting(document.getElementById('_menu_settings_site_alignment')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_site_alignment_buttons'))
};
//#endregion
//#region VideoPanel
var VideoPanel = {};
VideoPanel.elements = {};
VideoPanel.container = BaseElement.fromExisting(document.getElementById('_menu_settings_video'))
VideoPanel.elements.cropSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_video_crop')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_video_crop_buttons'))
}
VideoPanel.elements.stretchSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_video_stretch')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_video_stretch_buttons'))
}
VideoPanel.elements.alignmentSettings = {
buttons: {},
container: BaseElement.fromExisting(document.getElementById('_menu_settings_video_alignment')),
buttonContainer: BaseElement.fromExisting(document.getElementById('_menu_settings_video_alignment_buttons'))
}
// THE FOLLOWING BUTTONS ARE STILL HANDLED THE OLD-FASHIONED WAY
// DO NOT REMOVE
// buttons: for toggle, select
VideoPanel.buttons = {};
VideoPanel.buttons.zoom = {};
VideoPanel.buttons.zoom.showShortcuts = document.getElementById("_zoom_b_show_shortcuts");
VideoPanel.buttons.zoom.hideShortcuts = document.getElementById("_zoom_b_hide_shortcuts");
VideoPanel.buttons.changeAr = {};
VideoPanel.buttons.changeAr.showCustomAr = document.getElementById("_changeAr_b_show_customAr");
VideoPanel.buttons.changeAr.hideCustomAr = document.getElementById("_changeAr_b_hide_customAr");
// inputs (getting values)
VideoPanel.inputs = {};
VideoPanel.inputs.zoomSlider = document.getElementById("_input_zoom_slider");
VideoPanel.inputs.allowPan = document.getElementById("_input_zoom_site_allow_pan");
// various labels
VideoPanel.labels = {};
VideoPanel.labels.zoomLevel = document.getElementById("_label_zoom_level");
// misc stuff
VideoPanel.misc = {};
VideoPanel.misc.zoomShortcuts = document.getElementById("_zoom_shortcuts");
//#endregion
//#region about
var AboutPanel = {};
AboutPanel.container = BaseElement.fromExisting(document.getElementById('_menu_about'))
//#endregion

View File

@ -1,197 +0,0 @@
<html>
<head>
<!-- shit like this really makes you appreciate angular and similar frameworks, doesn't it? -->
<title></title>
<meta charset="utf-8">
<link rel='stylesheet' type='text/css' href='../css/font/overpass.css'>
<link rel='stylesheet' type='text/css' href='../css/font/overpass-mono.css'>
<link rel='stylesheet' type='text/css' href='../css/common.css'>
<link rel='stylesheet' type='text/css' href='./css/popup.css'>
</head>
<body>
<div class="header">
U<span class="smallcaps">ltrawidify</span>: <small>Quick settings</small>
</div>
<!-- TABS/SIDEBAR -->
<div id="tablist" class="left-side">
</div>
<!-- PANELS/CONTENT -->
<div id="tab-content" class="right-side">
<!-- <div id="script-not-running-warning" class="warning">If you see this line, then your browser didn't start the popup script yet. This is a problem caused by the browser. Please wait a few seconds.</div> -->
<!-- EXTENSION SETTINGS -->
<div id="_menu_settings_global" class="suboption hidden">
<p>These settings can be overriden on per-site basis.</p>
<div class="row">
<div id="_menu_settings_global_status" class="row">
<span class="label">Extension status</span>
<div id="_menu_settings_global_status_buttons" class="button-row">
</div>
</div>
<div id="_menu_settings_global_autoar" class="row">
<span class="label">Automatic detection</span>
<div id="_menu_settings_global_autoar_buttons" class="button-row">
</div>
</div>
<!-- STRETCH STUFF -->
<div id="_menu_settings_global_stretch" class="row">
<span class="label experimental">Stretching mode</span>
<div id="_menu_settings_global_stretch_buttons" class="button-row">
</div>
</div>
<!-- VIDEO ALIGNMENT -->
<div id="_menu_settings_global_alignment" class="row">
<span class="label">Video alignment:</span>
<div id="_menu_settings_global_alignment_buttons" class="button-row">
</div>
</div>
</div>
</div>
<!-- SITE SETTINGS -->
<div id="_menu_settings_site" class="suboption hidden">
<div id="_menu_settings_site_status" class="row">
<span class="label">Options for this site</span>
<div id="_menu_settings_site_status_buttons" class="button-row">
</div>
</div>
<div id="_menu_settings_site_autoar" class="row">
<span class="label">Automatic detection</span>
<div id="_menu_settings_site_autoar_buttons" class="button-row">
</div>
</div>
<!-- STRETCH STUFF -->
<div id="_menu_settings_site_stretch" class="row">
<span class="label experimental">Stretching mode</span>
<div id="_menu_settings_site_stretch_buttons" class="button-row">
</div>
</div>
<!-- VIDEO ALIGNMENT -->
<div id="_menu_settings_site_alignment" class="row">
<span class="label">Video alignment:</span>
<div id="_menu_settings_site_alignment_buttons" class="button-row">
</div>
</div>
</div>
<!-- VIDEO SETTINGS -->
<div id="_menu_settings_video" class="suboption">
<!-- CROP STUFF -->
<div id="_menu_settings_video_crop" class="row">
<span class="label">Cropping mode</span>
<div id="_menu_settings_video_crop_buttons" class="button-row">
</div>
<!-- todo: redirect 'custom aspect ratio' to settings -->
<!-- <div style="overflow: auto">
<div class="float-right medium-small">
<a id="_changeAr_b_show_customAr" class="_changeAr_show_customAr x-pad-1em">Set custom aspect ratio</a>
</div>
</div> -->
</div>
<!-- ZOOM STUFF -->
<span class="label experimental">Manual zooming and panning</span>
<div class="row">
<!--
min, max and value need to be implemented in js as this slider
should use logarithmic scale
-->
<input id="_input_zoom_slider" class="w100"
type="range"
step="any"
/>
<div style="overflow: auto">
<div class="inline-block float-left medium-small x-pad-1em">
Zoom: <span id="_label_zoom_level">100</span>%
</div>
<div class="inline-block float-right medium-small">
<a id="_zoom_b_show_shortcuts" class="_zoom_show_shortcuts x-pad-1em">show shortcuts</a>
<a id="_zoom_b_hide_shortcuts" class="_zoom_hide_shortcuts hidden x-pad-1em">hide shortcuts</a>
<a class="_zoom_reset x-pad-1em">reset</a>
</div>
</div>
<!-- <div class="m-t-0-33em w100 display-block">
<input id="_input_zoom_site_allow_pan"
type="checkbox"
/>
Pan with mouse
</div> -->
<div id="_zoom_shortcuts" class="row hidden">
<small>Keyboard shortcuts:<ul>
<li>Z: zoom</li>
<li>U: unzoom</li>
<li>P: toggle pan</li>
<li>shift: hold to enable/prevent pan</li>
</ul></small>
</div>
</div>
<!-- STRETCH STUFF -->
<div id="_menu_settings_video_stretch" class="row">
<span class="label experimental">Stretching mode</span>
<div id="_menu_settings_video_stretch_buttons" class="button-row">
</div>
</div>
<!-- VIDEO ALIGNMENT -->
<div id="_menu_settings_video_alignment" class="row">
<span class="label">Video alignment:</span>
<div id="_menu_settings_video_alignment_buttons" class="button-row">
</div>
</div>
</div>
<!-- ABOUT -->
<div id="_menu_about" class="suboption hidden">
<div class="row">
<span class="label">Ultrawidify version:</span><br/> <span id="uw-version"></span>
</div>
<div class="row">
<span class="label">Having an issue?</span><br/> Report <strike>undocumented features</strike> bugs using one of the following options:<ul><li> <a target="_blank" href="https://github.com/xternal7/ultrawidify/issues"><b>Github (strongly preferred)</b></a><br/></li>
<li>PM me on <a target="_blank" href="https://www.reddit.com/message/compose?to=xternal7&subject=[Ultrawidify]%20ENTER%20SUMMARY%20OF%20YOUR%20PROBLEM%20HERE&message=Describe+your+issue+in+more+detail.+Don%27t+forget+to+include%3A%0D%0A%2A+Extension+version%0D%0A%2A+Browser%0D%0A%2A+Operating+system%0D%0A%2A+Other+extensions+that+could+possibly+interfere%0D%0A%0D%0AIf+you%27re+reporting+an+issue+with+automatic+aspect+ratio+detection%2C+please+also+include+the+following+%28if+possible%29%3A%0D%0A%2A+model+and+make+of+your+CPU%0D%0A%2A+amount+of+RAM">reddit</a><br/></li>
<li>Email: <a target="_blank" href="mailto:tamius.han@gmail.com?subject=%5BUltrawidify%5D+ENTER+SUMMARY+OF+YOUR+ISSUE+HERE&body=Describe+your+issue+in+more+detail.+Don%27t+forget+to+include%3A%0D%0A%2A+Extension+version%0D%0A%2A+Browser%0D%0A%2A+Operating+system%0D%0A%2A+Other+extensions+that+could+possibly+interfere%0D%0A%0D%0AIf+you%27re+reporting+an+issue+with+automatic+aspect+ratio+detection%2C+please+also+include+the+following+%28if+possible%29%3A%0D%0A%2A+model+and+make+of+your+CPU%0D%0A%2A+amount+of+RAM">tamius.han@gmail.com</a></li>
</ul>
</div>
</div>
</div>
<!-- load all scripts. ordering is important! -->
<script src="../../js/conf/Debug.js"></script>
<script src="../../js/lib/BrowserDetect.js"></script>
<script src="../../js/lib/Comms.js"></script>
<script src="../../js/conf/ExtensionConf.js"></script>
<script src="../../js/lib/Settings.js"></script>
<!-- ui libs -->
<script src="../../js/lib/libghettoui/BaseElement.js"></script>
<script src="../../js/lib/libghettoui/popup/MenuItem.js"></script>
<script src="../../js/lib/libghettoui/popup/TabItem.js"></script>
<script src="../../js/lib/libghettoui/buttons/Button.js"></script>
<script src="../../js/lib/libghettoui/buttons/ShortcutButton.js"></script>
<script src="./js/popupvars.js"></script>
<script src="./js/popup.js"></script>
</body>
</html>

View File

@ -1,272 +0,0 @@
@import url("../css/font/overpass.css");
@import url("../css/font/overpass-mono.css");
body {
background-image: url(data:image/png;base64,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);
background-size: 75px;
background-color: #000000;
color: #ddd;
font-family: 'Overpass', sans-serif;
font-size: 1.2em;
width: 100%;
border: 0px;
margin: 0px;
padding: 0px;
text-align: center;
z-index: -1000;
}
a, a:visited{
color: #fa6607;
text-decoration: none;
}
a:hover{
color: #fa6;
}
.show{
display: block !important;
}
.hide{
display: none !important;
}
head{
width: 100%;
border: 0px;
margin: 0px;
padding: 0px;
}
h1,h2{
color: #ff9;
font-weight: 300;
}
h1{
font-size: 3.3em;
}
h2{
font-size: 2.2em;
}
.sites_header{
font-size: 1.6em;
color: #ff9;
}
.content{
display: inline-block;
width: 52em;
}
.center{
margin: 0 auto;
}
.basecolor {
color: #ddd !important;
}
.red{
color: #ff3a00;
}
.disabled {
opacity: 0.69;
}
.left {
text-align: left;
}
.block {
display: inline-block;
margin-left: 1em;
margin-right: 1em;
}
.tabline {
background-color: #000;
width: 100%;
margin-bottom: 1.5em;
padding-top: 0.3em;
padding-bottom: 0.4em;
z-index: -200;
}
.tab {
color: #fa6607;
}
.tab:hover{
text-shadow: #aa5 0px 0px 0.02em,#aa5 0px 0px 0.02em;
}
.tab-selected {
color: #ff9 !important;
}
#all{
min-width: 100%;
min-height: 100vh;
/* background-image: url('img/settings/about-bg.png'); */
background-position: calc(50vw + 20em) 10vh;
background-attachment: fixed;
background-size: auto 100%;
background-repeat: no-repeat;
}
.dup_keybinds{
background-color: #720 !important;
}
input[type=text]{
font-size: 1em;
padding-left: 0.6em;
margin-left: 1em;
width: 2em;
background-color: #000;
border: 1px #442 solid;
}
.uw_shortcuts_line{
padding-top: 0.25em;
padding-left: 5em;
}
.uw_shortcuts_label{
display: inline-block;
color: #fff;
width: 17.5em;
}
.uw_options_line{
margin-top: 0.75em;
font-size: 1.1em;
width: 80%;
margin-left: 5%;
}
.uw_options_option{
margin-left: 5%;
}
.uw_suboption{
margin-left: 5em;
margin-top: 0.75em;
font-size: 0.85em;
}
.uw_options_desc, .uw_suboption_desc{
margin-top: 0.33em;
font-size: 0.69em;
color: #aaa;
}
.uw_suboption_desc{
margin-left: 5em;
}
.buttonbar{
/* width: 100%; */
padding-left: 20em;
margin-bottom: 2em;
}
.button{
display: inline-block;
margin-left: 1em;
margin-right: 1em;
padding-left: 1em;
padding-right: 1em;
padding-top: 0.4em;
width: 4em;
text-align: center;
background-color: rgba(0,0,0,0.66);
color: #ffc;
height: 1.7em;
}
.monospace {
font-family: 'Overpass Mono', monospace
}
.center-text {
text-align: center;
}
/** site options css **/
.site_name {
padding-left: 1em;
padding-bottom: 0.3em;
color: #fff;
font-size: 1.1em;
height: 13em !important;
}
.site_details {
font-size: 0.8em;
}
.site_title_ebox {
width: 10em !important;
font-size: 1.5em !important;
background-color: rgba(0,0,0,0) !important;
margin-left: 0px !important;
border: 0px !important;
color: #ffc !important;
}
.details_ebox {
width: 12em !important;
background-color: rgba(0,0,0,0) !important;
border: 0px !important;
color: #ffc !important;
margin-left: 0em !important;
}
.details_ebox:disabled {
color: #aaa !important;
}
.inline_button {
display: inline-block;
margin-top: -1.42em;
}
.inline_button:hover {
color: #fff;
}
.checkbox-center {
text-align: center;
}
.checkbox-container {
display: inline-block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
/* cursor: pointer; */
font-size: 22px;
/* -webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; */
}
.checkbox {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
}
.checkbox-checked {
position: absolute;
left: 9px;
top: 5px;
width: 5px;
height: 10px;
border: solid rgb(245, 145, 63);
border-width: 0 3px 3px 0;
transform: rotate(45deg);
}
/* ACTION TABLE STYLES */
.action-item-category-label {
color: rgb(245, 145, 63);
font-size: 2em;
font-weight: 200;
margin-bottom: 0px;
padding-bottom: 0px;
padding-top: 1em;
}
.action-item-table-header {
color: rgb(245, 145, 63);
}
.action-item-table-header-small {
color: rgb(245, 145, 63);
font-size: 0.85em !important;
font-weight: 300 !important;
}
.action-list-item:hover {
background-color: rgba(254, 146, 63, 0.15);
}

View File

@ -1,79 +0,0 @@
if (Debug.debug) {
console.log("[customization.js] loading script for customization tab")
}
function loadActions() {
if (Debug.debug) {
console.log("[customization.js] loading actions\n", settings, "\n", settings.active.actions)
}
// build actions list
const actions = settings.active.actions;
const cropActions = actions.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-ar');
const stretchActions = actions.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-stretch');
const alignActions = actions.filter(action => action.cmd.length === 1 && action.cmd[0].action === 'set-alignment');
const zoomPanActions = actions.filter(action => action.cmd.length === 1 && (
action.cmd[0].action === 'set-zoom' ||
action.cmd[0].action === 'set-pan' ||
action.cmd[0].action === 'pan' ||
action.cmd[0].action === 'set-pan')
);
// this is shit on performance but it'll cut it for this job
const otherActions = actions.filter(action => action.cmd.length > 1 || (
action.cmd.length === 1 &&
cropActions.indexOf(action) === -1 &&
stretchActions.indexOf(action) === -1 &&
alignActions.indexOf(action) === -1 &&
zoomPanActions.indexOf(action) === -1 )
);
ActionItemCategoryHeaderProcessor.addCategoryName(ui.customization.actionList.element, "Crop actions");
ActionItemCategoryHeaderProcessor.addTableHeader(ui.customization.actionList.element);
loadActionSection(cropActions, ui.customization.actionList);
ActionItemCategoryHeaderProcessor.addCategoryName(ui.customization.actionList.element, "Stretch actions");
ActionItemCategoryHeaderProcessor.addTableHeader(ui.customization.actionList.element);
loadActionSection(stretchActions, ui.customization.actionList);
ActionItemCategoryHeaderProcessor.addCategoryName(ui.customization.actionList.element, "Alignment actions");
ActionItemCategoryHeaderProcessor.addTableHeader(ui.customization.actionList.element);
loadActionSection(alignActions, ui.customization.actionList);
ActionItemCategoryHeaderProcessor.addCategoryName(ui.customization.actionList.element, "Zoom actions");
ActionItemCategoryHeaderProcessor.addTableHeader(ui.customization.actionList.element);
loadActionSection(zoomPanActions, ui.customization.actionList);
ActionItemCategoryHeaderProcessor.addCategoryName(ui.customization.actionList.element, "Other actions");
ActionItemCategoryHeaderProcessor.addTableHeader(ui.customization.actionList.element);
loadActionSection(otherActions, ui.customization.actionList);
ui.customization.actionItems.push(cropActions);
ui.customization.actionItems.push(stretchActions);
ui.customization.actionItems.push(alignActions);
ui.customization.actionItems.push(zoomPanActions);
ui.customization.actionItems.push(otherActions);
console.log("ui.customization:", ui.customization)
}
function loadSectionHeader(title) {
}
function loadActionSection(actions, container) {
for(const action of actions) {
if (action.shortcut && action.shortcut[0].key) {
action.parsedShortcut = KeyboardShortcutParser.parseShortcut(action.shortcut[0])
}
const actionIndex = settings.active.actions.indexOf(action);
var newAction = new ActionItem(
undefined,
action,
() => editShortcut(actionIndex)
);
newAction.appendTo(container);
}
}
function editShortcut(actionIndex) {
alert(`customization.js/editShortcut: Implement me pls. ActionIndex: ${actionIndex}`);
}

View File

@ -1,28 +0,0 @@
if(Debug.debug)
console.log("[settings.js] loading settings script!");
// document.getElementById("uw-version").textContent = browser.runtime.getManifest().version;
var settings = new Settings(undefined, () => updateConfig());
function updateConfig() {
loadConfig();
}
function loadConfig() {
loadActions();
}
// setup:
async function initSettings() {
await settings.init();
loadConfig();
}
initSettings();

View File

@ -1,46 +0,0 @@
var ui = {
general: {
extensionSettings: {
buttonContainer: BaseElement.fromExisting(document.getElementById('_general_extension_global_settings')),
buttons: [],
whitelistTextbox: document.getElementById('_general_extension_whitelist'),
blacklistTextbox: document.getElementById('_general_extension_blacklist')
},
autoarSettings: {
buttonContainer: BaseElement.fromExisting(document.getElementById('_general_extension_global')),
buttons: []
},
alignmentSettings: {
buttonsContainer: BaseElement.fromExisting(document.getElementById('_general_extension_global_alignment')),
buttons: []
},
stretchSettings: {
buttonContainer: BaseElement.fromExisting(document.getElementById('_general_extension_global_stretch')),
buttons: [],
thinBordersThresholdInput: document.getElementById('_general_extension_global_stretch_thin_borders_threshold_input')
}
},
// Automatic detection settings:
autoar: {
autoarSettings: {
buttonContainer: BaseElement.fromExisting(document.getElementById('_autoar_global_settings')),
buttons: [],
whitelistTextbox: document.getElementById('_autoar_whitelist'),
blacklistTextbox: document.getElementById('_autoar_blacklist')
},
checkFrequency: {
playingCheckFrequencyInput: document.getElementById('_autoar_checkFrequency_playing'),
pausedCheckFrequencyInput: document.getElementById('_autoar_checkFrequency_paused'),
errorCheckFrequencyInput: document.getElementById('_autoar_checkFrequency_error')
}
},
// Customization settings
customization: {
actionList: BaseElement.fromExisting(document.getElementById('_customization_action_list')),
actionItems: [],
}
}

View File

@ -1,240 +0,0 @@
<html>
<head>
<title>Ultrawidify :: settings</title>
<meta charset="UTF-8">
<base target="_blank">
<link rel='stylesheet' type='text/css' href='../css/font/overpass.css'>
<link rel='stylesheet' type='text/css' href='../css/font/overpass-mono.css'>
<link rel='stylesheet' type='text/css' href='./css/flex.css'>
<link rel='stylesheet' type='text/css' href='../css/common.css'>
<link rel='stylesheet' type='text/css' href='./css/settings.css'>
</head>
<body>
<div id="all">
<header>
<div class="content center">
<div class="left">
<h1>Ultrawidify :: settings</h1>
</div>
</div>
<div class="tabline center">
<div class="content left">
<div id="tab_general_settings" class="block tab tab-selected">General settings</div>
<div id="tab_sites" class="block tab">Site options</div>
<div id="tab_shortcuts" class="block tab">Shortcuts</div>
<div id="tab_about" class="block tab">About</div>
</div>
</div>
</header>
<!-- GENERAL SETTINGS -->
<div id="general_settings">
<div class="content left">
<div class="row">
<span class="label">Enable this extension:</span>
<!-- Buttons go here -->
<div class="button-row" id="_general_extension_global_settings">
</div>
<span class="description">
<b>Always</b> enables this extension on every site you visit that you didn't blacklist.<br/>
<b>On whitelisted sites</b> enables this extension only on sites you explicitly whitelisted.<br/>
<b>Never</b> disables extension on all sites, even on those you whitelisted.
</span>
</div>
<div class="flex flex-row">
<div class="flex flex-column flex-auto">
<div class="label">Whitelisted sites</div>
<div class="description">List of whitelisted sites. One per line.</div>
<textarea id="_general_extension_whitelist"></textarea>
</div>
<div class="flex flex-column flex-auto">
<div class="label">Blacklisted sites</div>
<div class="description">List of blacklisted sites. One per line.</div>
<textarea id="_general_extension_blacklist"></textarea>
</div>
</div>
<div class="row">
<span class="label">Enable autodetection:</span>
<div class="button-row" id="_general_extension_global_autoar">
</div>
<span class="description">
<b>Always</b> enables autodetection on every site this extension is enabled for, unless blacklisted.<br/>
<b>On whitelisted sites</b> enables autodetection only for sites that you explicitly enabled.<br/>
<b>Never</b> disables autodetection on all sites, even on those you whitelisted.<br/>
<br/>
For more settings related to autodetection, please check the 'Autodetection' tab.
</span>
</div>
<div class="row">
<span class="label">Default video alignment:</span>
<div class="button-row" id="_general_extension_global_alignment">
</div>
</div>
<div class="row">
<div class="label">Default stretch mode</div>
<div class="button-row" id="_general_extension_global_stretch">
</div>
<span class="description">
<b>None:</b> do not stretch the video at all. This is the default option, for men of culture.<br/>
<b>Basic:</b> stretches video to fit the player or screen unconditionally. If video has letterbox encoded, this option <i>will not</i> try to remove letterbox before stretching. You probably shouldn't be using this option.<br/>
<b>Hybrid:</b> stretches the video to fit the player, but only if cropping didn't completely remove the black bars.<br/>
<b>Thin borders:</b> stretches only if the width of black borders after cropping is thin.
<br/>
Threshold for thin borders can be defined below.
</span>
<div class="flex flex-row">
<div class="flex flex-input-label">
Thin border threshold (%):
</div>
<div class="flex flex-input">
<input id="_general_extension_global_stretch_thin_borders_input" type="number">
</div>
</div>
</div>
</div>
</div>
<!-- AUTOMATIC DETECTION SETTINGS -->
<div id="autoar_settings">
<div class="content">
<div class="row">
<span class="label">Enable autodetection:</span>
<!-- Buttons go here -->
<div class="button-row" id="_autoar_global_settings">
</div>
<span class="description">
<b>Always</b> enables autodetection on every site you visit that you didn't blacklist.<br/>
<b>On whitelisted sites</b> enables autodetection only on sites you explicitly whitelisted.<br/>
<b>Never</b> disables autodetection on all sites, even on those you whitelisted.
</span>
</div>
<div class="flex flex-row">
<div class="flex flex-column flex-auto">
<div class="label">Whitelisted sites</div>
<div class="description">List of whitelisted sites. One per line.</div>
<textarea id="_autoar_whitelist"></textarea>
</div>
<div class="flex flex-column flex-auto">
<div class="label">Blacklisted sites</div>
<div class="description">List of blacklisted sites. One per line.</div>
<textarea id="_autoar_blacklist"></textarea>
</div>
</div>
<h2>Advanced automatic detection options</h2>
<div class="row">
<div class="label">Aspect ratio check frequency</div>
<div class="description">
<p>Options here decide how often the extension will check for changes in aspect ratio of a given video.</p>
<p>Values are given in milliseconds. Longer intervals increase delay between aspect ratio changing and extension re-correcting for the change. Using shorter intervals than the default ones can cause lage and <i>immense</i> RAM usage.</p>
</div>
<div class="flex flex-column">
<div class="flex flex-row">
<div class="flex flex-input-label">
Check frequency when video is playing (ms):
</div>
<div class="flex flex-input">
<input id="_autoar_checkFrequency_playing" type="number">
</div>
</div>
<div class="flex flex-row">
<div class="flex flex-input-label">
Check frequency when video is paused (ms):
</div>
<div class="flex flex-input">
<input id="_autoar_checkFrequency_paused" type="number">
</div>
</div>
<div class="flex flex-row">
<div class="flex flex-input-label">
Recheck delay on error (ms):
</div>
<div class="flex flex-input">
<input id="_autoar_checkFrequency_error" type="number">
</div>
</div>
</div>
</div>
<div id="_autoar_fallback_mode_top" class="row">
<div class="label">Fallback mode</div>
<div class="description">
<p>In order for autodetection to work, the extension grabs a frame of the video you're watching and takes a look at it.
Some websites use DRM, which prevents you from using the HTML5-blessed way of getting a frame from a video.
Some browsers offer some features that can be used to circumvent DRM protection.
With this option enabled, the extension will use said features to basically do that.
</p>
<p>At the moment, Firefox is the only browser to support this.</p>
<div>
This browser doesn't support fallback mode.
</div>
</div>
<div class="">Enable fallback mode</div>
</div>
</div>
</div>
<!-- CUSTOMIZATION (INTERFACE AND SHORTCUTS) -->
<div id="interface_shortcut_settings">
<div class="content">
<div class="label">Actions</div>
<div class="description">
<p>In this sections, you can define custom actions, add or change keyboard shortcut or hide buttons from the popup.</p>
</div>
<table id="_customization_action_list">
</div>
</div>
</div>
<!-- ABOUT -->
<div id="about" class="hide">
<div class="content left">
<h2>Ultrawidify - an aspect ratio fixer for youtube <small>(and netflix)</small></h2>
<p>Created by Tamius Han (me). If something is broken, you can shout at me on <a href="https://github.com/xternal7/ultrawidify">github</a> (shout nicely, though. Open an issue or bug report or something).
If you're curious to see the source code, <a href="https://github.com/xternal7/ultrawidify">github's here</a>.
If you're looking at this page because you're bored and want to be bored some more, <a href="http://tamius.net">my website's here</a>.</p>
<h2>So you want to help?</h2>
<p>Alan pls add quick description.</p>
<h2>Plans for the future</h2>
<h2>Acknowledgements</h2>
<p>This extension uses font <a href="http://overpassfont.org/">Overpass</a>.</p>
<p>Special thanks to me for making this extension. You're welcome.</p>
</div>
</div>
<script src="../../js/conf/Debug.js"></script>
<script src="../../js/lib/BrowserDetect.js"></script>
<script src="../../js/conf/ExtensionConf.js"></script>
<script src="../../js/lib/Settings.js"></script>
<script src="../../js/lib/KeyboardShortcutParser.js"></script>
<!-- ui libs -->
<script src="../../js/lib/libghettoui/BaseElement.js"></script>
<script src="../../js/lib/libghettoui/settings/ActionItem.js"></script>
<script src="../../js/lib/libghettoui/settings/ActionItemCategoryHeaderProcessor.js"></script>
<script src="js/settingsvars.js"></script>
<script src="js/customization.js"></script>
<script src="js/settings.js"></script>
</body>
</html>