Apache-UploadMeter

 view release on metacpan or  search on metacpan

javascript.pod  view on Meta::CPAN

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.

lib/Apache/UploadMeter/Resources/JavaScript.pm  view on Meta::CPAN

       elements = document.getElementsBySelect('div#main p a.external')
     
     Will return an array of all 'a' elements with 'external' in their 
     class attribute that are contained inside 'p' elements that are 
     contained inside the 'div' element which has id="main"

   New in version 0.4: Support for CSS2 and CSS3 attribute selectors:
   See http://www.w3.org/TR/css3-selectors/#attribute-selectors

   Version 0.4 - Simon Willison, March 25th 2003
   -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows
   -- Opera 7 fails 
*/

function getAllChildren(e) {
  // Returns all children of element. Workaround required for IE5/Windows. Ugh.
  return e.all ? e.all : e.getElementsByTagName('*');
}

document.getElementsBySelector = function(selector) {
  // Attempt to fail gracefully in lesser browsers



( run in 0.583 second using v1.01-cache-2.11-cpan-39bf76dae61 )