Skip to content

Move all source files to src/ #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2020
Merged
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
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@ html5QrCode.start(
});
```

> You can optionally set another argument in constructor called `verbose`
> to print all logs to console
>
> ```js
> const html5QrCode = new Html5Qrcode("reader", /* verbose= */ true);
> ```
> You can optionally set another argument in constructor called `verbose` to print all logs to console

```js
const html5QrCode = new Html5Qrcode("reader", /* verbose= */ true);
```

In mobile devices you may want users to directly scan the QR code using the back camera or the front camera for some use cases. For such cases you can avoid using the exact camera device id that you get from `Html5Qrcode.getCameras()`. The `start()` method allows passing constraints in place of camera device id similar to [html5 web API syntax](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Syntax). You can start scanning like mentioned in these examples:

Expand Down Expand Up @@ -465,8 +464,8 @@ Here's an example of normal and mirrored QR Code

## How to modify and build
1. Code changes should only be made to
- [html5-qrcode.js](./html5-qrcode.js)
- [html5-qrcode-scanner.js](./html5-qrcode-scanner.js)
- [src/html5-qrcode.js](./src/html5-qrcode.js)
- [src/html5-qrcode-scanner.js](./src/html5-qrcode-scanner.js)
- [third_party/qrcode.js](./third_party/qrcode.js)
2. Run `npm run-script build`.
> This should do `transpiling` --> `minification` --> `merging` different js code.
Expand All @@ -475,7 +474,7 @@ Here's an example of normal and mirrored QR Code
- Run the tests before sending PR, all tests should run.
- Please add tests for new behaviors sent in PR.

> Before sending a pull request with changes to [html5-qrcode.js](./html5-qrcode.js) please run instruction (2).
> Before sending a pull request with changes to [src](./src) please run instruction (2).

## Credits
The decoder used for the QRcode reading is from `LazarSoft` https://github.com/LazarSoft/jsqrcode<br>
3 changes: 3 additions & 0 deletions compatibility.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Compatibility list for tested device

**THIS IS WORK IN PROGRESS**: If you have tested the library to work with a different device please
send a pull request.

## Android
| Device | Android OS | Browser | Inline scanning | File Scanning | Known issues |
| --- | --- | --- | --- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion minified/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated code, do not modify manually.

- All files in this directory are minified from source code in the project.
- All files in this directory are minified from source code in the project hosted at [src](../src).
- Generated files should be supported in all major browsers.
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ echo 'Initiating build sequence'
## find assets/*.* -print0| xargs -0 -i{} bash -c 'echo s%{}%data\\:\\;base64\\,$(base64 -w0 {})%g'|sed -i -f - html5-qrcode.js

## Transpile the Main Js Code
babel html5-qrcode.js -d transpiled
babel src/html5-qrcode.js -d transpiled
echo 'html5-qrcode.js transpiled'

babel html5-qrcode-scanner.js -d transpiled
babel src/html5-qrcode-scanner.js -d transpiled
echo 'html5-qrcode-scanner.js transpiled'

## Minify the code
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion transpiled/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated code, do not modify manually.

- All files in this directory are transpiled from their source files in the project root.
- All files in this directory are transpiled from their source files in [src](../src).
- The files are created using [babeljs.io](https://babeljs.io).
- Generated files should be supported in all major browsers.