html5-qrcode
Advanced tools
Comparing version 2.2.7 to 2.2.8
@@ -371,2 +371,3 @@ "use strict"; | ||
var options = []; | ||
var anonymousCameraId = 1; | ||
for (var _i = 0, cameras_1 = cameras; _i < cameras_1.length; _i++) { | ||
@@ -376,2 +377,8 @@ var camera = cameras_1[_i]; | ||
var name_1 = camera.label == null ? value : camera.label; | ||
if (!name_1 || name_1 === "") { | ||
name_1 = [ | ||
strings_1.Html5QrcodeScannerStrings.anonymousCameraPrefix(), | ||
anonymousCameraId++ | ||
].join(" "); | ||
} | ||
var option = document.createElement("option"); | ||
@@ -378,0 +385,0 @@ option.value = value; |
@@ -33,2 +33,3 @@ export declare class Html5QrcodeStrings { | ||
static fileSelectionNoImageSelected(): string; | ||
static anonymousCameraPrefix(): string; | ||
} | ||
@@ -35,0 +36,0 @@ export declare class LibraryInfoStrings { |
@@ -103,2 +103,5 @@ "use strict"; | ||
}; | ||
Html5QrcodeScannerStrings.anonymousCameraPrefix = function () { | ||
return "Anonymous Camera"; | ||
}; | ||
return Html5QrcodeScannerStrings; | ||
@@ -105,0 +108,0 @@ }()); |
@@ -365,5 +365,12 @@ import { Html5QrcodeConstants, Html5QrcodeScanType, Html5QrcodeErrorFactory, BaseLoggger, isNullOrUndefined, } from "./core"; | ||
const options = []; | ||
let anonymousCameraId = 1; | ||
for (const camera of cameras) { | ||
const value = camera.id; | ||
const name = camera.label == null ? value : camera.label; | ||
let name = camera.label == null ? value : camera.label; | ||
if (!name || name === "") { | ||
name = [ | ||
Html5QrcodeScannerStrings.anonymousCameraPrefix(), | ||
anonymousCameraId++ | ||
].join(" "); | ||
} | ||
const option = document.createElement("option"); | ||
@@ -370,0 +377,0 @@ option.value = value; |
@@ -33,2 +33,3 @@ export declare class Html5QrcodeStrings { | ||
static fileSelectionNoImageSelected(): string; | ||
static anonymousCameraPrefix(): string; | ||
} | ||
@@ -35,0 +36,0 @@ export declare class LibraryInfoStrings { |
@@ -94,2 +94,5 @@ export class Html5QrcodeStrings { | ||
} | ||
static anonymousCameraPrefix() { | ||
return "Anonymous Camera"; | ||
} | ||
} | ||
@@ -96,0 +99,0 @@ export class LibraryInfoStrings { |
@@ -368,2 +368,3 @@ import { Html5QrcodeConstants, Html5QrcodeScanType, Html5QrcodeErrorFactory, BaseLoggger, isNullOrUndefined, } from "./core"; | ||
var options = []; | ||
var anonymousCameraId = 1; | ||
for (var _i = 0, cameras_1 = cameras; _i < cameras_1.length; _i++) { | ||
@@ -373,2 +374,8 @@ var camera = cameras_1[_i]; | ||
var name_1 = camera.label == null ? value : camera.label; | ||
if (!name_1 || name_1 === "") { | ||
name_1 = [ | ||
Html5QrcodeScannerStrings.anonymousCameraPrefix(), | ||
anonymousCameraId++ | ||
].join(" "); | ||
} | ||
var option = document.createElement("option"); | ||
@@ -375,0 +382,0 @@ option.value = value; |
@@ -33,2 +33,3 @@ export declare class Html5QrcodeStrings { | ||
static fileSelectionNoImageSelected(): string; | ||
static anonymousCameraPrefix(): string; | ||
} | ||
@@ -35,0 +36,0 @@ export declare class LibraryInfoStrings { |
@@ -100,2 +100,5 @@ var Html5QrcodeStrings = (function () { | ||
}; | ||
Html5QrcodeScannerStrings.anonymousCameraPrefix = function () { | ||
return "Anonymous Camera"; | ||
}; | ||
return Html5QrcodeScannerStrings; | ||
@@ -102,0 +105,0 @@ }()); |
{ | ||
"name": "html5-qrcode", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "A cross platform HTML5 QR Code & bar code scanner", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
@@ -33,2 +33,3 @@ export declare class Html5QrcodeStrings { | ||
static fileSelectionNoImageSelected(): string; | ||
static anonymousCameraPrefix(): string; | ||
} | ||
@@ -35,0 +36,0 @@ export declare class LibraryInfoStrings { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
2554145
35903