IMPORTANT: Please read this blog post before updating. The latest version, by default, breaks compatibility with previous versions!
I am happy to announce that dialogWrapper 2.1 has been released! Download/read about it at BitBucket: https://bitbucket.org/MostThingsWeb/dialogwrapper
The biggest change is that all methods are now namespaced! For example, instead of writing:
$.alert("This is an alert dialog!");
… by default you must now write:
$.dW.alert("This is an alert dialog!");
Why did I do this? Well, I was getting concerned about my polluting the global
$ namespace. It should now be easier for my plugin to work with other plugins that may have used the same or similar function names.
But that breaks compatibility!?
You can use the new
$.dW.classicMode() method to restore the old style functions. Just call it once, with no arguments. Then you can go back to using
$.createDialog and friends instead of the new namespaced versions.
What else is new?
This version has a few new nice features:
- The callbacks for
$.dW.input()are now executed within the context of the dialog. That means that you can now use
thiswithin the handler to reference the dialog.
- I added a callback to
$.dW.alert()that is executed when the Ok button is clicked.
- Options that dialogWrapper adds, with
hasClosebeing the only one so far, are now defaulted in
$.ui.dialog.prototype.options, along with native options. This way, you can easily modify the default
- You can now change the
hasCloseoption at runtime using the usual method.
- From this version forward, you can access the version string using
- I’ve exposed
$.dW.findDialog, which is a utility method that attempts to resolve the given identifier to a dialog object.
- I’ve removed the
smartModalsoptions since they became redundant.
- The default prefix for dialog IDs is now
- A few bug fixes.
- A couple of internal changes; if you are interested, read the full changelog in the source.