Issues (31)

assets/js/readqr.js (2 issues)

Labels
Severity
1
$(document).on('ready', function () {
2
3
    var scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
0 ignored issues
show
The variable Instascan seems to be never declared. If this is a global, consider adding a /** global: Instascan */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
4
    scanner.addListener('scan', function (content) {
5
        $('input[name="ticketId"]').val(content);
6
        $('#qr').hide();
7
        $('button[name="submit"]').click();
8
        scanner.stop();
9
    });
10
    Instascan.Camera.getCameras().then(function (cameras) {
0 ignored issues
show
The variable Instascan seems to be never declared. If this is a global, consider adding a /** global: Instascan */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
11
        if (cameras.length > 0) {
12
            scanner.start(cameras[0]);
13
            $('#qr').show();
14
        } else {
15
            console.error('No cameras found.');
16
        }
17
    }).catch(function (e) {
18
        console.error(e);
19
    });
20
21
});