A client of my company asked for the customization of the JavaScript builtin confirm() dialogs: they wanted to replace the standard text ("OK" and "Cancel") on the dialog's buttons with "Yes" and "No" labels. I did some web-crawling on the topic and arrived at
Steve's Custom Alert Demonstration. This was a good start, but it lacked several features that I was looking for, so I decided to write my own pseudo-modal dialog handler library.
Take a look at the included
example!
A colleague of mine suggested that I should take a look at the various, already existing JavaScript libraries out there. He pointed me to the following:
- Prototype JavaScript Framework
- MochiKit - a lightweight JavaScript library
- Dojo Toolkit
These are very fine libraries, however the first two lacked a dialog demonstration and the latter is very huge. One must include a JS file of over 100KB in the page in case of Dojo!
I choose to write my own dialog handler based on some code/ideas of Dojo, some ideas from Steve's dialog handler and adding my own ideas, etc. The result became a ~10K library that supports displaying of pseudo-modal dialogs in a crossbrowser-compatible way.
It's far from perfect, but it suits my needs perfectly.
I've also created an example html page so others can have a quick start with it.
I read through the license of Dojo (v0.2.2) and found no restrictions on the licensing of derivative works, so I choose to license my stuff under LGPL. Please, contact me if I'm wrong with my previous assumption and I'll be happy to change the licensing of my toolkit to anything that complies with Dojo's licensing.
Comments
MTK v0.3
MTK v0.5
MTK v0.6
MTK v0.7