Skip to content
Merged

Dev #46

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
12 changes: 7 additions & 5 deletions 1.hello-world/1.hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@
*/
await scanner.show();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
})();
</script>
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/10.read-video-pwa/helloworld-pwa.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
}
await scanner.show();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
})();

Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/11.read-video-requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
}
await scanner.show();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
})();
})
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/12.read-video-es6.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
}
await scanner.show();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
})();
</script>
Expand Down
24 changes: 14 additions & 10 deletions 1.hello-world/2.read-an-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
} catch (ex) {
document.getElementById('p-loading').innerText = ex;
document.getElementById('ipt-file').disabled = true;
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
})();

Expand Down Expand Up @@ -105,12 +107,14 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
divResults.appendChild(document.createElement('hr'));
divResults.scrollTop = divResults.scrollHeight;
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
} finally {
pReading.style.display = 'none';
this.value = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ export class VideoDecodeComponent implements OnInit {
};
await scanner.open();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
console.error(errMsg);
alert(errMsg);
}
}
async ngOnDestroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ export class HelloWorldComponent implements OnInit {
try {
await BarcodeScanner.loadWasm();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
}
showScanner(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ export class ImgDecodeComponent implements OnInit {
}
if (!results.length) { alert('No barcode found'); }
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
e.target.value = '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ class HelloWorld extends React.Component {
try {
await BarcodeReader.loadWasm();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ export default class ImgDecode extends Component {
}
if (!results.length) { alert('No barcode found'); }
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
e.target.value = '';
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions 1.hello-world/5.read-video-vue/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ export default {
try {
await BarcodeReader.loadWasm();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
},
components: {
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/5.read-video-vue/src/components/ImgDecode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ export default {
}
if (!results.length) { alert('No barcode found'); }
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
e.target.value = '';
}
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/5.read-video-vue/src/components/VideoDecode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ export default {
};
await scanner.open();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
},
async beforeDestroy() {
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/6.read-video-vue3/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ export default {
//Load the library on page load to speed things up.
await BarcodeScanner.loadWasm();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
});
const showScanner = () => {
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/6.read-video-vue3/src/components/ImgDecode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ export default {
}
if (!results.length) { alert('No barcode found'); }
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
e.target.value = '';
}
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/6.read-video-vue3/src/components/VideoDecode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ export default {
}
await scanner.open();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
});
onBeforeUnmount(async () => {
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/7.read-video-nextjs/components/HelloWorld.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ class HelloWorld extends React.Component {
//Load the library on page load to speed things up.
await BarcodeScanner.loadWasm();
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
}
showScanner = () => {
Expand Down
12 changes: 7 additions & 5 deletions 1.hello-world/7.read-video-nextjs/components/ImgDecode.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ export default class ImgDecode extends Component {
}
if (!results.length) { alert('No barcode found'); }
} catch (ex) {
if (ex.message.indexOf("network connection error")) {
let customMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
console.log(customMsg);
alert(customMsg);
let errMsg;
if (ex.message.includes("network connection error")) {
errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.";
} else {
errMsg = ex.message||ex;
}
throw ex;
console.error(errMsg);
alert(errMsg);
}
e.target.value = '';
}
Expand Down
Loading