File: ../../Developer.FoundationDotJS.org/wwwroot/Foundation.js

Namespace Foundation

Object
  
 
 
Foundation

Foundation

The namespace for the Foundation JavaScript framework.


Interface Summary
static InterfaceClass
static InterfaceElemental
Methods to interact with HTML elements and events. See the Foundation.Elemental home page for more information.
static InterfaceInterface
static InterfaceResourceful
Methods to retrieve resources. See the Foundation.Resourceful home page for more information.
static InterfaceServer

Class Summary
static ClassClientLoader
A featherweight class to load and invoke other classes. See the Foundation.ClientLoader home page for more information.
static ClassNamespace
static ClassPoint
Two dimensional point class with x and y.
static ClassPolygon
Two dimensional polygon class, implemented as an array of Foundation.Points, though it is not a true Array.
static ClassRectangle
Two dimensional rectangle class with x, y, width and height.
static ClassStringBuilder
A class to build strings efficiently and quickly. See the Foundation.StringBuilder home page for more information.
static ClassTMatrix
Two dimensional transformation class with a, b, c, d, tx, ty, u, v and w.

Function Summary
static ClassappendToClass(/*Class*/ class, /*Collection*/ virtualMethods, /*Collection*/ staticMethods)
Adds additional methods to a class or interface.
static InterfaceappendToInterface(/*Interface*/ interface, /*Collection*/ virtualMethods, /*Collection*/ staticMethods)
Adds additional methods to an interface.
static ClasscreateClass(/*String*/ classPath, /*Class*/ parentClass, /*Class*/ implementClass, ..., /*Function*/ constructor, /*Collection*/ virtualMethods, /*Collection*/ staticMethods)
Creates a new class.
static InterfacecreateInterface(/*String*/ classPath, /*Collection*/ virtualMethods, /*Collection*/ staticMethods)
Creates a new interface.
static  getComputedStyle(element, property)
static  isArray(constructor)
static  isDate(constructor)
static  jsSerialize(data, stringBuilder)
static  jsSerializeProperty(stringBuilder, dataName, dataValue, comma)
static BooleanloadScript(/*String*/ url, /*String*/ data, /*Boolean*/ debug, /*String*/ catchFunction)
Loads a script.
static  namespace(namespace, propertyList)
static  server(callback, url, serverFunction)
static  serverSerialized(callback, url, serverFunction)
static  serverSynchronous(url, serverFunction)
static  setInnerHtml(element, html)
static BooleanvalidateEmailFormat(/*String*/ emailAddress, /*Boolean*/ allowMultiple, /*Boolean*/ allowEmpty)
Validates the form of an email address. Allows any amount of leading and trailing whitespace and delimeters.

Function Detail

appendToClass

static Class appendToClass(/*Class*/ class,
                           /*Collection*/ virtualMethods,
                           /*Collection*/ staticMethods)

Adds additional methods to a class or interface.

Parameters:
class - 
The class to append to.
virtualMethods - 
Virtual methods and properties to append, or null.
staticMethods - 
(Optional) Static methods and properties to append.
Returns:
The class or interface.

appendToInterface

static Interface appendToInterface(/*Interface*/ interface,
                                   /*Collection*/ virtualMethods,
                                   /*Collection*/ staticMethods)

Adds additional methods to an interface.

Parameters:
interface - 
The interface to append to.
virtualMethods - 
Virtual methods and properties to append, or null.
staticMethods - 
(Optional) Static methods and properties to append.
Returns:
The interface.

createClass

static Class createClass(/*String*/ classPath,
                         /*Class*/ parentClass,
                         /*Class*/ implementClass,
                         ...,
                         /*Function*/ constructor,
                         /*Collection*/ virtualMethods,
                         /*Collection*/ staticMethods)

Creates a new class.

Parameters:
classPath - 
(Optional) Fully qualified name of class. Any missing namesspaces will be created.
parentClass - 
(Optional) Parent Class to inherit. Pass null to implement classes but not inherit one.
implementClass - 
(Optional)(Repeatable) Other classes to implement static and virtual methods of.
constructor - 
Constructor for the new class.
virtualMethods - 
(Optional) Virtual methods and properties for the new class.
staticMethods - 
(Optional) Static methods and properties for the new class.
Returns:
A new class.

Example:

var MyClass=Foundation.createClass(
function()
{
   //constructor
},
{
   //comma separated virtual methods
   someVirtualMethod:function(param)
   {
   }
},
{
   //comma separated static methods
   someStaticMethod:function(param)
   {
   }
});

createInterface

static Interface createInterface(/*String*/ classPath,
                                 /*Collection*/ virtualMethods,
                                 /*Collection*/ staticMethods)

Creates a new interface.

Parameters:
classPath - 
(Optional) Fully qualified name of interface. Any missing namesspaces will be created.
virtualMethods - 
Virtual methods and properties for the new interface, or null.
staticMethods - 
(Optional) Static methods and properties for the new interface.
Returns:
A new interface.

Example:

var MyInterface=Foundation.createInterface(
{
   //comma separated virtual methods
   someVirtualMethod:function(param)
   {
   }
},
{
   //comma separated static methods
   someStaticMethod:function(param)
   {
   }
});

getComputedStyle

static getComputedStyle(element,
                        property)
Parameters:
element - 

property - 


isArray

static isArray(constructor)
Parameters:
constructor - 


isDate

static isDate(constructor)
Parameters:
constructor - 


jsSerialize

static jsSerialize(data,
                   stringBuilder)
Parameters:
data - 

stringBuilder - 


jsSerializeProperty

static jsSerializeProperty(stringBuilder,
                           dataName,
                           dataValue,
                           comma)
Parameters:
stringBuilder - 

dataName - 

dataValue - 

comma - 


loadScript

static Boolean loadScript(/*String*/ url,
                          /*String*/ data,
                          /*Boolean*/ debug,
                          /*String*/ catchFunction)

Loads a script.

Parameters:
url - 
Url of script.
data - 
(Optional) Form encoded data to post with script request.
debug - 
(Optional) Show script request in popup window to examine response before executing.
catchFunction - 
(Optional) A function to call if an error occurs. Pass a string! Paremeters passed to error function are url, postData, script, errorMessage.
Returns:
True if successful or false otherwise (for example, will fail if post data given but there is no XmlHttpRequest object available to post with).

namespace

static namespace(namespace,
                 propertyList)
Parameters:
namespace - 

propertyList - 


server

static server(callback,
              url,
              serverFunction)
Parameters:
callback - 

url - 

serverFunction - 


serverSerialized

static serverSerialized(callback,
                        url,
                        serverFunction)
Parameters:
callback - 

url - 

serverFunction - 


serverSynchronous

static serverSynchronous(url,
                         serverFunction)
Parameters:
url - 

serverFunction - 


setInnerHtml

static setInnerHtml(element,
                    html)
Parameters:
element - 

html - 


validateEmailFormat

static Boolean validateEmailFormat(/*String*/ emailAddress,
                                   /*Boolean*/ allowMultiple,
                                   /*Boolean*/ allowEmpty)

Validates the form of an email address. Allows any amount of leading and trailing whitespace and delimeters.

Parameters:
emailAddress - 
Email address(es) to validate. Separate multiple addresses with whitespace, semi-colon(;) or comma(,).
allowMultiple - 
(Optional) Allow multiple addresses. Defaults to false.
allowEmpty - 
(Optional) Allow an empty value. Defaults to false.
Returns:
True if the format of each address is valid, false otherwise.