Advertisement
hecrus

Scanner JS

Feb 26th, 2021
1,024
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.13 KB | None | 0 0
  1. <script type="text/javascript" src="/js/scanner/zxing.min.js"></script>
  2. <script type="text/javascript" src="/js/falcon/as.codeScanner.js"></script>
  3. <script>
  4. $(document).ready(function () {
  5.         //video
  6.         as.codeScanner.init({
  7.             startDecodeBtn: "#startButton",
  8.             resetDecodeBtn:"#resetButton",
  9.             videoSourceSelect: "#sourceSelect",
  10.             videoId: "video",
  11.             callback: function (result) {
  12.                 if(as.codeScanner.disableScanner) return;
  13.              
  14.                 as.codeScanner.disableScanner = true;  
  15.                 setTimeout(function(){
  16.                     as.codeScanner.disableScanner = false;
  17.                 }, 2000);
  18.               as.sys.bootstrapAlert("Распознано: " + result, {type:"success"});
  19.              
  20.               $('.as-table[data-code=tst-scanner] .crd2FilterItem[data-code=name] input').val(result);
  21.               $('.as-table[data-code=tst-scanner] .crd2FilterLink ').trigger('click');
  22.            
  23.             },
  24.         });
  25.         //img
  26.         /*as.codeScanner.init({
  27.             startDecodeBtn: "#startButton",
  28.             callback: function (result) { alert(result); },
  29.             imgId: "viki"
  30.         });*/
  31.     });
  32. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement