2024-01-18 17:35:42 +00:00
|
|
|
function begin()
|
|
|
|
{
|
|
|
|
let settings = JSON.parse($("#settings").html());
|
|
|
|
let status = $("#status").html();
|
|
|
|
console.log("msg");
|
|
|
|
console.log(settings);
|
|
|
|
console.log(status);
|
|
|
|
|
|
|
|
$("#settings").remove();
|
|
|
|
$("#status").remove();
|
|
|
|
|
|
|
|
let auto_reload_page_interval = 0.0;
|
|
|
|
if(settings) {
|
|
|
|
auto_reload_page_interval = settings.advanced.auto_reload_page_interval;
|
|
|
|
}
|
|
|
|
|
|
|
|
// too short to cause error.
|
2024-03-24 12:30:48 +00:00
|
|
|
if(auto_reload_page_interval < 0.2) {
|
|
|
|
auto_reload_page_interval = 0.2;
|
2024-01-18 17:35:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(status=='ON') {
|
2024-03-21 07:42:29 +00:00
|
|
|
let target_interval = auto_reload_page_interval * 1000;
|
2024-01-18 17:35:42 +00:00
|
|
|
setInterval(() => {
|
2024-03-21 07:42:29 +00:00
|
|
|
//retry();
|
|
|
|
//console.log("trigger");
|
|
|
|
$(".btn_cta").prop('disabled', false).trigger("click");
|
|
|
|
}, target_interval);
|
2024-01-18 17:35:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function dom_ready()
|
|
|
|
{
|
|
|
|
//console.log("checking...");
|
|
|
|
if($("#settings").length>0) {
|
|
|
|
clearInterval(myInterval);
|
|
|
|
begin();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
myInterval = setInterval(() => {
|
|
|
|
dom_ready();
|
2024-01-09 08:30:49 +00:00
|
|
|
}, 100);
|