Skip to content

Commit 633bf0c

Browse files
committed
review a little
1 parent 5d21a0a commit 633bf0c

File tree

8 files changed

+54
-119
lines changed

8 files changed

+54
-119
lines changed

1.hello-world/1.minimum-code.html

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<!--
1111
This sample makes use of the library hosted by the CDN jsDelivr. If you would rather use the
1212
library offline. Please see the guide on how to host the library:
13-
https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=latest#host-the-library-yourself-recommended
13+
https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=latest&utm_source=github#host-the-library-yourself-recommended
1414
-->
1515
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
1616
</head>
@@ -20,29 +20,20 @@ <h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
2020
<button id="btn-show-scanner">Show Barcode Scanner</button>
2121
<script>
2222
/** LICENSE ALERT - README
23-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
24-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
25-
* Note that network connection is required for this license to work.
23+
* The library requires a license to work.
24+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
25+
* Note that network connection is required for the public license to work.
26+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2627
*/
2728

28-
/* When using your own license, uncomment the following line and specify your Organization ID. */
29+
/* When using your own license, uncomment the following line and specify your license. */
2930

30-
// Dynamsoft.DBR.organizationID = "YOUR-ORGANIZATION-ID";
31-
32-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
33-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
34-
35-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
36-
37-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
38-
39-
/** LICENSE ALERT - THE END */
31+
// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
4032

4133
let pScanner = null;
4234
document.getElementById('btn-show-scanner').onclick = async function() {
4335
try {
44-
pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance();
45-
let scanner = await pScanner;
36+
const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
4637
/*
4738
* onFrameRead is triggered after the library finishes reading a frame.
4839
* There can be one or multiple barcodes on each frame.

1.hello-world/10.read-video-pwa/helloworld-pwa.html

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,15 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
1616
<button id='readBarcode'>Read Barcode via Camera</button>
1717
<script>
1818
/** LICENSE ALERT - README
19-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
20-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
21-
* Note that network connection is required for this license to work.
19+
* The library requires a license to work.
20+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
21+
* Note that network connection is required for the public license to work.
22+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2223
*/
2324

24-
/* When using your own license, uncomment the following line and specify your Organization ID. */
25+
/* When using your own license, uncomment the following line and specify your license. */
2526

26-
// Dynamsoft.DBR.organizationID = "YOUR-ORGANIZATION-ID";
27-
28-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
29-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
30-
31-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
32-
33-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
34-
35-
/** LICENSE ALERT - THE END */
27+
// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
3628

3729
let pScanner = null;
3830
let latestResult = null;

1.hello-world/11.read-video-requirejs.html

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,21 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
1919
BarcodeScanner
2020
}) {
2121
/** LICENSE ALERT - README
22-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
23-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
24-
* Note that network connection is required for this license to work.
22+
* The library requires a license to work.
23+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
24+
* Note that network connection is required for the public license to work.
25+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2526
*/
2627

27-
/* When using your own license, uncomment the following line and specify your Organization ID. */
28+
/* When using your own license, uncomment the following line and specify your license. */
2829

29-
// DBR.organizationID = "YOUR-ORGANIZATION-ID";
30+
// BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
3031

31-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
32-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
33-
34-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
35-
36-
// DBR.productKeys = "YOUR-PRODUCT-KEY";
37-
38-
/** LICENSE ALERT - THE END */
39-
40-
DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
32+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
4133
let pScanner = null;
4234
document.getElementById('readBarcode').onclick = async function() {
4335
try {
44-
let scanner = await (pScanner = pScanner || DBR.BarcodeScanner.createInstance());
36+
let scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
4537
scanner.onFrameRead = results => {
4638
console.log("Barcodes on one frame:");
4739
for (let result of results) {

1.hello-world/2.read-an-image.html

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<!--
1111
This sample makes use of the library hosted by the CDN jsDelivr. If you would rather use the
1212
library offline. Please see the guide on how to host the library:
13-
https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=latest#host-the-library-yourself-recommended
13+
https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=latest&utm_source=github#host-the-library-yourself-recommended
1414
-->
1515
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
1616
</head>
@@ -30,23 +30,15 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
3030
</div>
3131
<script>
3232
/** LICENSE ALERT - README
33-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
34-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
35-
* Note that network connection is required for this license to work.
33+
* The library requires a license to work.
34+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
35+
* Note that network connection is required for the public license to work.
36+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
3637
*/
3738

38-
/* When using your own license, uncomment the following line and specify your Organization ID. */
39-
40-
// Dynamsoft.DBR.organizationID = "YOUR-ORGANIZATION-ID";
41-
42-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
43-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
44-
45-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
46-
47-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
48-
49-
/** LICENSE ALERT - THE END */
39+
/* When using your own license, uncomment the following line and specify your license. */
40+
41+
// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
5042

5143
// reader for decoding pictures
5244
let pReader = null;

1.hello-world/3.read-video-angular/src/app/dbr.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import DBR from "dynamsoft-javascript-barcode";
22

33
/** LICENSE ALERT - README
4-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
5-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
6-
* Note that network connection is required for this license to work.
4+
* The library requires a license to work.
5+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
6+
* Note that network connection is required for the public license to work.
7+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
78
*/
89

9-
/* When using your own license, uncomment the following line and specify your Organization ID. */
10+
/* When using your own license, uncomment the following line and specify your license. */
1011

11-
// DBR.organizationID = "YOUR-ORGANIZATION-ID";
12-
13-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
14-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
15-
16-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
17-
18-
// DBR.productKeys = "YOUR-PRODUCT-KEY";
19-
20-
/** LICENSE ALERT - THE END */
12+
// DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
2113

2214
DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
2315

1.hello-world/4.read-video-react/src/dbr.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import DBR from "dynamsoft-javascript-barcode";
22

33
/** LICENSE ALERT - README
4-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
5-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
6-
* Note that network connection is required for this license to work.
4+
* The library requires a license to work.
5+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
6+
* Note that network connection is required for the public license to work.
7+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
78
*/
89

9-
/* When using your own license, uncomment the following line and specify your Organization ID. */
10+
/* When using your own license, uncomment the following line and specify your license. */
1011

11-
// DBR.organizationID = "YOUR-ORGANIZATION-ID";
12-
13-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
14-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
15-
16-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
17-
18-
// DBR.productKeys = "YOUR-PRODUCT-KEY";
19-
20-
/** LICENSE ALERT - THE END */
12+
// DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
2113

2214
DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
2315

1.hello-world/5.read-video-vue/src/dbr.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import DBR from "dynamsoft-javascript-barcode";
22

33
/** LICENSE ALERT - README
4-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
5-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
6-
* Note that network connection is required for this license to work.
4+
* The library requires a license to work.
5+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
6+
* Note that network connection is required for the public license to work.
7+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
78
*/
89

9-
/* When using your own license, uncomment the following line and specify your Organization ID. */
10+
/* When using your own license, uncomment the following line and specify your license. */
1011

11-
// DBR.organizationID = "YOUR-ORGANIZATION-ID";
12-
13-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
14-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
15-
16-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
17-
18-
// DBR.productKeys = "YOUR-PRODUCT-KEY";
19-
20-
/** LICENSE ALERT - THE END */
12+
// DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
2113

2214
DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
2315

1.hello-world/6.read-video-vue3/src/dbr.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import DBR from "dynamsoft-javascript-barcode";
22

33
/** LICENSE ALERT - README
4-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
5-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
6-
* Note that network connection is required for this license to work.
4+
* The library requires a license to work.
5+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
6+
* Note that network connection is required for the public license to work.
7+
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
78
*/
89

9-
/* When using your own license, uncomment the following line and specify your Organization ID. */
10+
/* When using your own license, uncomment the following line and specify your license. */
1011

11-
// DBR.organizationID = "YOUR-ORGANIZATION-ID";
12-
13-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
14-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
15-
16-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
17-
18-
// DBR.productKeys = "YOUR-PRODUCT-KEY";
19-
20-
/** LICENSE ALERT - THE END */
12+
// DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
2113

2214
DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
2315

0 commit comments

Comments
 (0)