jaunesarmiento/fries — pull request #48 by jaunesarmiento (2013-07-01 23:31:12+00:00)
Title: Implement dialogs

Implemented dialogs. This pull request exposes a `Dialog` class in the `fries` namespace with the ff methods:
* `init()` - called when you do `new fries.Dialog(options);`. Initialises the dialog along with the `options` object. The dialog is initially hidden. Just call `show()` when you need to display the dialog.
* `show()` - Shows the dialog.
* `hide()` - Hides the dialog.

An example of the `options` object is as follows:
```javascript
{
selector: '#dialog',
okCallback: function () {
// this is called when the user presses the "OK" button inside the dialog
// do something here
// optionally, you can hide the dialog afterwards
this.hide(); // "this" refers to the dialog
},
cancelCallback: function () {
// this is called when the user presses the "Cancel" button inside the dialog
// do something else here
// usually, you just hide the dialog so:
this.hide();
}
}
```

__Notes:__
* Currently, the dialog only works with the first DOM element specified in the `selector` parameter. So if you need to create multiple dialogs, you need to call `new fries.Dialog()` on each of those elements for now.
* The `okCallback` and `cancelCallback` are optional parameters. Although it would seem pointless not to add an `okCallback`.