diff --git a/blockly_uncompressed.js b/blockly_uncompressed.js index 1404ccb16..e5c54697e 100644 --- a/blockly_uncompressed.js +++ b/blockly_uncompressed.js @@ -21,27 +21,28 @@ this.BLOCKLY_DIR = (function(root) { this.BLOCKLY_BOOT = function(root) { // Execute after Closure has loaded. -goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Tooltip', 'Blockly.Workspace', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.deprecation', 'Blockly.utils.object', 'Blockly.utils.string'], {'lang': 'es5'}); +goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Tooltip', 'Blockly.Workspace', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.deprecation', 'Blockly.utils.object', 'Blockly.utils.string'], {'lang': 'es5'}); goog.addDependency('../../core/block_animations.js', ['Blockly.blockAnimations'], ['Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/block_drag_surface.js', ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events', 'Blockly.Events.BlockDrag', 'Blockly.Events.BlockMove', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.constants', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Selected', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Xml', 'Blockly.blockAnimations', 'Blockly.blockRendering.IPathObject', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarCreate', 'Blockly.Procedures', 'Blockly.ShortcutRegistry', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.inject', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.colour'], {}); +goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Selected', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Xml', 'Blockly.blockAnimations', 'Blockly.blockRendering.IPathObject', 'Blockly.browserEvents', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarCreate', 'Blockly.Procedures', 'Blockly.ShortcutRegistry', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.inject', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.colour'], {}); goog.addDependency('../../core/blocks.js', ['Blockly.Blocks'], [], {}); goog.addDependency('../../core/browser_events.js', ['Blockly.browserEvents'], ['Blockly.Touch'], {}); goog.addDependency('../../core/bubble.js', ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate'], {}); goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.browserEvents', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml', 'Blockly.constants', 'Blockly.utils.deprecation'], {}); -goog.addDependency('../../core/connection_checker.js', ['Blockly.ConnectionChecker'], ['Blockly.Connection', 'Blockly.IConnectionChecker', 'Blockly.constants', 'Blockly.registry'], {}); -goog.addDependency('../../core/connection_db.js', ['Blockly.ConnectionDB'], ['Blockly.RenderedConnection', 'Blockly.constants'], {}); -goog.addDependency('../../core/constants.js', ['Blockly.constants'], [], {}); +goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.deprecation'], {}); +goog.addDependency('../../core/connection_checker.js', ['Blockly.ConnectionChecker'], ['Blockly.Connection', 'Blockly.IConnectionChecker', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.registry'], {}); +goog.addDependency('../../core/connection_db.js', ['Blockly.ConnectionDB'], ['Blockly.RenderedConnection', 'Blockly.connectionTypes', 'Blockly.constants'], {}); +goog.addDependency('../../core/connection_types.js', ['Blockly.connectionTypes'], [], {}); +goog.addDependency('../../core/constants.js', ['Blockly.constants'], ['Blockly.connectionTypes'], {}); goog.addDependency('../../core/contextmenu.js', ['Blockly.ContextMenu'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/contextmenu_items.js', ['Blockly.ContextMenuItems'], ['Blockly.Events', 'Blockly.constants'], {'lang': 'es5'}); +goog.addDependency('../../core/contextmenu_items.js', ['Blockly.ContextMenuItems'], ['Blockly.Events', 'Blockly.constants', 'Blockly.inputTypes'], {'lang': 'es5'}); goog.addDependency('../../core/contextmenu_registry.js', ['Blockly.ContextMenuRegistry'], ['Blockly.ContextMenuItems'], {'lang': 'es5'}); goog.addDependency('../../core/css.js', ['Blockly.Css'], [], {'lang': 'es5'}); goog.addDependency('../../core/dropdowndiv.js', ['Blockly.DropDownDiv'], ['Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.style'], {}); -goog.addDependency('../../core/events/block_events.js', ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/events/block_events.js', ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.Xml', 'Blockly.connectionTypes', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/events/events.js', ['Blockly.Events'], ['Blockly.registry', 'Blockly.utils'], {}); goog.addDependency('../../core/events/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events'], {}); goog.addDependency('../../core/events/events_block_drag.js', ['Blockly.Events.BlockDrag'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {}); @@ -80,8 +81,9 @@ goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.ASTNo goog.addDependency('../../core/grid.js', ['Blockly.Grid'], ['Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/icon.js', ['Blockly.Icon'], ['Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/inject.js', ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/input.js', ['Blockly.Input'], ['Blockly.Connection', 'Blockly.constants', 'Blockly.fieldRegistry'], {'lang': 'es5'}); -goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.Block', 'Blockly.Events', 'Blockly.blockAnimations', 'Blockly.constants'], {'lang': 'es5'}); +goog.addDependency('../../core/input.js', ['Blockly.Input'], ['Blockly.Connection', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes'], {'lang': 'es5'}); +goog.addDependency('../../core/input_types.js', ['Blockly.inputTypes'], ['Blockly.connectionTypes'], {}); +goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.Block', 'Blockly.Events', 'Blockly.blockAnimations', 'Blockly.connectionTypes', 'Blockly.constants'], {'lang': 'es5'}); goog.addDependency('../../core/interfaces/i_accessibility.js', ['Blockly.IASTNodeLocation', 'Blockly.IASTNodeLocationSvg', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.IKeyboardAccessible'], [], {}); goog.addDependency('../../core/interfaces/i_bounded_element.js', ['Blockly.IBoundedElement'], [], {}); goog.addDependency('../../core/interfaces/i_bubble.js', ['Blockly.IBubble'], [], {}); @@ -100,7 +102,7 @@ goog.addDependency('../../core/interfaces/i_selectable.js', ['Blockly.ISelectabl goog.addDependency('../../core/interfaces/i_styleable.js', ['Blockly.IStyleable'], [], {}); goog.addDependency('../../core/interfaces/i_toolbox.js', ['Blockly.IToolbox'], [], {}); goog.addDependency('../../core/interfaces/i_toolbox_item.js', ['Blockly.ICollapsibleToolboxItem', 'Blockly.ISelectableToolboxItem', 'Blockly.IToolboxItem'], [], {}); -goog.addDependency('../../core/keyboard_nav/ast_node.js', ['Blockly.ASTNode'], ['Blockly.constants', 'Blockly.utils.Coordinate'], {'lang': 'es5'}); +goog.addDependency('../../core/keyboard_nav/ast_node.js', ['Blockly.ASTNode'], ['Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.Coordinate'], {'lang': 'es5'}); goog.addDependency('../../core/keyboard_nav/basic_cursor.js', ['Blockly.BasicCursor'], ['Blockly.ASTNode', 'Blockly.Cursor', 'Blockly.registry'], {'lang': 'es5'}); goog.addDependency('../../core/keyboard_nav/cursor.js', ['Blockly.Cursor'], ['Blockly.ASTNode', 'Blockly.Marker', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es5'}); goog.addDependency('../../core/keyboard_nav/marker.js', ['Blockly.Marker'], ['Blockly.ASTNode'], {}); @@ -115,21 +117,21 @@ goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg', 'Bl goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.IdGenerator', 'Blockly.utils.Metrics', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.constants', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/registry.js', ['Blockly.registry'], [], {}); -goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.blockRendering'], ['Blockly.registry', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.constants', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es5'}); -goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/common/drawer.js', ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); goog.addDependency('../../core/renderers/common/i_path_object.js', ['Blockly.blockRendering.IPathObject'], [], {}); -goog.addDependency('../../core/renderers/common/info.js', ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.constants'], {}); -goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode', 'Blockly.Events', 'Blockly.Events.MarkerMove', 'Blockly.constants', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/renderers/common/info.js', ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.inputTypes'], {}); +goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode', 'Blockly.Events', 'Blockly.Events.MarkerMove', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.IPathObject', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/renderers/common/renderer.js', ['Blockly.blockRendering.Renderer'], ['Blockly.IRegistrable', 'Blockly.InsertionMarkerManager', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Debug', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo', 'Blockly.constants'], {}); +goog.addDependency('../../core/renderers/common/renderer.js', ['Blockly.blockRendering.Renderer'], ['Blockly.IRegistrable', 'Blockly.InsertionMarkerManager', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Debug', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo', 'Blockly.connectionTypes', 'Blockly.constants'], {}); goog.addDependency('../../core/renderers/geras/constants.js', ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/geras/drawer.js', ['Blockly.geras.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.geras.Highlighter', 'Blockly.geras.RenderInfo', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {}); goog.addDependency('../../core/renderers/geras/highlight_constants.js', ['Blockly.geras.HighlightConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/geras/highlighter.js', ['Blockly.geras.Highlighter'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); -goog.addDependency('../../core/renderers/geras/info.js', ['Blockly.geras', 'Blockly.geras.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/geras/info.js', ['Blockly.geras', 'Blockly.geras.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.inputTypes', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/geras/measurables/inputs.js', ['Blockly.geras.InlineInput', 'Blockly.geras.StatementInput'], ['Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.StatementInput', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/geras/path_object.js', ['Blockly.geras.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.PathObject', 'Blockly.geras.ConstantProvider', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/geras/renderer.js', ['Blockly.geras.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.geras.ConstantProvider', 'Blockly.geras.Drawer', 'Blockly.geras.HighlightConstantProvider', 'Blockly.geras.PathObject', 'Blockly.geras.RenderInfo', 'Blockly.utils.object'], {}); @@ -145,15 +147,15 @@ goog.addDependency('../../core/renderers/minimalist/info.js', ['Blockly.minimali goog.addDependency('../../core/renderers/minimalist/renderer.js', ['Blockly.minimalist.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.minimalist.ConstantProvider', 'Blockly.minimalist.Drawer', 'Blockly.minimalist.RenderInfo', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/thrasos/info.js', ['Blockly.thrasos', 'Blockly.thrasos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/thrasos/renderer.js', ['Blockly.thrasos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.thrasos.RenderInfo', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/zelos/constants.js', ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.constants', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/zelos/constants.js', ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/zelos/drawer.js', ['Blockly.zelos.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.utils.svgPaths', 'Blockly.zelos.RenderInfo'], {}); -goog.addDependency('../../core/renderers/zelos/info.js', ['Blockly.zelos', 'Blockly.zelos.RenderInfo'], ['Blockly.FieldImage', 'Blockly.FieldLabel', 'Blockly.FieldTextInput', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow'], {}); +goog.addDependency('../../core/renderers/zelos/info.js', ['Blockly.zelos', 'Blockly.zelos.RenderInfo'], ['Blockly.FieldImage', 'Blockly.FieldLabel', 'Blockly.FieldTextInput', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.inputTypes', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow'], {}); goog.addDependency('../../core/renderers/zelos/marker_svg.js', ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/renderers/zelos/measurables/inputs.js', ['Blockly.zelos.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/zelos/measurables/row_elements.js', ['Blockly.zelos.RightConnectionShape'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/zelos/measurables/rows.js', ['Blockly.zelos.BottomRow', 'Blockly.zelos.TopRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/zelos/path_object.js', ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider'], {}); -goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Renderer'], ['Blockly.InsertionMarkerManager', 'Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.constants', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo'], {}); +goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Renderer'], ['Blockly.InsertionMarkerManager', 'Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo'], {}); goog.addDependency('../../core/requires.js', ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.HorizontalFlyout', 'Blockly.Mutator', 'Blockly.Themes.Classic', 'Blockly.Themes.Dark', 'Blockly.Themes.Deuteranopia', 'Blockly.Themes.HighContrast', 'Blockly.Themes.Tritanopia', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.ZoomControls', 'Blockly.geras.Renderer', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer'], {}); goog.addDependency('../../core/scrollbar.js', ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['Blockly.Events', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/shortcut_items.js', ['Blockly.ShortcutItems'], ['Blockly.utils.KeyCodes'], {}); @@ -175,7 +177,7 @@ goog.addDependency('../../core/toolbox/toolbox_item.js', ['Blockly.ToolboxItem'] goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.browserEvents', 'Blockly.utils.string'], {}); goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.constants', 'Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.string'], {}); goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.Events', 'Blockly.Events.TrashcanOpen', 'Blockly.IPositionable', 'Blockly.Scrollbar', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.toolbox'], {}); +goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.Events', 'Blockly.Events.TrashcanOpen', 'Blockly.IPositionable', 'Blockly.Scrollbar', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.toolbox'], {'lang': 'es5'}); goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.constants', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.colour', 'Blockly.utils.global', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/utils/aria.js', ['Blockly.utils.aria'], [], {}); goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], [], {}); @@ -210,8 +212,8 @@ goog.addDependency('../../core/workspace_comment_render_svg.js', ['Blockly.Works goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Selected', 'Blockly.WorkspaceComment', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate'], {}); -goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ConnectionDB', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.ThemeChange', 'Blockly.Events.ViewportChange', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.MetricsManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {}); -goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ConnectionDB', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.ThemeChange', 'Blockly.Events.ViewportChange', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.MetricsManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es5'}); +goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.constants', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.Click', 'Blockly.IPositionable', 'Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es5'}); goog.addDependency("base.js", [], []); diff --git a/core/block.js b/core/block.js index 368e29dc5..e09bde0e5 100644 --- a/core/block.js +++ b/core/block.js @@ -15,6 +15,7 @@ goog.provide('Blockly.Block'); goog.require('Blockly.ASTNode'); goog.require('Blockly.Blocks'); goog.require('Blockly.Connection'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.Events'); goog.require('Blockly.Events.BlockChange'); @@ -24,6 +25,7 @@ goog.require('Blockly.Events.BlockMove'); goog.require('Blockly.Extensions'); goog.require('Blockly.fieldRegistry'); goog.require('Blockly.Input'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.Tooltip'); goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); @@ -499,7 +501,8 @@ Blockly.Block.prototype.getOnlyValueConnection_ = function() { var connection = null; for (var i = 0; i < this.inputList.length; i++) { var thisConnection = this.inputList[i].connection; - if (thisConnection && thisConnection.type == Blockly.INPUT_VALUE && + if (thisConnection && + thisConnection.type == Blockly.connectionTypes.INPUT_VALUE && thisConnection.targetConnection) { if (connection) { return null; // More than one value input found. @@ -660,7 +663,8 @@ Blockly.Block.prototype.getPreviousBlock = function() { */ Blockly.Block.prototype.getFirstStatementConnection = function() { for (var i = 0, input; (input = this.inputList[i]); i++) { - if (input.connection && input.connection.type == Blockly.NEXT_STATEMENT) { + if (input.connection && + input.connection.type == Blockly.connectionTypes.NEXT_STATEMENT) { return input.connection; } } @@ -1140,7 +1144,7 @@ Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) { 'connection.'); } this.previousConnection = - this.makeConnection_(Blockly.PREVIOUS_STATEMENT); + this.makeConnection_(Blockly.connectionTypes.PREVIOUS_STATEMENT); } this.previousConnection.setCheck(opt_check); } else { @@ -1167,7 +1171,8 @@ Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) { opt_check = null; } if (!this.nextConnection) { - this.nextConnection = this.makeConnection_(Blockly.NEXT_STATEMENT); + this.nextConnection = + this.makeConnection_(Blockly.connectionTypes.NEXT_STATEMENT); } this.nextConnection.setCheck(opt_check); } else { @@ -1199,7 +1204,8 @@ Blockly.Block.prototype.setOutput = function(newBoolean, opt_check) { throw Error('Remove previous connection prior to adding output ' + 'connection.'); } - this.outputConnection = this.makeConnection_(Blockly.OUTPUT_VALUE); + this.outputConnection = + this.makeConnection_(Blockly.connectionTypes.OUTPUT_VALUE); } this.outputConnection.setCheck(opt_check); } else { @@ -1236,15 +1242,15 @@ Blockly.Block.prototype.getInputsInline = function() { } // Not defined explicitly. Figure out what would look best. for (var i = 1; i < this.inputList.length; i++) { - if (this.inputList[i - 1].type == Blockly.DUMMY_INPUT && - this.inputList[i].type == Blockly.DUMMY_INPUT) { + if (this.inputList[i - 1].type == Blockly.inputTypes.DUMMY && + this.inputList[i].type == Blockly.inputTypes.DUMMY) { // Two dummy inputs in a row. Don't inline them. return false; } } for (var i = 1; i < this.inputList.length; i++) { - if (this.inputList[i - 1].type == Blockly.INPUT_VALUE && - this.inputList[i].type == Blockly.DUMMY_INPUT) { + if (this.inputList[i - 1].type == Blockly.inputTypes.VALUE && + this.inputList[i].type == Blockly.inputTypes.DUMMY) { // Dummy input after a value input. Inline them. return true; } @@ -1441,7 +1447,7 @@ Blockly.Block.prototype.toString = function(opt_maxLength, opt_emptyToken) { * @return {!Blockly.Input} The input object created. */ Blockly.Block.prototype.appendValueInput = function(name) { - return this.appendInput_(Blockly.INPUT_VALUE, name); + return this.appendInput_(Blockly.inputTypes.VALUE, name); }; /** @@ -1451,7 +1457,7 @@ Blockly.Block.prototype.appendValueInput = function(name) { * @return {!Blockly.Input} The input object created. */ Blockly.Block.prototype.appendStatementInput = function(name) { - return this.appendInput_(Blockly.NEXT_STATEMENT, name); + return this.appendInput_(Blockly.inputTypes.STATEMENT, name); }; /** @@ -1461,7 +1467,7 @@ Blockly.Block.prototype.appendStatementInput = function(name) { * @return {!Blockly.Input} The input object created. */ Blockly.Block.prototype.appendDummyInput = function(opt_name) { - return this.appendInput_(Blockly.DUMMY_INPUT, opt_name || ''); + return this.appendInput_(Blockly.inputTypes.DUMMY, opt_name || ''); }; /** @@ -1836,8 +1842,7 @@ Blockly.Block.prototype.stringToFieldJson_ = function(str) { /** * Add a value input, statement input or local variable to this block. - * @param {number} type Either Blockly.INPUT_VALUE or Blockly.NEXT_STATEMENT or - * Blockly.DUMMY_INPUT. + * @param {number} type One of Blockly.inputTypes. * @param {string} name Language-neutral identifier which may used to find this * input again. Should be unique to this block. * @return {!Blockly.Input} The input object created. @@ -1845,10 +1850,11 @@ Blockly.Block.prototype.stringToFieldJson_ = function(str) { */ Blockly.Block.prototype.appendInput_ = function(type, name) { var connection = null; - if (type == Blockly.INPUT_VALUE || type == Blockly.NEXT_STATEMENT) { + if (type == Blockly.inputTypes.VALUE || + type == Blockly.inputTypes.STATEMENT) { connection = this.makeConnection_(type); } - if (type == Blockly.NEXT_STATEMENT) { + if (type == Blockly.inputTypes.STATEMENT) { this.statementInputCount++; } var input = new Blockly.Input(type, name, this, connection); @@ -1929,7 +1935,7 @@ Blockly.Block.prototype.moveNumberedInputBefore = function( Blockly.Block.prototype.removeInput = function(name, opt_quiet) { for (var i = 0, input; (input = this.inputList[i]); i++) { if (input.name == name) { - if (input.type == Blockly.NEXT_STATEMENT) { + if (input.type == Blockly.inputTypes.STATEMENT) { this.statementInputCount--; } input.dispose(); diff --git a/core/block_svg.js b/core/block_svg.js index 1aacd4801..b2a386d91 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -17,6 +17,7 @@ goog.require('Blockly.Block'); goog.require('Blockly.blockAnimations'); goog.require('Blockly.blockRendering.IPathObject'); goog.require('Blockly.browserEvents'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.ContextMenu'); goog.require('Blockly.ContextMenuRegistry'); @@ -159,7 +160,7 @@ Blockly.BlockSvg.prototype.warningTextDb_ = null; /** * Constant for identifying rows that are to be rendered inline. - * Don't collide with Blockly.INPUT_VALUE and friends. + * Don't collide with Blockly.inputTypes. * @const */ Blockly.BlockSvg.INLINE = -1; @@ -1372,8 +1373,7 @@ Blockly.BlockSvg.prototype.moveNumberedInputBefore = function( /** * Add a value input, statement input or local variable to this block. - * @param {number} type Either Blockly.INPUT_VALUE or Blockly.NEXT_STATEMENT or - * Blockly.DUMMY_INPUT. + * @param {number} type One of Blockly.inputTypes. * @param {string} name Language-neutral identifier which may used to find this * input again. Should be unique to this block. * @return {!Blockly.Input} The input object created. @@ -1587,8 +1587,8 @@ Blockly.BlockSvg.prototype.positionNearConnection = function(sourceConnection, targetConnection) { // We only need to position the new block if it's before the existing one, // otherwise its position is set by the previous block. - if (sourceConnection.type == Blockly.NEXT_STATEMENT || - sourceConnection.type == Blockly.INPUT_VALUE) { + if (sourceConnection.type == Blockly.connectionTypes.NEXT_STATEMENT || + sourceConnection.type == Blockly.connectionTypes.INPUT_VALUE) { var dx = targetConnection.x - sourceConnection.x; var dy = targetConnection.y - sourceConnection.y; diff --git a/core/blockly.js b/core/blockly.js index 55bfa2f55..a2aedb5d2 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -18,6 +18,7 @@ goog.provide('Blockly'); goog.require('Blockly.browserEvents'); goog.require('Blockly.constants'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.Events'); goog.require('Blockly.Events.BlockCreate'); goog.require('Blockly.Events.FinishedLoading'); @@ -25,6 +26,7 @@ goog.require('Blockly.Events.Ui'); goog.require('Blockly.Events.UiBase'); goog.require('Blockly.Events.VarCreate'); goog.require('Blockly.inject'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.Procedures'); goog.require('Blockly.ShortcutRegistry'); goog.require('Blockly.Tooltip'); @@ -518,3 +520,33 @@ Blockly.ALIGN_CENTRE = Blockly.constants.ALIGN.CENTRE; * @see Blockly.constants.ALIGN.RIGHT */ Blockly.ALIGN_RIGHT = Blockly.constants.ALIGN.RIGHT; + + +/** + * Aliases for constants used for connection and input types. + */ + +/** + * @see Blockly.connectionTypes.INPUT_VALUE + */ +Blockly.INPUT_VALUE = Blockly.connectionTypes.INPUT_VALUE; + +/** + * @see Blockly.connectionTypes.OUTPUT_VALUE + */ +Blockly.OUTPUT_VALUE = Blockly.connectionTypes.OUTPUT_VALUE; + +/** + * @see Blockly.connectionTypes.NEXT_STATEMENT + */ +Blockly.NEXT_STATEMENT = Blockly.connectionTypes.NEXT_STATEMENT; + +/** + * @see Blockly.connectionTypes.PREVIOUS_STATEMENT + */ +Blockly.PREVIOUS_STATEMENT = Blockly.connectionTypes.PREVIOUS_STATEMENT; + +/** + * @see Blockly.inputTypes.DUMMY_INPUT + */ +Blockly.DUMMY_INPUT = Blockly.inputTypes.DUMMY; diff --git a/core/connection.js b/core/connection.js index 988f48b34..1aa1446be 100644 --- a/core/connection.js +++ b/core/connection.js @@ -12,6 +12,7 @@ goog.provide('Blockly.Connection'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.Events'); goog.require('Blockly.Events.BlockMove'); @@ -122,7 +123,7 @@ Blockly.Connection.prototype.connect_ = function(childConnection) { shadowDom = /** @type {!Element} */ (Blockly.Xml.blockToDom(orphanBlock)); orphanBlock.dispose(false); orphanBlock = null; - } else if (parentConnection.type == Blockly.INPUT_VALUE) { + } else if (parentConnection.type == Blockly.connectionTypes.INPUT_VALUE) { // Value connections. // If female block is already connected, disconnect and bump the male. if (!orphanBlock.outputConnection) { @@ -137,7 +138,8 @@ Blockly.Connection.prototype.connect_ = function(childConnection) { orphanBlock.outputConnection.connect(connection); orphanBlock = null; } - } else if (parentConnection.type == Blockly.NEXT_STATEMENT) { + } else if ( + parentConnection.type == Blockly.connectionTypes.NEXT_STATEMENT) { // Statement connections. // Statement blocks may be inserted into the middle of a stack. // Split the stack. @@ -234,8 +236,8 @@ Blockly.Connection.prototype.getSourceBlock = function() { * @return {boolean} True if connection faces down or right. */ Blockly.Connection.prototype.isSuperior = function() { - return this.type == Blockly.INPUT_VALUE || - this.type == Blockly.NEXT_STATEMENT; + return this.type == Blockly.connectionTypes.INPUT_VALUE || + this.type == Blockly.connectionTypes.NEXT_STATEMENT; }; /** @@ -382,7 +384,8 @@ Blockly.Connection.singleConnection_ = function(block, orphanBlock) { for (var i = 0; i < block.inputList.length; i++) { var thisConnection = block.inputList[i].connection; var typeChecker = output.getConnectionChecker(); - if (thisConnection && thisConnection.type == Blockly.INPUT_VALUE && + if (thisConnection && + thisConnection.type == Blockly.connectionTypes.INPUT_VALUE && typeChecker.canConnect(output, thisConnection, false)) { if (connection) { return null; // More than one connection. diff --git a/core/connection_checker.js b/core/connection_checker.js index e59db419e..a69c5706b 100644 --- a/core/connection_checker.js +++ b/core/connection_checker.js @@ -14,6 +14,7 @@ goog.provide('Blockly.ConnectionChecker'); goog.require('Blockly.Connection'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.IConnectionChecker'); goog.require('Blockly.registry'); @@ -198,9 +199,9 @@ Blockly.ConnectionChecker.prototype.doDragChecks = function(a, b, distance) { } switch (b.type) { - case Blockly.PREVIOUS_STATEMENT: + case Blockly.connectionTypes.PREVIOUS_STATEMENT: return this.canConnectToPrevious_(a, b); - case Blockly.OUTPUT_VALUE: { + case Blockly.connectionTypes.OUTPUT_VALUE: { // Don't offer to connect an already connected left (male) value plug to // an available right (female) value plug. if ((b.isConnected() && @@ -210,7 +211,7 @@ Blockly.ConnectionChecker.prototype.doDragChecks = function(a, b, distance) { } break; } - case Blockly.INPUT_VALUE: { + case Blockly.connectionTypes.INPUT_VALUE: { // Offering to connect the left (male) of a value block to an already // connected value pair is ok, we'll splice it in. // However, don't offer to splice into an immovable block. @@ -221,7 +222,7 @@ Blockly.ConnectionChecker.prototype.doDragChecks = function(a, b, distance) { } break; } - case Blockly.NEXT_STATEMENT: { + case Blockly.connectionTypes.NEXT_STATEMENT: { // Don't let a block with no next connection bump other blocks out of the // stack. But covering up a shadow block or stack of shadow blocks is // fine. Similarly, replacing a terminal statement with another terminal diff --git a/core/connection_db.js b/core/connection_db.js index 027c7fe34..0ce206f57 100644 --- a/core/connection_db.js +++ b/core/connection_db.js @@ -14,6 +14,7 @@ goog.provide('Blockly.ConnectionDB'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.RenderedConnection'); @@ -289,9 +290,13 @@ Blockly.ConnectionDB.prototype.searchForClosest = function(conn, maxRadius, Blockly.ConnectionDB.init = function(checker) { // Create four databases, one for each connection type. var dbList = []; - dbList[Blockly.INPUT_VALUE] = new Blockly.ConnectionDB(checker); - dbList[Blockly.OUTPUT_VALUE] = new Blockly.ConnectionDB(checker); - dbList[Blockly.NEXT_STATEMENT] = new Blockly.ConnectionDB(checker); - dbList[Blockly.PREVIOUS_STATEMENT] = new Blockly.ConnectionDB(checker); + dbList[Blockly.connectionTypes.INPUT_VALUE] = + new Blockly.ConnectionDB(checker); + dbList[Blockly.connectionTypes.OUTPUT_VALUE] = + new Blockly.ConnectionDB(checker); + dbList[Blockly.connectionTypes.NEXT_STATEMENT] = + new Blockly.ConnectionDB(checker); + dbList[Blockly.connectionTypes.PREVIOUS_STATEMENT] = + new Blockly.ConnectionDB(checker); return dbList; }; diff --git a/core/connection_types.js b/core/connection_types.js new file mode 100644 index 000000000..b2116812b --- /dev/null +++ b/core/connection_types.js @@ -0,0 +1,29 @@ +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview An enum for the possible types of connections. + * @author fenichel@google.com (Rachel Fenichel) + */ + +'use strict'; + +goog.provide('Blockly.connectionTypes'); + +/** + * Enum for the type of a connection or input. + * @enum {number} + */ +Blockly.connectionTypes = { + // A right-facing value input. E.g. 'set item to' or 'return'. + INPUT_VALUE: 1, + // A left-facing value output. E.g. 'random fraction'. + OUTPUT_VALUE: 2, + // A down-facing block stack. E.g. 'if-do' or 'else'. + NEXT_STATEMENT: 3, + // An up-facing block stack. E.g. 'break out of loop'. + PREVIOUS_STATEMENT: 4 +}; diff --git a/core/constants.js b/core/constants.js index 4c91693b4..a62155ff7 100644 --- a/core/constants.js +++ b/core/constants.js @@ -12,6 +12,9 @@ goog.provide('Blockly.constants'); +goog.require('Blockly.connectionTypes'); + + /** * The multiplier for scroll wheel deltas using the line delta mode. * @type {number} @@ -109,36 +112,6 @@ Blockly.SPRITE = { // Constants below this point are not intended to be changed. -/** - * ENUM for a right-facing value input. E.g. 'set item to' or 'return'. - * @const - */ -Blockly.INPUT_VALUE = 1; - -/** - * ENUM for a left-facing value output. E.g. 'random fraction'. - * @const - */ -Blockly.OUTPUT_VALUE = 2; - -/** - * ENUM for a down-facing block stack. E.g. 'if-do' or 'else'. - * @const - */ -Blockly.NEXT_STATEMENT = 3; - -/** - * ENUM for an up-facing block stack. E.g. 'break out of loop'. - * @const - */ -Blockly.PREVIOUS_STATEMENT = 4; - -/** - * ENUM for an dummy input. Used to add field(s) with no input. - * @const - */ -Blockly.DUMMY_INPUT = 5; - /** * Enum for alignment of inputs. * @enum {number} @@ -179,10 +152,14 @@ Blockly.DRAG_FREE = 2; * @const */ Blockly.OPPOSITE_TYPE = []; -Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE] = Blockly.OUTPUT_VALUE; -Blockly.OPPOSITE_TYPE[Blockly.OUTPUT_VALUE] = Blockly.INPUT_VALUE; -Blockly.OPPOSITE_TYPE[Blockly.NEXT_STATEMENT] = Blockly.PREVIOUS_STATEMENT; -Blockly.OPPOSITE_TYPE[Blockly.PREVIOUS_STATEMENT] = Blockly.NEXT_STATEMENT; +Blockly.OPPOSITE_TYPE[Blockly.connectionTypes.INPUT_VALUE] = + Blockly.connectionTypes.OUTPUT_VALUE; +Blockly.OPPOSITE_TYPE[Blockly.connectionTypes.OUTPUT_VALUE] = + Blockly.connectionTypes.INPUT_VALUE; +Blockly.OPPOSITE_TYPE[Blockly.connectionTypes.NEXT_STATEMENT] = + Blockly.connectionTypes.PREVIOUS_STATEMENT; +Blockly.OPPOSITE_TYPE[Blockly.connectionTypes.PREVIOUS_STATEMENT] = + Blockly.connectionTypes.NEXT_STATEMENT; /** diff --git a/core/contextmenu_items.js b/core/contextmenu_items.js index 6d5c54e27..9800c3476 100644 --- a/core/contextmenu_items.js +++ b/core/contextmenu_items.js @@ -18,6 +18,7 @@ goog.provide('Blockly.ContextMenuItems'); goog.require('Blockly.constants'); goog.require('Blockly.Events'); +goog.require('Blockly.inputTypes'); goog.requireType('Blockly.BlockSvg'); @@ -65,7 +66,7 @@ Blockly.ContextMenuItems.registerRedo = function() { }; Blockly.ContextMenuRegistry.registry.register(redoOption); }; - + /** Option to clean up blocks. */ Blockly.ContextMenuItems.registerCleanup = function() { /** @type {!Blockly.ContextMenuRegistry.RegistryItem} */ @@ -91,7 +92,7 @@ Blockly.ContextMenuItems.registerCleanup = function() { }; Blockly.ContextMenuRegistry.registry.register(cleanOption); }; - + /** * Creates a callback to collapse or expand top blocks. * @param {boolean} shouldCollapse Whether a block should collapse. @@ -143,7 +144,7 @@ Blockly.ContextMenuItems.registerCollapse = function() { }; Blockly.ContextMenuRegistry.registry.register(collapseOption); }; - + /** Option to expand all blocks. */ Blockly.ContextMenuItems.registerExpand = function() { /** @type {!Blockly.ContextMenuRegistry.RegistryItem} */ @@ -176,7 +177,7 @@ Blockly.ContextMenuItems.registerExpand = function() { }; Blockly.ContextMenuRegistry.registry.register(expandOption); }; - + /** * Adds a block and its children to a list of deletable blocks. * @param {!Blockly.BlockSvg} block to delete. @@ -194,7 +195,7 @@ Blockly.ContextMenuItems.addDeletableBlocks_ = function(block, deleteList) { } } }; - + /** * Constructs a list of blocks that can be deleted in the given workspace. * @param {!Blockly.WorkspaceSvg} workspace to delete all blocks from. @@ -209,7 +210,7 @@ Blockly.ContextMenuItems.getDeletableBlocks_ = function(workspace) { } return deleteList; }; - + /** Deletes the given blocks. Used to delete all blocks in the workspace. * @param {!Array.} deleteList list of blocks to delete. * @param {string} eventGroup event group id with which all delete events should be associated. @@ -229,7 +230,7 @@ Blockly.ContextMenuItems.deleteNext_ = function(deleteList, eventGroup) { } Blockly.Events.setGroup(false); }; - + /** Option to delete all blocks. */ Blockly.ContextMenuItems.registerDeleteAll = function() { /** @type {!Blockly.ContextMenuRegistry.RegistryItem} */ @@ -371,8 +372,8 @@ Blockly.ContextMenuItems.registerInline = function() { if (!block.isInFlyout && block.isMovable() && !block.isCollapsed()) { for (var i = 1; i < block.inputList.length; i++) { // Only display this option if there are two value or dummy inputs next to each other. - if (block.inputList[i - 1].type != Blockly.NEXT_STATEMENT && - block.inputList[i].type != Blockly.NEXT_STATEMENT) { + if (block.inputList[i - 1].type != Blockly.inputTypes.STATEMENT && + block.inputList[i].type != Blockly.inputTypes.STATEMENT) { return 'enabled'; } } @@ -535,4 +536,4 @@ Blockly.ContextMenuItems.registerDefaultOptions = function() { Blockly.ContextMenuItems.registerWorkspaceOptions_(); Blockly.ContextMenuItems.registerBlockOptions_(); }; - + diff --git a/core/events/block_events.js b/core/events/block_events.js index cbc608f3e..32b9be618 100644 --- a/core/events/block_events.js +++ b/core/events/block_events.js @@ -22,6 +22,7 @@ goog.provide('Blockly.Events.Move'); // Deprecated. goog.require('Blockly.Events'); goog.require('Blockly.Events.Abstract'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.registry'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.object'); @@ -545,12 +546,13 @@ Blockly.Events.Move.prototype.run = function(forward) { } else { var blockConnection = block.outputConnection || block.previousConnection; var parentConnection; + var connectionType = blockConnection.type; if (inputName) { var input = parentBlock.getInput(inputName); if (input) { parentConnection = input.connection; } - } else if (blockConnection.type == Blockly.PREVIOUS_STATEMENT) { + } else if (connectionType == Blockly.connectionTypes.PREVIOUS_STATEMENT) { parentConnection = parentBlock.nextConnection; } if (parentConnection) { diff --git a/core/input.js b/core/input.js index 098471046..c43a591d3 100644 --- a/core/input.js +++ b/core/input.js @@ -15,6 +15,7 @@ goog.provide('Blockly.Input'); goog.require('Blockly.Connection'); goog.require('Blockly.constants'); goog.require('Blockly.fieldRegistry'); +goog.require('Blockly.inputTypes'); goog.requireType('Blockly.Block'); goog.requireType('Blockly.BlockSvg'); @@ -33,7 +34,7 @@ goog.requireType('Blockly.RenderedConnection'); * @constructor */ Blockly.Input = function(type, name, block, connection) { - if (type != Blockly.DUMMY_INPUT && !name) { + if (type != Blockly.inputTypes.DUMMY && !name) { throw Error('Value inputs and statement inputs must have non-empty name.'); } /** @type {number} */ diff --git a/core/input_types.js b/core/input_types.js new file mode 100644 index 000000000..a58706358 --- /dev/null +++ b/core/input_types.js @@ -0,0 +1,29 @@ +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview An enum for the possible types of inputs. + * @author fenichel@google.com (Rachel Fenichel) + */ + +'use strict'; + +goog.provide('Blockly.inputTypes'); + +goog.require('Blockly.connectionTypes'); + +/** + * Enum for the type of a connection or input. + * @enum {number} + */ +Blockly.inputTypes = { + // A right-facing value input. E.g. 'set item to' or 'return'. + VALUE: Blockly.connectionTypes.INPUT_VALUE, + // A down-facing block stack. E.g. 'if-do' or 'else'. + STATEMENT: Blockly.connectionTypes.NEXT_STATEMENT, + // A dummy input. Used to add field(s) with no input. + DUMMY: 5 +}; diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index 490e88ef3..656412750 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -14,6 +14,7 @@ goog.provide('Blockly.InsertionMarkerManager'); goog.require('Blockly.Block'); goog.require('Blockly.blockAnimations'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.Events'); @@ -618,7 +619,8 @@ Blockly.InsertionMarkerManager.prototype.hideInsertionMarker_ = function() { var isFirstInStatementStack = (imConn == markerNext && !(markerPrev && markerPrev.targetConnection)); - var isFirstInOutputStack = imConn.type == Blockly.INPUT_VALUE && + var isFirstInOutputStack = + imConn.type == Blockly.connectionTypes.INPUT_VALUE && !(markerOutput && markerOutput.targetConnection); // The insertion marker is the first block in a stack. Unplug won't do // anything in that case. Instead, unplug the following block. @@ -626,7 +628,8 @@ Blockly.InsertionMarkerManager.prototype.hideInsertionMarker_ = function() { imConn.targetBlock().unplug(false); } // Inside of a C-block, first statement connection. - else if (imConn.type == Blockly.NEXT_STATEMENT && imConn != markerNext) { + else if (imConn.type == Blockly.connectionTypes.NEXT_STATEMENT && + imConn != markerNext) { var innerConnection = imConn.targetConnection; innerConnection.getSourceBlock().unplug(false); diff --git a/core/keyboard_nav/ast_node.js b/core/keyboard_nav/ast_node.js index 29a61546a..f1102143e 100644 --- a/core/keyboard_nav/ast_node.js +++ b/core/keyboard_nav/ast_node.js @@ -12,6 +12,7 @@ goog.provide('Blockly.ASTNode'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.utils.Coordinate'); @@ -147,16 +148,17 @@ Blockly.ASTNode.createConnectionNode = function(connection) { if (!connection) { return null; } - if (connection.type == Blockly.INPUT_VALUE) { + var type = connection.type; + if (type == Blockly.connectionTypes.INPUT_VALUE) { return Blockly.ASTNode.createInputNode(connection.getParentInput()); - } else if (connection.type == Blockly.NEXT_STATEMENT && + } else if (type == Blockly.connectionTypes.NEXT_STATEMENT && connection.getParentInput()) { return Blockly.ASTNode.createInputNode(connection.getParentInput()); - } else if (connection.type == Blockly.NEXT_STATEMENT) { + } else if (type == Blockly.connectionTypes.NEXT_STATEMENT) { return new Blockly.ASTNode(Blockly.ASTNode.types.NEXT, connection); - } else if (connection.type == Blockly.OUTPUT_VALUE) { + } else if (type == Blockly.connectionTypes.OUTPUT_VALUE) { return new Blockly.ASTNode(Blockly.ASTNode.types.OUTPUT, connection); - } else if (connection.type == Blockly.PREVIOUS_STATEMENT) { + } else if (type == Blockly.connectionTypes.PREVIOUS_STATEMENT) { return new Blockly.ASTNode(Blockly.ASTNode.types.PREVIOUS, connection); } return null; diff --git a/core/rendered_connection.js b/core/rendered_connection.js index d01dc4bba..56d1240a3 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -13,6 +13,7 @@ goog.provide('Blockly.RenderedConnection'); goog.require('Blockly.Connection'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.Events'); goog.require('Blockly.utils'); @@ -288,7 +289,8 @@ Blockly.RenderedConnection.prototype.highlight = function() { var sourceBlockSvg = /** @type {!Blockly.BlockSvg} */ (this.sourceBlock_); var renderConstants = sourceBlockSvg.workspace.getRenderer().getConstants(); var shape = renderConstants.shapeFor(this); - if (this.type == Blockly.INPUT_VALUE || this.type == Blockly.OUTPUT_VALUE) { + if (this.type == Blockly.connectionTypes.INPUT_VALUE || + this.type == Blockly.connectionTypes.OUTPUT_VALUE) { // Vertical line, puzzle tab, vertical line. var yLen = renderConstants.TAB_OFFSET_FROM_TOP; steps = Blockly.utils.svgPaths.moveBy(0, -yLen) + @@ -393,7 +395,8 @@ Blockly.RenderedConnection.prototype.startTrackingAll = function() { // of lower blocks. Also, since rendering a block renders all its parents, // we only need to render the leaf nodes. var renderList = []; - if (this.type != Blockly.INPUT_VALUE && this.type != Blockly.NEXT_STATEMENT) { + if (this.type != Blockly.connectionTypes.INPUT_VALUE && + this.type != Blockly.connectionTypes.NEXT_STATEMENT) { // Only spider down. return renderList; } @@ -533,8 +536,8 @@ Blockly.RenderedConnection.prototype.connect_ = function(childConnection) { childBlock.updateDisabled(); } if (parentRendered && childRendered) { - if (parentConnection.type == Blockly.NEXT_STATEMENT || - parentConnection.type == Blockly.PREVIOUS_STATEMENT) { + if (parentConnection.type == Blockly.connectionTypes.NEXT_STATEMENT || + parentConnection.type == Blockly.connectionTypes.PREVIOUS_STATEMENT) { // Child block may need to square off its corners if it is in a stack. // Rendering a child will render its parent. childBlock.render(); diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index aeb2af08e..004c284df 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -12,6 +12,7 @@ goog.provide('Blockly.blockRendering.ConstantProvider'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.utils'); goog.require('Blockly.utils.colour'); @@ -995,11 +996,11 @@ Blockly.blockRendering.ConstantProvider.prototype.makeOutsideCorners = function( Blockly.blockRendering.ConstantProvider.prototype.shapeFor = function( connection) { switch (connection.type) { - case Blockly.INPUT_VALUE: - case Blockly.OUTPUT_VALUE: + case Blockly.connectionTypes.INPUT_VALUE: + case Blockly.connectionTypes.OUTPUT_VALUE: return this.PUZZLE_TAB; - case Blockly.PREVIOUS_STATEMENT: - case Blockly.NEXT_STATEMENT: + case Blockly.connectionTypes.PREVIOUS_STATEMENT: + case Blockly.connectionTypes.NEXT_STATEMENT: return this.NOTCH; default: throw Error('Unknown connection type'); diff --git a/core/renderers/common/debugger.js b/core/renderers/common/debugger.js index 3cdb49745..21cda9439 100644 --- a/core/renderers/common/debugger.js +++ b/core/renderers/common/debugger.js @@ -20,6 +20,7 @@ goog.require('Blockly.blockRendering.Row'); goog.require('Blockly.blockRendering.SpacerRow'); goog.require('Blockly.blockRendering.TopRow'); goog.require('Blockly.blockRendering.Types'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.Svg'); @@ -229,19 +230,19 @@ Blockly.blockRendering.Debug.prototype.drawConnection = function(conn) { var colour; var size; var fill; - if (conn.type == Blockly.INPUT_VALUE) { + if (conn.type == Blockly.connectionTypes.INPUT_VALUE) { size = 4; colour = 'magenta'; fill = 'none'; - } else if (conn.type == Blockly.OUTPUT_VALUE) { + } else if (conn.type == Blockly.connectionTypes.OUTPUT_VALUE) { size = 2; colour = 'magenta'; fill = colour; - } else if (conn.type == Blockly.NEXT_STATEMENT) { + } else if (conn.type == Blockly.connectionTypes.NEXT_STATEMENT) { size = 4; colour = 'goldenrod'; fill = 'none'; - } else if (conn.type == Blockly.PREVIOUS_STATEMENT) { + } else if (conn.type == Blockly.connectionTypes.PREVIOUS_STATEMENT) { size = 2; colour = 'goldenrod'; fill = colour; diff --git a/core/renderers/common/info.js b/core/renderers/common/info.js index b98c0cf36..69f76507c 100644 --- a/core/renderers/common/info.js +++ b/core/renderers/common/info.js @@ -30,6 +30,7 @@ goog.require('Blockly.blockRendering.StatementInput'); goog.require('Blockly.blockRendering.TopRow'); goog.require('Blockly.blockRendering.Types'); goog.require('Blockly.constants'); +goog.require('Blockly.inputTypes'); goog.requireType('Blockly.blockRendering.ConstantProvider'); goog.requireType('Blockly.blockRendering.Icon'); @@ -286,7 +287,7 @@ Blockly.blockRendering.RenderInfo.prototype.populateTopRow_ = function() { } var precedesStatement = this.block_.inputList.length && - this.block_.inputList[0].type == Blockly.NEXT_STATEMENT; + this.block_.inputList[0].type == Blockly.inputTypes.STATEMENT; // This is the minimum height for the row. If one of its elements has a // greater height it will be overwritten in the compute pass. @@ -315,10 +316,9 @@ Blockly.blockRendering.RenderInfo.prototype.populateTopRow_ = function() { Blockly.blockRendering.RenderInfo.prototype.populateBottomRow_ = function() { this.bottomRow.hasNextConnection = !!this.block_.nextConnection; - var followsStatement = - this.block_.inputList.length && - this.block_.inputList[this.block_.inputList.length - 1] - .type == Blockly.NEXT_STATEMENT; + var followsStatement = this.block_.inputList.length && + this.block_.inputList[this.block_.inputList.length - 1].type == + Blockly.inputTypes.STATEMENT; // This is the minimum height for the row. If one of its elements has a // greater height it will be overwritten in the compute pass. @@ -367,19 +367,19 @@ Blockly.blockRendering.RenderInfo.prototype.populateBottomRow_ = function() { */ Blockly.blockRendering.RenderInfo.prototype.addInput_ = function(input, activeRow) { // Non-dummy inputs have visual representations onscreen. - if (this.isInline && input.type == Blockly.INPUT_VALUE) { + if (this.isInline && input.type == Blockly.inputTypes.VALUE) { activeRow.elements.push( new Blockly.blockRendering.InlineInput(this.constants_, input)); activeRow.hasInlineInput = true; - } else if (input.type == Blockly.NEXT_STATEMENT) { + } else if (input.type == Blockly.inputTypes.STATEMENT) { activeRow.elements.push( new Blockly.blockRendering.StatementInput(this.constants_, input)); activeRow.hasStatement = true; - } else if (input.type == Blockly.INPUT_VALUE) { + } else if (input.type == Blockly.inputTypes.VALUE) { activeRow.elements.push( new Blockly.blockRendering.ExternalValueInput(this.constants_, input)); activeRow.hasExternalInput = true; - } else if (input.type == Blockly.DUMMY_INPUT) { + } else if (input.type == Blockly.inputTypes.DUMMY) { // Dummy inputs have no visual representation, but the information is still // important. activeRow.minHeight = Math.max(activeRow.minHeight, @@ -407,12 +407,13 @@ Blockly.blockRendering.RenderInfo.prototype.shouldStartNewRow_ = function(input, return false; } // A statement input or an input following one always gets a new row. - if (input.type == Blockly.NEXT_STATEMENT || - lastInput.type == Blockly.NEXT_STATEMENT) { + if (input.type == Blockly.inputTypes.STATEMENT || + lastInput.type == Blockly.inputTypes.STATEMENT) { return true; } // Value and dummy inputs get new row if inputs are not inlined. - if (input.type == Blockly.INPUT_VALUE || input.type == Blockly.DUMMY_INPUT) { + if (input.type == Blockly.inputTypes.VALUE || + input.type == Blockly.inputTypes.DUMMY) { return !this.isInline; } return false; diff --git a/core/renderers/common/marker_svg.js b/core/renderers/common/marker_svg.js index 8cee6f5e5..8195440c7 100644 --- a/core/renderers/common/marker_svg.js +++ b/core/renderers/common/marker_svg.js @@ -14,6 +14,7 @@ goog.provide('Blockly.blockRendering.MarkerSvg'); goog.require('Blockly.ASTNode'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.Events'); goog.require('Blockly.Events.MarkerMove'); @@ -206,13 +207,14 @@ Blockly.blockRendering.MarkerSvg.prototype.draw = function(oldNode, curNode) { Blockly.blockRendering.MarkerSvg.prototype.showAtLocation_ = function(curNode) { var curNodeAsConnection = /** @type {!Blockly.Connection} */ (curNode.getLocation()); + var connectionType = curNodeAsConnection.type; if (curNode.getType() == Blockly.ASTNode.types.BLOCK) { this.showWithBlock_(curNode); } else if (curNode.getType() == Blockly.ASTNode.types.OUTPUT) { this.showWithOutput_(curNode); - } else if (curNodeAsConnection.type == Blockly.INPUT_VALUE) { + } else if (connectionType == Blockly.connectionTypes.INPUT_VALUE) { this.showWithInput_(curNode); - } else if (curNodeAsConnection.type == Blockly.NEXT_STATEMENT) { + } else if (connectionType == Blockly.connectionTypes.NEXT_STATEMENT) { this.showWithNext_(curNode); } else if (curNode.getType() == Blockly.ASTNode.types.PREVIOUS) { this.showWithPrevious_(curNode); diff --git a/core/renderers/common/renderer.js b/core/renderers/common/renderer.js index 1461b836f..9a3b8e094 100644 --- a/core/renderers/common/renderer.js +++ b/core/renderers/common/renderer.js @@ -19,6 +19,7 @@ goog.require('Blockly.blockRendering.IPathObject'); goog.require('Blockly.blockRendering.MarkerSvg'); goog.require('Blockly.blockRendering.PathObject'); goog.require('Blockly.blockRendering.RenderInfo'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.InsertionMarkerManager'); goog.require('Blockly.IRegistrable'); @@ -246,7 +247,9 @@ Blockly.blockRendering.Renderer.prototype.orphanCanConnectAtEnd = function(topBlock, orphanBlock, localType) { var orphanConnection = null; var lastConnection = null; - if (localType == Blockly.OUTPUT_VALUE) { // We are replacing an output. + if (localType == + Blockly.connectionTypes + .OUTPUT_VALUE) { // We are replacing an output. orphanConnection = orphanBlock.outputConnection; // TODO: I don't think this function necessarily has the correct logic, // but for now it is being kept for behavioral backwards-compat. @@ -278,22 +281,22 @@ Blockly.blockRendering.Renderer.prototype.orphanCanConnectAtEnd = * to display. * @package */ -Blockly.blockRendering.Renderer.prototype.getConnectionPreviewMethod = - function(closest, local, topBlock) { - if (local.type == Blockly.OUTPUT_VALUE || - local.type == Blockly.PREVIOUS_STATEMENT) { - if (!closest.isConnected() || - this.orphanCanConnectAtEnd( - topBlock, - /** @type {!Blockly.BlockSvg} */ (closest.targetBlock()), - local.type)) { - return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER; - } - return Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE; - } - +Blockly.blockRendering.Renderer.prototype.getConnectionPreviewMethod = function( + closest, local, topBlock) { + if (local.type == Blockly.connectionTypes.OUTPUT_VALUE || + local.type == Blockly.connectionTypes.PREVIOUS_STATEMENT) { + if (!closest.isConnected() || + this.orphanCanConnectAtEnd( + topBlock, + /** @type {!Blockly.BlockSvg} */ (closest.targetBlock()), + local.type)) { return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER; - }; + } + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE; + } + + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER; +}; /** * Render the block. diff --git a/core/renderers/geras/info.js b/core/renderers/geras/info.js index 5b5fadc97..6b8a3ecf4 100644 --- a/core/renderers/geras/info.js +++ b/core/renderers/geras/info.js @@ -33,6 +33,7 @@ goog.require('Blockly.blockRendering.Types'); goog.require('Blockly.constants'); goog.require('Blockly.geras.InlineInput'); goog.require('Blockly.geras.StatementInput'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils.object'); goog.requireType('Blockly.blockRendering.Field'); @@ -74,10 +75,9 @@ Blockly.geras.RenderInfo.prototype.getRenderer = function() { Blockly.geras.RenderInfo.prototype.populateBottomRow_ = function() { Blockly.geras.RenderInfo.superClass_.populateBottomRow_.call(this); - var followsStatement = - this.block_.inputList.length && - this.block_.inputList[this.block_.inputList.length - 1] - .type == Blockly.NEXT_STATEMENT; + var followsStatement = this.block_.inputList.length && + this.block_.inputList[this.block_.inputList.length - 1].type == + Blockly.inputTypes.STATEMENT; // The minimum height of the bottom row is smaller in Geras than in other // renderers, because the dark path adds a pixel. @@ -95,19 +95,19 @@ Blockly.geras.RenderInfo.prototype.populateBottomRow_ = function() { */ Blockly.geras.RenderInfo.prototype.addInput_ = function(input, activeRow) { // Non-dummy inputs have visual representations onscreen. - if (this.isInline && input.type == Blockly.INPUT_VALUE) { + if (this.isInline && input.type == Blockly.inputTypes.VALUE) { activeRow.elements.push( new Blockly.geras.InlineInput(this.constants_, input)); activeRow.hasInlineInput = true; - } else if (input.type == Blockly.NEXT_STATEMENT) { + } else if (input.type == Blockly.inputTypes.STATEMENT) { activeRow.elements.push( new Blockly.geras.StatementInput(this.constants_, input)); activeRow.hasStatement = true; - } else if (input.type == Blockly.INPUT_VALUE) { + } else if (input.type == Blockly.inputTypes.VALUE) { activeRow.elements.push( new Blockly.blockRendering.ExternalValueInput(this.constants_, input)); activeRow.hasExternalInput = true; - } else if (input.type == Blockly.DUMMY_INPUT) { + } else if (input.type == Blockly.inputTypes.DUMMY) { // Dummy inputs have no visual representation, but the information is still // important. activeRow.minHeight = Math.max(activeRow.minHeight, diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index 8da04559c..44d6f9ace 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -14,6 +14,7 @@ goog.provide('Blockly.zelos.ConstantProvider'); goog.require('Blockly.blockRendering.ConstantProvider'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.utils.colour'); goog.require('Blockly.utils.dom'); @@ -650,8 +651,8 @@ Blockly.zelos.ConstantProvider.prototype.shapeFor = function( checks = connection.targetConnection.getCheck(); } switch (connection.type) { - case Blockly.INPUT_VALUE: - case Blockly.OUTPUT_VALUE: + case Blockly.connectionTypes.INPUT_VALUE: + case Blockly.connectionTypes.OUTPUT_VALUE: var outputShape = connection.getSourceBlock().getOutputShape(); // If the block has an output shape set, use that instead. if (outputShape != null) { @@ -672,8 +673,8 @@ Blockly.zelos.ConstantProvider.prototype.shapeFor = function( return this.ROUNDED; } return this.ROUNDED; - case Blockly.PREVIOUS_STATEMENT: - case Blockly.NEXT_STATEMENT: + case Blockly.connectionTypes.PREVIOUS_STATEMENT: + case Blockly.connectionTypes.NEXT_STATEMENT: return this.NOTCH; default: throw Error('Unknown type'); diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index 0ced02658..3c76443ca 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -34,6 +34,7 @@ goog.require('Blockly.constants'); goog.require('Blockly.FieldImage'); goog.require('Blockly.FieldLabel'); goog.require('Blockly.FieldTextInput'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils.object'); goog.require('Blockly.zelos.BottomRow'); goog.require('Blockly.zelos.RightConnectionShape'); @@ -137,12 +138,13 @@ Blockly.zelos.RenderInfo.prototype.shouldStartNewRow_ = function(input, return false; } // A statement input or an input following one always gets a new row. - if (input.type == Blockly.NEXT_STATEMENT || - lastInput.type == Blockly.NEXT_STATEMENT) { + if (input.type == Blockly.inputTypes.STATEMENT || + lastInput.type == Blockly.inputTypes.STATEMENT) { return true; } // Value and dummy inputs get new row if inputs are not inlined. - if (input.type == Blockly.INPUT_VALUE || input.type == Blockly.DUMMY_INPUT) { + if (input.type == Blockly.inputTypes.VALUE || + input.type == Blockly.inputTypes.DUMMY) { return !this.isInline || this.isMultiRow; } return false; @@ -276,7 +278,7 @@ Blockly.zelos.RenderInfo.prototype.addInput_ = function(input, activeRow) { // If we have two dummy inputs on the same row, one aligned left and the other // right, keep track of the right aligned dummy input so we can add padding // later. - if (input.type == Blockly.DUMMY_INPUT && activeRow.hasDummyInput && + if (input.type == Blockly.inputTypes.DUMMY && activeRow.hasDummyInput && activeRow.align == Blockly.constants.ALIGN.LEFT && input.align == Blockly.constants.ALIGN.RIGHT) { activeRow.rightAlignedDummyInput = input; diff --git a/core/renderers/zelos/renderer.js b/core/renderers/zelos/renderer.js index 7e948c15a..74ca3620b 100644 --- a/core/renderers/zelos/renderer.js +++ b/core/renderers/zelos/renderer.js @@ -14,6 +14,7 @@ goog.provide('Blockly.zelos.Renderer'); goog.require('Blockly.blockRendering'); goog.require('Blockly.blockRendering.Renderer'); +goog.require('Blockly.connectionTypes'); goog.require('Blockly.constants'); goog.require('Blockly.InsertionMarkerManager'); goog.require('Blockly.utils.object'); @@ -111,28 +112,29 @@ Blockly.zelos.Renderer.prototype.makePathObject = function(root, style) { * @override */ Blockly.zelos.Renderer.prototype.shouldHighlightConnection = function(conn) { - return conn.type != Blockly.INPUT_VALUE && conn.type !== Blockly.OUTPUT_VALUE; + return conn.type != Blockly.connectionTypes.INPUT_VALUE && + conn.type !== Blockly.connectionTypes.OUTPUT_VALUE; }; /** * @override */ -Blockly.zelos.Renderer.prototype.getConnectionPreviewMethod = - function(closest, local, topBlock) { - if (local.type == Blockly.OUTPUT_VALUE) { - if (!closest.isConnected()) { - return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE; - } - // TODO: Returning this is a total hack, because we don't want to show - // a replacement fade, we want to show an outline affect. - // Sadly zelos does not support showing an outline around filled - // inputs, so we have to pretend like the connected block is getting - // replaced. - return Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE; - } +Blockly.zelos.Renderer.prototype.getConnectionPreviewMethod = function( + closest, local, topBlock) { + if (local.type == Blockly.connectionTypes.OUTPUT_VALUE) { + if (!closest.isConnected()) { + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE; + } + // TODO: Returning this is a total hack, because we don't want to show + // a replacement fade, we want to show an outline affect. + // Sadly zelos does not support showing an outline around filled + // inputs, so we have to pretend like the connected block is getting + // replaced. + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE; + } - return Blockly.zelos.Renderer.superClass_ - .getConnectionPreviewMethod(closest, local, topBlock); - }; + return Blockly.zelos.Renderer.superClass_.getConnectionPreviewMethod( + closest, local, topBlock); +}; Blockly.blockRendering.register('zelos', Blockly.zelos.Renderer); diff --git a/core/xml.js b/core/xml.js index 1f58eae82..5b30d0b9d 100644 --- a/core/xml.js +++ b/core/xml.js @@ -18,6 +18,7 @@ goog.provide('Blockly.Xml'); goog.require('Blockly.constants'); goog.require('Blockly.Events'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.global'); @@ -201,13 +202,13 @@ Blockly.Xml.blockToDom = function(block, opt_noId) { for (var i = 0, input; (input = block.inputList[i]); i++) { var container; var empty = true; - if (input.type == Blockly.DUMMY_INPUT) { + if (input.type == Blockly.inputTypes.DUMMY) { continue; } else { var childBlock = input.connection.targetBlock(); - if (input.type == Blockly.INPUT_VALUE) { + if (input.type == Blockly.inputTypes.VALUE) { container = Blockly.utils.xml.createElement('value'); - } else if (input.type == Blockly.NEXT_STATEMENT) { + } else if (input.type == Blockly.inputTypes.STATEMENT) { container = Blockly.utils.xml.createElement('statement'); } var shadow = input.connection.getShadowDom(); diff --git a/externs/generator-externs.js b/externs/generator-externs.js index a86531856..288c3aa2a 100644 --- a/externs/generator-externs.js +++ b/externs/generator-externs.js @@ -11,6 +11,7 @@ goog.provide('Blockly'); goog.provide('Blockly.Generator'); +goog.provide('Blockly.inputTypes'); goog.provide('Blockly.utils.global'); goog.provide('Blockly.utils.string'); diff --git a/generators/dart.js b/generators/dart.js index a801a0655..1eb3a706a 100644 --- a/generators/dart.js +++ b/generators/dart.js @@ -13,6 +13,7 @@ goog.provide('Blockly.Dart'); goog.require('Blockly.Generator'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils.string'); @@ -219,7 +220,7 @@ Blockly.Dart.scrub_ = function(block, code, opt_thisOnly) { // Collect comments for all value arguments. // Don't collect comments for nested statements. for (var i = 0; i < block.inputList.length; i++) { - if (block.inputList[i].type == Blockly.INPUT_VALUE) { + if (block.inputList[i].type == Blockly.inputTypes.VALUE) { var childBlock = block.inputList[i].connection.targetBlock(); if (childBlock) { comment = Blockly.Dart.allNestedComments(childBlock); diff --git a/generators/javascript.js b/generators/javascript.js index 368a35a6d..7bedb4831 100644 --- a/generators/javascript.js +++ b/generators/javascript.js @@ -13,6 +13,7 @@ goog.provide('Blockly.JavaScript'); goog.require('Blockly.Generator'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils.global'); goog.require('Blockly.utils.string'); @@ -244,7 +245,7 @@ Blockly.JavaScript.scrub_ = function(block, code, opt_thisOnly) { // Collect comments for all value arguments. // Don't collect comments for nested statements. for (var i = 0; i < block.inputList.length; i++) { - if (block.inputList[i].type == Blockly.INPUT_VALUE) { + if (block.inputList[i].type == Blockly.inputTypes.VALUE) { var childBlock = block.inputList[i].connection.targetBlock(); if (childBlock) { comment = Blockly.JavaScript.allNestedComments(childBlock); diff --git a/generators/lua.js b/generators/lua.js index 75a6b7b8b..da3e750d0 100644 --- a/generators/lua.js +++ b/generators/lua.js @@ -14,6 +14,7 @@ goog.provide('Blockly.Lua'); goog.require('Blockly.Generator'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils.string'); @@ -188,7 +189,7 @@ Blockly.Lua.scrub_ = function(block, code, opt_thisOnly) { // Collect comments for all value arguments. // Don't collect comments for nested statements. for (var i = 0; i < block.inputList.length; i++) { - if (block.inputList[i].type == Blockly.INPUT_VALUE) { + if (block.inputList[i].type == Blockly.inputTypes.VALUE) { var childBlock = block.inputList[i].connection.targetBlock(); if (childBlock) { comment = Blockly.Lua.allNestedComments(childBlock); diff --git a/generators/php.js b/generators/php.js index 326cc8ecd..8cab5c231 100644 --- a/generators/php.js +++ b/generators/php.js @@ -13,6 +13,7 @@ goog.provide('Blockly.PHP'); goog.require('Blockly.Generator'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils.string'); @@ -244,7 +245,7 @@ Blockly.PHP.scrub_ = function(block, code, opt_thisOnly) { // Collect comments for all value arguments. // Don't collect comments for nested statements. for (var i = 0; i < block.inputList.length; i++) { - if (block.inputList[i].type == Blockly.INPUT_VALUE) { + if (block.inputList[i].type == Blockly.inputTypes.VALUE) { var childBlock = block.inputList[i].connection.targetBlock(); if (childBlock) { comment = Blockly.PHP.allNestedComments(childBlock); diff --git a/generators/python.js b/generators/python.js index 9844b9501..707c948e7 100644 --- a/generators/python.js +++ b/generators/python.js @@ -13,6 +13,7 @@ goog.provide('Blockly.Python'); goog.require('Blockly.Generator'); +goog.require('Blockly.inputTypes'); goog.require('Blockly.utils.string'); @@ -271,7 +272,7 @@ Blockly.Python.scrub_ = function(block, code, opt_thisOnly) { // Collect comments for all value arguments. // Don't collect comments for nested statements. for (var i = 0; i < block.inputList.length; i++) { - if (block.inputList[i].type == Blockly.INPUT_VALUE) { + if (block.inputList[i].type == Blockly.inputTypes.VALUE) { var childBlock = block.inputList[i].connection.targetBlock(); if (childBlock) { comment = Blockly.Python.allNestedComments(childBlock);