<commit_before># Demo
Simple, light and flexible js dialogue.
http://mwyatt.github.io/dialogue/
# Installation
```bash
npm install mwyatt-dialogue --save
```
```javascript
var dialogueFactory = require('mwyatt-dialogue');
var dialogue = new dialogueFactory();

dialogue.create({
  title: 'Hello World'
});
```
## Options
| Property | Value |
| --- | --- |
| `title` | `string` Gives the dialogue a title. |
| `description` | `string` Gives the dialogue a description. |
| `hardClose` | `bool` `default: false` If true, only clicking the cross in the corner will close the dialogue. |
| `className` | `string` Appends the class name string to the dialogue when rendering. This allows for unique styling within specific dialogues. |
| `positionTo` | `object` Pass a jquery selection here and the dialogue will be positioned to it when it opens. |
| `draggable` | `bool` `default: false` If true, makes the dialogue draggable. |
| `actions` | Specify any buttons required for the dialogue and the callback functions which will execute when clicked. `actions: {'Name': function() {}}` |
| `ajax` | `bool` `default: false` If true, the dialogue is created with a CSS spinner in the body. The ajax request must be handled separately. |
| `onComplete` | `function` Callback function, fired when dialogue has been fully rendered and positioned. |
| `onClose` | `function` Fired when dialogue has been closed. |
| `mask` | `bool` `default: false` If true, the browser view port is masked/obscured slightly. |
| `html` | `string` Insert html directly into the dialogue. |
| `hideClose` | `bool` `default: false` If true, hides the closing cross from the corner. |
| `width` | `integer` Integer specifying exact pixel width for dialogue. |<commit_msg>readme methods<commit_after># Demo
Simple, light and flexible js dialogue.
http://mwyatt.github.io/dialogue/
# Installation
```bash
npm install mwyatt-dialogue --save
```
```javascript
var dialogueFactory = require('mwyatt-dialogue');
var dialogue = new dialogueFactory();

dialogue.create({
  title: 'Hello World'
});
```
## Options
| Property | Value |
| --- | --- |
| `title` | `string` Gives the dialogue a title. |
| `description` | `string` Gives the dialogue a description. |
| `hardClose` | `bool` `default: false` If true, only clicking the cross in the corner will close the dialogue. |
| `className` | `string` Appends the class name string to the dialogue when rendering. This allows for unique styling within specific dialogues. |
| `positionTo` | `object` Pass a jquery selection here and the dialogue will be positioned to it when it opens. |
| `draggable` | `bool` `default: false` If true, makes the dialogue draggable. |
| `actions` | Specify any buttons required for the dialogue and the callback functions which will execute when clicked. `actions: {'Name': function() {}}` |
| `ajax` | `bool` `default: false` If true, the dialogue is created with a CSS spinner in the body. The ajax request must be handled separately. |
| `onComplete` | `function` Callback function, fired when dialogue has been fully rendered and positioned. |
| `onClose` | `function` Fired when dialogue has been closed. |
| `mask` | `bool` `default: false` If true, the browser view port is masked/obscured slightly. |
| `html` | `string` Insert html directly into the dialogue. |
| `hideClose` | `bool` `default: false` If true, hides the closing cross from the corner. |
| `width` | `integer` Integer specifying exact pixel width for dialogue. |
## Methods
Various methods can be called upon once the dialogue is created.
```javascript
dialogue.close();
```
| Method | Action |
| --- | --- |
| `close` | Closes the dialogue and removes any events. |
| `setHtml` | `string` Replaces the html area with the passed string. |
| `setTitle` | `string` Replaces the title area with the passed string. |
| `reposition` | Centers the dialogue in the viewport. |
| `isOpen` | `returns bool` Returns true if the dialogue is curerntly open.  |
{'fraction_non_alphanumeric': 0.12074615578522813, 'fraction_numerical': 0.0, 'mean_word_length': 4.458046767537827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6753632', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1092, 'n_words': 497}