Skip to content

eston/dialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

dialog

Dialog is a very simple jQuery-based plugin for creating, well, dialogs that I wrote for use at isocket. 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.

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.

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.

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 eston@socialuxe.com.

About

An MIT-licensed, lightweight jQuery dialog.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published