<commit_before>A widget to estimate the cost of hiring in France

> Module Web d'estimation du coût d'une embauche en France.

**[Online demo](http://sgmap.github.io/cout-embauche/)**.

If you want to create your own specific interface, have a look at the [API documentation](http://embauche.sgmap.fr/api-cotisations-sociales).


Usage
-----

Include this line where you want the widget to appear in your page:

```html
 <script src="http://embauche.sgmap.fr/modules/pointe/cout-embauche-widget.js"></script>
 ```

> Reminder: this widget is in beta and may be updated at any time. Please send an email to embauche[AT]sgmap.fr to request being sent potentially breaking update notices.

### Using with Bootstrap

If you use [Twitter Bootstrap version 2 CSS](http://getbootstrap.com/2.3.2/), an integration is provided. Simply add the following line after the inclusion of the widget:

```html
<script async src="http://embauche.sgmap.fr/modules/pointe/bootstrap-compat.js"></script>
```

> If you use version [Bootstrap version 3](http://getbootstrap.com), no compatibility line should be required.  

Browser compatibility
---------------------

### [Continuously tested](https://circleci.com/gh/sgmap/cout-embauche) on:

[![Integration Tests Results](https://saucelabs.com/browser-matrix/sgmap-embauche-bot.svg)](https://saucelabs.com/u/sgmap-embauche-bot)


### Also known to be compatible with:

- IE10.
- Safari 8.
- Opera 28.

> These tests are run manually and may not be as up-to-date as the above.


### Not compatible with:

- IE < 10.
- Safari < 5.1.
- Opera < 11.5.


JS API
---

The JS API is exposed in `window.Embauche`.

At the moment, it depends on the widget being present in the DOM to load the configuration from it.

> Please open an issue if you want to consume the API in a different way.


### `window.Embauche.OpenFisca.getLastResults()`

Returns the currently-displayed computed simulation data, as an object containing the OpenFisca-computed values, as identifiers from the OpenFisca [legislation](http://legislation.openfisca.fr) mapped to `Number` values.


### `window.Embauche.OpenFisca.get([additionalParameters], callback)`

Calls the Paie API, parameterised with the current state of the form.

You can adjust the situation to compute by passing an object as the first argument (`additionalParameters`). The parameters you can use are documented in the [Paie API](http://embauche.sgmap.fr/api/doc).

This function takes a callback as last argument. This callback will be called with three parameters:

- An optional error. The failed `XMLHttpRequest`, or a `SyntaxError` if the fetched OpenFisca value is not properly formatted.
- An object containing the OpenFisca-computed values, as identifiers from the OpenFisca [legislation](http://legislation.openfisca.fr) mapped to `Number` values.
- The full OpenFisca [response](http://embauche.sgmap.fr/api/doc) if you need everything it sends back.

#### Example:

```js
window.Embauche.OpenFisca.get({
	zone_revitalisation_rurale: true
}, function(error, results) {
	if (error) throw error;
	window.alert('Employer would pay ' + results.salaire_super_brut + ' if this geographic zone was elected as a ZRR.')
});
```


### `window.Embauche.OpenFisca.buildURL([additionalParameters])`

Prepares a `GET` query to the [Paie API](http://embauche.sgmap.fr/api/doc), parameterised with the current state of the form.

You can adjust the situation to compute by passing an object as the first argument (`additionalParameters`). The parameters you can use are documented in the [Paie API](http://embauche.sgmap.fr/api/doc).

Returns the OpenFisca URL to `GET` to obtain results, as documented in the [`/formula` API](http://embauche.sgmap.fr/api/doc).

> If you simply want to obtain the results of calling this API, use `Embauche.OpenFisca.get`.


Build<commit_msg>Update readme js API section<commit_after>A widget to estimate the cost of hiring in France

> Module Web d'estimation du coût d'une embauche en France.

**[Online demo](http://sgmap.github.io/cout-embauche/)**.

If you want to create your own specific interface, have a look at the [API documentation](http://embauche.sgmap.fr/api-cotisations-sociales).


Usage
-----

Include this line where you want the widget to appear in your page:

```html
 <script src="http://embauche.sgmap.fr/modules/pointe/cout-embauche-widget.js"></script>
 ```

> Reminder: this widget is in beta and may be updated at any time. Please send an email to embauche[AT]sgmap.fr to request being sent potentially breaking update notices.

### Using with Bootstrap

If you use [Twitter Bootstrap version 2 CSS](http://getbootstrap.com/2.3.2/), an integration is provided. Simply add the following line after the inclusion of the widget:

```html
<script async src="http://embauche.sgmap.fr/modules/pointe/bootstrap-compat.js"></script>
```

> If you use version [Bootstrap version 3](http://getbootstrap.com), no compatibility line should be required.  

Browser compatibility
---------------------

### [Continuously tested](https://circleci.com/gh/sgmap/cout-embauche) on:

[![Integration Tests Results](https://saucelabs.com/browser-matrix/sgmap-embauche-bot.svg)](https://saucelabs.com/u/sgmap-embauche-bot)


### Also known to be compatible with:

- IE10.
- Safari 8.
- Opera 28.

> These tests are run manually and may not be as up-to-date as the above.


### Not compatible with:

- IE < 10.
- Safari < 5.1.
- Opera < 11.5.


JS API
---

The JS API is exposed in `window.Embauche`.

At the moment, it depends on the widget being present in the DOM to load the configuration from it.

> Please open an issue if you want to consume the API in a different way.


### `window.Embauche.OpenFisca.getLastResults()`

Returns the currently-displayed computed simulation data, as an object containing the OpenFisca-computed values, as identifiers from the OpenFisca [legislation](http://legislation.openfisca.fr) mapped to `Number` values.


### `window.Embauche.OpenFisca.get([additionalParameters], callback)`

Calls the Paie API, parameterised with the current state of the form.

You can adjust the situation to compute by passing an object as the first argument (`additionalParameters`). The parameters you can use are documented in the [Paie API](http://embauche.sgmap.fr/api/doc).

This function takes a callback as last argument. This callback will be called with three parameters:

- An optional error. The failed `XMLHttpRequest`, or a `SyntaxError` if the fetched OpenFisca value is not properly formatted.
- An object containing the OpenFisca-computed values, as identifiers from the OpenFisca [legislation](http://legislation.openfisca.fr) mapped to `Number` values.
- The full OpenFisca [response](http://embauche.sgmap.fr/api/doc) if you need everything it sends back.

If the callback is not input, returns the OpenFisca `GET` URL to obtain the results, as documented in the [`/formula` API](http://embauche.sgmap.fr/api/doc).

#### Example:

```js
window.Embauche.OpenFisca.get({
	zone_revitalisation_rurale: true
}, function(error, results) {
	if (error) throw error;
	window.alert('Employer would pay ' + results.salaire_super_brut + ' if this geographic zone was elected as a ZRR.')
});
```

Build
{'fraction_non_alphanumeric': 0.11429362114293622, 'fraction_numerical': 0.0047045800470458, 'mean_word_length': 4.252906976744186, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 22, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, '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': '695584', 'n_tokens_mistral': 2238, 'n_tokens_neox': 2169, 'n_words': 817}