MTK (Müzso Toolkit)

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. Smile 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:
  1. Prototype JavaScript Framework
  2. MochiKit - a lightweight JavaScript library
  3. 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! Shock

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. Smile It's far from perfect, but it suits my needs perfectly. Wink 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. Smile

AttachmentSize
mtk-0.1.zip4.22 KB
mtk-0.2.zip5.22 KB
mtk-0.3.zip5.97 KB
mtk-0.4.zip5.97 KB
mtk-0.5.zip6.72 KB
mtk-0.6.zip6.99 KB
mtk-0.7.zip7.01 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

MTK v0.3

The first two versions had a bug, when used in IE: the dialog layer did not cover underlying form elements properly. An IFRAME had to be added "below" the dialog layer to fix this. This idea came from Dojo as well.

MTK v0.5

Added the xmlhttp object. It provides a wrapper for various browsers' XmlHttp support, a httpGet() and a httpPost() method. This functionality was glued together from Drupal's XmlHttp wrapper and some of Dojo's ideas.

MTK v0.6

Fixed: using mtk.js on a page served over SSL (a "https://" url) caused the following warning to appear: "This page contains both secure and nonsecure items. Do you want to display the nonsecure items?"

MTK v0.7

Added IE7 compatibility.