Skip to content

Commit c633f91

Browse files
committed
algn with main branch
1 parent bab9590 commit c633f91

File tree

22 files changed

+149
-120
lines changed

22 files changed

+149
-120
lines changed

1.hello-world/12.read-video-webpack/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import DBR from "dynamsoft-javascript-barcode";
99
/* When using your own license, uncomment the following line and specify your Organization ID. */
1010

1111
Dynamsoft.DBR.organizationID = "200000";
12-
Dynamsoft.DBR.handshakeCode = "200000-dbr_js_samples";
12+
Dynamsoft.DBR.handshakeCode = "200000-dbr_js_samples";
1313

1414
/* 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 */
1515
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */

1.hello-world/3.read-video-angular/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@ testem.log
4444
# System Files
4545
.DS_Store
4646
Thumbs.db
47+
48+
# others
49+
50+
*-lock.json
51+
*.lock

1.hello-world/3.read-video-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
"tslint": "~6.1.0",
4444
"typescript": "~4.1.5"
4545
}
46-
}
46+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import DBR from "dynamsoft-javascript-barcode";
88

99
/* When using your own license, uncomment the following line and specify your Organization ID. */
1010

11-
DBR.organizationID = "200000";
12-
DBR.handshakeCode = "200000-dbr_js_samples";
11+
DBR.organizationID = "200000";
12+
DBR.handshakeCode = "200000-dbr_js_samples";
1313

1414
/* 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 */
1515
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */

1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,7 @@
7272
height: 40vh;
7373
width: 80vw;
7474
}
75+
76+
h1 {
77+
font-size: 1.5em;
78+
}

1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="helloWorld">
2-
<h1 style="font-size: 1.5em;">Hello World for Angular<img style="height: 25px;" alt="logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
2+
<h1>Hello World for Angular<img style="height: 25px;" alt="logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
33
/>
44
</h1>
55
<input type="text" [value]="resultValue" readonly="true" class="latest-result" placeholder="The Last Read Barcode">

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
25+
# others
26+
27+
*.lock

1.hello-world/4.read-video-react/src/components/HelloWorld.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
color: #455A64;
1010
}
1111

12+
h1 {
13+
font-size: 1.5em;
14+
}
15+
1216
button {
1317
font-size: 1.5rem;
1418
margin-bottom: 2vh;

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

Lines changed: 77 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -5,102 +5,85 @@ import React from 'react';
55
import BarcodeScanner from './BarcodeScanner';
66

77
class HelloWorld extends React.Component {
8-
constructor(props) {
9-
super(props);
10-
this.refDivMessage = React.createRef();
11-
this.state = {
12-
libLoaded: false,
13-
resultValue: "",
14-
resultItems: [],
15-
bShowScanner: false
16-
};
17-
}
18-
async componentDidMount() {
19-
try {
20-
await DBR.BarcodeScanner.loadWasm();
21-
this.setState(state => {
22-
state.libLoaded = true;
23-
return state;
24-
}, () => {
25-
this.showScanner();
26-
});
27-
} catch (ex) {
28-
alert(ex.message);
29-
throw ex;
30-
}
8+
constructor(props) {
9+
super(props);
10+
this.refDivMessage = React.createRef();
11+
this.state = {
12+
libLoaded: false,
13+
resultValue: "",
14+
resultItems: [],
15+
bShowScanner: false
16+
};
17+
}
18+
async componentDidMount() {
19+
try {
20+
await DBR.BarcodeScanner.loadWasm();
21+
this.setState(state => {
22+
state.libLoaded = true;
23+
return state;
24+
}, () => {
25+
this.showScanner();
26+
});
27+
} catch (ex) {
28+
alert(ex.message);
29+
throw ex;
3130
}
31+
}
3232

33-
scrollToBottom = () => {
34-
this.refDivMessage.current.scrollTop = this.refDivMessage.current.scrollHeight;
35-
}
33+
scrollToBottom = () => {
34+
this.refDivMessage.current.scrollTop = this.refDivMessage.current.scrollHeight;
35+
}
3636

37-
componentDidUpdate() {
38-
this.scrollToBottom();
39-
}
37+
componentDidUpdate() {
38+
this.scrollToBottom();
39+
}
4040

41-
appendMessage = (message) => {
42-
switch (message.type) {
43-
case "result":
44-
this.setState(prevState => {
45-
prevState.resultValue = message.format + ": " + message.text;
46-
prevState.resultItems = prevState.resultItems.concat([{ type: message.format + ": ", text: message.text }]);
47-
return prevState;
48-
});
49-
break;
50-
case "error":
51-
this.setState(prevState => {
52-
prevState.resultValue = message.msg;
53-
prevState.resultItems = prevState.resultItems.concat([{ type: "Error: ", text: message.msg }]);
54-
return prevState;
55-
});
56-
break;
57-
default:
58-
break;
59-
}
60-
}
61-
showScanner = () => {
62-
this.setState({
63-
bShowScanner: true
64-
});
41+
appendMessage = (message) => {
42+
switch (message.type) {
43+
case "result":
44+
this.setState(prevState => {
45+
prevState.resultValue = message.format + ": " + message.text;
46+
prevState.resultItems = prevState.resultItems.concat([{ type: message.format + ": ", text: message.text }]);
47+
return prevState;
48+
});
49+
break;
50+
case "error":
51+
this.setState(prevState => {
52+
prevState.resultValue = message.msg;
53+
prevState.resultItems = prevState.resultItems.concat([{ type: "Error: ", text: message.msg }]);
54+
return prevState;
55+
});
56+
break;
57+
default:
58+
break;
6559
}
66-
render() {
67-
return ( <
68-
div className = "helloWorld" >
69-
<
70-
h1 style = "font-size: 1.5em;" > Hello World
71-
for React < img src = { reactLogo }
72-
className = "App-logo"
73-
alt = "logo" / > < /h1> <
74-
input type = "text"
75-
value = { this.state.resultValue }
76-
readOnly = { true }
77-
className = "latest-result"
78-
placeholder = "The Last Read Barcode" / >
79-
<
80-
div id = "UIElement" > {!this.state.libLoaded ? ( < span style = {
81-
{ fontSize: "x-large" }
82-
} > Loading Library... < /span>) : ""} {
83-
this.state.bShowScanner ? ( < BarcodeScanner appendMessage = { this.appendMessage } > < /BarcodeScanner>) : ""} < /
84-
div > <
85-
div >
86-
<
87-
span style = {
88-
{ float: "left" }
89-
} > All Results: < /span><br / >
90-
<
91-
div id = "results"
92-
ref = { this.refDivMessage } >
93-
<
94-
ul > {
95-
this.state.resultItems.map((item, index) => ( <
96-
li key = { 100000 + index } > < span > { item.type } < /span><span className="resultText">{item.text}</span > < /li>
97-
))
98-
} <
99-
/ul> < /
100-
div > <
101-
/div> < /
102-
div >
103-
);
104-
}
105-
}
106-
export default HelloWorld;
60+
}
61+
showScanner = () => {
62+
this.setState({
63+
bShowScanner: true
64+
});
65+
}
66+
render() {
67+
return (
68+
<div className="helloWorld">
69+
<h1>Hello World for React<img src={reactLogo} className="App-logo" alt="logo" /></h1>
70+
<input type="text" value={this.state.resultValue} readOnly={true} className="latest-result" placeholder="The Last Read Barcode" />
71+
<div id="UIElement">
72+
{!this.state.libLoaded ? (<span style={{ fontSize: "x-large" }}>Loading Library...</span>) : ""}
73+
{this.state.bShowScanner ? (<BarcodeScanner appendMessage={this.appendMessage}></BarcodeScanner>) : ""}
74+
</div>
75+
<div>
76+
<span style={{ float: "left" }}>All Results:</span><br />
77+
<div id="results" ref={this.refDivMessage}>
78+
<ul>
79+
{this.state.resultItems.map((item, index) => (
80+
<li key={100000 + index} ><span>{item.type}</span><span className="resultText">{item.text}</span> </li>
81+
))}
82+
</ul>
83+
</div>
84+
</div>
85+
</div>
86+
);
87+
}
88+
}
89+
export default HelloWorld;

1.hello-world/5.read-video-vue/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ pnpm-debug.log*
2121
*.njsproj
2222
*.sln
2323
*.sw?
24+
25+
# others
26+
27+
*.lock

0 commit comments

Comments
 (0)