Skip to content

Commit 639ed42

Browse files
committed
remove duplicate titles
2 parents 4155de0 + dd81a69 commit 639ed42

File tree

37 files changed

+156
-89
lines changed

37 files changed

+156
-89
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
11+
jobs:
12+
# This workflow contains a single job called "build"
13+
Build-Demo:
14+
if: ${{ github.ref == 'refs/heads/demo' }}
15+
16+
# The type of runner that the job will run on
17+
runs-on: self-hosted
18+
19+
# Steps represent a sequence of tasks that will be executed as part of the job
20+
steps:
21+
# Runs a set of commands using the runners shell
22+
- name: Get Source
23+
run: |
24+
cd /home/ubuntu
25+
[ -d barcode-reader-javascript-samples ] && rm -rf barcode-reader-javascript-samples
26+
git clone --depth 1 -b demo https://github.com/Dynamsoft/barcode-reader-javascript-samples.git
27+
28+
- name: Sync files
29+
uses: SamKirkland/[email protected]
30+
with:
31+
server: ${{ secrets.FTP_DEMO_SERVER }}
32+
username: ${{ secrets.FTP_DEMO_USERNAME }}
33+
password: ${{ secrets.FTP_DEMO_PASSWORD }}
34+
port: 21
35+
local-dir: /home/ubuntu/barcode-reader-javascript-samples/
36+
server-dir: /demo.dynamsoft.com/Samples/DBR/JS/

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
22
node_modules
3-
dist
4-
build
3+
# dist
4+
# build
55

66
# local env files
77
.env.local

1.hello-world/1.hello-world.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* To use the library, you need to first specify a license key using the API "license" as shown below.
1818
*/
1919

20-
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
20+
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ==';
2121

2222
/**
2323
* 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.
@@ -26,7 +26,7 @@
2626
* LICENSE ALERT - THE END
2727
*/
2828

29-
window.onload = async function() {
29+
(async function() {
3030
try {
3131
const scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
3232
/**
@@ -54,10 +54,11 @@
5454
*/
5555
await scanner.show();
5656
} catch (ex) {
57+
alert(ex);
5758
throw ex;
5859
}
59-
};
60+
})();
6061
</script>
6162
</body>
6263

63-
</html>
64+
</html>

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
1919
* To use the library, you need to first specify a license key using the API "license" as shown below.
2020
*/
2121

22-
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
22+
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ==';
2323

2424
/**
2525
* 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.
@@ -30,7 +30,21 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
3030

3131
let pScanner = null;
3232
let latestResult = null;
33-
window.onload = async function() {
33+
34+
function startNotificationLoop() {
35+
if (latestResult != null) {
36+
const title = "New Barcode Found!";
37+
const notifBody = `Barcode Text: ${latestResult}.`;
38+
const options = {
39+
body: notifBody,
40+
};
41+
new Notification(title, options);
42+
latestResult = null;
43+
}
44+
setTimeout(startNotificationLoop, 100);
45+
}
46+
47+
(async function() {
3448
Notification.requestPermission().then((result) => {
3549
if (result === 'granted') {
3650
startNotificationLoop();
@@ -52,24 +66,12 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
5266
alert(ex.message);
5367
throw ex;
5468
}
55-
};
56-
57-
function startNotificationLoop() {
58-
if (latestResult != null) {
59-
const title = "New Barcode Found!";
60-
const notifBody = `Barcode Text: ${latestResult}.`;
61-
const options = {
62-
body: notifBody,
63-
};
64-
new Notification(title, options);
65-
latestResult = null;
66-
}
67-
setTimeout(startNotificationLoop, 100);
68-
}
69+
})();
70+
6971
if ('serviceWorker' in navigator) {
7072
navigator.serviceWorker.register('./service-worker.js');
7173
};
7274
</script>
7375
</body>
7476

75-
</html>
77+
</html>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
2121
* To use the library, you need to first specify a license key using the API "license" as shown below.
2222
*/
2323

24-
BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
24+
BarcodeReader.license = 'DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ==';
2525

2626
/**
2727
* 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.
@@ -32,7 +32,7 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
3232

3333
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/[email protected]/dist/";
3434
let pScanner = null;
35-
window.onload = async function() {
35+
(async function() {
3636
try {
3737
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
3838
scanner.onFrameRead = results => {
@@ -50,9 +50,9 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
5050
alert(ex.message);
5151
throw ex;
5252
}
53-
};
53+
})();
5454
})
5555
</script>
5656
</body>
5757

58-
</html>
58+
</html>

1.hello-world/12.read-video-es6.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
1818
* To use the library, you need to first specify a license key using the API "license" as shown below.
1919
*/
2020

21-
BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
21+
BarcodeReader.license = 'DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ==';
2222

2323
/**
2424
* 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.
@@ -30,7 +30,7 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
3030
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/[email protected]/dist/";
3131

3232
let pScanner = null;
33-
window.onload = async () => {
33+
(async () => {
3434
try {
3535
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
3636
/*
@@ -57,8 +57,8 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
5757
alert(ex.message);
5858
throw ex;
5959
}
60-
};
60+
})();
6161
</script>
6262
</body>
6363

64-
</html>
64+
</html>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
3535
* To use the library, you need to first specify a license key using the API "license" as shown below.
3636
*/
3737

38-
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
38+
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ==';
3939

4040
/**
4141
* 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.
@@ -56,6 +56,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
5656
} catch (ex) {
5757
document.getElementById('p-loading').innerText = ex;
5858
document.getElementById('ipt-file').disabled = true;
59+
alert(ex);
5960
throw ex;
6061
}
6162
})();
@@ -100,6 +101,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
100101
divResults.appendChild(document.createElement('hr'));
101102
divResults.scrollTop = divResults.scrollHeight;
102103
} catch (ex) {
104+
alert(ex);
103105
throw ex;
104106
} finally {
105107
pReading.style.display = 'none';

1.hello-world/3.read-video-angular/src/app/barcode-scanner/barcode-scanner.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class VideoDecodeComponent implements OnInit {
2222
};
2323
await scanner.open();
2424
} catch (ex) {
25-
console.error(ex);
25+
alert(ex);
2626
}
2727
}
2828
async ngOnDestroy() {

1.hello-world/3.read-video-angular/src/app/img-decode/img-decode.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class ImgDecodeComponent implements OnInit {
2020
}
2121
if(!results.length){ alert('No barcode found'); }
2222
} catch (ex) {
23-
console.error(ex);
23+
alert(ex);
2424
}
2525
e.target.value = '';
2626
}

1.hello-world/4.read-video-react/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# testing
1010
/coverage
1111

12-
# production
13-
# /build (keep for demoing purpose)
12+
# production(keep for demoing purpose)
13+
# /build
1414

1515
# misc
1616
.DS_Store

0 commit comments

Comments
 (0)