-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ui classes and id, update file selection UI & graduate useBarCode…
…DetectorIfSupported from experimental #### Add support for custom CSS Developer / User Story: As a developer I can write custom CSS for `Html5QrcodeScanner`. Feature request: [Issue#389](#389) List of CSS class and IDs added. 1. All key elements will have a common CSS class `html5-qrcode-element`. This way developers can customise element by element. For example: ```css button.html5-qrcode-element { color: 'red' !important, border: '1px solid red' !important } ``` Key elements are: - Request camera permission button. - "Scan and image file" vs "Scan using camera directly" link. - "File selection" input ('file') - Start or Stop camera button. - Camera selection Select element - Torch button 2. key elements will have specific IDs defined in `src/ui/scanner/base.ts`. This can be used to customise per elements. ##### TODOs - [ ] Document in a blog post - [ ] Add pointer in qrcode.minhazav.dev - [ ] Add pointer in Readme #### Graduate `useBarCodeDetectorIfSupported` to `Html5QrcodeConfigs`. `useBarCodeDetectorIfSupported` was tested as an experimental configuration for a long time and has proven to be very efficient and well supported. It has been tested in [ScanApp](https://scanapp.org) for quiet some time. Considering this experimental API is not well documented, it makes it hard for folks to discover it. By graduating this configuration to `Html5QrcodeConfigs` I hope to make it more discoverable. In this version the `ExperimentalFeaturesConfig#useBarCodeDetectorIfSupported` has been marked deprecated but not removed due to backwards compatibility reasons. Users can set either of them but `Html5QrcodeConfigs` one will take precedence if set. Once further support is added to browsers, this can be set as true by default. ##### TODOS - [ ] Update documentation on readme. - [ ] Update documentation on [qrcode.minhazav.dev](https://qrcode.minhazav.dev). - [ ] Publish article around this.
- Loading branch information
Showing
17 changed files
with
364 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@ECHO OFF | ||
:: This is a script for running tests on Windows OS. | ||
|
||
ECHO Initiating test script. | ||
|
||
mocha -r tsconfig-paths/register --timeout 200000 output/tests/**/*.test.js output/tests/tests/ui/scanner/*.test.js | ||
|
||
ECHO Cleaning up test artifacts | ||
|
||
rmdir /s /q .\\output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
## Build Script | ||
|
||
echo 'Initiating test script.' | ||
|
||
mocha -r tsconfig-paths/register \ | ||
-r jsdom-global/register \ | ||
--timeout 200000 \ | ||
output/tests/**/*.test.js \ | ||
output/tests/tests/ui/scanner/*.test.js | ||
|
||
echo 'Cleaning up test artifacts' | ||
rm -Rf ./output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.