added idle clear timer
This commit is contained in:
18
index.html
18
index.html
@@ -286,8 +286,7 @@ function keyboard_entry(ev) {
|
|||||||
toggle_blank();
|
toggle_blank();
|
||||||
}
|
}
|
||||||
if (/C/.test(k)) {
|
if (/C/.test(k)) {
|
||||||
document.getElementById("filter").value='';
|
clear();
|
||||||
filter(ev);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,6 +425,21 @@ function set_cookie(name,value) {
|
|||||||
document.cookie = name + "=" + value.toString() + "&" + window.location.pathname +
|
document.cookie = name + "=" + value.toString() + "&" + window.location.pathname +
|
||||||
";path=" + window.location.pathname + ";max-age="+ (60*60*2).toString() + ";";
|
";path=" + window.location.pathname + ";max-age="+ (60*60*2).toString() + ";";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clear() {
|
||||||
|
document.getElementById("filter").value = '';
|
||||||
|
filter(true);
|
||||||
|
}
|
||||||
|
function resetTimer() {
|
||||||
|
clearTimeout(idleTimer);
|
||||||
|
idleTimer = setTimeout(clear, 20 * 60 * 1000); // 20 minutes
|
||||||
|
}
|
||||||
|
var idleTimer;
|
||||||
|
|
||||||
|
window.onload = resetTimer;
|
||||||
|
document.onmousemove = resetTimer;
|
||||||
|
document.onmouseclick = resetTimer;
|
||||||
|
document.onkeypress = resetTimer;
|
||||||
document.onkeyup = keyboard_entry;
|
document.onkeyup = keyboard_entry;
|
||||||
document.onscroll = scroll_save;
|
document.onscroll = scroll_save;
|
||||||
var linkReg=/([^\[]*)\[([^\]]+)\]\(([^\)]+)\)(.*)/;
|
var linkReg=/([^\[]*)\[([^\]]+)\]\(([^\)]+)\)(.*)/;
|
||||||
|
|||||||
Reference in New Issue
Block a user