Apache-UploadMeter
view release on metacpan or search on metacpan
javascript.pod view on Meta::CPAN
the bundled default pop-up window. If you don't want this to happen, just run:
C<Event.stopObserving(aum_el, 'submit', aum_popup);>
=head1 API Documentation
=head3 UploadMeter Object
This is where most of the action happens. The public interface to this object
consists of a constructor, start and stop methods, and some callbacks that can
be used to do extra stuff at various key points in the UploadMeter's lifetime.
=over
=item *
UploadMeter(I<Element>, I<Meter-Id>, I<Meter-URL>, I<options>)
This is the default constructor for a new UploadMeter instance. It accepts 3
mandatory parameters and a hash of additional options. The first parameter,
I<Element> is a DIV element under which to create a graphical progress-bar (see
javascript.pod view on Meta::CPAN
The time (in seconds) which has elapsed since the upload started
=item *
remaining
The approximate time (in seconds) remaining in the upload
=back
The callbacks currently available are:
=over
=item *
onCreate(I<>)
This callback is called once just before the first AJAX call is made. As such,
it doesn't happen on construction; it happens after um.start(), but before the
initial AJAX request is made. I know it's not really well named, but you're
welcom to suggest something better.
javascript.pod view on Meta::CPAN
=back
=back
=back
=head3 UploadMeter.Responders
In addition to adding handlers to individual UploadMeter objects, as described
above, you can also add global callbacks which will be called for *every* uploadmeter
on the page. This might be useful, for example, for Web 2.0 applications that
allow for multiple asynchronous uploads in separate requests. In such a case,
rather than registering identical handlers for each UploadMeter instance,
you can register a single function globally and it will be called for the appropriate
callback for all UploadMeter instances running on the page.
Callbacks that are registered this way will receive, as the first parameter,
the UploadMeter object of the instance which is currently calling into it.
=head3 Util
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
delay: 3.0 // Delay in seconds between requests (also almost duration of sliding effect for smoothest exerience)
},
// We can't seem to Element.extend our elements in a seperate window... Dunno why yet
// but it makes for uglier code :-(
// Constructor - Parameters are:
// el: Outer div to bind widget to
// meter: uploadmeter id
// url: uploadmeter ajax url
// options: additional callbacks, etc
initialize: function(el, meter, url, options) {
this.url = url;
this.meter = meter;
this.main = $(el);
Object.extend(this.options, options || {});
this.desc = Builder.node( "div", {className:'metercontent'});
this.main.appendChild(this.desc);
this.desc = $(this.desc);
Position.absolutize(this.desc);
Position.clone(this.main, this.desc);
( run in 0.399 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )