Skip to content

Commit

Permalink
Merge pull request #66 from mCaptcha/prep-vanilla-glue-0.1.0-rc2
Browse files Browse the repository at this point in the history
Prep vanilla glue 0.1.0 rc2
  • Loading branch information
realaravinth authored Nov 6, 2023
2 parents 1ba0f45 + d3805df commit d66d22f
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 14 deletions.
49 changes: 49 additions & 0 deletions packages/vanilla/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,55 @@
- external: changes within the library that affect API exposed to end
users

## 0.1.0-rc2

### Fixed

- [internal] typo

## 0.1.0-rc1

## Changed

- [external] Installation code: We've added the ability to use mCaptcha with JavaScript disabled by
[using a CLI tool](https://mcaptcha.org/docs/user-manual/cli). Installation code for `0.1.0-rc1`:

```html
<label
data-mcaptcha_url="{{paste your widget link here}}"
for="mcaptcha__token"
id="mcaptcha__token-label"
>
mCaptcha authorization token.
<a
href="https://mcaptcha.org/docs/user-manual/how-to-mcaptcha-without-js/"
>Instructions</a
>.
<input type="text" name="mcaptcha__token" id="mcaptcha__token" />
</label>
<div id="mcaptcha__widget-container"></div>
<script src="https://unpkg.com/@mcaptcha/vanilla-glue@0.1.0-rc2/dist/index.js"></script
```
Please preserve the `id` on the `<label>` and `<input>` elements.
They will be marked hidden by the JavaScript library.
Installation code **pre** `0.1.0-rc1`:
```html
<div id="mcaptcha__widget-container"></div>
<script
src="https://unpkg.com/@mcaptcha/vanilla-glue@0.1.0-alpha3/dist/index.js"
>
</script
<script charset="utf-8">
let config = {
widgetLink: new URL( "{{ your widget link }}"),
};
new mcaptchaGlue.default(config);
</script>
```

## `0.1.0-alpha-2`

### Changed
Expand Down
26 changes: 14 additions & 12 deletions packages/vanilla/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ Add this snippet to the form which requires to be protected using
mCaptcha

```html
<div
id="mcaptcha__widget-container"
></div>
<script src="../dist/index.js"></script>
<script charset="utf-8">
let config = {
widgetLink: new URL(
"https://demo.mcaptcha.org/widget/?sitekey=pHy0AktWyOKuxZDzFfoaewncWecCHo23"
),
};
new mcaptchaGlue.default(config);
</script>
<label
data-mcaptcha_url="{{paste your widget link here}}"
for="mcaptcha__token"
id="mcaptcha__token-label"
>
mCaptcha authorization token.
<a
href="https://mcaptcha.org/docs/user-manual/how-to-mcaptcha-without-js/"
>Instructions</a
>.
<input type="text" name="mcaptcha__token" id="mcaptcha__token" />
</label>
<div id="mcaptcha__widget-container"></div>
<script src="https://unpkg.com/@mcaptcha/vanilla-glue@0.1.0-rc2/dist/index.js"></script
```
## Example
Expand Down
2 changes: 1 addition & 1 deletion packages/vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Aravinth Manivannan <realaravinth@batsense.net>",
"name": "@mcaptcha/vanilla-glue",
"description": "glue code to setup mCaptcha on your website",
"version": "0.1.0-rc1",
"version": "0.1.0-rc2",
"license": "(MIT OR Apache-2.0)",
"keywords": [
"mCaptcha",
Expand Down
2 changes: 1 addition & 1 deletion packages/vanilla/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const run = () => {
new Widget(config);
} else {
throw new Error(
`Couldn't find "mcaptcha_url" dataset in elmement (ID=${INPUT_LABEL_ID})`
`Couldn't find "mcaptcha_url" dataset in element (ID=${INPUT_LABEL_ID})`
);
}
};
Expand Down

0 comments on commit d66d22f

Please sign in to comment.