From befafc71d54b9a2ac0226f97520da5b918b4e465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Mon, 19 Mar 2012 12:20:15 +0100 Subject: [PATCH] [imp] add required jquery plugin bzr revid: rlo@openerp.com-20120319112015-788gds4aioshyvco --- .../src/js/jquery.barcodelistener-1.1-min.js | 1 + .../src/js/jquery.barcodelistener-1.1.js | 79 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js create mode 100644 addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1.js diff --git a/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js b/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js new file mode 100644 index 00000000000..f3b7c205dbf --- /dev/null +++ b/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js @@ -0,0 +1 @@ +(function(a){jQuery.fn.BarcodeListener=function(b,c){char0=new Array("§","32");char1=new Array("~","732");settings=new Array(char0,char1);if(b){jQuery.extend(settings,b)}a("body").append('
');a(document).keypress(function(d){if(d.which==settings[0][1]){if(settings.length-1>0){wlBUJTIw=1;xaWi4Y4y=true;while((wlBUJTIw"); + + // intercetta barcode reader con sequenza di caratteri §~ + $(document).keypress(function(e) { + if (e.which == settings[0][1]) { + if(settings.length-1>0) { + wlBUJTIw = 1; + xaWi4Y4y = true; + while ((wlBUJTIw < settings.length) && (xaWi4Y4y == true)) { + $(document).keypress(function(e) { + if (e.which == settings[wlBUJTIw][1]) { + xaWi4Y4y = true; + } else { + xaWi4Y4y = false; + } + }); + wlBUJTIw++; + } + if (xaWi4Y4y == true) { + $("#L3ZitQdL").val("").focus(); + } + } else { + $("#L3ZitQdL").val("").focus(); + } + + // event propagation + e.cancelBubble = true; + e.returnValue = false; + + if (e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } + + } + }); + + // intercetta invio del form + $("#29LLRUZk").submit(function() { + code = $("#L3ZitQdL").val(); + for (i=0; i