move JavaScript into ui.js

This commit is contained in:
DepFA 2022-10-02 00:12:49 +01:00 committed by GitHub
parent 027c5aae55
commit 55b046312c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,3 +212,8 @@ function update_token_counter(button_id) {
clearTimeout(token_timeout);
token_timeout = setTimeout(() => gradioApp().getElementById(button_id)?.click(), wait_time);
}
function restart_reload(){
document.body.innerHTML='<h1 style="font-family:monospace;margin-top:20%;color:lightgray;text-align:center;">Reloading...</h1>';
setTimeout(function(){location.reload()},2000)
}