html5-qrcode
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -340,6 +340,13 @@ "use strict"; | ||
var cameraSelectionContainer = document.createElement("span"); | ||
cameraSelectionContainer.innerText | ||
= "Select Camera (" + cameras.length + ") "; | ||
cameraSelectionContainer.style.marginRight = "10px"; | ||
var numCameras = cameras.length; | ||
var cameraSelectionSelect = document.createElement("select"); | ||
if (numCameras === 1) { | ||
cameraSelectionSelect.style.display = "none"; | ||
} | ||
else { | ||
var selectCameraString = strings_1.Html5QrcodeScannerStrings.selectCamera(); | ||
cameraSelectionContainer.innerText | ||
= selectCameraString + " (" + cameras.length + ") "; | ||
} | ||
cameraSelectionSelect.id = this.getCameraSelectionId(); | ||
@@ -371,5 +378,21 @@ var options = []; | ||
scpCameraScanRegion.appendChild(cameraActionContainer); | ||
var resetCameraActionStarButton = function (shouldShow) { | ||
if (!shouldShow) { | ||
cameraActionStartButton.style.display = "none"; | ||
} | ||
cameraActionStartButton.innerText | ||
= strings_1.Html5QrcodeScannerStrings | ||
.scanButtonStartScanningText(); | ||
cameraActionStartButton.style.opacity = "1"; | ||
cameraActionStartButton.disabled = false; | ||
if (shouldShow) { | ||
cameraActionStartButton.style.display = "inline-block"; | ||
} | ||
}; | ||
cameraActionStartButton.addEventListener("click", function (_) { | ||
cameraActionStartButton.innerText | ||
= strings_1.Html5QrcodeScannerStrings.scanButtonScanningStarting(); | ||
cameraSelectionSelect.disabled = true; | ||
cameraActionStartButton.disabled = true; | ||
cameraActionStartButton.style.opacity = "0.5"; | ||
$this.showHideScanTypeSwapLink(false); | ||
@@ -382,3 +405,3 @@ var cameraId = cameraSelectionSelect.value; | ||
cameraActionStopButton.style.display = "inline-block"; | ||
cameraActionStartButton.style.display = "none"; | ||
resetCameraActionStarButton(false); | ||
}) | ||
@@ -388,6 +411,9 @@ .catch(function (error) { | ||
cameraSelectionSelect.disabled = false; | ||
cameraActionStartButton.disabled = false; | ||
resetCameraActionStarButton(true); | ||
$this.setHeaderMessage(error, Html5QrcodeScannerStatus.STATUS_WARNING); | ||
}); | ||
}); | ||
if (numCameras === 1) { | ||
cameraActionStartButton.click(); | ||
} | ||
cameraActionStopButton.addEventListener("click", function (_) { | ||
@@ -394,0 +420,0 @@ if (!$this.html5Qrcode) { |
@@ -39,3 +39,3 @@ import { CameraDevice, QrcodeErrorCallback, QrcodeSuccessCallback, Html5QrcodeSupportedFormats, Html5QrcodeResult, QrDimensions } from "./core"; | ||
isScanning: boolean; | ||
constructor(elementId: string, configOrVerbosityFlag: boolean | Html5QrcodeFullConfig | undefined); | ||
constructor(elementId: string, configOrVerbosityFlag?: boolean | Html5QrcodeFullConfig | undefined); | ||
start(cameraIdOrConfig: Html5QrcodeIdentifier, configuration: Html5QrcodeCameraScanConfig | undefined, qrCodeSuccessCallback: QrcodeSuccessCallback | undefined, qrCodeErrorCallback: QrcodeErrorCallback | undefined): Promise<null>; | ||
@@ -42,0 +42,0 @@ pause(): void; |
@@ -22,4 +22,6 @@ export declare class Html5QrcodeStrings { | ||
static scanButtonStartScanningText(): string; | ||
static scanButtonScanningStarting(): string; | ||
static textIfCameraScanSelected(): string; | ||
static textIfFileScanSelected(): string; | ||
static selectCamera(): string; | ||
} | ||
@@ -26,0 +28,0 @@ export declare class LibraryInfoStrings { |
@@ -70,2 +70,5 @@ "use strict"; | ||
}; | ||
Html5QrcodeScannerStrings.scanButtonScanningStarting = function () { | ||
return "Launching Camera..."; | ||
}; | ||
Html5QrcodeScannerStrings.textIfCameraScanSelected = function () { | ||
@@ -77,2 +80,5 @@ return "Scan an Image File"; | ||
}; | ||
Html5QrcodeScannerStrings.selectCamera = function () { | ||
return "Select Camera"; | ||
}; | ||
return Html5QrcodeScannerStrings; | ||
@@ -79,0 +85,0 @@ }()); |
@@ -335,6 +335,13 @@ import { Html5QrcodeConstants, Html5QrcodeScanType, Html5QrcodeErrorFactory, BaseLoggger, } from "./core"; | ||
const cameraSelectionContainer = document.createElement("span"); | ||
cameraSelectionContainer.innerText | ||
= `Select Camera (${cameras.length}) `; | ||
cameraSelectionContainer.style.marginRight = "10px"; | ||
const numCameras = cameras.length; | ||
const cameraSelectionSelect = document.createElement("select"); | ||
if (numCameras === 1) { | ||
cameraSelectionSelect.style.display = "none"; | ||
} | ||
else { | ||
const selectCameraString = Html5QrcodeScannerStrings.selectCamera(); | ||
cameraSelectionContainer.innerText | ||
= `${selectCameraString} (${cameras.length}) `; | ||
} | ||
cameraSelectionSelect.id = this.getCameraSelectionId(); | ||
@@ -365,5 +372,21 @@ const options = []; | ||
scpCameraScanRegion.appendChild(cameraActionContainer); | ||
const resetCameraActionStarButton = (shouldShow) => { | ||
if (!shouldShow) { | ||
cameraActionStartButton.style.display = "none"; | ||
} | ||
cameraActionStartButton.innerText | ||
= Html5QrcodeScannerStrings | ||
.scanButtonStartScanningText(); | ||
cameraActionStartButton.style.opacity = "1"; | ||
cameraActionStartButton.disabled = false; | ||
if (shouldShow) { | ||
cameraActionStartButton.style.display = "inline-block"; | ||
} | ||
}; | ||
cameraActionStartButton.addEventListener("click", (_) => { | ||
cameraActionStartButton.innerText | ||
= Html5QrcodeScannerStrings.scanButtonScanningStarting(); | ||
cameraSelectionSelect.disabled = true; | ||
cameraActionStartButton.disabled = true; | ||
cameraActionStartButton.style.opacity = "0.5"; | ||
$this.showHideScanTypeSwapLink(false); | ||
@@ -376,3 +399,3 @@ const cameraId = cameraSelectionSelect.value; | ||
cameraActionStopButton.style.display = "inline-block"; | ||
cameraActionStartButton.style.display = "none"; | ||
resetCameraActionStarButton(false); | ||
}) | ||
@@ -382,6 +405,9 @@ .catch((error) => { | ||
cameraSelectionSelect.disabled = false; | ||
cameraActionStartButton.disabled = false; | ||
resetCameraActionStarButton(true); | ||
$this.setHeaderMessage(error, Html5QrcodeScannerStatus.STATUS_WARNING); | ||
}); | ||
}); | ||
if (numCameras === 1) { | ||
cameraActionStartButton.click(); | ||
} | ||
cameraActionStopButton.addEventListener("click", (_) => { | ||
@@ -388,0 +414,0 @@ if (!$this.html5Qrcode) { |
@@ -39,3 +39,3 @@ import { CameraDevice, QrcodeErrorCallback, QrcodeSuccessCallback, Html5QrcodeSupportedFormats, Html5QrcodeResult, QrDimensions } from "./core"; | ||
isScanning: boolean; | ||
constructor(elementId: string, configOrVerbosityFlag: boolean | Html5QrcodeFullConfig | undefined); | ||
constructor(elementId: string, configOrVerbosityFlag?: boolean | Html5QrcodeFullConfig | undefined); | ||
start(cameraIdOrConfig: Html5QrcodeIdentifier, configuration: Html5QrcodeCameraScanConfig | undefined, qrCodeSuccessCallback: QrcodeSuccessCallback | undefined, qrCodeErrorCallback: QrcodeErrorCallback | undefined): Promise<null>; | ||
@@ -42,0 +42,0 @@ pause(): void; |
@@ -22,4 +22,6 @@ export declare class Html5QrcodeStrings { | ||
static scanButtonStartScanningText(): string; | ||
static scanButtonScanningStarting(): string; | ||
static textIfCameraScanSelected(): string; | ||
static textIfFileScanSelected(): string; | ||
static selectCamera(): string; | ||
} | ||
@@ -26,0 +28,0 @@ export declare class LibraryInfoStrings { |
@@ -61,2 +61,5 @@ export class Html5QrcodeStrings { | ||
} | ||
static scanButtonScanningStarting() { | ||
return "Launching Camera..."; | ||
} | ||
static textIfCameraScanSelected() { | ||
@@ -68,2 +71,5 @@ return "Scan an Image File"; | ||
} | ||
static selectCamera() { | ||
return "Select Camera"; | ||
} | ||
} | ||
@@ -70,0 +76,0 @@ export class LibraryInfoStrings { |
@@ -337,6 +337,13 @@ import { Html5QrcodeConstants, Html5QrcodeScanType, Html5QrcodeErrorFactory, BaseLoggger, } from "./core"; | ||
var cameraSelectionContainer = document.createElement("span"); | ||
cameraSelectionContainer.innerText | ||
= "Select Camera (" + cameras.length + ") "; | ||
cameraSelectionContainer.style.marginRight = "10px"; | ||
var numCameras = cameras.length; | ||
var cameraSelectionSelect = document.createElement("select"); | ||
if (numCameras === 1) { | ||
cameraSelectionSelect.style.display = "none"; | ||
} | ||
else { | ||
var selectCameraString = Html5QrcodeScannerStrings.selectCamera(); | ||
cameraSelectionContainer.innerText | ||
= selectCameraString + " (" + cameras.length + ") "; | ||
} | ||
cameraSelectionSelect.id = this.getCameraSelectionId(); | ||
@@ -368,5 +375,21 @@ var options = []; | ||
scpCameraScanRegion.appendChild(cameraActionContainer); | ||
var resetCameraActionStarButton = function (shouldShow) { | ||
if (!shouldShow) { | ||
cameraActionStartButton.style.display = "none"; | ||
} | ||
cameraActionStartButton.innerText | ||
= Html5QrcodeScannerStrings | ||
.scanButtonStartScanningText(); | ||
cameraActionStartButton.style.opacity = "1"; | ||
cameraActionStartButton.disabled = false; | ||
if (shouldShow) { | ||
cameraActionStartButton.style.display = "inline-block"; | ||
} | ||
}; | ||
cameraActionStartButton.addEventListener("click", function (_) { | ||
cameraActionStartButton.innerText | ||
= Html5QrcodeScannerStrings.scanButtonScanningStarting(); | ||
cameraSelectionSelect.disabled = true; | ||
cameraActionStartButton.disabled = true; | ||
cameraActionStartButton.style.opacity = "0.5"; | ||
$this.showHideScanTypeSwapLink(false); | ||
@@ -379,3 +402,3 @@ var cameraId = cameraSelectionSelect.value; | ||
cameraActionStopButton.style.display = "inline-block"; | ||
cameraActionStartButton.style.display = "none"; | ||
resetCameraActionStarButton(false); | ||
}) | ||
@@ -385,6 +408,9 @@ .catch(function (error) { | ||
cameraSelectionSelect.disabled = false; | ||
cameraActionStartButton.disabled = false; | ||
resetCameraActionStarButton(true); | ||
$this.setHeaderMessage(error, Html5QrcodeScannerStatus.STATUS_WARNING); | ||
}); | ||
}); | ||
if (numCameras === 1) { | ||
cameraActionStartButton.click(); | ||
} | ||
cameraActionStopButton.addEventListener("click", function (_) { | ||
@@ -391,0 +417,0 @@ if (!$this.html5Qrcode) { |
@@ -39,3 +39,3 @@ import { CameraDevice, QrcodeErrorCallback, QrcodeSuccessCallback, Html5QrcodeSupportedFormats, Html5QrcodeResult, QrDimensions } from "./core"; | ||
isScanning: boolean; | ||
constructor(elementId: string, configOrVerbosityFlag: boolean | Html5QrcodeFullConfig | undefined); | ||
constructor(elementId: string, configOrVerbosityFlag?: boolean | Html5QrcodeFullConfig | undefined); | ||
start(cameraIdOrConfig: Html5QrcodeIdentifier, configuration: Html5QrcodeCameraScanConfig | undefined, qrCodeSuccessCallback: QrcodeSuccessCallback | undefined, qrCodeErrorCallback: QrcodeErrorCallback | undefined): Promise<null>; | ||
@@ -42,0 +42,0 @@ pause(): void; |
@@ -22,4 +22,6 @@ export declare class Html5QrcodeStrings { | ||
static scanButtonStartScanningText(): string; | ||
static scanButtonScanningStarting(): string; | ||
static textIfCameraScanSelected(): string; | ||
static textIfFileScanSelected(): string; | ||
static selectCamera(): string; | ||
} | ||
@@ -26,0 +28,0 @@ export declare class LibraryInfoStrings { |
@@ -67,2 +67,5 @@ var Html5QrcodeStrings = (function () { | ||
}; | ||
Html5QrcodeScannerStrings.scanButtonScanningStarting = function () { | ||
return "Launching Camera..."; | ||
}; | ||
Html5QrcodeScannerStrings.textIfCameraScanSelected = function () { | ||
@@ -74,2 +77,5 @@ return "Scan an Image File"; | ||
}; | ||
Html5QrcodeScannerStrings.selectCamera = function () { | ||
return "Select Camera"; | ||
}; | ||
return Html5QrcodeScannerStrings; | ||
@@ -76,0 +82,0 @@ }()); |
@@ -39,3 +39,3 @@ import { CameraDevice, QrcodeErrorCallback, QrcodeSuccessCallback, Html5QrcodeSupportedFormats, Html5QrcodeResult, QrDimensions } from "./core"; | ||
isScanning: boolean; | ||
constructor(elementId: string, configOrVerbosityFlag: boolean | Html5QrcodeFullConfig | undefined); | ||
constructor(elementId: string, configOrVerbosityFlag?: boolean | Html5QrcodeFullConfig | undefined); | ||
start(cameraIdOrConfig: Html5QrcodeIdentifier, configuration: Html5QrcodeCameraScanConfig | undefined, qrCodeSuccessCallback: QrcodeSuccessCallback | undefined, qrCodeErrorCallback: QrcodeErrorCallback | undefined): Promise<null>; | ||
@@ -42,0 +42,0 @@ pause(): void; |
{ | ||
"name": "html5-qrcode", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "A cross platform HTML5 QR Code & bar code scanner", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
@@ -23,5 +23,5 @@ # Html5-QRCode | ||
| <img src="./assets/pixel3.gif" width="200px"> | <img src="./assets/pixel4_barcode_480.gif" width="180px">| | ||
| <img src="./assets/pixel3.gif" width="180px"> | <img src="./assets/pixel4_barcode_480.gif" width="180px">| | ||
| -- | -- | | ||
| _Figure: Running on Android, Pixel 3_ | _Figure: Running on Android, Pixel 4, **Scanning different types of codes**_ | | ||
| _Demo at [scanapp.org](https://scanapp.org)_ | _Demo at [qrcode.minhazav.dev](https://qrcode.minhazav.dev) - **Scanning different types of codes**_ | | ||
@@ -91,2 +91,4 @@ ## Notice | ||
> See an end to end scanner experience at [scanapp.org](https://scanapp.org). | ||
This is a cross-platform JavaScript library to integrate QR code, bar codes & a few other types of code scanning capabilities to your applications running on HTML5 compatible browser. | ||
@@ -93,0 +95,0 @@ |
@@ -22,4 +22,6 @@ export declare class Html5QrcodeStrings { | ||
static scanButtonStartScanningText(): string; | ||
static scanButtonScanningStarting(): string; | ||
static textIfCameraScanSelected(): string; | ||
static textIfFileScanSelected(): string; | ||
static selectCamera(): string; | ||
} | ||
@@ -26,0 +28,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 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2630037
34969
788