@@ -, +, @@ --- .../opac-tmpl/bootstrap/en/modules/sci/sci-main.tt | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt @@ -120,7 +120,7 @@
- +
[% ELSE %] @@ -242,6 +242,30 @@ // set focus at the beginning dofocus(); }); + + var idleTime = 0; + $(document).ready(function () { + //Increment the idle time counter every minute. + var idleInterval = setInterval(timerIncrement, 1000); // 1 second + + //Zero the idle timer on mouse movement. + $(this).mousemove(function (e) { + idleTime = 0; + }); + $(this).keypress(function (e) { + idleTime = 0; + }); + }); + + function timerIncrement() { + if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) { + idleTime = idleTime + 1; + if (idleTime >= 30 ) { // 30 seconds + if ( $("#sci_finish_button").is(":visible") ) $("#sci_finish_button").click(); + if ( $("#sci_refresh_button").is(":visible") ) $("#sci_refresh_button").click(); + } + } + } [% IF ( Koha.Preference('SCOUserJS') ) %][% END %] --