From 8fb1178ed82fd97edd40575ff624332e07c151a2 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Mon, 14 Mar 2016 16:00:25 -0700 Subject: [PATCH] Update message descriptions. --- core/connection.js | 2 +- core/connection_db.js | 4 ++-- core/events.js | 4 ++-- core/workspace_svg.js | 2 +- msg/messages.js | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/connection.js b/core/connection.js index 1e38fe42c..eda88eafa 100644 --- a/core/connection.js +++ b/core/connection.js @@ -816,7 +816,7 @@ Blockly.Connection.prototype.unhideAll = function() { for (var c = 0; c < connections.length; c++) { renderList.push.apply(renderList, connections[c].unhideAll()); } - if (renderList.length == 0) { + if (!renderList.length) { // Leaf block. renderList[0] = block; } diff --git a/core/connection_db.js b/core/connection_db.js index b1c85b1b3..2da1ac703 100644 --- a/core/connection_db.js +++ b/core/connection_db.js @@ -71,7 +71,7 @@ Blockly.ConnectionDB.prototype.addConnection = function(connection) { * @return The index of the connection, or -1 if the connection was not found. */ Blockly.ConnectionDB.prototype.findConnection = function(conn) { - if (this.length == 0) { + if (!this.length) { return -1; } @@ -110,7 +110,7 @@ Blockly.ConnectionDB.prototype.findConnection = function(conn) { * @private */ Blockly.ConnectionDB.prototype.findPositionForConnection_ = function(connection) { - if (this.length == 0) { + if (!this.length) { return 0; } var pointerMin = 0; diff --git a/core/events.js b/core/events.js index 3f6cfb208..9cf1c9217 100644 --- a/core/events.js +++ b/core/events.js @@ -85,8 +85,8 @@ Blockly.Events.fire = function(event) { if (!Blockly.Events.isEnabled()) { return; } - if (Blockly.Events.FIRE_QUEUE_.length == 0) { - // Schedule a firing of the event queue. + if (!Blockly.Events.FIRE_QUEUE_.length) { + // First event added; schedule a firing of the event queue. setTimeout(Blockly.Events.fireNow_, 0); } Blockly.Events.FIRE_QUEUE_.push(event); diff --git a/core/workspace_svg.js b/core/workspace_svg.js index d2ccf64c2..444a73109 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -670,7 +670,7 @@ Blockly.WorkspaceSvg.prototype.onMouseWheel_ = function(e) { Blockly.WorkspaceSvg.prototype.getBlocksBoundingBox = function() { var topBlocks = this.getTopBlocks(); // There are no blocks, return empty rectangle. - if (topBlocks.length <= 0) { + if (!topBlocks.length) { return {x: 0, y: 0, width: 0, height: 0}; } diff --git a/msg/messages.js b/msg/messages.js index 7e4a3dddd..66ef72bb5 100644 --- a/msg/messages.js +++ b/msg/messages.js @@ -250,11 +250,11 @@ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = 'Return true if the first input is great Blockly.Msg.LOGIC_OPERATION_HELPURL = 'https://github.com/google/blockly/wiki/Logic#logical-operations'; /// tooltip - See [https://en.wikipedia.org/wiki/Logical_conjunction https://en.wikipedia.org/wiki/Logical_conjunction]. Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = 'Return true if both inputs are true.'; -/// block text - See [https://en.wikipedia.org/wiki/Logical_conjunction https://en.wikipedia.org/wiki/Logical_conjunction]. +/// block text - See [https://en.wikipedia.org/wiki/Logical_conjunction https://en.wikipedia.org/wiki/Logical_conjunction].\n{{Identical|And}} Blockly.Msg.LOGIC_OPERATION_AND = 'and'; /// block text - See [https://en.wikipedia.org/wiki/Disjunction https://en.wikipedia.org/wiki/Disjunction]. Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = 'Return true if at least one of the inputs is true.'; -/// block text - See [https://en.wikipedia.org/wiki/Disjunction https://en.wikipedia.org/wiki/Disjunction]. +/// block text - See [https://en.wikipedia.org/wiki/Disjunction https://en.wikipedia.org/wiki/Disjunction].\n{{Identical|Or}} Blockly.Msg.LOGIC_OPERATION_OR = 'or'; /// url - Information about logical negation. The translation of [https://en.wikipedia.org/wiki/Logical_negation https://en.wikipedia.org/wiki/Logical_negation] is recommended if it exists in the target language.