IntroductionNamespace structure for Kuvio. Namespace- KUVIO
- config
- DebugMode
boolean In debug mode, certain errors are logged to console if available.
- lang
- impl
function (object/function, object/function) Checks to see if the signatures of the two objects are similar. Typical usage is KUVIO.lang.impl(myObject,myInterface). - fold
function (array, function, initialPosition, scope) Iterates over an array, calling function on each value. function should match the signature: function(currentReturnValue,arrayValue). initialPosition and scope are optional. - strHelper
function (string, array) For each value in the array, replace a token in the string. Example: KUVIO.lang.strHelper("I am {0} {1}",['very','happy']) returns "I am very happy". - clone
function (object) Creates and returns a clone of an object.
- interfaces
- IEventListener
interface An internal interface used for EventListeners is the Event logic. Defined as: { _fn : function() {}, _sc : {}}
- event
- CustomEvent
object (name (string), defaultScope (object), data (object), listenerInterface (interface) Creates a custom event that can register listeners and invoke them. If a listener is added without a scope, defaultScope will be used instead. data is an object or array that will be accessible to anyone with access to your custom event object. listenerInterface is a signature for the listener function, and is optional. - fire
function (data) Fires an event, passing each listener itself and the data object supplied by the caller. - addListener
function (function, scope (object)) Adds a given function as a listener to the event. If scope is provided, the function will be called within the scope of that object. Returns the EventListener object created. - addListenerAsEventListener
function (listener (IEventListener)) Adds a given object that implements the IEventListener interface to the list of listeners. - removeListener
function (function) Removes a given function from the list of listeners. Returns the EventListener object which was stored in the listener array if successful. - removeListenerAsEventListener
function (listener (IEventListener)) Given an object which implements IEventListener, remove it from the event.
- EventListener
object (function, scope) implements IEventListener - invoke
function (data) invokes the listener with data passed as an argument.
- Log
Error logging object, instantiated as a singleton. - error
function (error) adds an error to the log. - report
function () Logs each error in its history to the console. If console is not available, alerts them. - onError
event fires whenever an error is registered with KUVIO.Log.
- connection
- createBaseRequest
function () Creates a cross-browser XMLHttpRequest object. - XHR
object (config, extraData) An XMLHttpRequest object wrapped in utility functions and event hooks. - config
object Accepts the following values: - timeout: Time, in milliseconds, before the request will timeout.
- events
- onSetUp
- onConnectionOpen
- onSent
- onProcessing
- onComplete
- open
function ()
|