Skip to content
Dethe Elza edited this page Jan 16, 2015 · 9 revisions

OUTDATED: This page needs to be updated and does not reflect the current state of Waterbear.


WikiAPI ReferenceBlock

Initialize both menu (template) blocks and instance (script) blocks, maintain their state, serialize and deserialize them.


# wb.Block(obj)

Registers a block and returns a DOM element for the block.

  • obj: A block object.

===

# wb.blockDesc(block)

Returns the descriptor for the block.

  • block: A block object.

===

# wb.blockRegistery

An object containing all the registered blocks.

===

# wb.changeName(event)

Renames a block.

  • event: An event triggered by the block to be renamed.

===

# wb.cloneBlock(block)

Makes a copy of the block.

  • block: A HTML element representing the block to be cloned.

===

# wb.codeFromBlock(block)

Returns the code for a specific block.

  • block: A HTML element representing the block.

===

# wb.getSockets()

Returns an array of all the sockets in a block.

===

# wb.getSocketValue(socket)

Returns the value in a socket.

  • socket:

===

# wb.registerSeqNum(seqNum)

Sets sequence number to a specific value.

  • seqNum: The new sequence number.

===

# wb.resetSeqNum()

Resets sequence number to 0.