uiUpload status

uiUpload status


Okay guys, i've put a lot of time into uiUpload yesterday. The
Javascript is currently 2.5kb uncompressed and the actionscript code
is currently 11,9kb uncompressed (2kb (!!) compiled SWF). The
actionnscript code is a rewrite of SWFUpload and i added some more
callbacks to it, cleaned up some errors and so on. This means we don't
use Adobe Flash for this (=we don't have to supply an FLA and people
have to have Adobe Flash installed) but we supply an open-source .AS
file which people can edit and rebuild using tools like FlashDevelop.
The actionscript code is done, that means, it should run. Right now i
am completing the Javascript, but i've run into some implementation
problems, on which i would like your opinion (see below).
I think i have some more time tonight, and see if i can wip up a beta
version this week for you guys to play with :)
-- Gilles
------------------------------------------------------------
How should i implement the construction of the widget?
------------------------------------------------------------
A user can expect 2 things from this widget:
a) You call the $.fn.uiUpload( {...} ) for each and every file upload
field you want to transform (just like the method Paul suggested we
should use). This means you get a SWF object for each and every file
upload field you change
b) You call the $.fn.uiUpload( {...} ) for a set of fields (e.g. an
array) and all those fields get transformed into 1 uiUpload field. You
only get one SWF for each "group" you transform.
In a real world, thinking unobtrusive and so on, i would expect that
this widget changes 10 upload fields into 1 uiUpload widget, since
that supports multiple select and so on.
------------------------------------------------------------
Event binding
------------------------------------------------------------
Should i code it in a way that the callbacks can be supplied as
options, or as jQuery chainable functions.
a) $.fn.uiUpload( {fFileProgress: function() {...} } )
b) $.fn.uiUpload().fileStart( function()
{...} ).fileProgress( function() {...} ).fileComplete( function()
{...} );
I think the second method (b) is cooler, and more jQuery-ish (aka,
more like OO style programming, less like JavaScript programming), but
i would like an example from John on how to implement this in a
plugin...