SuperDialog v1.0 by Markus F. Hay

License

Creative Commons License
This work is licensed under a Creative Commons Attribution 2.5 License.

Overview

SuperDialog is meant to replace the generic modal alert and prompt dialogs provided by JavaScript. SuperDialog offers the ability to set a title and format the "body" of the dialog using HTML, if desired. Also, SuperDialog offers 5 types of dialogs:

For an example of SuperDialog in action, see the demo page.

[more info]

Browser Compatibility

While browser compatibility was in mind from the start, not all browsers were available for testing. These browsers include Safari, Netscape, and Linux-only browsers such as Konquerer. The major browsers that were tested cover approximately 98% of browsers in use, so it's fairly safe to say that no major problems will arise.

[more info]


How To Use

[Download SuperDialog]

To use SuperDialog, add the following line to the <head> of your document:

<script type="text/javascript" language="javascript" src="superdialog/superdialog.js"></script>

Next, the image path in superdialog.js must be set. Open superdialog.js and find the member variable this.url. Set this to the correct path where the images for SuperDialog are located. If, for example, the SuperDialog directory is in a directory named "js" in the root of the website, then you would set it as follows:

this.url = 'http://www.mysite.com/js/superdialog/';

Finally, you should set, at a minimum, the type of dialog you want to use, the title of the dialog, and a description that you'll want to place in the dialog body. The following quick start example will set up a simple information dialog.

myDialog.setDialog('INFO','The Title','The Description');
myDialog.start();	// show the dialog

[more info]


Documentation (API)

Below is a listing of public functions which are used to setup "SuperDialog".

myDialog.action() [more info]

myDialog.getButtonClicked() [more info]

myDialog.setDetails(sDetails) [more info]

myDialog.setDialog(sType, sTitle, sDetails) [more info]

myDialog.setTitle(sTitle) [more info]

myDialog.setType(sType) [more info]

myDialog.start() [more info]