|
Lines 202-207
Link Here
|
| 202 |
|
202 |
|
| 203 |
[% INCLUDE 'opac-bottom.inc' %] |
203 |
[% INCLUDE 'opac-bottom.inc' %] |
| 204 |
[% BLOCK jsinclude %] |
204 |
[% BLOCK jsinclude %] |
|
|
205 |
[% Asset.js('js/timeout.js') | $raw %] |
| 205 |
<script> |
206 |
<script> |
| 206 |
|
207 |
|
| 207 |
function mungeHistory() { |
208 |
function mungeHistory() { |
|
Lines 273-301
Link Here
|
| 273 |
}); |
274 |
}); |
| 274 |
|
275 |
|
| 275 |
|
276 |
|
| 276 |
var idleTime = 0; |
277 |
let idleTimeout = [% Koha.Preference('SelfCheckInTimeOut') || 120 %]; |
| 277 |
$(document).ready(function () { |
278 |
let refresh_button = $("#sci_refresh_button"); |
| 278 |
//Increment the idle time counter every second |
279 |
let finish_button = $("#sci_finish_button"); |
| 279 |
var idleInterval = setInterval(timerIncrement, 1000); |
280 |
let home_href = "/cgi-bin/koha/sci/sci-main.pl"; |
| 280 |
|
|
|
| 281 |
//Zero the idle timer on mouse movement. |
| 282 |
$(this).mousemove(function (e) { |
| 283 |
idleTime = 0; |
| 284 |
}); |
| 285 |
$(this).keypress(function (e) { |
| 286 |
idleTime = 0; |
| 287 |
}); |
| 288 |
}); |
| 289 |
|
| 290 |
function timerIncrement() { |
| 291 |
if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) { |
| 292 |
idleTime = idleTime + 1; |
| 293 |
idleTimeout = [% refresh_timeout | html %]; |
| 294 |
if (idleTime >= idleTimeout ) { |
| 295 |
location.href = '/cgi-bin/koha/sci/sci-main.pl'; |
| 296 |
} |
| 297 |
} |
| 298 |
} |
| 299 |
|
281 |
|
| 300 |
|
282 |
|
| 301 |
function checkBarcodeInput() { |
283 |
function checkBarcodeInput() { |