-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Avoid crashing when a procedure input has an empty string #2182
Conversation
Fixes google#1958 This will drop the input when it's in the empty string state. This causes the block to remove the input and re-add it when the text is reverted, but prevents the breakage. A followup fix should leave the input alone instead of removing it, but this works for now.
I assume that the pre-existing logic that keeps blocks attached to the correct inputs when renaming/moving inputs around also works here. If so, lgtm. I agree that there are better long-term solutions, but this is a good fix for now. Do you want me to cherry-pick this into the release, or leave it for february? |
Yep, confirmed the reconnection logic still works (as does undo/redo). Probably worth merging in since it's a somewhat painful crash. |
* Avoid crashing when a procedure input has an empty string (google#2182) Fixes google#1958 This will drop the input when it's in the empty string state. This causes the block to remove the input and re-add it when the text is reverted, but prevents the breakage. A followup fix should leave the input alone instead of removing it, but this works for now. * Added message for running local_build.sh from correct folder. * Changes in comment. * Comment out removing tmp directory for testing * Debuggin * Fix generator tests * Bump version number on develop * Updated Comments. * Add error message for when style is not set * Remove use of style variables in block definition * Fixing review comments * Update the style on blocks in the mutator * Fixed scrolling horizontal flyouts with mousewheel. * Changed callback to be looked up dynamically when the button is clicked. * Localisation updates from https://translatewiki.net. * Changed how bubbles position themselves. * Fixed RTL mistake. * Fixes refresh on simple toolbox withno categories * Fix failing test * Localisation updates from https://translatewiki.net. * Fixing review comments * Prevent duplicate parameters in functions (google#2177) Prevents the coder from using duplicate parameters names in functions. In the validator function check for parameter names that have been used. If it finds a block with a name that matches return null so that it will revert the change. Also change the name each time a new parameter is created to try to prevent duplicate name. * Updated createZoomSVG comments. * Changes names for block styles * Enable insertion markers * First pass at creating mocha tests * Add jsunit->chai assert converters, and block tests * More testing with mocha * Skip two broken test suites * Changes Blockly style to be Blockly theme. * Remove dependenceis and use unpkg * Delete commented-out code * Go back to run_all_tests.sh for npm test * Fix eslint errors with in-file comments * Fixes problem with hat style * Adds hat style * Adds support for category styles * Add eslintrc to mocha directory * Fixes error thrown for style defined inline * Small fixes * Added flipRtl Support for FieldImages (google#2203) * Added flipRtl support for FieldImages. Added a flipRtl test block. * Added blockfactory support. * Fixed JSDoc. * Fixing review comments * Final fixes * Added displaying flyout horizontally when layout is horizontal. * Fixed comments not being recorded in delete event. (google#2211) * Remove old eslintrc and use .json for mocha eslintrc * Fixing compiler error for blockly themes * Remove unnecessary scripts * Moved theme scripts out of core * Adding compressed files * Adding accessible uncompressed * Access colours using bracket notation * Localisation updates from https://translatewiki.net. * local_build: Add build for local_blocks_compressed.js (google#2204) * local_build.sh: Add generation of local_blocks_compressed.js * Added comments to local_build.sh * Ignore insertion markers when checking remaining capacity * Added a Finished Loading event. * Updated blockly_uncompressed file. * Update copyright year * Fixed Xml goog.require's. Changed Blockly.Events.Ui functions to Blockly.Events.FinishedLoading. * Changed require's to be in correct lexicographical order. * Changed trashcan and zoom controls to be positioned in the opposite corner of the toolbox. Fixed trashcan hotspot being incorrect. * Added the ability to drag disabled blocks out of the trashcan flyout. * Changed the trashcan lid to always open towards the workspace. * Ignore insertion markers in getAllBlocks; add accessors for inseriton markers * Removed render_ call, which was causing fields to calculate their size incorrectly. * Localisation updates from https://translatewiki.net. * Update procedures.js When I use [Rename variable...] in procedure definition block. The argument name for calling procedure has not changed. * Use a real JS array for the connection DB. Previously “Array.isArray(connectionDB)” was false, even through “connectionDB instanceof Array” was true. * Added a test block for a dynamic dropdown. * Localisation updates from https://translatewiki.net. * Update connection_db_test * New label and title case * Fix event description for theme * Fixed comments and defaults. * Update to latest Closure Template jars, recompile. There was a small chance that the existing Soy jar files contained a denial of service vulnerability. Not that this affects Blockly in any way. https://buganizer.corp.google.com/issues/123937301 * Typo fix in code comment (google#2269) "independent" instead of "independant". * Changes colour names * language-neutral text -> language-neutral id * Check against healing child shadow blocks. Fixes google#2227, healing values. Also applies to shadow next blocks. Added a playground test block group with a shadow statement. * Fixed next blocks not being disabled in flyout. (google#2278) * Fixed horizontal scrolling on window resize. * Fixed flyout scrollbars not being repositioned on window resize. * Update dependencies * Changed flyout setter/change blocks so the selected variable is the most recently created one. * Changed for dynamic variables as well. * Rebuild * Add new message * Fixed multiple trashcans on the same page leaking state. * Localisation updates from https://translatewiki.net. * Fix insertion marker flickering on value inputs (PR google#2295) Merge from rachel-fenichel/bugfix/2255 * Fix insertion marker flickering on value inputs * Rebuild and update version numbers * Fixed multiple trashcans on the same page leaking state. * rebuild after cherry-pick * Fixed bubble positioning to work with simple toolboxes (PR google#2279) Merge from BeksOmega/fixes/BubbleSimpleToolbox * Update version number * Localisation updates from https://translatewiki.net. * Movement Updates (google#2247) This is a squash and merge of a large set of changes by @BeksOmega * Added functionality to scrolling, dragging, and zooming. * Fixed incorrect changes to workspaceChanged function. * Fixed comment. * Fixed typo. * Removed scrollbar.set calls from workspace_svg. * Removed scrollbar.resize() call. * Added move options to playground. * Fixed scroll_ calls that replaced scrollbar.set calls. * Removed this.scrollbar checks. * Changed zoom so that it always zooms towards the coordinates. Changed isContentBounded_ to be separate from isMovable_ (b/c of the previous change zoomControls had to be added to the bounded check). Fixed scroll_() calls... again. * Changed procedures so the Highlight definition option is only available if the workspace is moveable. * Fixed scrollCenter so that it works with flyout toolboxes. * Fixed zoomToFit so that it works with horizontal flyout toolboxes. * Fixed Typo. * Fixed bumping blocks when the workspace is not movable. * Fixed bumping not working with left and top toolbox positions. * Re-Added not allowing scrollCenter if the workspace is not movable. Disabled scrollCenter button for this case. * Cleaned up formatting. * Fixed bumping... again. Reformatted workspaceChanged a bit. * Changed blocks to be completely bumped into the workspace. * Reorganized metrics-getting for workspaceChanged. * Added bumping workspace comments. Moved event checking. * Renamed workspaceChanged to bumpObjects. * Added a bumpObjects developer reminder. * Added warning to zoomToFit. * Cleaned up some text. * Added better inline documentation. * Fixed up inline docs. * Cleaned up comments. * Fixed zoomCenter not actually zooming towards the center. * Fixed zoomControls error on unmovable bottom-toolbox workspaces * Fixed programatically placing blocks in an unmovable workspace. * Removed unnecessary translate call in inject. * Reversed removal of translate. (apparently it was necessary) * Cleaned up code in response to first round of reviews. * Added unit comments to the zoom function. * Removed bumpObjectsEventChecker. Added BUMP_EVENTS list to Blockly.Events. * Changed getWorkspaceObjectMetrics call to getBoundingRectangle(). * Fixed utils.mouseToSvg (was causing problems with zoom on wheel if the page was scrolled). * Fixed zoom when page is scrolled (actually this time). Reverted changes to utils.mouseToSvg. * Fixed centerOnBlock. * Added unit docs to translate. Moved setting the grid position to the translate function. * Added TODO's. * Disable orphaned mutator blocks. (google#2304) * Correcting jsdoc tag spacing (PR google#2303) * Fix hat logic * Fixes block input sticking to the screen when navigated away. * Added scroll delta mode constants. * Add dropdowndiv file * Use dropdown div for colour field * Use dropdown div for dropdowns * Readded the toolbox click subscriber. Added preventing propagation to the toolbox click subscriber. Added clearing touch identifier to the document click subscriber. * Fix error by init of dropdown in case the value is "" (google#2308) I have following dropdown options ``` [ ["no matter", ""] ["Update", "true"] ["Command", "false"] ] ``` In case my value is "" the text is not filled with "no matter" by the initial draw and the empty selector is shown. I expect the text "no matter" This PR fixes that * Changed absolute metrics to avoid simple toolboxes. * Localisation updates from https://translatewiki.net. * Use dropdowndiv for field colour but not field dropdown * Add require and rebuild for travis * css cleanup * Use dropdownDiv for the angle field as well * Add click target property to fields, with accessor * Removed accessing private flyout.width_ variable. * Removed console log. * Added event filtering to workspaceChanged in mutator. (google#2320) * Clarify some dropdown rendering code * Fixed scroll event binding to work with multiple workspaces. * Don't try to bump if the object has already been deleted. * Use constants for dropdown div colours in the colour field * Update toolbox.js Changed style attribute to categorystyle. * Update playground.html * Ran build.py * Removed build changes * Reset blockly_compressed * Missed a few reversions * blockly_compressed was still off. * Localisation updates from https://translatewiki.net. * Fix issue 2061 (google#2326) * Reverts changes to fix bug with selecting dropdown * Localisation updates from https://translatewiki.net. * Add a playgound for debugging SVG paths * Localisation updates from https://translatewiki.net. * Fixed updateToolbox not properly updating flyouts. (google#2332) * Localisation updates from https://translatewiki.net. * Fixed setTheme so it doesn't error when no workspace is created * Refactor setTheme * Add private annotation * Add license; translate the group, not the start point of the path * Delete bad translation This translates back as “% 1 is the name of the renamed variable” which is the translator’s description, not the message. * Fix comment on new message. /// is needed to indicate translator message. * Prevent gestures from being broken by zoom/scroll. * Lint issues found while debugging. * Routine recompile Closure changed, this clears an error. * Remove Python references in Dart math generator Resolves google#2329 Commit in develop branch * Localisation updates from https://translatewiki.net. * Fixed trashcan flyout positioning. * Ignores urls for eslint * Listener functions are no longer wrapped opaquely. * Add comment regarding async nature of listening. * Failing unit tests no longer show useful info. * Fix JSDoc * Delete bad translation This translates back as “% 1 is the name of the renamed variable” which is the translator’s description, not the message. * Line length * Remove Blockly.WidgetDiv.position Nobody appears to call it. * Make drag detection more robust. Previously, one could drag (and hold) a quark outside the bounds of a mutator bubble, then scroll, and the old code wouldn’t query the mutator for gestures. * Consistent speling. * No need to check non-null before nullifying * Use hashes instead of objects. * No keyboard access to quarks during drag. Same issue as zooming with the mouse wheel. * Fix @return JSDocs. * More comprehensive approach to gesture detection. Search all workspaces. The flaw with looking at the workspace of the selected block is that dragging a workspace is a gesture but has no selected block. * Corrections to JSDoc comments * Don’t drop newValue from bubble open events. * Update help URLs to be https. * Localisation updates from https://translatewiki.net. * Update selected menu sizing to fix google#2351 (google#2353) * Adds check for a targetConnection * Fixes test case for unplug * Rename WorkspaceSvg.getFlyout_ (google#2357) * Develop1709 (google#2358) * Remove Python references in Dart math generator Resolves google#2329 Commit in develop branch * first commit for Thomas * Created entry for custom-dialogs Part of issue google#1709 * icon.png for custom dialog demo added * Localisation updates from https://translatewiki.net. * Hides chaff on document mouseup * Fixes bumping too much when in RTL * Fix margins/checkbox in RTL dropdown menus (google#2356) Fixes google#2337 by adding in correct positioning for RTL selected states and fixing an incorrect margin value. * Common prefix for test blocks Fixes google#2103. This will break any saved XML involving the playground’s test blocks. I don’t think any such XML exists on this planet. * Localisation updates from https://translatewiki.net. * Updates function call * typo fix in line 134 of field.js for documentation * Rebuild * Reverts hideChaff fix * Fixed Mutator Flyout Being Positioned Incorrectly RTL (google#2378) * Fixed mutator flyout being positioned incorrectly. * Changed flyout_horizonal and flyout_vertical to check this.targetWorkspace_.toolboxPosition instead of targetWorkspaceMetrics.toolboxPosition. * rebuild * Update version number to 1.20190419.0 * Fix style matching in Firefox 67 Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now returns ‘transform: translate(107px);’ if the y value is 0. This is consistent with existing behaviour in the translate SVG attribute. The comment in our code specifically states: // Accounts for same exceptions as XY_REGEX_ Yet that was not true at all. This PR makes the y argument optional (as falsely described in the comment). It also merges the 2D and 3D regeps together to simplify the code. Resolves issue google#2482. Needs to be cherrypicked to Master and everything rebuilt and pushed. * Recompile to pick up XY regex fix. * Set node version explicitly for travis on master
* Storing procedures is now possible * Added confirmation window when overriding * Master update (#20) * Avoid crashing when a procedure input has an empty string (google#2182) Fixes google#1958 This will drop the input when it's in the empty string state. This causes the block to remove the input and re-add it when the text is reverted, but prevents the breakage. A followup fix should leave the input alone instead of removing it, but this works for now. * Added message for running local_build.sh from correct folder. * Changes in comment. * Comment out removing tmp directory for testing * Debuggin * Fix generator tests * Bump version number on develop * Updated Comments. * Add error message for when style is not set * Remove use of style variables in block definition * Fixing review comments * Update the style on blocks in the mutator * Fixed scrolling horizontal flyouts with mousewheel. * Changed callback to be looked up dynamically when the button is clicked. * Localisation updates from https://translatewiki.net. * Changed how bubbles position themselves. * Fixed RTL mistake. * Fixes refresh on simple toolbox withno categories * Fix failing test * Localisation updates from https://translatewiki.net. * Fixing review comments * Prevent duplicate parameters in functions (google#2177) Prevents the coder from using duplicate parameters names in functions. In the validator function check for parameter names that have been used. If it finds a block with a name that matches return null so that it will revert the change. Also change the name each time a new parameter is created to try to prevent duplicate name. * Updated createZoomSVG comments. * Changes names for block styles * Enable insertion markers * First pass at creating mocha tests * Add jsunit->chai assert converters, and block tests * More testing with mocha * Skip two broken test suites * Changes Blockly style to be Blockly theme. * Remove dependenceis and use unpkg * Delete commented-out code * Go back to run_all_tests.sh for npm test * Fix eslint errors with in-file comments * Fixes problem with hat style * Adds hat style * Adds support for category styles * Add eslintrc to mocha directory * Fixes error thrown for style defined inline * Small fixes * Added flipRtl Support for FieldImages (google#2203) * Added flipRtl support for FieldImages. Added a flipRtl test block. * Added blockfactory support. * Fixed JSDoc. * Fixing review comments * Final fixes * Added displaying flyout horizontally when layout is horizontal. * Fixed comments not being recorded in delete event. (google#2211) * Remove old eslintrc and use .json for mocha eslintrc * Fixing compiler error for blockly themes * Remove unnecessary scripts * Moved theme scripts out of core * Adding compressed files * Adding accessible uncompressed * Access colours using bracket notation * Localisation updates from https://translatewiki.net. * local_build: Add build for local_blocks_compressed.js (google#2204) * local_build.sh: Add generation of local_blocks_compressed.js * Added comments to local_build.sh * Ignore insertion markers when checking remaining capacity * Added a Finished Loading event. * Updated blockly_uncompressed file. * Update copyright year * Fixed Xml goog.require's. Changed Blockly.Events.Ui functions to Blockly.Events.FinishedLoading. * Changed require's to be in correct lexicographical order. * Changed trashcan and zoom controls to be positioned in the opposite corner of the toolbox. Fixed trashcan hotspot being incorrect. * Added the ability to drag disabled blocks out of the trashcan flyout. * Changed the trashcan lid to always open towards the workspace. * Ignore insertion markers in getAllBlocks; add accessors for inseriton markers * Removed render_ call, which was causing fields to calculate their size incorrectly. * Localisation updates from https://translatewiki.net. * Update procedures.js When I use [Rename variable...] in procedure definition block. The argument name for calling procedure has not changed. * Use a real JS array for the connection DB. Previously “Array.isArray(connectionDB)” was false, even through “connectionDB instanceof Array” was true. * Added a test block for a dynamic dropdown. * Localisation updates from https://translatewiki.net. * Update connection_db_test * New label and title case * Fix event description for theme * Fixed comments and defaults. * Update to latest Closure Template jars, recompile. There was a small chance that the existing Soy jar files contained a denial of service vulnerability. Not that this affects Blockly in any way. https://buganizer.corp.google.com/issues/123937301 * Typo fix in code comment (google#2269) "independent" instead of "independant". * Changes colour names * language-neutral text -> language-neutral id * Check against healing child shadow blocks. Fixes google#2227, healing values. Also applies to shadow next blocks. Added a playground test block group with a shadow statement. * Fixed next blocks not being disabled in flyout. (google#2278) * Fixed horizontal scrolling on window resize. * Fixed flyout scrollbars not being repositioned on window resize. * Update dependencies * Changed flyout setter/change blocks so the selected variable is the most recently created one. * Changed for dynamic variables as well. * Rebuild * Add new message * Fixed multiple trashcans on the same page leaking state. * Localisation updates from https://translatewiki.net. * Fix insertion marker flickering on value inputs (PR google#2295) Merge from rachel-fenichel/bugfix/2255 * Fix insertion marker flickering on value inputs * Rebuild and update version numbers * Fixed multiple trashcans on the same page leaking state. * rebuild after cherry-pick * Fixed bubble positioning to work with simple toolboxes (PR google#2279) Merge from BeksOmega/fixes/BubbleSimpleToolbox * Update version number * Localisation updates from https://translatewiki.net. * Movement Updates (google#2247) This is a squash and merge of a large set of changes by @BeksOmega * Added functionality to scrolling, dragging, and zooming. * Fixed incorrect changes to workspaceChanged function. * Fixed comment. * Fixed typo. * Removed scrollbar.set calls from workspace_svg. * Removed scrollbar.resize() call. * Added move options to playground. * Fixed scroll_ calls that replaced scrollbar.set calls. * Removed this.scrollbar checks. * Changed zoom so that it always zooms towards the coordinates. Changed isContentBounded_ to be separate from isMovable_ (b/c of the previous change zoomControls had to be added to the bounded check). Fixed scroll_() calls... again. * Changed procedures so the Highlight definition option is only available if the workspace is moveable. * Fixed scrollCenter so that it works with flyout toolboxes. * Fixed zoomToFit so that it works with horizontal flyout toolboxes. * Fixed Typo. * Fixed bumping blocks when the workspace is not movable. * Fixed bumping not working with left and top toolbox positions. * Re-Added not allowing scrollCenter if the workspace is not movable. Disabled scrollCenter button for this case. * Cleaned up formatting. * Fixed bumping... again. Reformatted workspaceChanged a bit. * Changed blocks to be completely bumped into the workspace. * Reorganized metrics-getting for workspaceChanged. * Added bumping workspace comments. Moved event checking. * Renamed workspaceChanged to bumpObjects. * Added a bumpObjects developer reminder. * Added warning to zoomToFit. * Cleaned up some text. * Added better inline documentation. * Fixed up inline docs. * Cleaned up comments. * Fixed zoomCenter not actually zooming towards the center. * Fixed zoomControls error on unmovable bottom-toolbox workspaces * Fixed programatically placing blocks in an unmovable workspace. * Removed unnecessary translate call in inject. * Reversed removal of translate. (apparently it was necessary) * Cleaned up code in response to first round of reviews. * Added unit comments to the zoom function. * Removed bumpObjectsEventChecker. Added BUMP_EVENTS list to Blockly.Events. * Changed getWorkspaceObjectMetrics call to getBoundingRectangle(). * Fixed utils.mouseToSvg (was causing problems with zoom on wheel if the page was scrolled). * Fixed zoom when page is scrolled (actually this time). Reverted changes to utils.mouseToSvg. * Fixed centerOnBlock. * Added unit docs to translate. Moved setting the grid position to the translate function. * Added TODO's. * Disable orphaned mutator blocks. (google#2304) * Correcting jsdoc tag spacing (PR google#2303) * Fix hat logic * Fixes block input sticking to the screen when navigated away. * Added scroll delta mode constants. * Add dropdowndiv file * Use dropdown div for colour field * Use dropdown div for dropdowns * Readded the toolbox click subscriber. Added preventing propagation to the toolbox click subscriber. Added clearing touch identifier to the document click subscriber. * Fix error by init of dropdown in case the value is "" (google#2308) I have following dropdown options ``` [ ["no matter", ""] ["Update", "true"] ["Command", "false"] ] ``` In case my value is "" the text is not filled with "no matter" by the initial draw and the empty selector is shown. I expect the text "no matter" This PR fixes that * Changed absolute metrics to avoid simple toolboxes. * Localisation updates from https://translatewiki.net. * Use dropdowndiv for field colour but not field dropdown * Add require and rebuild for travis * css cleanup * Use dropdownDiv for the angle field as well * Add click target property to fields, with accessor * Removed accessing private flyout.width_ variable. * Removed console log. * Added event filtering to workspaceChanged in mutator. (google#2320) * Clarify some dropdown rendering code * Fixed scroll event binding to work with multiple workspaces. * Don't try to bump if the object has already been deleted. * Use constants for dropdown div colours in the colour field * Update toolbox.js Changed style attribute to categorystyle. * Update playground.html * Ran build.py * Removed build changes * Reset blockly_compressed * Missed a few reversions * blockly_compressed was still off. * Localisation updates from https://translatewiki.net. * Fix issue 2061 (google#2326) * Reverts changes to fix bug with selecting dropdown * Localisation updates from https://translatewiki.net. * Add a playgound for debugging SVG paths * Localisation updates from https://translatewiki.net. * Fixed updateToolbox not properly updating flyouts. (google#2332) * Localisation updates from https://translatewiki.net. * Fixed setTheme so it doesn't error when no workspace is created * Refactor setTheme * Add private annotation * Add license; translate the group, not the start point of the path * Delete bad translation This translates back as “% 1 is the name of the renamed variable” which is the translator’s description, not the message. * Fix comment on new message. /// is needed to indicate translator message. * Prevent gestures from being broken by zoom/scroll. * Lint issues found while debugging. * Routine recompile Closure changed, this clears an error. * Remove Python references in Dart math generator Resolves google#2329 Commit in develop branch * Localisation updates from https://translatewiki.net. * Fixed trashcan flyout positioning. * Ignores urls for eslint * Listener functions are no longer wrapped opaquely. * Add comment regarding async nature of listening. * Failing unit tests no longer show useful info. * Fix JSDoc * Delete bad translation This translates back as “% 1 is the name of the renamed variable” which is the translator’s description, not the message. * Line length * Remove Blockly.WidgetDiv.position Nobody appears to call it. * Make drag detection more robust. Previously, one could drag (and hold) a quark outside the bounds of a mutator bubble, then scroll, and the old code wouldn’t query the mutator for gestures. * Consistent speling. * No need to check non-null before nullifying * Use hashes instead of objects. * No keyboard access to quarks during drag. Same issue as zooming with the mouse wheel. * Fix @return JSDocs. * More comprehensive approach to gesture detection. Search all workspaces. The flaw with looking at the workspace of the selected block is that dragging a workspace is a gesture but has no selected block. * Corrections to JSDoc comments * Don’t drop newValue from bubble open events. * Update help URLs to be https. * Localisation updates from https://translatewiki.net. * Update selected menu sizing to fix google#2351 (google#2353) * Adds check for a targetConnection * Fixes test case for unplug * Rename WorkspaceSvg.getFlyout_ (google#2357) * Develop1709 (google#2358) * Remove Python references in Dart math generator Resolves google#2329 Commit in develop branch * first commit for Thomas * Created entry for custom-dialogs Part of issue google#1709 * icon.png for custom dialog demo added * Localisation updates from https://translatewiki.net. * Hides chaff on document mouseup * Fixes bumping too much when in RTL * Fix margins/checkbox in RTL dropdown menus (google#2356) Fixes google#2337 by adding in correct positioning for RTL selected states and fixing an incorrect margin value. * Common prefix for test blocks Fixes google#2103. This will break any saved XML involving the playground’s test blocks. I don’t think any such XML exists on this planet. * Localisation updates from https://translatewiki.net. * Updates function call * typo fix in line 134 of field.js for documentation * Rebuild * Reverts hideChaff fix * Fixed Mutator Flyout Being Positioned Incorrectly RTL (google#2378) * Fixed mutator flyout being positioned incorrectly. * Changed flyout_horizonal and flyout_vertical to check this.targetWorkspace_.toolboxPosition instead of targetWorkspaceMetrics.toolboxPosition. * rebuild * Update version number to 1.20190419.0 * Fix style matching in Firefox 67 Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now returns ‘transform: translate(107px);’ if the y value is 0. This is consistent with existing behaviour in the translate SVG attribute. The comment in our code specifically states: // Accounts for same exceptions as XY_REGEX_ Yet that was not true at all. This PR makes the y argument optional (as falsely described in the comment). It also merges the 2D and 3D regeps together to simplify the code. Resolves issue google#2482. Needs to be cherrypicked to Master and everything rebuilt and pushed. * Recompile to pick up XY regex fix. * Set node version explicitly for travis on master * Fixed issues with merge * Small bugfixes * Added search functionality * Added optional check for dropdown search * made optinal param false by default * Initial logic * Fixed bugs with deleting blocks * Checkmark * Merge * Fixes to search logic * Bug fixes * Bug fixes with insertion markers * Bug fixes to search logic * Search improvement - custom search terms added * Major search optimizations. Hardcoded keywords. * Search refactor * Search keywords added * Added a clearAll for when changing the toolbox * Bugfix when not adding chars to search. Comments and refactoring. * Fable Functions refactored * Added an important TODO * moved custom dialog stuff into blockly
* Storing procedures is now possible * Added confirmation window when overriding * Master update (#20) * Avoid crashing when a procedure input has an empty string (google#2182) Fixes google#1958 This will drop the input when it's in the empty string state. This causes the block to remove the input and re-add it when the text is reverted, but prevents the breakage. A followup fix should leave the input alone instead of removing it, but this works for now. * Added message for running local_build.sh from correct folder. * Changes in comment. * Comment out removing tmp directory for testing * Debuggin * Fix generator tests * Bump version number on develop * Updated Comments. * Add error message for when style is not set * Remove use of style variables in block definition * Fixing review comments * Update the style on blocks in the mutator * Fixed scrolling horizontal flyouts with mousewheel. * Changed callback to be looked up dynamically when the button is clicked. * Localisation updates from https://translatewiki.net. * Changed how bubbles position themselves. * Fixed RTL mistake. * Fixes refresh on simple toolbox withno categories * Fix failing test * Localisation updates from https://translatewiki.net. * Fixing review comments * Prevent duplicate parameters in functions (google#2177) Prevents the coder from using duplicate parameters names in functions. In the validator function check for parameter names that have been used. If it finds a block with a name that matches return null so that it will revert the change. Also change the name each time a new parameter is created to try to prevent duplicate name. * Updated createZoomSVG comments. * Changes names for block styles * Enable insertion markers * First pass at creating mocha tests * Add jsunit->chai assert converters, and block tests * More testing with mocha * Skip two broken test suites * Changes Blockly style to be Blockly theme. * Remove dependenceis and use unpkg * Delete commented-out code * Go back to run_all_tests.sh for npm test * Fix eslint errors with in-file comments * Fixes problem with hat style * Adds hat style * Adds support for category styles * Add eslintrc to mocha directory * Fixes error thrown for style defined inline * Small fixes * Added flipRtl Support for FieldImages (google#2203) * Added flipRtl support for FieldImages. Added a flipRtl test block. * Added blockfactory support. * Fixed JSDoc. * Fixing review comments * Final fixes * Added displaying flyout horizontally when layout is horizontal. * Fixed comments not being recorded in delete event. (google#2211) * Remove old eslintrc and use .json for mocha eslintrc * Fixing compiler error for blockly themes * Remove unnecessary scripts * Moved theme scripts out of core * Adding compressed files * Adding accessible uncompressed * Access colours using bracket notation * Localisation updates from https://translatewiki.net. * local_build: Add build for local_blocks_compressed.js (google#2204) * local_build.sh: Add generation of local_blocks_compressed.js * Added comments to local_build.sh * Ignore insertion markers when checking remaining capacity * Added a Finished Loading event. * Updated blockly_uncompressed file. * Update copyright year * Fixed Xml goog.require's. Changed Blockly.Events.Ui functions to Blockly.Events.FinishedLoading. * Changed require's to be in correct lexicographical order. * Changed trashcan and zoom controls to be positioned in the opposite corner of the toolbox. Fixed trashcan hotspot being incorrect. * Added the ability to drag disabled blocks out of the trashcan flyout. * Changed the trashcan lid to always open towards the workspace. * Ignore insertion markers in getAllBlocks; add accessors for inseriton markers * Removed render_ call, which was causing fields to calculate their size incorrectly. * Localisation updates from https://translatewiki.net. * Update procedures.js When I use [Rename variable...] in procedure definition block. The argument name for calling procedure has not changed. * Use a real JS array for the connection DB. Previously “Array.isArray(connectionDB)” was false, even through “connectionDB instanceof Array” was true. * Added a test block for a dynamic dropdown. * Localisation updates from https://translatewiki.net. * Update connection_db_test * New label and title case * Fix event description for theme * Fixed comments and defaults. * Update to latest Closure Template jars, recompile. There was a small chance that the existing Soy jar files contained a denial of service vulnerability. Not that this affects Blockly in any way. https://buganizer.corp.google.com/issues/123937301 * Typo fix in code comment (google#2269) "independent" instead of "independant". * Changes colour names * language-neutral text -> language-neutral id * Check against healing child shadow blocks. Fixes google#2227, healing values. Also applies to shadow next blocks. Added a playground test block group with a shadow statement. * Fixed next blocks not being disabled in flyout. (google#2278) * Fixed horizontal scrolling on window resize. * Fixed flyout scrollbars not being repositioned on window resize. * Update dependencies * Changed flyout setter/change blocks so the selected variable is the most recently created one. * Changed for dynamic variables as well. * Rebuild * Add new message * Fixed multiple trashcans on the same page leaking state. * Localisation updates from https://translatewiki.net. * Fix insertion marker flickering on value inputs (PR google#2295) Merge from rachel-fenichel/bugfix/2255 * Fix insertion marker flickering on value inputs * Rebuild and update version numbers * Fixed multiple trashcans on the same page leaking state. * rebuild after cherry-pick * Fixed bubble positioning to work with simple toolboxes (PR google#2279) Merge from BeksOmega/fixes/BubbleSimpleToolbox * Update version number * Localisation updates from https://translatewiki.net. * Movement Updates (google#2247) This is a squash and merge of a large set of changes by @BeksOmega * Added functionality to scrolling, dragging, and zooming. * Fixed incorrect changes to workspaceChanged function. * Fixed comment. * Fixed typo. * Removed scrollbar.set calls from workspace_svg. * Removed scrollbar.resize() call. * Added move options to playground. * Fixed scroll_ calls that replaced scrollbar.set calls. * Removed this.scrollbar checks. * Changed zoom so that it always zooms towards the coordinates. Changed isContentBounded_ to be separate from isMovable_ (b/c of the previous change zoomControls had to be added to the bounded check). Fixed scroll_() calls... again. * Changed procedures so the Highlight definition option is only available if the workspace is moveable. * Fixed scrollCenter so that it works with flyout toolboxes. * Fixed zoomToFit so that it works with horizontal flyout toolboxes. * Fixed Typo. * Fixed bumping blocks when the workspace is not movable. * Fixed bumping not working with left and top toolbox positions. * Re-Added not allowing scrollCenter if the workspace is not movable. Disabled scrollCenter button for this case. * Cleaned up formatting. * Fixed bumping... again. Reformatted workspaceChanged a bit. * Changed blocks to be completely bumped into the workspace. * Reorganized metrics-getting for workspaceChanged. * Added bumping workspace comments. Moved event checking. * Renamed workspaceChanged to bumpObjects. * Added a bumpObjects developer reminder. * Added warning to zoomToFit. * Cleaned up some text. * Added better inline documentation. * Fixed up inline docs. * Cleaned up comments. * Fixed zoomCenter not actually zooming towards the center. * Fixed zoomControls error on unmovable bottom-toolbox workspaces * Fixed programatically placing blocks in an unmovable workspace. * Removed unnecessary translate call in inject. * Reversed removal of translate. (apparently it was necessary) * Cleaned up code in response to first round of reviews. * Added unit comments to the zoom function. * Removed bumpObjectsEventChecker. Added BUMP_EVENTS list to Blockly.Events. * Changed getWorkspaceObjectMetrics call to getBoundingRectangle(). * Fixed utils.mouseToSvg (was causing problems with zoom on wheel if the page was scrolled). * Fixed zoom when page is scrolled (actually this time). Reverted changes to utils.mouseToSvg. * Fixed centerOnBlock. * Added unit docs to translate. Moved setting the grid position to the translate function. * Added TODO's. * Disable orphaned mutator blocks. (google#2304) * Correcting jsdoc tag spacing (PR google#2303) * Fix hat logic * Fixes block input sticking to the screen when navigated away. * Added scroll delta mode constants. * Add dropdowndiv file * Use dropdown div for colour field * Use dropdown div for dropdowns * Readded the toolbox click subscriber. Added preventing propagation to the toolbox click subscriber. Added clearing touch identifier to the document click subscriber. * Fix error by init of dropdown in case the value is "" (google#2308) I have following dropdown options ``` [ ["no matter", ""] ["Update", "true"] ["Command", "false"] ] ``` In case my value is "" the text is not filled with "no matter" by the initial draw and the empty selector is shown. I expect the text "no matter" This PR fixes that * Changed absolute metrics to avoid simple toolboxes. * Localisation updates from https://translatewiki.net. * Use dropdowndiv for field colour but not field dropdown * Add require and rebuild for travis * css cleanup * Use dropdownDiv for the angle field as well * Add click target property to fields, with accessor * Removed accessing private flyout.width_ variable. * Removed console log. * Added event filtering to workspaceChanged in mutator. (google#2320) * Clarify some dropdown rendering code * Fixed scroll event binding to work with multiple workspaces. * Don't try to bump if the object has already been deleted. * Use constants for dropdown div colours in the colour field * Update toolbox.js Changed style attribute to categorystyle. * Update playground.html * Ran build.py * Removed build changes * Reset blockly_compressed * Missed a few reversions * blockly_compressed was still off. * Localisation updates from https://translatewiki.net. * Fix issue 2061 (google#2326) * Reverts changes to fix bug with selecting dropdown * Localisation updates from https://translatewiki.net. * Add a playgound for debugging SVG paths * Localisation updates from https://translatewiki.net. * Fixed updateToolbox not properly updating flyouts. (google#2332) * Localisation updates from https://translatewiki.net. * Fixed setTheme so it doesn't error when no workspace is created * Refactor setTheme * Add private annotation * Add license; translate the group, not the start point of the path * Delete bad translation This translates back as “% 1 is the name of the renamed variable” which is the translator’s description, not the message. * Fix comment on new message. /// is needed to indicate translator message. * Prevent gestures from being broken by zoom/scroll. * Lint issues found while debugging. * Routine recompile Closure changed, this clears an error. * Remove Python references in Dart math generator Resolves google#2329 Commit in develop branch * Localisation updates from https://translatewiki.net. * Fixed trashcan flyout positioning. * Ignores urls for eslint * Listener functions are no longer wrapped opaquely. * Add comment regarding async nature of listening. * Failing unit tests no longer show useful info. * Fix JSDoc * Delete bad translation This translates back as “% 1 is the name of the renamed variable” which is the translator’s description, not the message. * Line length * Remove Blockly.WidgetDiv.position Nobody appears to call it. * Make drag detection more robust. Previously, one could drag (and hold) a quark outside the bounds of a mutator bubble, then scroll, and the old code wouldn’t query the mutator for gestures. * Consistent speling. * No need to check non-null before nullifying * Use hashes instead of objects. * No keyboard access to quarks during drag. Same issue as zooming with the mouse wheel. * Fix @return JSDocs. * More comprehensive approach to gesture detection. Search all workspaces. The flaw with looking at the workspace of the selected block is that dragging a workspace is a gesture but has no selected block. * Corrections to JSDoc comments * Don’t drop newValue from bubble open events. * Update help URLs to be https. * Localisation updates from https://translatewiki.net. * Update selected menu sizing to fix google#2351 (google#2353) * Adds check for a targetConnection * Fixes test case for unplug * Rename WorkspaceSvg.getFlyout_ (google#2357) * Develop1709 (google#2358) * Remove Python references in Dart math generator Resolves google#2329 Commit in develop branch * first commit for Thomas * Created entry for custom-dialogs Part of issue google#1709 * icon.png for custom dialog demo added * Localisation updates from https://translatewiki.net. * Hides chaff on document mouseup * Fixes bumping too much when in RTL * Fix margins/checkbox in RTL dropdown menus (google#2356) Fixes google#2337 by adding in correct positioning for RTL selected states and fixing an incorrect margin value. * Common prefix for test blocks Fixes google#2103. This will break any saved XML involving the playground’s test blocks. I don’t think any such XML exists on this planet. * Localisation updates from https://translatewiki.net. * Updates function call * typo fix in line 134 of field.js for documentation * Rebuild * Reverts hideChaff fix * Fixed Mutator Flyout Being Positioned Incorrectly RTL (google#2378) * Fixed mutator flyout being positioned incorrectly. * Changed flyout_horizonal and flyout_vertical to check this.targetWorkspace_.toolboxPosition instead of targetWorkspaceMetrics.toolboxPosition. * rebuild * Update version number to 1.20190419.0 * Fix style matching in Firefox 67 Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now returns ‘transform: translate(107px);’ if the y value is 0. This is consistent with existing behaviour in the translate SVG attribute. The comment in our code specifically states: // Accounts for same exceptions as XY_REGEX_ Yet that was not true at all. This PR makes the y argument optional (as falsely described in the comment). It also merges the 2D and 3D regeps together to simplify the code. Resolves issue google#2482. Needs to be cherrypicked to Master and everything rebuilt and pushed. * Recompile to pick up XY regex fix. * Set node version explicitly for travis on master * Fixed issues with merge * Small bugfixes * Added search functionality * Added optional check for dropdown search * made optinal param false by default * Initial logic * Fixed bugs with deleting blocks * Checkmark * Merge * Fixes to search logic * Bug fixes * Bug fixes with insertion markers * Bug fixes to search logic * Search improvement - custom search terms added * Major search optimizations. Hardcoded keywords. * Search refactor * Search keywords added * Added a clearAll for when changing the toolbox * Bugfix when not adding chars to search. Comments and refactoring. * Fable Functions refactored * Added an important TODO * moved custom dialog stuff into blockly * Fixed typo
Fixes #1958
This will drop the input when it's in the empty string state. This
causes the block to remove the input and re-add it when the text
is reverted, but prevents the breakage. A followup fix should leave
the input alone instead of removing it, but this works for now.
The basics
The details
Resolves
Proposed Changes
Reason for Changes
Test Coverage
Tested on:
Desktop Chrome
Additional Information
This change is