From db0dbc69eec19b3f77a4dcfd813e44a315a62875 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 16 Oct 2018 01:40:42 -0700 Subject: [PATCH] Update todos and requires. --- core/block.js | 1 - core/block_svg.js | 2 +- core/blockly.js | 1 + core/connection.js | 1 + core/contextmenu.js | 1 + core/field_variable.js | 2 +- core/flyout_base.js | 1 + core/inject.js | 2 +- core/options.js | 2 ++ core/utils.js | 3 ++- core/variables.js | 1 + core/variables_dynamic.js | 1 + core/workspace_svg.js | 2 +- core/ws_comment_events.js | 6 +++--- core/xml_utils.js | 12 ++++++++---- 15 files changed, 25 insertions(+), 13 deletions(-) diff --git a/core/block.js b/core/block.js index a69e4b381..eef55c47a 100644 --- a/core/block.js +++ b/core/block.js @@ -39,7 +39,6 @@ goog.require('Blockly.Mutator'); goog.require('Blockly.utils'); goog.require('Blockly.Warning'); goog.require('Blockly.Workspace'); -goog.require('Blockly.Xml'); goog.require('goog.math.Coordinate'); diff --git a/core/block_svg.js b/core/block_svg.js index 48d034791..4cd15dde5 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -568,7 +568,7 @@ Blockly.BlockSvg.prototype.createTabList_ = function() { for (var i = 0, input; input = this.inputList[i]; i++) { for (var j = 0, field; field = input.fieldRow[j]; j++) { if (field instanceof Blockly.FieldTextInput) { - // TODO(# 1276): Also support dropdown fields. + // TODO (#1276): Also support dropdown fields. list.push(field); } } diff --git a/core/blockly.js b/core/blockly.js index 2fcd5fb9e..bfd58cdff 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -53,6 +53,7 @@ goog.require('Blockly.WorkspaceSvg'); goog.require('Blockly.constants'); goog.require('Blockly.inject'); goog.require('Blockly.utils'); +goog.require('Blockly.Xml'); goog.require('goog.color'); diff --git a/core/connection.js b/core/connection.js index 87b6d7836..b94d07fec 100644 --- a/core/connection.js +++ b/core/connection.js @@ -27,6 +27,7 @@ goog.provide('Blockly.Connection'); goog.require('Blockly.Events.BlockMove'); +goog.require('Blockly.Xml'); /** diff --git a/core/contextmenu.js b/core/contextmenu.js index d29eae364..b23e8e11e 100644 --- a/core/contextmenu.js +++ b/core/contextmenu.js @@ -33,6 +33,7 @@ goog.provide('Blockly.ContextMenu'); goog.require('Blockly.Events.BlockCreate'); goog.require('Blockly.utils'); goog.require('Blockly.utils.uiMenu'); +goog.require('Blockly.Xml'); goog.require('goog.events'); goog.require('goog.math.Coordinate'); diff --git a/core/field_variable.js b/core/field_variable.js index 3b488f441..9622374d6 100644 --- a/core/field_variable.js +++ b/core/field_variable.js @@ -90,7 +90,7 @@ Blockly.FieldVariable.prototype.init = function() { } Blockly.FieldVariable.superClass_.init.call(this); - // TODO (1010): Change from init/initModel to initView/initModel + // TODO (#1010): Change from init/initModel to initView/initModel this.initModel(); }; diff --git a/core/flyout_base.js b/core/flyout_base.js index fc4dac2af..235a03bb9 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -35,6 +35,7 @@ goog.require('Blockly.Gesture'); goog.require('Blockly.Touch'); goog.require('Blockly.utils'); goog.require('Blockly.WorkspaceSvg'); +goog.require('Blockly.Xml'); goog.require('goog.math.Rect'); diff --git a/core/inject.js b/core/inject.js index acfe4e10f..5ee706d15 100644 --- a/core/inject.js +++ b/core/inject.js @@ -355,7 +355,7 @@ Blockly.inject.bindDocumentEvents_ = function() { if (goog.userAgent.IPAD) { Blockly.bindEventWithChecks_(window, 'orientationchange', document, function() { - // TODO(#397): Fix for multiple blockly workspaces. + // TODO (#397): Fix for multiple Blockly workspaces. Blockly.svgResize(Blockly.getMainWorkspace()); }); } diff --git a/core/options.js b/core/options.js index 5b3e4ba81..51a47a1ce 100644 --- a/core/options.js +++ b/core/options.js @@ -26,6 +26,8 @@ goog.provide('Blockly.Options'); +goog.require('Blockly.Xml'); + /** * Parse the user-specified options, using reasonable defaults where behaviour diff --git a/core/utils.js b/core/utils.js index 7c83c37b2..8d5ccac83 100644 --- a/core/utils.js +++ b/core/utils.js @@ -432,7 +432,8 @@ Blockly.utils.checkMessageReferences = function(message) { var msgTable = Blockly.Msg; - // TODO(#1169): Implement support for other string tables, prefixes other than BKY_. + // TODO (#1169): Implement support for other string tables, + // prefixes other than BKY_. var regex = /%{(BKY_[A-Z][A-Z0-9_]*)}/gi; var match = regex.exec(message); while (match) { diff --git a/core/variables.js b/core/variables.js index 6e2e1f63a..fbd627f48 100644 --- a/core/variables.js +++ b/core/variables.js @@ -34,6 +34,7 @@ goog.require('Blockly.Blocks'); goog.require('Blockly.constants'); goog.require('Blockly.VariableModel'); goog.require('Blockly.Workspace'); +goog.require('Blockly.Xml'); goog.require('goog.string'); diff --git a/core/variables_dynamic.js b/core/variables_dynamic.js index 22e29402c..51d1d110f 100644 --- a/core/variables_dynamic.js +++ b/core/variables_dynamic.js @@ -33,6 +33,7 @@ goog.require('Blockly.constants'); goog.require('Blockly.VariableModel'); // TODO Fix circular dependencies // goog.require('Blockly.Workspace'); +goog.require('Blockly.Xml'); Blockly.VariablesDynamic.onCreateVariableButtonClick_String = function(button) { diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 471695dbf..5f5a462d9 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -1052,7 +1052,7 @@ Blockly.WorkspaceSvg.prototype.pasteWorkspaceComment_ = function(xmlComment) { commentX = -commentX; } // Offset workspace comment. - // TODO: #1719 properly offset comment such that it's not interfereing + // TODO (#1719): Properly offset comment such that it's not interfering // with any blocks. commentX += 50; commentY += 50; diff --git a/core/ws_comment_events.js b/core/ws_comment_events.js index daf8f8c8a..7d245d50f 100644 --- a/core/ws_comment_events.js +++ b/core/ws_comment_events.js @@ -195,7 +195,7 @@ Blockly.Events.CommentCreate.prototype.type = Blockly.Events.COMMENT_CREATE; * Encode the event as JSON. * @return {!Object} JSON representation. */ -// TODO(#1266): "Full" and "minimal" serialization. +// TODO (#1266): "Full" and "minimal" serialization. Blockly.Events.CommentCreate.prototype.toJson = function() { var json = Blockly.Events.CommentCreate.superClass_.toJson.call(this); json['xml'] = Blockly.Xml.domToText(this.xml); @@ -268,7 +268,7 @@ Blockly.Events.CommentDelete.prototype.type = Blockly.Events.COMMENT_DELETE; * Encode the event as JSON. * @return {!Object} JSON representation. */ -// TODO(#1266): "Full" and "minimal" serialization. +// TODO (#1266): "Full" and "minimal" serialization. Blockly.Events.CommentDelete.prototype.toJson = function() { var json = Blockly.Events.CommentDelete.superClass_.toJson.call(this); return json; @@ -357,7 +357,7 @@ Blockly.Events.CommentMove.prototype.setOldCoordinate = function(xy) { * Encode the event as JSON. * @return {!Object} JSON representation. */ -// TODO(#1266): "Full" and "minimal" serialization. +// TODO (#1266): "Full" and "minimal" serialization. Blockly.Events.CommentMove.prototype.toJson = function() { var json = Blockly.Events.CommentMove.superClass_.toJson.call(this); if (this.newCoordinate_) { diff --git a/core/xml_utils.js b/core/xml_utils.js index fa5efdc28..60c6518d0 100644 --- a/core/xml_utils.js +++ b/core/xml_utils.js @@ -35,10 +35,11 @@ goog.provide('Blockly.Xml.utils'); * Create DOM element for XML. * @param {string} tagName Name of DOM element. * @return {!Element} New DOM element. + * @package */ Blockly.Xml.utils.createElement = function(tagName) { - // TODO: Namespace this element. - // TODO: Support node.js. + // TODO (#1978): Namespace this element. + // TODO (#2082): Support node.js. return document.createElement(tagName); }; @@ -46,9 +47,10 @@ Blockly.Xml.utils.createElement = function(tagName) { * Create text element for XML. * @param {text} text Text content. * @return {!Node} New DOM node. + * @package */ Blockly.Xml.utils.createTextNode = function(text) { - // TODO: Support node.js. + // TODO (#2082): Support node.js. return document.createTextNode(text); }; @@ -58,6 +60,7 @@ Blockly.Xml.utils.createTextNode = function(text) { * @param {string} text XML string. * @return {!Element} The DOM document. * @throws if XML doesn't parse. + * @package */ Blockly.Xml.utils.textToDomDocument = function(text) { var oParser = new DOMParser(); @@ -69,9 +72,10 @@ Blockly.Xml.utils.textToDomDocument = function(text) { * Currently the text format is fairly ugly: all one line with no whitespace. * @param {!Element} dom A tree of XML elements. * @return {string} Text representation. + * @package */ Blockly.Xml.utils.domToText = function(dom) { - // TODO: Support node.js. + // TODO (#2082): Support node.js. var oSerializer = new XMLSerializer(); return oSerializer.serializeToString(dom); };