<commit_before>VividCortex reCaptcha AngularJS Directive
=========================================

Use this directive to be able to submit with XHR a form that contains a reCaptcha.


Demo
====

See demo/test.html for an usage example. Keep in mind that the captcha only works from a domain and with a correct re-captcha key, so this file wont work if you just load it in your browser.


Usage
=====

You need first to get a valid public key for your domain. See http://www.google.com/recaptcha.

Then, in your view, you need to place a container for the captcha:

```html
    <div
        vc-recaptcha
        ng-model="model.captcha"
        key="---- YOUR PUBLIC KEY GOES HERE ----"
    ></div>
```

In this case we are mapping the captcha data to the scope property ```model.captcha```. If you inspect the value of this roperty you'll see something like:

```json
{
    "response": "foo bar",
    "challenge": "<KEY>"
}
```

This object contains the two values needed to validate the captcha in your server. ```response``` is the response of the user, and ```challenge``` is the identification of the response.

To validate this object from your server, you need to use one of the [server side plugins](https://developers.google.com/recaptcha/docs/) or [roll your own](https://developers.google.com/recaptcha/docs/verify).


Other Parameters
================

You can optionally pass other parameters to the captcha, as html attributes:

```html
    <div
        vc-recaptcha
        ng-model="model.captcha"
        tabindex="3"
        theme="clean"
        lang="en"
        key="---- YOUR PUBLIC KEY GOES HERE ----"
    ></div>
```

In this case we are specifying that the captcha should use the theme named 'clean', display the texts in english language and the captcha input should have tabindex 3.
<commit_msg>[docs] - added some info to the readme file<commit_after>VividCortex reCaptcha AngularJS Directive
=========================================

Use this directive to be able to submit with XHR a form that contains a reCaptcha.


Demo
====

See demo/test.html for an usage example. Keep in mind that the captcha only works when used from a real domain and with a valid re-captcha key, so this file wont work if you just load it in your browser.


Usage
=====

You need first to get a valid public key for your domain. See http://www.google.com/recaptcha.

Then, in your view, you need to place a container for the captcha:

```html
    <div
        vc-recaptcha
        ng-model="model.captcha"
        key="---- YOUR PUBLIC KEY GOES HERE ----"
    ></div>
```

In this case we are mapping the captcha data to the scope property ```model.captcha```. If you inspect the value of this roperty you'll see something like:

```json
{
    "response": "foo bar",
    "challenge": "<KEY>"
}
```

This object contains the two values needed to validate the captcha in your server. ```response``` is the response of the user, and ```challenge``` is the identification of the captcha that your user resolved.

To validate this object from your server, you need to use one of the [server side plugins](https://developers.google.com/recaptcha/) or [roll your own](https://developers.google.com/recaptcha/docs/verify).


Other Parameters
================

You can optionally pass other parameters to the captcha, as html attributes:

```html
    <div
        vc-recaptcha
        ng-model="model.captcha"
        tabindex="3"
        theme="clean"
        lang="en"
        key="---- YOUR PUBLIC KEY GOES HERE ----"
    ></div>
```

In this case we are specifying that the captcha should use the theme named 'clean', display the texts in english language and the captcha input should have tabindex 3.

{'fraction_non_alphanumeric': 0.12469635627530365, 'fraction_numerical': 0.0010796221322537112, 'mean_word_length': 3.36, 'pattern_counts': {'":': 4, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6140589', 'n_tokens_mistral': 1078, 'n_tokens_neox': 994, 'n_words': 484}