10xSebastian / barcode-scanner.js

Javascript library to handle and identify data (keystrokes) entered by a barcode scanner.
GNU General Public License v2.0
17 stars 7 forks source link

Disconnect, Offline storage and retry #4

Open unitedbummersconference opened 8 years ago

unitedbummersconference commented 8 years ago

Dear Pape thanks for this wonderful code.

I am trying your lib because of its developer friendlier , for me internet connectivity is not very reliable, so its causing some issues.

thanks

10xSebastian commented 8 years ago

Asked by @unitedbummersconference here: https://github.com/pape-io/barcode-scanner.js/issues/3#issuecomment-161124622

Hi, for me on disconnects

 <form>
 <input data-barcode-scanner-target type='text'   class="pape-save-offline-barcode"></input>
  </form>
        $('form').on('submit', function(e){
        e.preventDefault();
        SaveToOffline();
        SeverBatchUpload();
    });

totally bombs out on me,would be supeer sweet, if this was an option

10xSebastian commented 8 years ago

As I want this library to focus on the detection, it's unlikely that I will store them locally in case of bad connection. Thats something your app should take care of, and obviously from your source code, you already solved that problem, don't you?

10xSebastian commented 8 years ago

The library cannot detect if the scanner is ready/online. In general web applications cannot detect if a scanner is connected via usb.

10xSebastian commented 8 years ago

For retrying simply use a retrying library like: https://github.com/johnkpaul/jquery-ajax-retry

smartmeter commented 8 years ago

I would like to vote this up too :+1: