Apache-UploadMeter
view release on metacpan or search on metacpan
javascript.pod view on Meta::CPAN
=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.
=item *
onInitialize(I<status>, I<last>)
This callback is called once after the initial AJAX response is received and
parsed. While I<last> is generally useless at this point (it's a subset of
I<status> right now), it's provided in case you want to change the value of
anything in it.
=item *
onUpdate(I<status>, I<last>)
This callback is called every time data is updated from meter URL. It can be
utilized to update other GUI elements, such as is done in the default pop-up.
=item *
onFinished(I<status>, I<last>)
This callback is called after onUpdate if the upload is determined to be complete
(eg, C<tatus.finished == 1>)
=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
The Util namespace is not an object, but rather a namespace to group some helper
utility functions that may make your life a bit easier when creating your custom
user interface.
=over
=item *
Util.formatTime(I<timestamp>)
This function takes a single parameter, I<timestamp> which is a numeric value
corresponding to a number of seconds. This is not necessarily a "unix timestamp"
(the number of seconds since the epoch) but rather an arbitrary number of seconds.
The function will return a formatted string returning the number of seconds in
HH:mm:ss format
=item *
Util.formatDec(I<value>)
This function takes a numeric (decimal/floating point) value as a parameter
and returns a string containing the number and 2 decimal points.
=back
=head1 AUTHOR AND COPYRIGHT
Copyright (c) 2001-2007 Issac Goldstand E<lt>margol@beamartyr.netE<gt> - All rights reserved.
This library is free software. It can be redistributed and/or modified
under the same terms as Perl itself.
This software contains third-party components licensed under BSD and MIT style
open-source licenses.
=head1 SEE ALSO
L<Apache::UploadMeter>
=cut
( run in 0.596 second using v1.01-cache-2.11-cpan-39bf76dae61 )