Classes

Properties

BLOCK_CHANGE

constant   static

Name of event that changes a block.

BLOCK_CREATE

constant   static

Name of event that creates a block.

BLOCK_DELETE

constant   static

Name of event that deletes a block.

BLOCK_MOVE

constant   static

Name of event that moves a block.

CHANGE

constant   static

Name of event that changes a block. Will be deprecated for BLOCK_CHANGE.

COMMENT_CHANGE

constant   static

Name of event that changes a comment.

COMMENT_CREATE

constant   static

Name of event that creates a comment.

COMMENT_DELETE

constant   static

Name of event that deletes a comment.

COMMENT_MOVE

constant   static

Name of event that moves a comment.

CREATE

constant   static

Name of event that creates a block. Will be deprecated for BLOCK_CREATE.

DELETE

constant   static

Name of event that deletes a block. Will be deprecated for BLOCK_DELETE.

MOVE

constant   static

Name of event that moves a block. Will be deprecated for BLOCK_MOVE.

recordUndo

static

boolean

Sets whether the next event should be added to the undo stack.

UI

constant   static

Name of event that records a UI change.

VAR_CREATE

constant   static

Name of event that creates a variable.

VAR_DELETE

constant   static

Name of event that deletes a variable.

VAR_RENAME

constant   static

Name of event that renames a variable.

Methods

clearPendingUndo

static

clearPendingUndo()

Modify pending undo events so that when they are fired they don't land in the undo stack. Called by Blockly.Workspace.clearUndo.

disable

static

disable()

Stop sending events. Every call to this function MUST also call enable.

disableOrphans

static

disableOrphans(event)

Enable/disable a block depending on whether it is properly connected. Use this on applications where all blocks should be connected to a top block. Recommend setting the 'disable' option to 'false' in the config so that users don't try to reenable disabled orphan blocks.

Parameter

event

Blockly.Events.Abstract

Custom data for event.

Value must not be null.

enable

static

enable()

Start sending events. Unless events were already disabled when the corresponding call to disable was made.

filter

static

filter(queueIn, forward) returns Array of non-null Blockly.Events.Abstract

Filter the queued events and merge duplicates.

Parameter

queueIn

Array of non-null Blockly.Events.Abstract

Array of events.

Value must not be null.

forward

boolean

True if forward (redo), false if backward (undo).

Returns

non-null Array of non-null Blockly.Events.Abstract Array of filtered events.

fire

static

fire(event)

Create a custom event and fire it.

Parameter

event

Blockly.Events.Abstract

Custom data for event.

Value must not be null.

fromJson

static

fromJson(json, workspace) returns Blockly.Events.Abstract

Decode the JSON into an event.

Parameter

json

Object

JSON representation.

Value must not be null.

workspace

Blockly.Workspace

Target workspace for event.

Value must not be null.

Returns

non-null Blockly.Events.Abstract The event represented by the JSON.

getGroup

static

getGroup() returns string

Current group.

Returns

string ID string.

isEnabled

static

isEnabled() returns boolean

Returns whether events may be fired or not.

Returns

boolean True if enabled.

setGroup

static

setGroup(state)

Start or stop a group.

Parameter

state

(boolean or string)

True to start new group, false to end group. String to set group explicitly.