pi.util2009-01-06 09:23:27
Summary
pi.util is an object that contains some essential javascript tools.
Methods
Curry
pi.util.Curry(function,scope,arguments ...)
Returns a generic curried version of specified function.
Extend
var className = pi.util.Extend(
superClass,
{
"$Init":Constructor,
property name:value,
private member:value
},
boolean skipClonning (optional)
)
Provides creating javascript classes by using pi.base.With this function, you can extend a class with other classes. If not another class will be extended, pi.base should be send as the first parameter.
IsArray
pi.util.IsArray(value);
Finds whether a variable is an array
IsHash
pi.util.IsHash(value);
Finds whether a variable is a hash.
Init
pi.util.Init.push(function);
An array containing functions that runs when DOM document is loaded.
Import
pi.util.Import(file url,fileType (optional));
Includes a JS or CSS file to the page with a synchronous request.
AddEvent
pi.util.AddEvent(target,type,listener,useCapture);
Allows the registration of event listeners on the event target.
RemoveEvent
pi.util.RemoveEvent(target,type,listener,useCapture);
Allows the removal of event listeners on the event target.
Include
pi.util.Include(url,callback);
A Function that loads and executes javascript files using an HTTP GET request and allows cross domain JSON transfers.
GetViewport
pi.util.GetViewport();
Returns size of available space on the screen.