validation feedback on autoar timer input field
This commit is contained in:
parent
cf813cf6f8
commit
8a73d8c6a4
@ -343,7 +343,6 @@ function getCustomAspectRatio() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function validateCustomAr(){
|
function validateCustomAr(){
|
||||||
console.log("validating!")
|
|
||||||
const valid = getCustomAspectRatio() !== false;
|
const valid = getCustomAspectRatio() !== false;
|
||||||
const inputField = document.getElementById("_input_custom_ar");
|
const inputField = document.getElementById("_input_custom_ar");
|
||||||
const valueSaveButton = document.getElementById("_b_changeAr_save_custom_ar");
|
const valueSaveButton = document.getElementById("_b_changeAr_save_custom_ar");
|
||||||
@ -357,6 +356,19 @@ function validateCustomAr(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateAutoArTimeout(){
|
||||||
|
const inputField = document.getElementById("_input_autoAr_timer");
|
||||||
|
const valueSaveButton = document.getElementById("_b_autoar_save_autoar_frequency");
|
||||||
|
|
||||||
|
if (! isNaN(parseInt(inputField.trim().value()))) {
|
||||||
|
inputField.classList.remove("invalid-input");
|
||||||
|
valueSaveButton.classList.remove("disabled-button");
|
||||||
|
} else {
|
||||||
|
inputField.classList.add("invalid-input");
|
||||||
|
valueSaveButton.classList.add("disabled-button");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function toggleSite(option){
|
function toggleSite(option){
|
||||||
if(Debug.debug)
|
if(Debug.debug)
|
||||||
console.log("[popup::toggleSite] toggling extension 'should I work' status to", option, "on current site");
|
console.log("[popup::toggleSite] toggling extension 'should I work' status to", option, "on current site");
|
||||||
@ -606,14 +618,23 @@ document.addEventListener("click", (e) => {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const inputField = document.getElementById("_input_custom_ar");
|
const customArInputField = document.getElementById("_input_custom_ar");
|
||||||
inputField.addEventListener("blur", (event) => {
|
const autoarFrequencyInputField = document.getElementById("_input_autoAr_timer");
|
||||||
|
|
||||||
|
customArInputField.addEventListener("blur", (event) => {
|
||||||
validateCustomAr();
|
validateCustomAr();
|
||||||
});
|
});
|
||||||
inputField.addEventListener("mouseleave", (event) => {
|
customArInputField.addEventListener("mouseleave", (event) => {
|
||||||
validateCustomAr();
|
validateCustomAr();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
autoarFrequencyInputField.addEventListener("blur", (event) => {
|
||||||
|
validateAutoArTimeout();
|
||||||
|
});
|
||||||
|
autoarFrequencyInputField.addEventListener("mouseleave", (event) => {
|
||||||
|
validateAutoArTimeout();
|
||||||
|
});
|
||||||
|
|
||||||
hideWarning("script-not-running-warning");
|
hideWarning("script-not-running-warning");
|
||||||
openMenu(selectedMenu);
|
openMenu(selectedMenu);
|
||||||
getConf();
|
getConf();
|
@ -1,5 +1,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<!-- shit like this really makes you appreciate angular and similar frameworks, doesn't it? -->
|
||||||
<title></title>
|
<title></title>
|
||||||
<meta charset="utf-8">
|
<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.css'>
|
||||||
@ -264,7 +265,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- <p><small class="color_warn" id="_autoAr_disabled_reason"></small><br/> -->
|
<!-- <p><small class="color_warn" id="_autoAr_disabled_reason"></small><br/> -->
|
||||||
|
|
||||||
<p>Check every <input id="_input_autoAr_timer" class="_autoAr _autoAr_timer" type="number" min="5" max="10000"> ms — <span class="button _save_autoAr_frequency _autoAr">Save</span></p>
|
<p>Check every <input id="_input_autoAr_timer" class="_autoAr _autoAr_timer" type="number" min="5" max="10000"> ms — <span id="_b_autoar_save_autoar_frequency" class="button _save_autoAr_frequency _autoAr">Save</span></p>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<span class="label">Options for this site:</span>
|
<span class="label">Options for this site:</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user