|
Lines 226-262
Link Here
|
| 226 |
}); |
226 |
}); |
| 227 |
|
227 |
|
| 228 |
$(document).ready(function() { |
228 |
$(document).ready(function() { |
| 229 |
// Barcodes scanning table initially hidden |
229 |
// Barcodes scanning table initially hidden |
| 230 |
$("#sci_barcodes_table").hide(); |
230 |
$("#sci_barcodes_table").hide(); |
| 231 |
// Control de 'append' button behaviour |
|
|
| 232 |
$("#sci_append_button").on('click',function( e ){ |
| 233 |
// Make sure the form is not submitted by the button |
| 234 |
e.preventDefault(); |
| 235 |
var barcode = $('#barcode_input').val(); |
| 236 |
//var result = validate_barcode( barcode ); |
| 237 |
$('#sci_barcodes_table tbody').append( |
| 238 |
'<tr style="font-size: initial;"><td>' + |
| 239 |
barcode + |
| 240 |
'<input type="hidden" name="barcode" value="' + barcode + '" />' + |
| 241 |
'</td></tr>' ); |
| 242 |
// Make sure the table is now displayed |
| 243 |
$("#sci_barcodes_table").show(); |
| 244 |
$('#sci_checkin_button').show(); |
| 245 |
$('#sci_refresh_button').show(); |
| 246 |
barcodes.push(barcode); |
| 247 |
// clean the input, reset the focus |
| 248 |
$('#barcode_input').val(''); |
| 249 |
dofocus(); |
| 250 |
}); |
| 251 |
|
231 |
|
| 252 |
$(".helpModal-trigger").on("click",function(e){ |
232 |
// Control the 'append' button behaviour |
| 253 |
e.preventDefault(); |
233 |
$("#sci_append_button").on('click', function(e) { |
| 254 |
$("#helpModal").modal("show"); |
234 |
// Make sure the form is not submitted by the button |
| 255 |
}); |
235 |
e.preventDefault(); |
|
|
236 |
|
| 237 |
var barcode = $('#barcode_input').val().trim(); // Trim whitespace from input |
| 238 |
|
| 239 |
if (barcode !== "") { |
| 240 |
// Properly escape the barcode value by using .text() for display |
| 241 |
var barcodeHtml = $('<tr style="font-size: initial;"><td></td></tr>'); |
| 242 |
barcodeHtml.find('td').text(barcode).append( |
| 243 |
$('<input>').attr({ |
| 244 |
type: 'hidden', |
| 245 |
name: 'barcode', |
| 246 |
value: barcode |
| 247 |
}) |
| 248 |
); |
| 249 |
|
| 250 |
$('#sci_barcodes_table tbody').append(barcodeHtml); |
| 251 |
|
| 252 |
// Make sure the table is now displayed |
| 253 |
$("#sci_barcodes_table").show(); |
| 254 |
$('#sci_checkin_button').show(); |
| 255 |
$('#sci_refresh_button').show(); |
| 256 |
|
| 257 |
// Add barcode to the array |
| 258 |
barcodes.push(barcode); |
| 259 |
} |
| 260 |
|
| 261 |
// Clear the input and reset the focus |
| 262 |
$('#barcode_input').val(''); |
| 263 |
dofocus(); |
| 264 |
}); |
| 265 |
|
| 266 |
$(".helpModal-trigger").on("click", function(e) { |
| 267 |
e.preventDefault(); |
| 268 |
$("#helpModal").modal("show"); |
| 269 |
}); |
| 270 |
|
| 271 |
// Set focus at the beginning |
| 272 |
dofocus(); |
| 273 |
}); |
| 256 |
|
274 |
|
| 257 |
// set focus at the beginning |
|
|
| 258 |
dofocus(); |
| 259 |
}); |
| 260 |
|
275 |
|
| 261 |
var idleTime = 0; |
276 |
var idleTime = 0; |
| 262 |
$(document).ready(function () { |
277 |
$(document).ready(function () { |
| 263 |
- |
|
|