Archive for September 2008
Somewhat delayed but hopefully worth the wait, boxy 0.1.4 is ready. Boxy is a Facebook-style dialog library for jQuery with a rich API for manipulating windows. It’s also pretty well documented.
- Fixed issue with multiple visible modals
- Moved modal opacity value from CSS to code to appease IE (not ideal)
- Moved default options to Boxy.DEFAULTS for application-wide configurability
- Added custom callback for attaching behaviours to dialog content
- Added Boxy.alert() for displaying simple messages
- Added Boxy.confirm() helper
- Added support for unloading/removing boxy instances: boxy.unload(), boxy.hideAndUnload(after), constructor option ‘unloadOnHide’
- Boxys created with Boxy.ask() or its derivatives now unload themselves on dismissal
- Fixed centering issue in IE6 (non-standards compliant mode)
- Added afterShow callback, fired whenever boxy becomes visible
- Added Boxy.load() for manually loading boxy content via AJAX
- Moved WRAPPER to from Boxy.prototype to Boxy to improve app-wide configurability
- Complete rewrite of $.fn.boxy; see elsewhere for explanation
- Removed ’single’ plugin option
- Added option to link each boxy instance to the DOM element which triggered it; this is automatically severed when boxy is unloaded
- Added option to filter AJAX content using jQuery selector
- Fixed positioning bug with Opera
- Added beforeUnload callback
- Added Boxy.isModalVisible() for testing if a modal dialog is currently visible
- Added afterHide callback
- Added afterDrop callback
- Modal shading now resizes with browser window
- Added clickToFront option, bringing a dialog to front when clicking anywhere within it
- Added Boxy.linkedTo() to get boxy instance linked to a given element via ‘actuator’ option
- Added boxy.toggle() to toggle between visible/hidden
There’s also a new test and examples page that gives all of the major features a workout.
This will be the final release before 1.0; from now until then I’ll be concentrating solely on fixing bugs and stabilising the API. I think I’ve managed to accommodate most feature requests in one way or another.
Just a couple of extractions from recent projects that may be useful to somebodies.
First up is an automatically growing textarea. This implementation is borrowed from Facebook and uses an off-screen auxiliary <div> to calculate the required dimensions of the textarea. Usage is simple:
Next is a cookie-based style switcher, the obvious use of which is toggling between small/medium/large text. Quite why the browser supplied zoom features are insufficient is a mystery to me, but hey ho, the client is always right.
- cookieResize('#sizer a', 'medium');
The first argument is a selector matching the resize/style-switching links. When the user clicks any of these its CSS class will be applied to document.body - this class name will also be stored in a cookie for retrieval on successive page views. The second argument is the default class to use if no cookie is present.
No official plugin pages for these; just copy and paste into your project…