Zapatec

Overview | File | Class | Tree | Index | Help

Zapatec Utils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class Zapatec

    Object
       |
       +--Zapatec

class Zapatec

Defined in zapatec-core.js

Nested Class Summary
`<static class>` | `Zapatec.ColorPicker`
`<static class>` | `Zapatec.ChildWidget`
`<static class>` | `Zapatec.ImagePreloader`
`<static class>` | `Zapatec.PreloadImages`
`<static class>` | `Zapatec.Modal`
`<static class>` | `Zapatec.Indicator`
`<static class>` | `Zapatec.word2num`
`<static class>` | `Zapatec.Spinner`
`<static class>` | `Zapatec.StyleSheet`
`<static class>` | `Zapatec.Transport`
`<static class>` | `Zapatec.BasicTree`
`<static class>` | `Zapatec.Wizard`
`<static class>` | `Zapatec.EventDriven`
`<static class>` | `Zapatec.Pane`
`<static class>` | `Zapatec.EditInline`
`<static class>` | `Zapatec.demo`
`<static class>` | `Zapatec.ProgressBar`
`<static class>` | `Zapatec.Widget`
`<static class>` | `Zapatec.SRProp`
`<static class>` | `Zapatec.Tab`
`<static class>` | `Zapatec.Tabs`
`<static class>` | `Zapatec.TabsWizard`
`<static class>` | `Zapatec.AccordionTab`
`<static class>` | `Zapatec.AccordionTabs`
`<static class>` | `Zapatec.Tree`

Field Summary
`<static> Object` | `CommandEvent` Command event interface.
`<static> Object` | `Drag`
`<static> Object` | `FixateOnScreen`
`<static> Object` | `GlobalEvents` The object working with global controlled events.
`<static> Object` | `include` Shortcut.
`<static> Object` | `is_gecko`
`<static> Object` | `is_ie`
`<static> Object` | `is_ie5`
`<static> Object` | `is_ie7`
`<static> Object` | `is_khtml`
`<static> Object` | `is_konqueror`
`<static> Object` | `is_mac_ie`
`<static> Object` | `is_opera`
`<static> Object` | `is_webkit`
`<static> Object` | `isLite`
`<static> Object` | `Movable` This is a set of functionality used for moving object and is implemented in interface (mixin) manner.
`<static> Object` | `Resizable` This is a set of functionality used for resizing object and is implemented in interface (mixin) manner.
`<static> Object` | `ScrollWithWindow` Zapatec ScrollWithWindow Widget.
`<static> Object` | `Sizable` This is a set of functionality used for sizing object and is implemented in interface (mixin) manner.
`<static> Object` | `tabsPath`
`<static> Object` | `treePath`
`<static> Object` | `Utils`
`<static> Object` | `webkitVersion`
`<static> Object` | `windowLoaded` This is some kind of indicator that window has already loaded.
`<static> Object` | `zapatecPath`

Constructor Summary
`Zapatec()` Namespace definition.

Method Summary
`<static> array` | `Array(arr)` This is a constructor for Zapatec Array.
`<static> string` | `getPath(<string> sId)` Returns path from the script element with specified id.
`<static> object` | `Hash(hash)` This is a constructor for Zapatec Hash.
`<static> boolean` | `implement(classOrObject, interfaceStr)` This is a type of interface technology (mixin).
`<static> void` | `inherit(<object> oSubClass, <object> oSuperClass, <object> oArg)` Extends one class with another.
`<static> Object` | `isArray(arr)` Returns true if object is an array.
`<static> Object` | `isDate(date)` Returns true if object is a Date object.
`<static> Object` | `isHtmlElement(el)` Returns true if this is HTML element.
`<static> Object` | `isMovableObj(obj)` Returns true if object has movable interface.
`<static> Object` | `isSizableObj(obj)` Returns true if object has sizable interface.
`<static> void` | `Log(objArgs)` Displays error message.

Field Detail

### CommandEvent

    <static> Object CommandEvent

Command event interface. It lets you controll the listeners execution, like stoping, re-executing. It is thought that implementing object inherits Zapatec.EventDriven.

### Drag

    <static> Object Drag

### FixateOnScreen

    <static> Object FixateOnScreen

### GlobalEvents

    <static> Object GlobalEvents

The object working with global controlled events.

### include

    <static> Object include

Shortcut. The same as Zapatec.Transport.include().

### is_gecko

    <static> Object is_gecko

### is_ie

    <static> Object is_ie

### is_ie5

    <static> Object is_ie5

### is_ie7

    <static> Object is_ie7

### is_khtml

    <static> Object is_khtml

### is_konqueror

    <static> Object is_konqueror

### is_mac_ie

    <static> Object is_mac_ie

### is_opera

    <static> Object is_opera

### is_webkit

    <static> Object is_webkit

### isLite

    <static> Object isLite

### Movable

    <static> Object Movable

This is a set of functionality used for moving object and is implemented in interface (mixin) manner.

### Resizable

    <static> Object Resizable

This is a set of functionality used for resizing object and is implemented in interface (mixin) manner.

### ScrollWithWindow

    <static> Object ScrollWithWindow

Zapatec ScrollWithWindow Widget. Used to produce effect similar to "position: fixed".

### Sizable

    <static> Object Sizable

This is a set of functionality used for sizing object and is implemented in interface (mixin) manner.

### tabsPath

    <static> Object tabsPath

### treePath

    <static> Object treePath

### Utils

    <static> Object Utils

### webkitVersion

    <static> Object webkitVersion

### windowLoaded

    <static> Object windowLoaded

This is some kind of indicator that window has already loaded.

### zapatecPath

    <static> Object zapatecPath

Constructor Detail

### Zapatec

    Zapatec()

Namespace definition.

Method Detail

### Array

    <static> array Array(arr)

This is a constructor for Zapatec Array. It can create new array or extend the given one with some useful methods. You can use it with new opertaor or as simple function. Here is the list of extended methods: method name | description ------------------------------------------------------------------------------------------------- clear | empties the array and returns itself compact | deletes the null and undefined items from resulting array indexOf | returns the index of the item with the value pointed without | returns array without values pointed as all arguments remove | returns array without elements that were under poited indexes. | You can pass arguments or you can pass an array.

Parameters:

`arr` - {array} if given this array will be extended.

Returns:

extended array.

### getPath

    <static> string getPath(<string> sId)

Returns path from the script element with specified id. If id is not specified or specified id is not found on the page, returns path from the last loaded script element. Splits src attribute value and returns path without js file name. Returns empty string if path is not found.

     If specified id is not found on the page, returns last script element instead
     of alerting. This gives ability for developer to include script using
     Zapatec#include and specify id because in some cases it may be needed to get
     correct path; and for user to include script directly into the page without
     remembering internal Zapatec ids because id is not needed to determine path
     correctly in this case.

     Developer is responsible for checking that the same script id is passed to
     Zapatec#include and Zapatec#getPath because there is no alert if they are
     different and result may be wrong.

     Note: This function must be invoked during page load to determine path to js
     file from which it is called correctly.

Parameters:

`sId` - Optional. Id of the script element

Returns:

Path to the script, e.g. '../src/' or '' if path is not found

### Hash

    <static> object Hash(hash)

This is a constructor for Zapatec Hash. It can create new hash or extend the given one with some useful methods. You can use it with new opertaor or as simple function. Here is the list of extended methods: method name | description ------------------------------------------------------------------------------------------------- hashRemove | returns hash without properties pointed as all arguments or array as an argument hashEach | iterates through all hash pairs of key and value. Internal methods are skiped. hashIsEmpty | returns true if hash has no items. Internal methods are not taken in account.

Parameters:

`hash` - {object} if given this hash will be extended.

Returns:

extended hash.

### implement

    <static> boolean implement(classOrObject, interfaceStr)

This is a type of interface technology (mixin). It takes the methods and properties of interface object and add them to our class or object instance. If property is present in our class and is not core method of interface then it will not be added. Our class or object will also be added hasInterface method to work with interfaces.

Parameters:

`classOrObject` - {object or function} the object or class to enhance with the interface.

`interfaceObj` - {object} object holding interface logic.

Returns:

true if success, otherwise false.

### inherit

    <static> void inherit(<object> oSubClass, <object> oSuperClass, <object> oArg)

Extends one class with another. Gives ability to access properties and methods of the superclass having the same names as in subclass.

     Zapatec.Widget specific feature: If superclass has static property
     path, by default subclass will get path to js file from which this
     function is called into path property instead of value from
     superclass. This behaviour can be changed with leavePath option below.

     To determine path correctly when widget module is included using
     Zapatec.include function, static property id should be set in widget
     class. Value of this property must be passed to Zapatec.include function as
     script id.

     Following additional options are accepted:
     {
       keepPath: [boolean] if true, static property path is inherited from
        superclass; useful, for example, when you inherit a widget and want to use
        the same path to themes as superclass
     }

     Should be used as follows:

     // Define SuperClass and its methods
     Zapatec.SuperClass = function(oArg) {
       ...
     };

     Zapatec.SuperClass.prototype.init = function(oArg) {
       ...
     };

     // Define SubClass and its methods
     Zapatec.SubClass = function(oArg) {
       ...
       // Call constructor of superclass
       Zapatec.SubClass.SUPERconstructor.call(this, oArg);
       ...
     };

     // Unique static id of the widget class to determine path correctly
     // Neded only if class is derived from Zapatec.Widget class
     Zapatec.SubClass.id = 'Zapatec.SubClass';

     // Inherit SuperClass
     Zapatec.inherit(Zapatec.SubClass, Zapatec.SuperClass);

     Zapatec.SubClass.prototype.init = function(oArg) {
       ...
       // Call method of superclass
       Zapatec.SubClass.SUPERclass.init.call(this, oArg);
       ...
     };

     Note: This function must be invoked during page load to determine path to js
     file from which it is called correctly.

Parameters:

`oSubClass` - Inheriting class

`oSuperClass` - Class from which to inherit

`oArg` - Additional options (see above)

### isArray

    <static> Object isArray(arr)

Returns true if object is an array. return {boolean} true if array, otherwise false.

### isDate

    <static> Object isDate(date)

Returns true if object is a Date object. return {boolean} true if Date object, otherwise false.

### isHtmlElement

    <static> Object isHtmlElement(el)

Returns true if this is HTML element. return {boolean} true if HTML element, otherwise false.

### isMovableObj

    <static> Object isMovableObj(obj)

Returns true if object has movable interface. return {boolean} true if sizable, otherwise false.

### isSizableObj

    <static> Object isSizableObj(obj)

Returns true if object has sizable interface. return {boolean} true if sizable, otherwise false.

### Log

    <static> void Log(objArgs)

Displays error message. Override this if needed. \param objArgs [number] error object: { severity: [string, optional] error severity, description: [string] human readable error description }

Overview | File | Class | Tree | Index | Help

Zapatec Utils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Aug 16 12:18:39 2007