Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HichemTab-tech committed Aug 1, 2023
1 parent 4fb62ea commit 73470df
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ You can install EasyCaptchaJS via npm:
You can also include EasyCaptchaJS directly from a CDN by adding the following script tag to your HTML file:

```HTML
<script src="https://cdn.jsdelivr.net/gh/HichemTab-tech/EasyCaptchaJS@1.0.1/dist/easycaptcha.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/HichemTab-tech/EasyCaptchaJS@1.1.0/dist/easycaptcha.min.js"></script>
```

### Local Download
Expand Down
22 changes: 21 additions & 1 deletion dist/easycaptcha.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* EasyCaptchaJS v1.0.1
* EasyCaptchaJS v1.1.0
* (c) HichemTech
* Released under the MIT License.
* Github: https://github.com/HichemTab-tech/EasyCaptchaJS
Expand Down Expand Up @@ -70,6 +70,26 @@ const EasyCaptcha = function (options = {}, ...args) {
let results = [];

const methods = {
'getTarget': function (results, data, args) {
if (args.length !== 0) {
if (args[0].startsWith('#')) args[0] = args[0].substring(1);
if (args[0] === data.parentId) {
let res = {
parentElement: $("#" + data.parentId),
data: data
};
results.push(res);
}
}
else{
let res = {
parentElement: $("#" + data.parentId),
data: data
};
results.push(res);
}
return results;
},
'verify': function (results, data, args) {
if (args.length !== 0) {
if (args[0].startsWith('#')) args[0] = args[0].substring(1);
Expand Down
4 changes: 2 additions & 2 deletions dist/easycaptcha.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easycaptchajs",
"version": "1.0.1",
"version": "1.1.0",
"description": "EasyCaptchaJS is a lightweight and user-friendly jQuery/JS library that simplifies the integration of Google reCAPTCHA API into web pages. With EasyCaptchaJS, developers can effortlessly add the security and anti-bot protection of Google reCAPTCHA to their applications. The library dynamically imports the Google reCAPTCHA API script, handles event bindings and listeners, and initiates the reCAPTCHA checkbox within a specified parent container. Developers can take advantage of powerful options, including customizable success/failure listeners, verification checks, and a getter function to access the reCAPTCHA secret code for further processing. Streamline your web application's security with EasyCaptchaJS and ensure a smooth user experience.",
"main": "index.js",
"scripts": {
Expand Down
20 changes: 20 additions & 0 deletions src/easycaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ export const EasyCaptcha = function (options = {}, ...args) {
let results = [];

const methods = {
'getTarget': function (results, data, args) {
if (args.length !== 0) {
if (args[0].startsWith('#')) args[0] = args[0].substring(1);
if (args[0] === data.parentId) {
let res = {
parentElement: $("#" + data.parentId),
data: data
};
results.push(res);
}
}
else{
let res = {
parentElement: $("#" + data.parentId),
data: data
};
results.push(res);
}
return results;
},
'verify': function (results, data, args) {
if (args.length !== 0) {
if (args[0].startsWith('#')) args[0] = args[0].substring(1);
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const webpack = require("webpack");
// noinspection JSUnresolvedReference
let bannerPlugin = new webpack.BannerPlugin({
banner: `/*!
* EasyCaptchaJS v1.0.1
* EasyCaptchaJS v1.1.0
* (c) HichemTech
* Released under the MIT License.
* Github: https://github.com/HichemTab-tech/EasyCaptchaJS
Expand Down

0 comments on commit 73470df

Please sign in to comment.