@UTF-8
WAJAF is the WebAbility Javascript Application Framework. It is a synchronized GO-Server <=> JS-Client framework to developp organized web applications.
GO manuals are available on godoc.org
The examples and tests show the working functions and the manual of them.
- The main core.
The main core contains:
- 2 attributes:
- zIndex method, used to set an unused zIndex to a node,
- Verification methods is*, used to know the type of JS objects. All the functions return true/false. True means the variable match the specified type by the is* method. -- isDefined: returns true if the variable is not undefined. -- isEmpty: returns true if the variable is empty: empty means undefined, null, empty array or empty string. -- isBool: returns true if the variable is a boolean. -- isNumber: returns true if the variable is number, integer or float. -- isString: returns true if the variable is a string or a String object. -- isArray: returns true if the variable is an array. -- isObject: returns true if the variable is an object. It includes String(), Date(), {}. etc. Note than Javasript consider null as an object too. -- isFunction: returns true if the variable is a function. -- isDate: return true if the variable is a Date object. -- isDOM: return true if the variable is a DOM node object.
- Objects and nodes methods.
For objects:
- WA.extend: Will extends an object from another (inheritance).
- WA.clone: Will clone an object and all its children. -- If you dont care the type of object but only its attributes, you can use WA.clone(object, true) -- If you use the normal method WA.clone(object), it will close the whole object with attributes and methods.
- WA.sizeof: Will calculates the size (number of attributes) of an object.
For DOM nodes:
- WA.createDomNode: Will create a DOM Node of specified type, and apply classname if defined.
- WA.getDomNode: Will get the DOM node of the specified Id.
- WA.toDOM: Will get the DOM node from a string ID or a node itself.
- Node get() functions.
The get function lets you find a node or a set of nodes by rules, then apply some changes on the node.
The get() method works as followed:
- The code will search all the nodes corresponding to the filter you give it.
There are 3 posibilities:
a - No nodes were found. The subsequent operations will do nothing. b - There was only one node found. The subsequent operations will work directly on this node. c - There was more than 1 node found (from 2 to the whole DOM). The subsequent operations will work for each one of the found nodes.
-
The operation is applied to all the node(s).
-
The operations can be chained.
The parameter of get() method is a string used to search the nodes:
"#id": If you want to find a single node by its unique id, using the CSS syntax. ".class": If you want to find a list of nodes by their class, using the CSS syntax. "!name": If you want to find a list of nodes by their name (in a form). "tag": If you want to find a list of nodes by their tag type (example: 'div', 'a').
- The browser core:
- Adds local specific functions to all the Containers, Elements, Zones, etc to improve tree programmation.
- Tests
- First build on GO, with all the necesary code to devel, test, publish and show live examples.
- Adds titleview parameter to buttonelement.js (missing)
- Separates coreext.js and coretemplate.js from core.js
- JS code is now embedded into GO code in resources directory. embed.go is added to generate embedded code, but is not compilable with the libraries.
- Correction on node: HELP as messages, not help children
- Correction on node: JSON Marshal, wrong ',' calculations (again)
- Correction on node: JSON Marshal, wrong ',' calculations
- Added parameters to creation of containers, zones, dataset and elements
- Added know child "code" to event
- Correction of event node so code is into code node.
- Correction of all the Types of containers and elements to put correct js library name (nameContainer and nameElement syntax)
- Added MarshalXML on Node to build XML code from nodes
- Correction on assigning the node data (concatened, only if some info into it: will ignore spaces and line formatting characters)
- Added UnmarshalXML
- Added MarshalJSON
- Added basic functions AddMessage, AddHelp, AddEvent to a Node, with auto creation of children nodes
- Removed messages, events, help attributes of Node
- Added AddZone() to SeparatorContainer as a new struct extended from DomDef interface to build upon specific functions for specific nodes (it works)
- All structures and Application tree implemented in GO
- Full wajaf JS available in js directory