Skip to content

This library provides a custom modal dialog box overriding the Window.alert() function.

License

Notifications You must be signed in to change notification settings

AlexandreRozier/ModalDialogBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

#ModalDialogBox

This library provides a modal dialog box, overriding the well-known Window.alert() function.

To begin with, you just have to include this lib via a <script> tag :

<script src="ModalPopupWindow.js" type="text/javascript"></script>
<script type="text/javascript">
    alert();
</script>

The main features are :

  1. Adding and removing buttons
  2. Customize completely each component (color, background, text, ...)
  3. Adding special actions to the buttons clicks
  4. Adding callback functions triggered when the dialog is dismissed

Customizing the ModalDialog is really simple, all you have to do is chain the modification methods, as follows :

    alert().setActionBarText("My custom title")
            .setContentText("Very interesting content")
            .addButton("My Button", "Click me !", myCallBackFunction)
            .setContentColor("#949A9C")

I hope this will give you a hand ! It is under the MIT license, so feel free to use it.

About

This library provides a custom modal dialog box overriding the Window.alert() function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published