Skip to content
Merged

Dev #75

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 1.hello-world/1.hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
/**
Expand Down
3 changes: 2 additions & 1 deletion 1.hello-world/10.read-video-pwa/helloworld-pwa.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
scanner.onUniqueRead = (txt, result) => {
Expand Down
3 changes: 2 additions & 1 deletion 1.hello-world/11.read-video-requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
scanner.onUniqueRead = (txt, result) => {
Expand Down
3 changes: 2 additions & 1 deletion 1.hello-world/12.read-video-es6.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
Expand Down
5 changes: 3 additions & 2 deletions 1.hello-world/2.read-an-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
divResults.appendChild(createEl('p', "No Barcode Found!"));
}
for (let result of results) {
iptReadonlyLastResult.value = result.barcodeFormatString + ": " + result.barcodeText; // show last txt result
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
iptReadonlyLastResult.value = format + ": " + result.barcodeText; // show last txt result
const p = document.createElement('p');
p.appendChild(createEl('span', result.barcodeFormatString + ": "));
p.appendChild(createEl('span', format + ": "));
p.appendChild(createEl('span', result.barcodeText, "sp-resultText"));
divResults.appendChild(p);
if (result.barcodeText.indexOf("Attention(exceptionCode") != -1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default {
}

.dce-bg-loading {
display: none;
animation: 1s linear infinite dce-rotate;
width: 40%;
height: 40%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export default {
}

.dce-bg-loading {
display: none;
animation: 1s linear infinite dce-rotate;
width: 40%;
height: 40%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default {
}

.dce-bg-loading {
display: none;
animation: 1s linear infinite dce-rotate;
width: 40%;
height: 40%;
Expand Down
6 changes: 4 additions & 2 deletions 2.ui-tweaking/1.read-video-show-result.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ <h1 style="font-size: 1.5em;">Use the Default Built-in UI</h1>
scanner.onFrameRead = (_results) => {
for (let result of _results) {
let newElements = [];
newElements.push(createASpan(result.barcodeFormatString + ": "));
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
newElements.push(createASpan(format + ": "));
newElements.push(createASpan(result.barcodeText, "resultText"));
newElements.push(document.createElement('br'));
if (result.barcodeText.indexOf("Attention(exceptionCode") != -1) {
Expand All @@ -83,7 +84,8 @@ <h1 style="font-size: 1.5em;">Use the Default Built-in UI</h1>
}
};
scanner.onUniqueRead = (txt, result) => {
document.getElementById('result').value = result.barcodeFormatString + ": " + txt;
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
document.getElementById('result').value = format + ": " + txt;
document.getElementById('result').focus();
setTimeout(() => {
document.getElementById('result').blur();
Expand Down
3 changes: 2 additions & 1 deletion 2.ui-tweaking/2.read-video-no-extra-control.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ <h1 style="font-size: 1.5em;">Hide UI Controls</h1>
try {
let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
scanner.onUniqueRead = (txt, result) => {
document.getElementById('result').value = result.barcodeFormatString + ": " + txt;
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
document.getElementById('result').value = format + ": " + txt;
document.getElementById('result').focus();
setTimeout(() => {
document.getElementById('result').blur();
Expand Down
3 changes: 2 additions & 1 deletion 2.ui-tweaking/3.read-video-with-external-control.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ <h1 style="font-size: 1.5em;">Customized UI</h1>
let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
await scanner.setUIElement(document.getElementById('div-ui-container'));
scanner.onUniqueRead = (txt, result) => {
document.getElementById('result').value = result.barcodeFormatString + ": " + txt;
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
document.getElementById('result').value = format + ": " + txt;
document.getElementById('result').focus();
setTimeout(() => {
document.getElementById('result').blur();
Expand Down
3 changes: 2 additions & 1 deletion 2.ui-tweaking/4.difference-video-size.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ <h1 style="font-size: 1.5em;">Enlarge the Video Stream</h1>
let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
await scanner.setUIElement(document.getElementById('div-ui-container'));
scanner.onUniqueRead = (txt, result) => {
document.getElementById('result').value = result.barcodeFormatString + ": " + txt;
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
document.getElementById('result').value = format + ": " + txt;
if (fitPage.hidden)
exitFullPage();
document.getElementById('result').focus();
Expand Down
3 changes: 2 additions & 1 deletion 2.ui-tweaking/5.read-video-with-custom-default-ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ <h1>Customized Default UI</h1>
let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
document.getElementById('UIElement').appendChild(scanner.getUIElement());
scanner.onUniqueRead = (txt, result) => {
document.getElementById('result').value = result.barcodeFormatString + ": " + txt;
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
document.getElementById('result').value = format + ": " + txt;
document.getElementById('result').focus();
setTimeout(() => {
document.getElementById('result').blur();
Expand Down
3 changes: 2 additions & 1 deletion 3.settings/initScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ async function startReading() {
let scanner = await pScanner;
scanner.onFrameRead = (_results) => {
for (let result of _results) {
resultBox.value = result.barcodeFormatString + ": " + result.barcodeText;
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
resultBox.value = format + ": " + result.barcodeText;
}
};
await scanner.show();
Expand Down