File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ function getCookie(cname) {
2323$ ( document ) . ready ( function ( ) {
2424
2525 $ ( "#flipCam" ) . click ( function ( ) {
26- camNo = ( camNo + 1 ) % totCam ;
26+ if ( camNo === 0 )
27+ camNo = 1 ;
28+ else
29+ camNo = 0 ;
2730 scanner . stop ( ) . then ( ( ) => { startCam ( ) ; } ) ;
2831 } )
2932
@@ -126,7 +129,6 @@ var arrPhoto = [];
126129
127130var scanner ;
128131var camNo = - 1 ;
129- var totCam ;
130132
131133function startCam ( ) {
132134 scanner = new Instascan . Scanner ( {
@@ -135,7 +137,6 @@ function startCam() {
135137 } )
136138 Instascan . Camera . getCameras ( ) . then ( function ( cameras ) {
137139 if ( camNo === - 1 ) {
138- totCam = cameras . length ;
139140 if ( cameras . length > 1 ) {
140141 camNo = 1 ;
141142 } else if ( cameras . length > 0 ) {
Original file line number Diff line number Diff line change 4646 function barcode ( code ) {
4747 var bool = false ;
4848
49- if ( ( code [ 0 ] . match ( / [ a - z ] / i) && code [ 2 ] . match ( / [ a - z ] / i) && code . length === 11 ) || ( code . length === 4 && Number . isInteger ( code ) ) ) {
49+ if ( code [ 0 ] . match ( / [ a - z ] / i) && code [ 2 ] . match ( / [ a - z ] / i) && code . length === 11 || ( code . length === 4 && Number . isInteger ( code [ 0 ] ) && Number . isInteger ( code [ 1 ] ) && Number . isInteger ( code [ 2 ] ) && Number . isInteger ( code [ 3 ] ) ) ) {
5050 console . log ( code ) ;
5151 // start loading a(if possible pause video)
5252 $ ( ".loading" ) . show ( ) ;
You can’t perform that action at this time.
0 commit comments