diff --git a/core/block.js b/core/block.js index 315a4d83c..60dba2745 100644 --- a/core/block.js +++ b/core/block.js @@ -46,7 +46,7 @@ goog.require('goog.string'); * @param {!Blockly.Workspace} workspace The block's workspace. * @param {?string} prototypeName Name of the language object containing * type-specific functions for this block. - * @param {=string} opt_id Optional ID. Use this ID if provided, otherwise + * @param {string=} opt_id Optional ID. Use this ID if provided, otherwise * create a new id. * @constructor */ @@ -1023,7 +1023,7 @@ Blockly.Block.prototype.jsonInit = function(json) { * @param {string} message Text contains interpolation tokens (%1, %2, ...) * that match with fields or inputs defined in the args array. * @param {!Array} args Array of arguments to be interpolated. - * @param {=string} lastDummyAlign If a dummy input is added at the end, + * @param {string=} lastDummyAlign If a dummy input is added at the end, * how should it be aligned? * @private */ diff --git a/core/block_svg.js b/core/block_svg.js index db6e70ac6..7c92c767a 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -43,7 +43,7 @@ goog.require('goog.userAgent'); * @param {!Blockly.Workspace} workspace The block's workspace. * @param {?string} prototypeName Name of the language object containing * type-specific functions for this block. - * @param {=string} opt_id Optional ID. Use this ID if provided, otherwise + * @param {string=} opt_id Optional ID. Use this ID if provided, otherwise * create a new id. * @extends {Blockly.Block} * @constructor diff --git a/core/blockly.js b/core/blockly.js index 106957f52..15914fd79 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -24,7 +24,10 @@ */ 'use strict'; -// Top level object for Blockly. +/** + * The top level namespace used to access the Blockly library. + * @namespace Blockly + */ goog.provide('Blockly'); goog.require('Blockly.BlockSvg.render'); diff --git a/core/events.js b/core/events.js index 38e09ec4f..047b0f066 100644 --- a/core/events.js +++ b/core/events.js @@ -24,6 +24,10 @@ */ 'use strict'; +/** + * Events fired as a result of actions in Blockly's editor. + * @namespace Blockly.Events + */ goog.provide('Blockly.Events'); goog.require('goog.array'); diff --git a/core/flyout.js b/core/flyout.js index f2ed92312..8f52b10c3 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -111,13 +111,15 @@ Blockly.Flyout = function(workspaceOptions) { /** * y coordinate of mousedown - used to calculate scroll distances. - * @private {number} + * @type {number} + * @private */ this.startDragMouseY_ = 0; /** * x coordinate of mousedown - used to calculate scroll distances. - * @private {number} + * @type {number} + * @private */ this.startDragMouseX_ = 0; }; @@ -125,40 +127,46 @@ Blockly.Flyout = function(workspaceOptions) { /** * When a flyout drag is in progress, this is a reference to the flyout being * dragged. This is used by Flyout.terminateDrag_ to reset dragMode_. - * @private {Blockly.Flyout} + * @type {Blockly.Flyout} + * @private */ Blockly.Flyout.startFlyout_ = null; /** * Event that started a drag. Used to determine the drag distance/direction and * also passed to BlockSvg.onMouseDown_() after creating a new block. - * @private {Event} + * @type {Event} + * @private */ Blockly.Flyout.startDownEvent_ = null; /** * Flyout block where the drag/click was initiated. Used to fire click events or * create a new block. - * @private {Event} + * @type {Event} + * @private */ Blockly.Flyout.startBlock_ = null; /** * Wrapper function called when a mouseup occurs during a background or block * drag operation. - * @private {Array.} + * @type {Array.} + * @private */ Blockly.Flyout.onMouseUpWrapper_ = null; /** * Wrapper function called when a mousemove occurs during a background drag. - * @private {Array.} + * @type {Array.} + * @private */ Blockly.Flyout.onMouseMoveWrapper_ = null; /** * Wrapper function called when a mousemove occurs during a block drag. - * @private {Array.} + * @type {Array.} + * @private */ Blockly.Flyout.onMouseMoveBlockWrapper_ = null; diff --git a/core/options.js b/core/options.js index 3f756ead7..f5d2b7d94 100644 --- a/core/options.js +++ b/core/options.js @@ -127,8 +127,8 @@ Blockly.Options = function(options) { }; /** - * @type {Blockly.Workspace} the parent of the current workspace, or null if - * there is no parent workspace. + * The parent of the current workspace, or null if there is no parent workspace. + * @type {Blockly.Workspace} **/ Blockly.Options.prototype.parentWorkspace = null; diff --git a/core/workspace.js b/core/workspace.js index a3a72e1b6..89912a724 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -83,14 +83,14 @@ Blockly.Workspace = function(opt_options) { }; /** - * Workspaces may be headless. - * @type {boolean} True if visible. False if headless. + * Returns `true` if the workspace is visible and `false` if it's headless. + * @type {boolean} */ Blockly.Workspace.prototype.rendered = false; /** - * Maximum number of undo events in stack. - * @type {number} 0 to turn off undo, Infinity for unlimited. + * Maximum number of undo events in stack. `0` turns off undo, `Infinity` sets it to unlimited. + * @type {number} */ Blockly.Workspace.prototype.MAX_UNDO = 1024; @@ -362,7 +362,7 @@ Blockly.Workspace.prototype.getWidth = function() { * Obtain a newly created block. * @param {?string} prototypeName Name of the language object containing * type-specific functions for this block. - * @param {=string} opt_id Optional ID. Use this ID if provided, otherwise + * @param {string=} opt_id Optional ID. Use this ID if provided, otherwise * create a new id. * @return {!Blockly.Block} The created block. */ diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 313308d11..34dfb2750 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -69,14 +69,15 @@ Blockly.WorkspaceSvg = function(options) { goog.inherits(Blockly.WorkspaceSvg, Blockly.Workspace); /** - * Wrapper function called when a resize event occurs. - * @type {Array.} Data that can be passed to unbindEvent_ + * A wrapper function called when a resize event occurs. You can pass the result to `unbindEvent_`. + * @type {Array.} */ Blockly.WorkspaceSvg.prototype.resizeHandlerWrapper_ = null; /** - * Svg workspaces are user-visible (as opposed to a headless workspace). - * @type {boolean} True if visible. False if headless. + * The render status of an SVG workspace. + * Returns `true` for visible workspaces and `false` for non-visible, or headless, workspaces. + * @type {boolean} */ Blockly.WorkspaceSvg.prototype.rendered = true; @@ -314,7 +315,7 @@ Blockly.WorkspaceSvg.prototype.dispose = function() { * Obtain a newly created block. * @param {?string} prototypeName Name of the language object containing * type-specific functions for this block. - * @param {=string} opt_id Optional ID. Use this ID if provided, otherwise + * @param {string=} opt_id Optional ID. Use this ID if provided, otherwise * create a new id. * @return {!Blockly.BlockSvg} The created block. */