Generic Commit; Most likely a fix or small feature
This commit is contained in:
@@ -615,18 +615,6 @@ body {
|
||||
Point the camera at the barcode or QR code
|
||||
</p>
|
||||
|
||||
<form id="scanner-barcode-form" class="form">
|
||||
<input
|
||||
type="text"
|
||||
name="barcode"
|
||||
placeholder="Or enter barcode manually"
|
||||
class="input"
|
||||
/>
|
||||
<button id="start-scan-btn" type="submit" class="btn btn-green">
|
||||
Search
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<button id="stop-scanner-btn" class="btn btn-cancel">
|
||||
<svg
|
||||
class="icon-sm"
|
||||
@@ -657,8 +645,9 @@ body {
|
||||
<p class="error-title">❌ Error</p>
|
||||
<p id="error-message" class="error-message"></p>
|
||||
<button id="error-back-btn" class="btn btn-danger">
|
||||
Back
|
||||
</button>
|
||||
import type { ProductAnalysis } from "..import type { ProductAnalysis } from "../types";
|
||||
import { analyzeProduct } from "../utils/productAnalysis";types";
|
||||
import { analyzeProduct } from "../utils/productAnalysis";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -907,29 +896,17 @@ import { analyzeProduct } from "../utils/productAnalysis";
|
||||
barcodeDisplay.textContent = "";
|
||||
showView(scannerView);
|
||||
|
||||
let selectedDeviceId : string;
|
||||
codeReader = new window.ZXing.BrowserMultiFormatReader();
|
||||
|
||||
codeReader.listVideoInputDevices().then((videoInputDevices: unknown) => {
|
||||
selectedDeviceId = videoInputDevices[0].deviceId
|
||||
if (videoInputDevices.length >= 1) {
|
||||
videoInputDevices.forEach((element) => {
|
||||
const sourceOption = document.createElement('option')
|
||||
sourceOption.text = element.label
|
||||
sourceOption.value = element.deviceId
|
||||
})
|
||||
}
|
||||
|
||||
document.getElementById('start-scan-btn').addEventListener('click', () => {
|
||||
codeReader.decodeFromVideoDevice(undefined, 'scanner-video', (result, err) => {
|
||||
if (result) {
|
||||
const code = result.getText();
|
||||
barcodeDisplay.textContent = code;
|
||||
barcodeDisplay.style.display = "block";
|
||||
codeReader.reset();
|
||||
searchProduct(code);
|
||||
}
|
||||
})
|
||||
document.getElementById('start-scanner-btn').addEventListener('click', () => {
|
||||
codeReader.decodeFromVideoDevice(undefined, 'scanner-video', (result, err) => {
|
||||
if (result) {
|
||||
const code = result.getText();
|
||||
barcodeDisplay.textContent = code;
|
||||
barcodeDisplay.style.display = "block";
|
||||
codeReader.reset();
|
||||
searchProduct(code);
|
||||
}
|
||||
})
|
||||
})
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user