Skip to content

Commit 7645194

Browse files
committed
remove unnecessary; format;
1 parent 14ce610 commit 7645194

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

2.ui-tweaking/1.read-video-show-result.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ <h1>Use the Default Built-in UI</h1>
4343
document.getElementById('showScanner').addEventListener('click', async () => {
4444
try {
4545
let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
46-
if(scanner.singleFrameMode) {
47-
scanner.singleFrameMode = false;
48-
document.querySelector('.dce-sel-camera').style.display = "block";
49-
document.querySelector('.dce-sel-resolution').style.display = "block";
50-
}
5146
scanner.onUniqueRead = (txt, result) => { alert(txt); };
5247
document.getElementById('UIElement').appendChild(scanner.getUIElement());
5348
await scanner.show();
@@ -62,8 +57,6 @@ <h1>Use the Default Built-in UI</h1>
6257
let scanner = await(pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
6358
scanner.hide();
6459
scanner.singleFrameMode = true;
65-
document.querySelector('.dce-sel-camera').style.display = "none";
66-
document.querySelector('.dce-sel-resolution').style.display = "none";
6760
await scanner.show();
6861
} catch (ex) {
6962
alert(ex.message);

2.ui-tweaking/3.read-video-with-external-control.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ <h1>Customized UI</h1>
7373
*/
7474

7575
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
76-
76+
7777
/**
7878
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
7979
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
@@ -147,7 +147,7 @@ <h1>Customized UI</h1>
147147
});
148148
document.getElementById("cam_selector_switch").addEventListener("click", toggleCamView);
149149
document.getElementById("res_selector_switch").addEventListener("click", toggleResView);
150-
150+
151151
function toggleBtnView(boolean) {
152152
document.getElementById('btn-hide-scanner').hidden = boolean;
153153
document.getElementById('btn-show-scanner').hidden = !boolean;
@@ -206,6 +206,7 @@ <h1>Customized UI</h1>
206206
}
207207
updateOptions();
208208
updateCurrentResolution();
209+
return;
209210
}
210211
});
211212
}
@@ -225,6 +226,7 @@ <h1>Customized UI</h1>
225226
async function updateOptions() {
226227
let scanner = await pScanner;
227228
const cameras = await scanner.getAllCameras();
229+
const currentCamera = await scanner.getCurrentCamera();
228230
document.getElementById("ul_options_camera").innerHTML = "";
229231
cameras.forEach(camera => {
230232
let li = document.createElement("li");
@@ -234,8 +236,7 @@ <h1>Customized UI</h1>
234236
li.appendChild(span);
235237
document.getElementById("ul_options_camera").appendChild(li);
236238
});
237-
const currentCamera = await scanner.getCurrentCamera();
238-
let camOption = document.querySelectorAll("#ul_options_camera span");
239+
const camOption = document.querySelectorAll("#ul_options_camera span");
239240
camOption.forEach(sapn => {
240241
sapn.addEventListener("click", camOptionSelected);
241242
if (!currentCamera || sapn.id === currentCamera.deviceId) {
@@ -268,12 +269,12 @@ <h1>Customized UI</h1>
268269
if (camViewable === -1 && e.target.id !== "selector_input_camera" && e.target.id !== "arrow_camera" && e.target.parentNode.id !== "arrow_camera") {
269270
toggleCamView();
270271
}
271-
if (resViewable ===-1 && e.target.id !== "selector_input_resolution" && e.target.id !== "arrow_resolution" && e.target.parentNode.id !== "arrow_resolution") {
272+
if (resViewable === -1 && e.target.id !== "selector_input_resolution" && e.target.id !== "arrow_resolution" && e.target.parentNode.id !== "arrow_resolution") {
272273
toggleResView();
273274
}
274275
if (camViewable !== -1 && resViewable !== -1) {
275276
// trigger only once
276-
document.removeEventListener("click", arguments.callee)
277+
document.removeEventListener("click", arguments.callee);
277278
}
278279
}
279280
</script>

4.use-case/2.read-a-drivers-license.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ <h1 id='header'>Read A Driver's License <a href="javascript:void(0)" id='readAga
7373
});
7474
document.getElementById("resultAlert_btn").addEventListener("click", closeResultAlert);
7575
document.getElementById("confirm_btn").addEventListener("click", () => {
76-
document.getElementById('hintMSG').innerHTML = "Click the icon below to select a picture to read. <a href='javascript:void(0)' onclick='backToCameraMode()'>Back to camera mode</a>"
76+
document.getElementById('hintMSG').innerHTML = "Click below to select a picture to read. <a href='javascript:void(0)' onclick='backToCameraMode()'>Back to camera mode</a>"
7777
startScanning(true);
7878
document.getElementById("message_box").style.display = "none";
7979
});
@@ -117,7 +117,7 @@ <h1 id='header'>Read A Driver's License <a href="javascript:void(0)" id='readAga
117117
else {
118118
scanner.onFrameRead = (result) => {
119119
if (result.length === 0) {
120-
document.getElementById('resultAlert_content').innerText = "No Barcode Found!";
120+
document.getElementById('resultAlert_content').innerText = "No PDF417 Barcode Found!";
121121
document.getElementById('resultAlert').hidden = false;
122122
document.addEventListener("mousedown", clickToHide);
123123
}

0 commit comments

Comments
 (0)