Navigation
MavDialog v0.1.1 (A mootools more library)
MavDialog is a light-weight, easy to use and customizable replacement for system dialog windows. It contains child classes for replacing the default alert, prompt, and confirm dialog boxes as well. There are options for forcing user input (by preventing user access to the rest of the page) and the message of the dialog box can be loaded from a string, adopted from an existing DOM element, generated by a function, or retrieved by an Ajax request.
MavDialog boxes can be dragged, and use effects for showing/hiding. This is an early version, and most of the CSS customization hasn't been moved out to the options yet, but it is easily done if so desired.
Discussion
For now, all discussion will be located at the unofficial mootools forum. Partly because i think people will probably look there for it anyway, partly i hate setting up forums, and also because right now i'm feeling lazy. ^_^
Discuss MavDialog on the unofficial mootools forumDownload MavDialog
mavDialog requires both mootools core 1.2+ and mootools more 1.2 (atleast the Drag and Drag.Move). You will also need the base CSS classes provided in the file below, as well as the class.MavDialog.js.
Get the newest Mootools Core Example CSS file MavDialog Javascript (Uncompressed) MavDialog Example Zip
Back to topExamples
Back to topUsage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mavenous MavDialog</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet"
type="text/css" href="/library/public/mavdialog/mavdialog.css" />
<script type="text/javascript"
src="/library/code/js/core/mootools-1.2.2-core.js"></script>
<script type="text/javascript"
src="/library/code/js/core/mootools-1.2.2.1-more.js"></script>
<script type="text/javascript"
src="/library/public/mavdialog/class.MavDialog.js"></script>
<script type="text/javascript">
var mdialog = [];
function create_mdialog() {
mdialog[0] = new MavDialog({
'force': true,
'title': 'MavDialog Demonstration',
'message': 'This is the content for the dialog box.',
'draggable': true
});
}
function create_alertDialog() {
mdialog[3] = new MavDialog.Alert({
'title': 'MavDialog Alert Box',
'message': 'This is the message dialog box'
});
}
function create_confirmDialog() {
mdialog[4] = new MavDialog.Confirm({
'title': 'MavDialog Confirm Dialog',
'message': 'confirm dialog box',
'callback': display_confirm
});
}
function create_promptDialog() {
mdialog[5] = new MavDialog.Prompt({
'title': 'MavDialog Prompt Dialog',
'message': 'prompt dialog box',
'callback': display_prompt
});
}
function display_confirm(_confirmed) {
// do something with _confirmed
}
function display_prompt(_prompted) {
// do something with _prompted
}
</script>
</head>
<body>
<a href="#" onclick="create_mdialog()">Default Dialog</a> |
<a href="#" onclick="create_alertDialog()">Alert Dialog</a> |
<a href="#" onclick="create_confirmDialog()">Confirm Dialog</a> |
<a href="#" onclick="create_promptDialog()">Prompt Dialog</a><br />
</body>
</html>
Back to top
Syntax
new MavDialog({
'title': 'Dialog Header',
'message': 'This is what will show up in the content of the dialog box.'
});
Back to top
Arguments
-
JSON object used to set MavDialog options.
(Object)
A JSON object containing the options to be set.
Returns
(Object)
The MavDialog object(null)
If an error occurred, null is returned.
Options
Back to topCompatibility
Tested and working with:- Firefox 2 / Firefox 3
- IE 7, IE 8
- Opera 9.63
- Google Chrome 1.0.154.59
Changelog
-
v 0.1.1 - April 26th, 2009
- Initial public early beta release.