Preference Dialog

Properties

pref.name

string, ( r )

The scriptable name of this droplet.  This name can be set using rename method dynamically.

pref.width

string, ( r, w )

Specifies the width of this droplet.

autoDefault.  The DIV container calculates the actual width automatically.
%Defines the width in % of the document’s width.
lengthDefines the width in px, cm, etc.

pref.height

string, ( r, w )

Specifies the height of this droplet.

autoDefault.  The DIV container calculates the actual height automatically.
%Defines the height in % of the document’s height.
lengthDefines the height in px, cm, etc.

pref.passthru

bool, ( r, w )

Specifies if the droplet should handle user interface events or pass them to the droplets underneath.

pref.hideonload

bool, ( r, w )

Specifies if the droplet should be hidden on app loads.

parentBoxID

string, ( r )

Returns the identifier of the parent droplet that this droplet attaches to.

parentBox

string, ( r )

Returns the parent droplet that this droplet attaches to.

childBoxes

array, ( r )

Returns the array of child droplets that are currently attached to this droplet.

boxWidth

string, ( r )

Returns the width of this droplet in pixels.

boxHeight

string, ( r )

Returns the height of this droplet in pixels.

position

object, ( r )

Returns the position of this droplet in relation to the upper-left corner of the document, {x:100,y:100};

size

object, ( r )

Returns the dimension of this droplet, {x:300,y:500};

zIndex

int, ( r, w )

Specifies the z-order of this droplet.

div

object, ( r )

Returns the container div of this droplet.

draggable

bool, ( w )

Makes this droplet draggable.

droppable

bool, ( w )

Makes this droplet droppable.

molecules

array, ( r, w )

An array of molecules.  Used to access individual molecule by index.  (e.g. droplet.molecules[3]).

Functions

paint

paint: function()
paint();

Forces droplet to repaint its canvas molecule, if any.

Parameters

N/A

Returns

N/A

getElementsByTagName

getElementsByTagName: function(n)
getElementsByTagName(name);

Searches within this droplet and returns an array of elements having the given tag name.

Parameters

name(string) a valid tag name.

Returns

(array) an array of DOM elements.

getElementById

getElementById: function(n)
getElementById(id);

Searches within this droplet for element with the given id.

Parameters

id(string) an ID.

Returns

(object) a DOM element.

$n

$n: function(n)
$n(name);

Short hand version of getElementsByTagName.

Parameters

name(string) a valid tag name.

Returns

(array) an array of DOM elements.

$

$: function(n)
$(id);

Short hand version of getElementById.

Parameters

id(string) an ID.

Returns

(object) a DOM element.

$$

$$: function(n)
$$(selector);

Searches within this droplet and returns an array of elements satisfying the given css selector.

Parameters

selector(string) a valid css selector.

Returns

(array) an array of DOM elements.

refreshMolecules

refreshMolecules: function()
refreshMolecules();

Forces this droplet’s iframe and gmap molecules to reload.

Parameters

N/A

Returns

N/A

isDropletAtPoint

isDropletAtPoint(x, y);

Query if this droplet contains the given point.

Parameters

x(int) x-coordinate in pixel.
y(int) y-coordinate in pixel.

Returns

(bool) result in boolean.

center

center: function()
center();

Moves this droplet to the center of document.

Parameters

N/A

Returns

N/A

show

show: function()
show();

Show this droplet.

Parameters

N/A

Returns

N/A

hide

hide: function()
hide();

Hide this droplet.

Parameters

N/A

Returns

N/A

showAll

showAll: function()
showAll();

Show this droplet and all its attached child droplets.

Parameters

N/A

Returns

N/A

hideAll

hideAll: function()
hideAll();

Hide this droplet and all its attached child droplets.

Parameters

N/A

Returns

N/A

showAllChildren

showAllChildren: function()
showAllChildren();

Show all attached child droplets.

Parameters

N/A

Returns

N/A

hideAllChildren

hideAllChildren: function()
hideAllChildren();

Hide all attached child droplets.

Parameters

N/A

Returns

N/A

delete

deleteBox: function(deep)
delete(deep);

Deletes this droplet.

Parameters

deep(bool) delete all attached child droplets as well.

Returns

N/A

rotateTo

rotateTo: function(d)
rotateTo(deg);

Rotates this droplet to the given degree from its default horizontal position.

Parameters

deg(float) angle in degree.

Returns

N/A

rotateBy

rotateBy: function(d)
rotateBy(deg);

Rotates this droplet by given degree.

Parameters

deg(float) angle in degree.

Returns

N/A

moveTo

moveTo: function(x,
y)
moveTo(x, y);

Moves this droplet to location (x, y) relative to the upper left corner of the document.

Parameters

x(int) x-coordinate in pixel.
y(int) y-coordinate in pixel.

Returns

N/A

moveBy

moveBy: function(x,
y)
moveBy(x, y);

Moves this droplet by x and y pixels.

Parameters

x(int) x-coordinate in pixel.
y(int) y-coordinate in pixel.

Returns

N/A

resizeTo

resizeTo: function(x,
y)
resizeTo(w, h);

Resizes this droplet to the given width and height.

Parameters

w(int) width in pixel.
h(int) height in pixel.

Returns

N/A

resizeBy

resizeBy: function(x,
y)
resizeBy(w, h);

Resizes this droplet by w and h pixels.

Parameters

w(int) width delta in pixel.
h(int) height delta in pixel.

Returns

N/A

addMolecule

addMolecule(molecule);

Adds a molecule to this droplet.  The new molecule is appended to the molecules array.

Parameters

molecule(object) a moleclule.

Returns

N/A

getMolecules

getMolecules(type);

Returns the molecules of given type within this droplet.

Parameters

type(string) a space-delimited molecule types.

Returns

(array) an array of molecules.

$m

$m(type);

Short hand version of getMolecules.

Parameters

type(string) a space-delimited molecule types.

Returns

(array) an array of molecules.

$mn

$mn(name);

Retrieve a molecule with the given name.

Parameters

name(string) name of a molecule as specified by pref.name.

Returns

(object) a molecule.

deepClone

deepClone: function(sameScene)
deepClone(cloneScene);

Creates a clone of this droplet and all its attached child droplets. if cloneScene is true, all child 3D molecules are duplicated and placed in the same 3D scene, otherwise, it is placed in a duplicated scene.

Parameters

cloneScene(bool) clone 3D scene.  Default to false.

Returns

N/A

clone

clone: function(sameScene)
clone(cloneScene);

Creates a clone of this droplet. if cloneScene is true, all child 3D molecules are duplicated and placed in the same 3D scene, otherwise, it is placed in a duplicated scene.

Parameters

cloneScene(bool) clone 3D scene.  Default to false.

Returns

N/A

rename

rename: function(name)
rename(name);

Rename this droplet.

Parameters

name(string) a new name.

Returns

N/A

serialize

serialize: function()
serialize();

Serialize this droplet into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a droplet.

dispatchEvent

dispatchEvent: function(evt_name)
dispatchEvent(event_name);

Dispatches a custom DOM event with the given event name to this droplet.

Parameters

event_name(string) event name.

Returns

N/A

dispatchEventWithData

dispatchEventWithData: function(evt_name,
data_name,
data)
dispatchEventWithData(event_name, obj_name, obj);

Dispatches a custom DOM event with the given event name and a data object with the given name to this droplet.  The receiver of the event can use params[obj_name] to access passed data in a script molecule.

Parameters

event_name(string) event name.
obj_name(string) data object name.
obj(object) data object.

Returns

N/A

refresh

refresh: function()
refresh();

Forces this droplet to redraw with the current set of preference properties.

Parameters

N/A

Returns

N/A

attachToDroplet

attachToDroplet(o);

If o is a droplet, attaches this droplet to the given droplet, if o is of type string, to the droplet with the given name.

Parameters

droplet(object or string) a droplet or a droplet’s name.

Returns

N/A

detachFromDroplet

detachFromDroplet();

Detach from the parent droplet, if any.

Parameters

N/A

Returns

N/A

bringDropletToTop

bringDropletToTop();

Brings this droplet to the top of z-order.

Parameters

N/A

Returns

N/A

paint: function()
getElementsByTagName: function(n)
getElementById: function(n)
$n: function(n)
$: function(n)
$$: function(n)
refreshMolecules: function()
center: function()
show: function()
hide: function()
showAll: function()
hideAll: function()
showAllChildren: function()
hideAllChildren: function()
deleteBox: function(deep)
rotateTo: function(d)
rotateBy: function(d)
moveTo: function(x,
y)
moveBy: function(x,
y)
resizeTo: function(x,
y)
resizeBy: function(x,
y)
deepClone: function(sameScene)
clone: function(sameScene)
rename: function(name)
serialize: function()
dispatchEvent: function(evt_name)
dispatchEventWithData: function(evt_name,
data_name,
data)
refresh: function()
array, ( r, w )
Close