Skip to content

Commit 33fa40d

Browse files
author
Amro Anwer
committed
Merge remote-tracking branch 'origin/main' into amro-branch
2 parents 79b0122 + 7d5d545 commit 33fa40d

File tree

68 files changed

+880
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+880
-174
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
password: ${{ secrets.FTP_DEMO_PASSWORD }}
3434
port: 21
3535
local-dir: /home/ubuntu/barcode-reader-javascript-samples/
36-
server-dir: /demo.dynamsoft.com/Samples/DBR/JS/
36+
server-dir: /Demo.dynamsoft.com/Samples/DBR/JS/

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<body>
1414
Loading...
15-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/dbr.js"></script>
15+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js"></script>
1616
<script>
1717
/** LICENSE ALERT - README
1818
* To use the library, you need to first specify a license key using the API "license" as shown below.
@@ -23,36 +23,37 @@
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.
2525
* 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.
26-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.2&utm_source=github#specify-the-license or contact support@dynamsoft.com.
26+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.6.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2727
* LICENSE ALERT - THE END
2828
*/
2929

3030
(async function() {
3131
try {
3232
const scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
3333
/**
34-
* onFrameRead is triggered after the library finishes reading a frame image.
34+
* 'onFrameRead' is triggered after the library finishes reading a frame image.
3535
* There can be multiple barcodes on one image.
3636
*/
3737
scanner.onFrameRead = results => {
3838
console.log("Barcodes on one frame:");
3939
for (let result of results) {
40-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
40+
const format = result.barcodeFormatString;
41+
console.log(format + ": " + result.barcodeText);
4142
}
4243
};
4344
/**
44-
* onUniqueRead is triggered only when a 'new' barcode is found.
45+
* 'onUniqueRead' is triggered only when a 'new' barcode is found.
4546
* The amount of time that the library 'remembers' a barcode is defined by
4647
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
4748
*/
4849
scanner.onUniqueRead = (txt, result) => {
49-
alert(txt);
50-
console.log("Unique Code Found: ", result);
51-
}
52-
/**
53-
* show() opens the camera and shows the video stream on the page.
54-
* After that, the library starts to scan the frame images continuously.
55-
*/
50+
alert(txt);
51+
console.log("Unique Code Found: ", result);
52+
}
53+
/**
54+
* 'show()' opens the camera and shows the video stream on the page.
55+
* After that, the library starts to scan the frame images continuously.
56+
*/
5657
await scanner.show();
5758
} catch (ex) {
5859
let errMsg;

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body>
1515
<h1 style="font-size: 1.5em;">Hello World for PWA</h1>
1616
Loading...
17-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/dbr.js"></script>
17+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js"></script>
1818
<script>
1919
/** LICENSE ALERT - README
2020
* To use the library, you need to first specify a license key using the API "license" as shown below.
@@ -25,7 +25,7 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
2525
/**
2626
* 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.
2727
* 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.
28-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.2&utm_source=github#specify-the-license or contact support@dynamsoft.com.
28+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.6.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2929
* LICENSE ALERT - THE END
3030
*/
3131

@@ -56,7 +56,8 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
5656
scanner.onFrameRead = results => {
5757
console.log("Barcodes on one frame:");
5858
for (let result of results) {
59-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
59+
const format = result.barcodeFormatString;
60+
console.log(format + ": " + result.barcodeText);
6061
}
6162
};
6263
scanner.onUniqueRead = (txt, result) => {

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
1313
Loading...
1414
<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.js"></script>
1515
<script>
16-
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/dbr.js'], function({
16+
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.js'], function({
1717
BarcodeReader,
1818
BarcodeScanner
1919
}) {
@@ -26,19 +26,20 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
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.
2828
* 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.
29-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.2&utm_source=github#specify-the-license or contact support@dynamsoft.com.
29+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.6.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
3030
* LICENSE ALERT - THE END
3131
*/
3232

33-
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/";
33+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/";
3434
let pScanner = null;
3535
(async function() {
3636
try {
3737
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
3838
scanner.onFrameRead = results => {
3939
console.log("Barcodes on one frame:");
4040
for (let result of results) {
41-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
41+
const format = result.barcodeFormatString;
42+
console.log(format + ": " + result.barcodeText);
4243
}
4344
};
4445
scanner.onUniqueRead = (txt, result) => {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<h1 style="font-size: 1.5em;">Hello World for ES6</h1>
1414
Loading...
1515
<script type="module">
16-
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/dbr.mjs';
16+
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/dbr.mjs';
1717
/** LICENSE ALERT - README
1818
* To use the library, you need to first specify a license key using the API "license" as shown below.
1919
*/
@@ -23,24 +23,25 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
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.
2525
* 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.
26-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.2&utm_source=github#specify-the-license or contact support@dynamsoft.com.
26+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.6.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2727
* LICENSE ALERT - THE END
2828
*/
2929

30-
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/";
30+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.0/dist/";
3131

3232
let pScanner = null;
3333
(async () => {
3434
try {
3535
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
3636
/*
37-
* onFrameRead is triggered after the library finishes reading a frame.
37+
* 'onFrameRead' is triggered after the library finishes reading a frame.
3838
* There can be one or multiple barcodes on each frame.
3939
*/
4040
scanner.onFrameRead = results => {
4141
console.log("Barcodes on one frame:");
4242
for (let result of results) {
43-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
43+
const format = result.barcodeFormatString;
44+
console.log(format + ": " + result.barcodeText);
4445
}
4546
};
4647
/*
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `npm start`
10+
11+
Runs the app in the development mode.\
12+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13+
14+
The page will reload if you make edits.\
15+
You will also see any lint errors in the console.
16+
17+
### `npm test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21+
22+
### `npm run build`
23+
24+
Builds the app for production to the `build` folder.\
25+
It correctly bundles React in production mode and optimizes the build for the best performance.
26+
27+
The build is minified and the filenames include the hashes.\
28+
Your app is ready to be deployed!
29+
30+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
32+
### `npm run eject`
33+
34+
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
35+
36+
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
38+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39+
40+
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41+
42+
## Learn More
43+
44+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45+
46+
To learn React, check out the [React documentation](https://reactjs.org/).
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "read-video-react",
3+
"version": "0.1.0",
4+
"homepage": "./",
5+
"private": true,
6+
"dependencies": {
7+
"@testing-library/jest-dom": "^5.16.4",
8+
"@testing-library/react": "^13.3.0",
9+
"@testing-library/user-event": "^13.5.0",
10+
"@types/jest": "^27.5.2",
11+
"@types/node": "^16.11.45",
12+
"@types/react": "^18.0.15",
13+
"@types/react-dom": "^18.0.6",
14+
"dynamsoft-javascript-barcode": "9.6.0",
15+
"react": "^18.2.0",
16+
"react-dom": "^18.2.0",
17+
"react-scripts": "5.0.1",
18+
"typescript": "^4.7.4",
19+
"web-vitals": "^2.1.4"
20+
},
21+
"scripts": {
22+
"start": "react-scripts start",
23+
"build": "react-scripts build",
24+
"test": "react-scripts test",
25+
"eject": "react-scripts eject"
26+
},
27+
"eslintConfig": {
28+
"extends": [
29+
"react-app",
30+
"react-app/jest"
31+
]
32+
},
33+
"browserslist": {
34+
"production": [
35+
">0.2%",
36+
"not dead",
37+
"not op_mini all"
38+
],
39+
"development": [
40+
"last 1 chrome version",
41+
"last 1 firefox version",
42+
"last 1 safari version"
43+
]
44+
}
45+
}
3.78 KB
Binary file not shown.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<!--
14+
Notice the use of %PUBLIC_URL% in the tags above.
15+
It will be replaced with the URL of the `public` folder during the build.
16+
Only files inside the `public` folder can be referenced from the HTML.
17+
18+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
19+
work correctly both with client-side routing and a non-root public URL.
20+
Learn how to configure a non-root public URL by running `npm run build`.
21+
-->
22+
<title>React App</title>
23+
</head>
24+
<body>
25+
<noscript>You need to enable JavaScript to run this app.</noscript>
26+
<div id="root"></div>
27+
<!--
28+
This HTML file is a template.
29+
If you open it directly in the browser, you will see an empty page.
30+
31+
You can add webfonts, meta tags, or analytics to this file.
32+
The build step will place the bundled scripts into the <body> tag.
33+
34+
To begin the development, run `npm start` or `yarn start`.
35+
To create a production bundle, use `npm run build` or `yarn build`.
36+
-->
37+
</body>
38+
</html>

0 commit comments

Comments
 (0)