|
|
@@ -329,12 +329,14 @@
|
|
|
$('.fileinput').fileinput();
|
|
|
|
|
|
<% if @product.barcode.blank? %>
|
|
|
- $('#product_barcode').codeScanner({
|
|
|
- maxEntryTime: 100, // milliseconds
|
|
|
- minEntryChars: 7, // characters
|
|
|
- onScan: function ($element, code) {
|
|
|
- $('#product_barcode').val(code);
|
|
|
- validateBarcode(code);
|
|
|
+ $(document).scannerDetection({
|
|
|
+ timeBeforeScanTest: 200, // wait for the next character for upto 200ms
|
|
|
+ startChar: [120], // Prefix character for the cabled scanner (OPL6845R)
|
|
|
+ endChar: [13], // be sure the scan is complete if key 13 (enter) is detected
|
|
|
+ avgTimeByChar: 40, // it's not a barcode if a character takes longer than 40ms
|
|
|
+ onComplete: function(barcode, qty){
|
|
|
+ $('#product_barcode').val(barcode);
|
|
|
+ validateBarcode(barcode);
|
|
|
}
|
|
|
});
|
|
|
<% end %>
|