Improved "SCAN" Interface

So...
When one scan button is pressed(when scan is running we can say) you can't press the other one or reload button, you have to wait until some "certain amount of time"(I was trying adjust the times I hope it's good enough I hope I didn't miss anything).
Also  when you press scan button it will disappear for "certain amount of time" and then appear after that specified time.
I make this because if you accidentally press the button two times, or both at the same time it would show error and etc.. and this way it won't allow you to press it how you shouldn't and it won't show any error, it's more friendly-user I would say.
For Linux Firefox I removed the weird white dot line box around text inside the buttons.
To-do:
Maybe some loading animation under button, like when button disappears there will be maybe three sliding dots
This commit is contained in:
Arisa
2019-04-19 15:58:59 +02:00
parent 4a23c770be
commit f0009ea875
3 changed files with 50 additions and 12 deletions

View File

@@ -128,11 +128,40 @@ function drawNames(){
getE("nTable").innerHTML = html;
}
var duts;
var elxtime;
function scan(type){
getE('RButton').disabled = true;
switch(type){
case 0:
getE('scanOne').disabled = true;
getE('scanZero').style.visibility = 'hidden';
elxtime = 2450;
break;
case 1:
getE('scanZero').disabled = true;
getE('scanOne').style.visibility = 'hidden';
elxtime = parseInt(getE("scanTime").value+"000") + 1500;
}
var cmdStr = "scan "
+ (type == 0 ? "aps " : "stations -t "+getE("scanTime").value+"s")
+ " -ch "+getE("ch").options[getE("ch").selectedIndex].value;
getFile("run?cmd="+cmdStr);
duts = parseInt(type);
setTimeout(buttonFunc, elxtime)
}
function buttonFunc(){
switch (duts) {
case 0:
getE('scanZero').style.visibility = 'visible';
getE('scanOne').disabled = false;
break;
case 1:
getE('scanOne').style.visibility = 'visible';
getE('scanZero').disabled = false;
}
getE('RButton').disabled = false;
}
function load(){