API/libsapojs/SAPO

[Elements] are optional

Class SAPO


class SAPO
Defined in 0.1/lib.js

Nested Class Summary
requires SAPO SAPO Widget class : all widgets should be subclasses of this one

Function Summary
Function bindObj (Object obj, [Array args])
Extends the native Function object. Creates a delegate (callback) that sets the scope to obj. Call directly on any function.
Example: this.myFunction.bindObj(this)
Will create a function that is automatically scoped to this.
Function bindObjEvent (Object event, Object obj, [Array args])
Extends the native Function object. Creates a delegate (callback) that sets the scope to obj. Call directly on any function.
Example: this.myFunction.bindObjEvent(this)
Will create a function that is automatically scoped to this.
Object extendObj (Object destination, Object source)
Extends a given Object with a given set of properties
Object namespace (string ns)
Creates the SAPO namespace
DOMElement|Array s$ (string|Array elementID|ArrayOfIDs)
Shortcut for document.getElementById

Function Details

function bindObj

Function bindObj(Object obj, [Array args])
Extends the native Function object. Creates a delegate (callback) that sets the scope to obj. Call directly on any function.
Example: this.myFunction.bindObj(this)
Will create a function that is automatically scoped to this.
Parameters:
obj The object for which the scope is set
[args] Overrides arguments for the call. (Defaults to the arguments passed by the caller)
Returns:
The new function

function bindObjEvent

Function bindObjEvent(Object event, Object obj, [Array args])
Extends the native Function object. Creates a delegate (callback) that sets the scope to obj. Call directly on any function.
Example: this.myFunction.bindObjEvent(this)
Will create a function that is automatically scoped to this.
Parameters:
event The default event
obj The object for which the scope is set
[args] Overrides arguments for the call. (Defaults to the arguments passed by the caller)
Returns:
The new function

function extendObj

Object extendObj(Object destination, Object source)
Extends a given Object with a given set of properties
Parameters:
destination - The original objecty
source - The new properties
Returns:
The extended object

function namespace

Object namespace(string ns)
Creates the SAPO namespace
Parameters:
ns - namespace path
Returns:
Object with SAPO namespace

function s$

DOMElement|Array s$(string|Array elementID|ArrayOfIDs)
Shortcut for document.getElementById
Parameters:
elementID|ArrayOfIDs Receives either an id or an Array of id's
Returns:
Either the DOM element for the given id or an array of elements for the given ids