|
Lines 254-259
Link Here
|
| 254 |
$("#sci_barcodes_table").show(); |
254 |
$("#sci_barcodes_table").show(); |
| 255 |
$('#sci_checkin_button').show(); |
255 |
$('#sci_checkin_button').show(); |
| 256 |
$('#sci_refresh_button').show(); |
256 |
$('#sci_refresh_button').show(); |
|
|
257 |
login_timeout(); |
| 257 |
|
258 |
|
| 258 |
// Add barcode to the array |
259 |
// Add barcode to the array |
| 259 |
barcodes.push(barcode); |
260 |
barcodes.push(barcode); |
|
Lines 273-284
Link Here
|
| 273 |
dofocus(); |
274 |
dofocus(); |
| 274 |
}); |
275 |
}); |
| 275 |
|
276 |
|
| 276 |
|
277 |
document.addEventListener("DOMContentLoaded",function(){ |
| 277 |
let idleTimeout = [% Koha.Preference('SelfCheckInTimeOut') || 120 %]; |
278 |
if ( document.querySelector('#sci_finish_button') ){ |
| 278 |
let refresh_button = $("#sci_refresh_button"); |
279 |
login_timeout(); |
| 279 |
let finish_button = $("#sci_finish_button"); |
280 |
} |
| 280 |
let home_href = "/cgi-bin/koha/sci/sci-main.pl"; |
281 |
}); |
| 281 |
|
282 |
function login_timeout(){ |
|
|
283 |
//NOTE: There can only be 1 sci_login_timer at a time |
| 284 |
if ( ! window.sci_login_timer ){ |
| 285 |
const idleTimeout = "[% Koha.Preference('SelfCheckInTimeOut') || 120 | html %]"; |
| 286 |
const home_href = "/cgi-bin/koha/sci/sci-main.pl"; |
| 287 |
const sci_timer = new sc_timer({ |
| 288 |
"idle_timeout": idleTimeout, |
| 289 |
"redirect_url": home_href |
| 290 |
}); |
| 291 |
window.sci_login_timer = sci_timer; |
| 292 |
sci_timer.start_timer(); |
| 293 |
} |
| 294 |
} |
| 282 |
|
295 |
|
| 283 |
function checkBarcodeInput() { |
296 |
function checkBarcodeInput() { |
| 284 |
var inputField = document.getElementById("barcode_input"); |
297 |
var inputField = document.getElementById("barcode_input"); |