diff --git a/.github/skills/update-sample-html-tracking-and-license/SKILL.md b/.github/skills/update-sample-html-tracking-and-license/SKILL.md new file mode 100644 index 00000000..b7d29a46 --- /dev/null +++ b/.github/skills/update-sample-html-tracking-and-license/SKILL.md @@ -0,0 +1,41 @@ +--- +name: update-sample-html-tracking-and-license +description: 'Batch update HTML samples. Use this to batch-replace GTM code in HTML, move the `noscript` and `script` tags to the beginning of the `body`, batch-replace Dynamsoft license strings, and standardize sample tracking snippets.' +argument-hint: 'Describe the target HTML scope and whether to update GTM, license, or both.' +user-invocable: true +--- + +# Update Sample HTML Tracking And License + +## When to Use +- Batch update GTM snippets in sample HTML files. +- Move GTM `noscript` and `script` blocks to the start of ``. +- Replace an old Dynamsoft sample license string with a new one. +- Normalize multiple sample pages to the same HTML tracking structure. + +## Inputs To Confirm +- Which HTML files are in scope. +- Whether the task is GTM only, license only, or both. +- The exact old and new strings if replacing license values. +- Whether the GTM block should be inserted in `` or at the start of ``. +- Whether `frameworks/**/*.html` should be excluded. Default: exclude framework HTML from license replacement unless explicitly requested. + +## Procedure +1. Search the repository for the current GTM ID or license string to get the exact file list. +2. Inspect 2 to 3 representative files to confirm whether the GTM block is in ``, between `` and ``, or already inside ``. +3. If updating GTM placement, remove the existing block from its current location and insert the canonical block from [assets/gtm-block.html](./assets/gtm-block.html) immediately after ``. +4. If updating license text, replace only the exact old license string and leave surrounding code untouched. +5. By default, exclude `frameworks/**/*.html` from license replacement unless the user explicitly includes framework HTML. +6. Verify there are no remaining GTM blocks under `` or between `` and ``. +7. Verify the GTM block appears once per target file at the start of ``. +8. Verify the old license string no longer exists in the intended non-framework files and that framework HTML retains its original license unless explicitly included. + +## Output Expectations +- Minimal, scoped HTML edits only. +- No unrelated formatting changes. +- A short report with file count, what changed, and verification results. + +## Notes +- For HTML validity, `noscript` with iframe should live under ``. +- Keep the `script` and `noscript` together when the request is to standardize placement. +- Prefer repository-local skill reuse for this sample set. diff --git a/.github/skills/update-sample-html-tracking-and-license/assets/gtm-block.html b/.github/skills/update-sample-html-tracking-and-license/assets/gtm-block.html new file mode 100644 index 00000000..f1eda6ac --- /dev/null +++ b/.github/skills/update-sample-html-tracking-and-license/assets/gtm-block.html @@ -0,0 +1,28 @@ + + diff --git a/.github/skills/update-sample-html-tracking-and-license/assets/license-key.txt b/.github/skills/update-sample-html-tracking-and-license/assets/license-key.txt new file mode 100644 index 00000000..1776ed5b --- /dev/null +++ b/.github/skills/update-sample-html-tracking-and-license/assets/license-key.txt @@ -0,0 +1,2 @@ +OLD=DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9 +NEW=DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ== diff --git a/hello-world.html b/hello-world.html index b78fb99b..4b0dd9ae 100644 --- a/hello-world.html +++ b/hello-world.html @@ -13,6 +13,34 @@ + +

Hello World (Scan Barcode via Camera)

@@ -22,7 +50,7 @@

Hello World (Read an Image)

@@ -30,7 +58,7 @@

Hello World (Read an Image)

* For more information, see https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner.html#license&utm_source=samples or contact support@dynamsoft.com. * LICENSE ALERT - THE END */ - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); const resultsContainer = document.querySelector("#results"); const pInit = (async () => { diff --git a/scan-a-single-barcode.html b/scan-a-single-barcode.html index 9dfc605d..c6f88aa9 100644 --- a/scan-a-single-barcode.html +++ b/scan-a-single-barcode.html @@ -13,6 +13,34 @@ + +

Hello World (Scan One Single Barcode via Camera)

@@ -20,7 +48,7 @@

@@ -74,7 +102,7 @@ let totalUniqueBarcodesCount = 0; let startTime; - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); const pInit = (async () => { const cameraView = await Dynamsoft.DCE.CameraView.createInstance(); const cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView); diff --git a/scenarios/cart-builder/index.html b/scenarios/cart-builder/index.html index e43fc43b..a11a1057 100644 --- a/scenarios/cart-builder/index.html +++ b/scenarios/cart-builder/index.html @@ -12,8 +12,35 @@ - + +

🛒 Scan Barcode to Add Items to Cart

@@ -52,7 +79,7 @@

Simulated Shopping Cart

Read Barcodes from Camera - Debug

@@ -36,7 +64,7 @@

Read Barcodes from Camera - Debug

* To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. diff --git a/scenarios/locate-an-item-with-barcode/index.html b/scenarios/locate-an-item-with-barcode/index.html index d8921d92..e7348574 100644 --- a/scenarios/locate-an-item-with-barcode/index.html +++ b/scenarios/locate-an-item-with-barcode/index.html @@ -13,8 +13,35 @@ - + +
@@ -87,7 +114,7 @@
/** LICENSE ALERT - README * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. * 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. diff --git a/scenarios/pick-one-to-fill/index.html b/scenarios/pick-one-to-fill/index.html index f9117d74..d84ea527 100644 --- a/scenarios/pick-one-to-fill/index.html +++ b/scenarios/pick-one-to-fill/index.html @@ -13,6 +13,34 @@ + +
@@ -58,7 +86,7 @@ const scanBtns = document.querySelectorAll(".open-btn"); const decodeBtns = document.querySelectorAll(".decode-btn"); - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); const pInit = (async () => { const cameraView = await Dynamsoft.DCE.CameraView.createInstance(); const cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView); diff --git a/scenarios/read-a-drivers-license/index.html b/scenarios/read-a-drivers-license/index.html index fff14556..f44f655b 100644 --- a/scenarios/read-a-drivers-license/index.html +++ b/scenarios/read-a-drivers-license/index.html @@ -10,8 +10,35 @@ Dynamsoft Barcode Reader Sample - Read a Driver's License - + +

Read a Driver's License

@@ -41,7 +68,7 @@

Read a Driver's License

const backToScan = document.querySelector(".back-to-scan"); const barcodeScannerView = document.querySelector(".barcode-scanner-view"); - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); Dynamsoft.DCP.CodeParserModule.loadSpec(["AAMVA_DL_ID", "SOUTH_AFRICA_DL"]); let cameraView, cameraEnhancer, cvRouter, parser; diff --git a/scenarios/read-and-parse-GS1-AI/index.html b/scenarios/read-and-parse-GS1-AI/index.html index e93e3f7b..83f30140 100644 --- a/scenarios/read-and-parse-GS1-AI/index.html +++ b/scenarios/read-and-parse-GS1-AI/index.html @@ -10,8 +10,35 @@ Dynamsoft Barcode Reader Sample - Read a GS1-AI - + + Click the play button to activate the camera.

Read a GS1-AI

@@ -57,7 +84,7 @@

Read a GS1-AI

/** LICENSE ALERT - README * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. diff --git a/scenarios/read-vin/index.html b/scenarios/read-vin/index.html index b66fbb6e..fd49552f 100644 --- a/scenarios/read-vin/index.html +++ b/scenarios/read-vin/index.html @@ -11,8 +11,35 @@ Dynamsoft Barcode Reader Sample - Read a VIN - + +

Read VIN

@@ -38,7 +65,7 @@

Read VIN

const barcodeScannerView = document.querySelector(".barcode-scanner-view"); const backToScan = document.querySelector(".back-to-scan"); - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); Dynamsoft.DCP.CodeParserModule.loadSpec("VIN"); let cameraView, cameraEnhancer, cvRouter, parser; diff --git a/scenarios/scan-1D-Industrial/index.html b/scenarios/scan-1D-Industrial/index.html index 31a32d63..0651305e 100644 --- a/scenarios/scan-1D-Industrial/index.html +++ b/scenarios/scan-1D-Industrial/index.html @@ -52,15 +52,42 @@ } - + +

Scan oneD Industrial codes

Scan oneD Retail codes

📦 Instant Product Information Lookup

Enter a UPC, EAN, or ISBN number to retrieve accurate product data from a specific database

@@ -40,7 +67,7 @@

Enter a UPC, EAN, or ISBN number to retrieve accurate product data from a sp const barcodeScannerView = document.querySelector("#barcode-scanner-view"); const searchResult = document.querySelector("#search-result"); - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); const pInit = (async () => { const cameraView = await Dynamsoft.DCE.CameraView.createInstance(); diff --git a/scenarios/scan-common-1D-and-2D/index.html b/scenarios/scan-common-1D-and-2D/index.html index 03aee1be..6373939a 100644 --- a/scenarios/scan-common-1D-and-2D/index.html +++ b/scenarios/scan-common-1D-and-2D/index.html @@ -52,15 +52,42 @@ } - + +

Scan Common 1D And 2D

Scan Common 2D codes

Scan DataMatrix codes

Scan DPM codes

Scan From Distance

Scan QR codes

Display Barcode Results as Video Overlays

Scan barcodes to display results as overlays on video

@@ -76,7 +103,7 @@

Scan barcodes to display results as overlays on video

* To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ - Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); + Dynamsoft.License.LicenseManager.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGVzIiwib3JnYW5pemF0aW9uSUQiOiIyMDAwMDAifQ=="); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days.