vegUI.org home of the javascript based window manager and AJAX framework

VegUISiteKit: Core Library

The vegUI Site Kit core library provides the VSK_Node object which allows the manipulation of any existing node in the document. Node's can be moved, resized, made transparent and much more. Also provides functions to create new nodes and handle events. Most of the VSK libraries required this library as a dependency.

Demonstration

Code: Javascript

/* 
 * Take control of the node with id 'mynode', the V function looks for the node with the id
 * and then creates a VSK_Node object controlling the node. The VSK_Node object
 * offers several functions that allow you to manipulate the node.
 */

var n = V('mynode');

/* 
 * position, move and resize the node
 */

n.set_pos('absolute');
n.move(50,50);
n.resize(100,100);

/* 
 * since every manipulation method returns the object it self you can do some quick
 * prototyping
 */

V('mynode').set_pos('absolute').move(50,50).resize(100,100);

Dependencies:

none

Download (Updated: 18th October 2007)

This package contains the code in both commented and compressed forms. The compressed version has had it's comments and unnecessary whitespace removed in order to reduce it's size.

download version
tar.gz (8 KB),
zip (11 KB)
0.1.4 (beta)
tar.gz (8 KB),
zip (10 KB)
0.1.3 (beta)
tar.gz (7,8 KB),
zip (10 KB)
0.1.2 (beta)

Tutorials on using this library

BETA notice

While this library is in BETA phase YOU can help get it out of there quicker by submitting any bugs you may find to the bug database. Thanks for helping ;)

Changelog

2007-10-14 - vegu@vegui.org
        * version 0.1.4
        * added: VSK_Node.move(): two additional optional arguments (x2 and
        y2) that overwrite x and y. (x = left, y = top, x2 = right, y2 =
        bottom)

2007-09-25 - vegu@vegui.org
        * version 0.1.3
        * fixed an error that was caused by array iteration when the library
        was used together with the prototype library

2007-07-14 - vegu@vegui.org

        * fixed: vsk_rel_target() will now return the element the mouse
        pointer is coming from when the submitted event type is mouseover in
        internet explorer

2007-04-08 - vegu@vegui.org

        * version 0.1.2
        * fixed: the V() function now returns NULL if no node with the
        specified id was found in the document

2007-04-05 - vegu@vegui.org

        * added: VSK_Node.abs_x(): returns the position of the element on the x
        axis relative to the document or a submitted parent node
        * added: VSK_Node.abs_y(): returns the position of the element on the
        y axis relative to the document or a submitted parent node
        * added: added new event called 'hide' that will fire when the
        VSK_Node.hide() method is called on the element.

2007-03-29 - vegu@vegui.org

        * updated: VSK_Node.w() and h() now take an optional argument that
        makes them return the offsetWidth / offsetHeight attributes even if
        their style counterparts are set.
        * added: global function: vsk_rand(), returns a random number
        * fixed: VSK_Node.fade(), now fades the object to 1% transparency if a
        number lower than that is submitted. In order to hide the note
        completly the hide() method should be used instead.

2007-03-20 - vegu@vegui.org

        * fixed: dock() now returns the object
        * added: vsk specific event handling for resize, move, dock and undock
        * added: method to VSK_Node: vsk_event_add() to add a function to a vsk
        specific event handler
        * added: method to VSK_Node: vsk_event_unset() to remove a function
        from a vsk specific event handler
        * added: method to VSK_Node: vsk_event_fire() to trigger the handling
        of a vsk specific event
        * added: VegUIDynFunc class from the original vegUI framework