vegui. sk. std.js

Summary
Returns VSK_Node object that controlls the submitted node
Returns VSK_node object that controls the node with the submitted id
Returns a new node
Create and return a text node
sets vskX and vskY to the current mouse coordinates
Returns the related target of a mouse event (cross browser support)
Wrapper function for parseInt
check if a value exists inside an array
Returns a random number
Returns the x position of the element relative to the document or a specified parent element
Returns the y position of the element relative to the document or a specified parent element
Removes all the child nodes of the node
Takes control of another node
Appends node to the submitted node as a child
Method set an event listener on the node (cross browser supported)
Sets the transparency of the node to the selected value
Returns the height of the node
Check if a node is the parent of the controlled node somewhere down the parentNode list
Hides or shows the node
Append multiple nodes to this node as children
Inserts a html node after this html node
Insert one or more html nodes before this node
Moves the node to a new position
Resizes the node
Sets the css position of the node and the node’s z-index
Returns the transparency of the node (in percent)
Removes an unspecified amount of child nodes from the beginning or end of the child nodes array of the controlled node until the defined length is reached
Removes the node from its parentNode
Checks if the node is hidden
Adds a vsk specific event handler
Triggers the event handler for a certain vsk event
Remove a function from a specific vsk event handler by it’s unique function id
Returns the width of the node
returns x position of the node
Returns the right x position of the node
returns y position of the node
Returns the y bottom position of the node
returns zindex of node
Allows to have a function with dynamic content
Constructor
Adds a function to the stack
Executes all the functions in the stack
Free a unique function id effectivly removing the function linked to it from the stack

Functions

v

function v(node)

Returns VSK_Node object that controlls the submitted node

Paramters

Node nodenode to control

Returns

VSK_Node object

V

function V(id)

Returns VSK_node object that controls the node with the submitted id

Parameters

var idid of the node to control

Returns

VSK_Nodeif node could be retrieved
nullif no node with specified id was found in the document

vsk_html_node

vsk_html_node = vsk_h = function(nodeName,
className,
parentNode,
id)

Returns a new node

Alias

vsk_h()

Parameters

string nodeNametag/node name of the node to create
<string className>if submitted the created node will use this css class
<Node parentNode>if submitted the created node will be appended to this node
<var id>if submitted the created node will have its id property set

Returns

Nodecreated node

vsk_txt_node

vsk_txt_node = vsk_t = function(text,
parentNode)

Create and return a text node

Alias

vsk_t()

Parameters

string texttext to create
<Node parentNode>if submitted the created text node will be appended to the node

Returns

TextNodecreated text node

vsk_get_mouse

function vsk_get_mouse(e)

sets vskX and vskY to the current mouse coordinates

Parameters

Event eevent object

vsk_rel_target

function vsk_rel_target(e)

Returns the related target of a mouse event (cross browser support)

Parameters

Event eevent object

pi

function pi(str)

Wrapper function for parseInt

in_array

function in_array(arr,
value)

check if a value exists inside an array

Parameters

array arrarray to check
var valuevalue to look for

Returns

booltrue if value exists in array
boolfalse if value does not exist in array

vsk_rand

function vsk_rand(min,
max)

Returns a random number

Parameters

int minminimum number
int maxmaximum number

Returnd

inta random number between min and max

VSK_Node

Summary
Returns the x position of the element relative to the document or a specified parent element
Returns the y position of the element relative to the document or a specified parent element
Removes all the child nodes of the node
Takes control of another node
Appends node to the submitted node as a child
Method set an event listener on the node (cross browser supported)
Sets the transparency of the node to the selected value
Returns the height of the node
Check if a node is the parent of the controlled node somewhere down the parentNode list
Hides or shows the node
Append multiple nodes to this node as children
Inserts a html node after this html node
Insert one or more html nodes before this node
Moves the node to a new position
Resizes the node
Sets the css position of the node and the node’s z-index
Returns the transparency of the node (in percent)
Removes an unspecified amount of child nodes from the beginning or end of the child nodes array of the controlled node until the defined length is reached
Removes the node from its parentNode
Checks if the node is hidden
Adds a vsk specific event handler
Triggers the event handler for a certain vsk event
Remove a function from a specific vsk event handler by it’s unique function id
Returns the width of the node
returns x position of the node
Returns the right x position of the node
returns y position of the node
Returns the y bottom position of the node
returns zindex of node

Functions

abs_x

VSK_Node.prototype.abs_x = function(Parent)

Returns the x position of the element relative to the document or a specified parent element

Parameters

<Node Parent>if submitted the position will be relative to this parent node

Returns

intx position of the element

abs_y

VSK_Node.prototype.abs_y = function(Parent)

Returns the y position of the element relative to the document or a specified parent element

Parameters

<Node Parent>if submitted the position will be relative to this parent node

Returns

inty position of the element

clear

VSK_Node.prototype.clear = function(node)

Removes all the child nodes of the node

Paramters

<Node node>optional node to append to this node after clearing

Returns

VSK_Nodeself

control

VSK_Node.prototype.control = function(node)

Takes control of another node

Parameters

Node nodenode to take control of

Returns

VSK_Nodeself

dock

VSK_Node.prototype.dock = function(toNode)

Appends node to the submitted node as a child

Parameters

Node toNodenode to append to

Returns

VSK_Nodeself

event_add

VSK_Node.prototype.event_add = function(eventName,
func)

Method set an event listener on the node (cross browser supported)

Parameters

string eventNamename of the event (ie.  ‘click’ or ‘mousedown’)
function funcfunction to be added

Returns

VSK_Nodeself

fade

VSK_Node.prototype.fade = function(n)

Sets the transparency of the node to the selected value

Parameters

int ntransparency value (percent)

Returns

VSK_Nodeself

h

VSK_Node.prototype.h = function(o)

Returns the height of the node

Parameters

<bool o>if set to true the node’s offsetHeight attribute is returned even if the style.height attribute is set.

Returns

intheight of the node

has_parent

VSK_Node.prototype.has_parent = function(parentNode)

Check if a node is the parent of the controlled node somewhere down the parentNode list

Parameters

Node parentNodenode to check

Returns

booltrue when parentNode is the parent of this node somewhere down the parentNode chain
boolfalse when not

hide

VSK_Node.prototype.hide = function(hide)

Hides or shows the node

Paramters

bool hideif true node will be hidden, if false node will be shown

Returns

VSK_Nodeself

html_append

VSK_Node.prototype.html_append = function()

Append multiple nodes to this node as children

Alias

html_a()

Parameters

Node node1node to append to this node as child
Node node2node to append to this node as child
...additional nodes

Returns

Nodethis.b

html_insert_after

VSK_Node.prototype.html_insert_after = function()

Inserts a html node after this html node

Alias

html_ia()

Parameters

Node ...node(s) to insert

Returns

VSK_Nodeself

html_insert_before

VSK_Node.prototype.html_insert_before = function()

Insert one or more html nodes before this node

Alias

html_ib()

Parameters

Node ...html nodes to insert

Returns

VSK_Nodeself

move

VSK_Node.prototype.move = function(x,
y,
x2,
y2)

Moves the node to a new position

Parameters

int xnew position on the x axis (px, left)
int ynew position on the y axis (px, top)
<int x2>new position on the x axis (px, right, overwrites x)
<int y2>new position on the y axis (px, bottom, overwrites y)

Returns

VSK_Nodeself

resize

VSK_Node.prototype.resize = function(w,
h)

Resizes the node

Parameters

int wnew width (px)
int hnew height (px)

Returns

VSK_Nodeself

set_pos

VSK_Node.prototype.set_pos = function(pos,
zIndex)

Sets the css position of the node and the node’s z-index

Parameters

strign posposition (‘absolute’, ‘relative’ ...)
<int zIndex>new zIndex

Returns

VSK_Nodeself

t

VSK_Node.prototype.t = function()

Returns the transparency of the node (in percent)

Returns

inttransparency of the node (in percent)

trim

VSK_Node.prototype.trim = function(length,
reverse)

Removes an unspecified amount of child nodes from the beginning or end of the child nodes array of the controlled node until the defined length is reached

Parameters

int lengthtrim child nodes to this amount
bool reverseif true child nodes will be trimmed from the end

undock

VSK_Node.prototype.undock = function()

Removes the node from its parentNode

Returns

VSK_Nodeself

v

VSK_Node.prototype.v = function()

Checks if the node is hidden

Returns

booltrue, if the node is visible
boolfalse, if the node is hidden

vsk_event_add

VSK_Node.prototype.vsk_event_add = function(name,
func,
id)

Adds a vsk specific event handler

Parameters

string nameevent name
function funcfunction to be added to the event handler
<var id>unique function id so that the added function can later be removed again from the event handler

Valid Events

resizewhen the node is resized using the resize method
movewhen the node is moved using the move method
dockwhen the node is docked using the dock method
undockwhen the node is undocked using the undock method

Returns

VSK_Nodeself

vsk_event_fire

VSK_Node.prototype.vsk_event_fire = function(name)

Triggers the event handler for a certain vsk event

Parameters

string namename of event to trigger

Returns

VSK_Nodeself

vsk_event_unset

VSK_Node.prototype.vsk_event_unset = function(name,
id)

Remove a function from a specific vsk event handler by it’s unique function id

Parameters

string namename of the event handler
var idunique function id

Returns

VSK_Nodeself

w

VSK_Node.prototype.w = function(o)

Returns the width of the node

Parameters

<bool o>if true the node’s offsetWidth attribute will be returned even if the style.width attribute is set

Returns

intwidth of the node

x

VSK_Node.prototype.x = function()

returns x position of the node

Returns

intx position of the node

x2

VSK_Node.prototype.x2 = function()

Returns the right x position of the node

Returns

intx position of the right border of the node

y

VSK_Node.prototype.y = function()

returns y position of the node

Returns

inty position of the node

y2

VSK_Node.prototype.y2 = function()

Returns the y bottom position of the node

Returns

intposition of the node’s bottom border on the y axis

z

VSK_Node.prototype.z = function()

returns zindex of node

Returns

intz-index of node

VegUIDynFunc

Allows to have a function with dynamic content

Summary
Constructor
Adds a function to the stack
Executes all the functions in the stack
Free a unique function id effectivly removing the function linked to it from the stack

Properties

Object Properties

FuncsArray, holds the functions
returnValvariable, holds the value that will be returned by the execute method

Functions

VegUIDynFunc

function VegUIDynFunc(returnVal)

Constructor

Parameters

var returnValvalue to be returned by the execute method

add

this.add = function(fn,
id)

Adds a function to the stack

Parameters

function fnfunction to be added to the stack
var idunique id string

Code example

myDynFunc.add(function() { alert('hi'); }, 'hi');

See also

free

execute

this.execute = function(argArr)

Executes all the functions in the stack

Parameters

<Array ArgArr>Array that can hold various parameters.  In order for functions in the stack to be able to work with the argArr argument they need to be defined with it in mind

Code example

myDynFunc.add( function(argArr) { alert(argArr[0]); } );
myDynFunc.execute(['hello world']);

Returns

variablereturns the value of this.returnValue

free

this.free = function(id)

Free a unique function id effectivly removing the function linked to it from the stack

Parameters

variable idunique function id

See also

add

function v(node)
Returns VSK_Node object that controlls the submitted node
function V(id)
Returns VSK_node object that controls the node with the submitted id
vsk_html_node = vsk_h = function(nodeName,
className,
parentNode,
id)
Returns a new node
vsk_txt_node = vsk_t = function(text,
parentNode)
Create and return a text node
function vsk_get_mouse(e)
sets vskX and vskY to the current mouse coordinates
function vsk_rel_target(e)
Returns the related target of a mouse event (cross browser support)
function pi(str)
Wrapper function for parseInt
function in_array(arr,
value)
check if a value exists inside an array
function vsk_rand(min,
max)
Returns a random number
VSK_Node.prototype.abs_x = function(Parent)
Returns the x position of the element relative to the document or a specified parent element
VSK_Node.prototype.abs_y = function(Parent)
Returns the y position of the element relative to the document or a specified parent element
VSK_Node.prototype.clear = function(node)
Removes all the child nodes of the node
VSK_Node.prototype.control = function(node)
Takes control of another node
VSK_Node.prototype.dock = function(toNode)
Appends node to the submitted node as a child
VSK_Node.prototype.event_add = function(eventName,
func)
Method set an event listener on the node (cross browser supported)
VSK_Node.prototype.fade = function(n)
Sets the transparency of the node to the selected value
VSK_Node.prototype.h = function(o)
Returns the height of the node
VSK_Node.prototype.has_parent = function(parentNode)
Check if a node is the parent of the controlled node somewhere down the parentNode list
VSK_Node.prototype.hide = function(hide)
Hides or shows the node
VSK_Node.prototype.html_append = function()
Append multiple nodes to this node as children
VSK_Node.prototype.html_insert_after = function()
Inserts a html node after this html node
VSK_Node.prototype.html_insert_before = function()
Insert one or more html nodes before this node
VSK_Node.prototype.move = function(x,
y,
x2,
y2)
Moves the node to a new position
VSK_Node.prototype.resize = function(w,
h)
Resizes the node
VSK_Node.prototype.set_pos = function(pos,
zIndex)
Sets the css position of the node and the node’s z-index
VSK_Node.prototype.t = function()
Returns the transparency of the node (in percent)
VSK_Node.prototype.trim = function(length,
reverse)
Removes an unspecified amount of child nodes from the beginning or end of the child nodes array of the controlled node until the defined length is reached
VSK_Node.prototype.undock = function()
Removes the node from its parentNode
VSK_Node.prototype.v = function()
Checks if the node is hidden
VSK_Node.prototype.vsk_event_add = function(name,
func,
id)
Adds a vsk specific event handler
VSK_Node.prototype.vsk_event_fire = function(name)
Triggers the event handler for a certain vsk event
VSK_Node.prototype.vsk_event_unset = function(name,
id)
Remove a function from a specific vsk event handler by it’s unique function id
VSK_Node.prototype.w = function(o)
Returns the width of the node
VSK_Node.prototype.x = function()
returns x position of the node
VSK_Node.prototype.x2 = function()
Returns the right x position of the node
VSK_Node.prototype.y = function()
returns y position of the node
VSK_Node.prototype.y2 = function()
Returns the y bottom position of the node
VSK_Node.prototype.z = function()
returns zindex of node
function VegUIDynFunc(returnVal)
Constructor
this.add = function(fn,
id)
Adds a function to the stack
this.execute = function(argArr)
Executes all the functions in the stack
this.free = function(id)
Free a unique function id effectivly removing the function linked to it from the stack