Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eston/dialog
An MIT-licensed, lightweight jQuery dialog.
https://github.com/eston/dialog
Last synced: 14 days ago
JSON representation
An MIT-licensed, lightweight jQuery dialog.
- Host: GitHub
- URL: https://github.com/eston/dialog
- Owner: eston
- Created: 2010-03-05T03:29:52.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-04-14T23:45:17.000Z (over 14 years ago)
- Last Synced: 2024-10-15T12:16:31.113Z (about 2 months ago)
- Language: JavaScript
- Homepage: http://github.com/eston/dialog
- Size: 97.7 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
Awesome Lists containing this project
README
h1. dialog
Dialog is a _very simple_ jQuery-based plugin for creating, well, dialogs that I wrote for use at "isocket":http://isocket.com/. There's no CSS, but the jQuery plugin itself is free for use under the MIT license (which jQuery also uses.) Feel free to use it in your projects, as a gift from this startup to yours.
h2. Usage
Dialog is simple: you have $.dialog.show() and $.dialog.hide().
To wrap a dialog around this with a simple OK button, you don't have to do much:
@$.dialog.show({ title: 'Dialog Title', body: 'This is some text I want to put in the dialog' });@
*dialog* will do the rest.
h3. Custom buttons and button callbacks
The common _OK_ button state will simply close the window. If you wish to make custom callback functions or process data, you may create your own button objects and pass them along in the _buttons_ parameter. *dialog* will accept an array of objects and parse them into multiple buttons. The _button_ object type allows for three properties: _caption_, _class_ and _callback_. For example, a button captioned _LOL_ with class _lmao_ and a callback which fires the alert _lmfao_ would be added to the dialog parameters as follows:
@$.dialog.show({ title: 'Dialog Title', body: 'some text', buttons: '{caption: 'LOL', class: 'lmao', callback: function() { alert('lmfao'); }});@
Note that a _buttons_ array with a length of 1 will be parsed equivalently.
h2. Support
Note that *dialog* is not officially supported by me or isocket — use it at your own risk. Upstream patches may be submitted to me at [email protected].