Skip to content

Commit 2df0b15

Browse files
Develop to master (google#1244)
* Adding new minimap demo * Basic code style changes. Adding a few more comments. Return early if disableScrollChange in onScrollChange listener. * Adding horizontal scrolling. Changed scroll change callbacks from onScroll_ to setHandlePosition. onScroll_ is not challed when workspace is dragged. * Registering mousemove and mouseup listener in mousedown event. Mousemove and Mouseup events are now listening over document. * Adding the remove variable modal and functionality to accessible Blockly. (google#1011) * Minimap position bug fix for browsers other than chrome. Added touch support. * Adding an add variable modal to accessible Blockly. (google#1015) * Adding the remove variable modal and functionality to accessible Blockly. * Adding the add variable modal for accessible Blockly. * Block browser context menu in the toolbox and flyout * Add links to the dev registration form and contributor guidelines * Miscellaneous comment cleanup * Adding the common modal class. (google#1017) Centralizes accessible modal behavior. * - Changed error message referencing 'procedure' instead of 'function' (google#1019) - Added iOS specific UI messages - Fixed bug with js_to_json.py script where it didn't recognize ' character * - Allows use of Blockly's messaging format for category name, colour,… (google#1028) ...in toolbox XML. - Updated code editor demo to use this message format - Re-built blockly_compressed.js * Making text_count use a text color (like text_length, which also returns a number). (google#1027) * Enable google/blockly with continuous build on travis ci (google#1023) (google#1035) * create .travis for ci job * initial checkin for blocky-web travis ci job * rename file to .travis.yaml for typo * remove after_script * added cache * rename .travis.yaml to .travis.yml * Update .travis.yml * include build script * fix yaml file format issue * debug install part * debug build issue * Update .travis.yml * remove cache for now * Update .travis.yml * Update .travis.yml * Update .travis.yml * more debug info * Update .travis.yml * Update .travis.yml * fix typo * installing chrome browser * remove chrome setting config * run build.py as part of npm install * Update .travis.yml * update karma dependency * use karma as test runner * fix typo * remove karma test for now * Update .travis.yml * Update package.json * add npm test target * add browserstack-runner depdendency * update browser support * fix typo for test target * fix chrome typo * added closure dependency * add google-closure-library * include blockly_uncompressed.js and core.js dependency * uncomment out core/*.js files * add kama job as part of install * remove browserstack add on for now * fix karma config typo * add karma-closure * add os support * remove typo config * include more closure files * change os back to linux * use closure-library from node_modules * change log level back to INFO * change npm test target to use open browser command instead of karma * change travis test target to use open command instead of karma * list current directory * find what's in current dir * typo command * Update .travis.yml * typo again * open right index.html * use right path for index.html * xdg-open to open default browser on travis * exit browser after 5s wait * change timeout to 1 min * exit after opening up browser * use browser only * use karma * remove un-needed dependency * clean up script section * fix typo * update build status on readme * initial commit for selenium integration tests * update selenium jar path * fix test_runner.js typo * add more debug info * check java version * add && instead of 9288 * fix java path * add logic to check if selenium is running or not * add some deugging info * initial commit to get chromedriver * add chromedriver flag * add get_chromedriver.sh to package.json and .travel * change browser to chrome for now * fix path issue * update chromdriver path * fix path issue again * more debugging * add debug msg * fix typo * minor fix for getting chromedriver * install latest chrome browser * clean up pakcage.json * use npm target for test run * remove removing trailing comma * fix another trailing comma * updated travis test target * clean up scripts * not sure nmp run preinstall * redirect selenium log to tmp file * revert writing console log to file * update test summary * more clean up * minor clean up before pull request * resolved closure-library conflict 1. add closure-library to dependencies instead of devDependencies. 2. add lint back in scripts block * fix typo (adding comma) in script section * Renames Blockly.workspaceDragSurface to Blockly.WorkspaceDragSurface. Fixes google#880. * Ensure useDragSurface is a boolean. Fixed google#988 * use pretest instead of preinstall in package.json (google#1043) * cherry pick for pretest fix * put pretest target to test_setup.sh * fix conflict * cherry pick for get_chromedriver.sh * add some sleep to wait download to finish * use node.js stable * use npm test target * field_angle renders degree symbol consistently. Fixes google#973 * bumpNeighbours_ function moved to block_svg. Fixed google#1009 * Update RegEx in js-to-json to match windowi eol (google#1050) The current regex only works with the "\n" line endings as it expects no characters after the optional ";" at the end of the line. In windows, if it adds the "\r" it counts as a characters and is not part of the line terminator so it doesn't match. * Fix French translation of "colour with rgb" block (google#1053) "colorier", which is currently used, is a verb and proposed "couleur" is a noun: the block in question does not change colour of anything, it creates new colour instead, thus noun is more applicable. Also, noun is used in French translation of "random colour" block: "couleur aléatoire". * Enforcing non-empty names on value inputs and statement inputs. (google#1054) * Correcting google#1054 (google#1056) single quotes. better logic. * Created a variable model with name, id, and type. Created a jsunit test file for variable model. * Change how blockly handles cursors. The old way was quite slow becau… (google#1057) * Change how blockly handles cursors. The old way was quite slow because it changed the stylesheet directly. See issue google#981 for more details on implementation and tradeoffs. This changes makes the following high level changes: deprecate Blockly.Css.setCursor, use built in open and closed hand cursor instead of custom .cur files, add css to draggable objects to set the open and closed hand cursors. * Rebuild blockly_uncompressed to pick up a testing change to make travis happy. Fix a build warning from a multi-line string in the process. (google#1059) * Merge master into develop (google#1063) - pick up translation changes - clean up trailing spaces * use goog.string.startswith instead of string.startswith (google#1065) * New jsinterpreter demo includes wait block. Both demos have improved UI for clarity. (google#1001) Refactor of interpreter demo * Renamed demos/interpreter/index.html as demos/interpreter/step-execution.html (including redirect), and added demos/interpreter/async-execution.html. * Refactored code to automatically generate/parse the blocks, eliminating the need for a "Parse JavaScript" button. Code is still shown in alert upon stepping to the first statement. Print statements now write to output <textarea> instead of modal dialogs. * VariableMap and functions added. * Create separate file for VariableMap and its functions. * Fix google#1069 (google#1073) * VariableMap and functions added. * Fix google#1051 (google#1084) * Improve errors when validating JSON block definitions. (google#1086) goog.asserts to not run from blockly_compressed.js. User data validation should always run. * Dragging changes, rebased on develop (google#1078) * Add block drag surface translateSurfaceBy * Add dragged connection manager * Add gesture.js * Add GestureHandler * Implemented gesture skeleton * Most basic workspace dragging * Add dragged connection manager * cleanup * doc * more cleanup * Add gesture handler * Add translateSurfaceInternal * core/block_dragger.js * cleanup * Pull in changes to dragged connection manager * Pull in changes to dragged connection manager * comments * more annotations * Add workspace dragger * Add coordinate annotations * Start on block dragging * Limit number of concurrent gestures * Add some TODOs * start using dragged connection manager * Set origin correctly for dragging blocks * Connect or delete at the end of a block drag. * cleanup * handle field clicks and block + workspace right-clicks * move code into BlockDragger class, but still reach into Gesture internals a lot * Clean up block dragger * Call blockDragger constructor with correct arguments * Enable block dragging in a mutator workspace * Add workspace dragger * click todos * Drag flyout with background * more dragging from flyout * nit * fix dragging from flyouts * Remove unused code and rename gestureHandler to gestureDB * Rename gesture handler * Added some jsdoc in gesture.js * Update some docs * Move some code to block_svg and clean up code * Lots of coordinate annotations * Fix block dragging when zoomed. * Remove built files from branch * More dragging work (google#1026) -- Drag bubbles while dragging blocks -- Use bindEventWithChecks to work in touch on Android. Not tested anywhere else yet. -- Handle dragging blocks while zoomed -- Handle dragging blocks in mutators -- Handle right-clicks (I hope) -- Removed lots of unused code * More dragging work (google#1048) - Removed gestureDB - Removing uses of terminateDrag - Cleaned up disposal code * Dragging bugfixes (google#1058) - Get rid of flyout.dragMode_ and blockly.dragMode_ - Make drags from the flyout start from the top block in the group - Block tooltips from being scheduled or shown during gestures - Don't resize mutator bubbles mid-drag * Fix events in new dragging (google#1060) * rebuild for testing * unbuild * Fix events * rebuild * Fix up cursors * Use language files from develop * Remove handled TODOS * attempt to fix IE rerendering bug, and recalculate workspace positions on scroll * Rebuild all the things * Comment cleanup; annotations; delete unused variables. * Tidy up context menu code. (google#1081) * add osx travis test run job (google#1074) * Names are correctly fetched from VariableModels! * add more wait time for test setup (google#1091) * Work around timing issue with travis osx issue (google#1092) * add more wait time for test setup * increase selenium wait time * add more wait * Fix google#1077 by adding a rule to cover the toolbox labels too. (google#1099) * Assign variable UUID to field_variable dropdown. * Change registration link to a static one (google#1106) This lets us redirect to a different form if we change it in the future. * Edit generators to read in Variable Models. * Add VariableMap requirement to workspace. * Changed parameter name in workspace for clarity. * Add type, id, and info to the generated xml. Add xml tests for fieldToDom. Update workspace tests to pass with new changes. * Fix apostrophe in tooltips and helpurls (google#1111) * Click events on shadow blocks have the correct id (google#1089) * Add image_onclick option (google#1080) * Cleanup: semicolons, spacing, etc. (google#1116) * Spelling. Spelling is hard. * Add variable info to xml generated in variables.js * Add missing CLAs info to the contributing file (google#1119) * Add missing CLAs info to the contributing file * Added larger changes paragraph * Replacing latest prettifier hosted in repo with latest version at rawgit CDN. (google#1120) * Forgot update code demo (google#1121) * Move audio code to a new file (google#1122) * move audio code to a new file * dispose * null check * Make flyout get variables from target workspace's variableMap. * Require VariableModel in field_variable.js. * Update contributing.md (google#1126) * Include variables at top of serialization. * Move blockSvg.getHeightWidth to block_render_svg.js (google#1118) * Deserialization variables at top. * Create grid object (google#1131) * Create grid object * Doc * Units! Thanks @RoboErikG * Appease eslint: semicolons and such. * Deserialization variables at top. * Setting up accessible Blockly for Closure compilation. (google#1134) Moving closure compilation into the build file. Fixing up goog.requires for accessible blockly. Adding accessible to the build script. * Fix google#1109 * Adding command-line options to the buildscript. (google#1136) * Fix for travis-ci testing failure (google#1141) It looks like the default configuration for Travis might have changed. Adding a manual step to install webdriverio. * Convert text_join block to JSON + mutator format (google#1140) * Clean up and create test utilities file. * Add BLOCK events and constructor tests. * Convert more text blocks to json (google#1147) * Convert more text blocks to json Converts the mutator blocks for text_join and the text_append block to JSON format. * Fixing modals so they're announced on focus, and changing variables t… (google#1030) * Fixing modals so they're announced on focus, and changing variables to only react to enter, not onChange. * Adding a temp index. * Whoops - added it in the wrong spot. * Adding automatically-generated variable lists to the accessible toolbox. (google#1149) Fixing a bug with the core-only uncompressed file not finding its own directory. * Field Variable setValue() looks up variable. * Wrap Error in Try Finally Block. * Changing the build file to allow forced rebuilding of the msg files. (google#1158) * Split flyout into flyout_base, flyout_horizontal, and flyou_vertical * Rename flyout to flyout_base * flyout_base minus horizontal and vertical code * Add flyout_vertical and flyout_horizontal * review fixes + toolbox and workspace use * Fix hat block case * rebuild uncompressed * Fix travis problem * Fix build problem * Add VAR events. * Correctly named block events called. * Fire VAR events and test. * Create utility function for checking variable values. * In DropdownCreate check for Msg.DELETE_VARIABLE. * Test Delete Variable Twice. * Convert more text blocks to JSON format (google#1163) * Convert more text blocks to JSON format Converts text_charAt, text_indexOf, text_isEmpty, and text_length to JSON. Includes a rebuild to pick up message changes. * Fixing the accessible variable stuff so it interacts correctly with (google#1170) variableMap. * createVariable in workspaceSvg takes in id and type. * Followup RefreshToolbox. * Fixing an error with block messages and ordering. (google#1171) * Remove out of date todo comments. * Fix checkbox delete bug. * Fixing variable dropdowns so they select the correct option. (google#1184) * Always open flyout fields are editable. * Fixing the tree service so it doesn't treat unknown block deletion (google#1182) as an error, and turning off keypresses on the workspace when the variable modals are open. * Revamping mostly gesture tests. * Merge master to develop (google#1189) * Merge master into develop (google#1063) - pick up translation changes - clean up trailing spaces * Rebuild for translations * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Cherrypick a fix for google#1069 and rebuild (google#1075) * Fix google#1069 (google#1073) * rebuild * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Rebuild compressed files * Add some translatewiki annotations back into msg/messages.js * Rebuild msg files * Fix flyout dropdown bug. * Fix python and php procedures. * Dropdown Create does not create a missing variable twice. * Fire field variable change event with variable value, not name. * Fix google#1160 (google#1197) Fix "Connection UI Effect not playing on block connect" * Only add a block in the flyout if it is not disabled (google#1204) * Only add a block in the flyout if it is not disabled * PR feedback * remove previous fix * Fix issue with compression stripping dropdown options (google#1207) * Change the build process to be deterministic (google#1154) * Change the Blockly build process to be deterministic across machines. * A couple more missed locations for deterministic ordering. * Modularize Rename Variable prompt and allow custom context menus for flyout. * Adding BlocklyDevTools.Analytics (google#1217) Adding BlocklyDevTools.Analytics, an interface for integrating an analytics library to track basic usage, including: * navigation. * saving, importing, and exporting. * warnings and errors. * Modify the colour_rgb function to match other languages (google#1210) There are two tests fail before modifying the color_rgb function because it behaves differently in Dart and in other languages. In Dart, this function takes parameters ranging from 0 to 1.0 while in other languages such as Lua the counterpart function takes parameters ranging from 0 to 100. Now I have modified it to let it behave the same as other languages. * Fix code generation for procedures (PHP, Python). * Typo in a deprecated variable's value (google#1228) Misspelled variable name, should be Blockly.PROCEDURE_CATEGORY_NAME. * Use the same math for dragging blocks out of horizontal and vertical flyouts. (google#1215) * Use the same math for dragging blocks out of horizontal and vertical flyouts. * Update flyout_base.js * Add VariableType checks. * Add opt_type to Blockly.Variables.CreateVariable. * Fix Blockly.Procedures.isNameUsed return values. Add tests for Procedures.isNameUsed() so this bug never happens again. * Compatibility for Closure Compiler. (google#1240) * Rebuild all the things * Master to develop 07 31 17 (google#1243) * Rebuild for master push * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Enable google/blockly with continuous build on travis ci (google#1023) * create .travis for ci job * initial checkin for blocky-web travis ci job * rename file to .travis.yaml for typo * remove after_script * added cache * rename .travis.yaml to .travis.yml * Update .travis.yml * include build script * fix yaml file format issue * debug install part * debug build issue * Update .travis.yml * remove cache for now * Update .travis.yml * Update .travis.yml * Update .travis.yml * more debug info * Update .travis.yml * Update .travis.yml * fix typo * installing chrome browser * remove chrome setting config * run build.py as part of npm install * Update .travis.yml * update karma dependency * use karma as test runner * fix typo * remove karma test for now * Update .travis.yml * Update package.json * add npm test target * add browserstack-runner depdendency * update browser support * fix typo for test target * fix chrome typo * added closure dependency * add google-closure-library * include blockly_uncompressed.js and core.js dependency * uncomment out core/*.js files * add kama job as part of install * remove browserstack add on for now * fix karma config typo * add karma-closure * add os support * remove typo config * include more closure files * change os back to linux * use closure-library from node_modules * change log level back to INFO * change npm test target to use open browser command instead of karma * change travis test target to use open command instead of karma * list current directory * find what's in current dir * typo command * Update .travis.yml * typo again * open right index.html * use right path for index.html * xdg-open to open default browser on travis * exit browser after 5s wait * change timeout to 1 min * exit after opening up browser * use browser only * use karma * remove un-needed dependency * clean up script section * fix typo * update build status on readme * initial commit for selenium integration tests * update selenium jar path * fix test_runner.js typo * add more debug info * check java version * add && instead of 9288 * fix java path * add logic to check if selenium is running or not * add some deugging info * initial commit to get chromedriver * add chromedriver flag * add get_chromedriver.sh to package.json and .travel * change browser to chrome for now * fix path issue * update chromdriver path * fix path issue again * more debugging * add debug msg * fix typo * minor fix for getting chromedriver * install latest chrome browser * clean up pakcage.json * use npm target for test run * remove removing trailing comma * fix another trailing comma * updated travis test target * clean up scripts * not sure nmp run preinstall * redirect selenium log to tmp file * revert writing console log to file * update test summary * more clean up * minor clean up before pull request * resolved closure-library conflict 1. add closure-library to dependencies instead of devDependencies. 2. add lint back in scripts block * fix typo (adding comma) in script section * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Merge develop into master (google#1064) * Adding new minimap demo * Basic code style changes. Adding a few more comments. Return early if disableScrollChange in onScrollChange listener. * Adding horizontal scrolling. Changed scroll change callbacks from onScroll_ to setHandlePosition. onScroll_ is not challed when workspace is dragged. * Registering mousemove and mouseup listener in mousedown event. Mousemove and Mouseup events are now listening over document. * Adding the remove variable modal and functionality to accessible Blockly. (google#1011) * Minimap position bug fix for browsers other than chrome. Added touch support. * Adding an add variable modal to accessible Blockly. (google#1015) * Adding the remove variable modal and functionality to accessible Blockly. * Adding the add variable modal for accessible Blockly. * Block browser context menu in the toolbox and flyout * Add links to the dev registration form and contributor guidelines * Miscellaneous comment cleanup * Adding the common modal class. (google#1017) Centralizes accessible modal behavior. * - Changed error message referencing 'procedure' instead of 'function' (google#1019) - Added iOS specific UI messages - Fixed bug with js_to_json.py script where it didn't recognize ' character * - Allows use of Blockly's messaging format for category name, colour,… (google#1028) ...in toolbox XML. - Updated code editor demo to use this message format - Re-built blockly_compressed.js * Making text_count use a text color (like text_length, which also returns a number). (google#1027) * Enable google/blockly with continuous build on travis ci (google#1023) (google#1035) * create .travis for ci job * initial checkin for blocky-web travis ci job * rename file to .travis.yaml for typo * remove after_script * added cache * rename .travis.yaml to .travis.yml * Update .travis.yml * include build script * fix yaml file format issue * debug install part * debug build issue * Update .travis.yml * remove cache for now * Update .travis.yml * Update .travis.yml * Update .travis.yml * more debug info * Update .travis.yml * Update .travis.yml * fix typo * installing chrome browser * remove chrome setting config * run build.py as part of npm install * Update .travis.yml * update karma dependency * use karma as test runner * fix typo * remove karma test for now * Update .travis.yml * Update package.json * add npm test target * add browserstack-runner depdendency * update browser support * fix typo for test target * fix chrome typo * added closure dependency * add google-closure-library * include blockly_uncompressed.js and core.js dependency * uncomment out core/*.js files * add kama job as part of install * remove browserstack add on for now * fix karma config typo * add karma-closure * add os support * remove typo config * include more closure files * change os back to linux * use closure-library from node_modules * change log level back to INFO * change npm test target to use open browser command instead of karma * change travis test target to use open command instead of karma * list current directory * find what's in current dir * typo command * Update .travis.yml * typo again * open right index.html * use right path for index.html * xdg-open to open default browser on travis * exit browser after 5s wait * change timeout to 1 min * exit after opening up browser * use browser only * use karma * remove un-needed dependency * clean up script section * fix typo * update build status on readme * initial commit for selenium integration tests * update selenium jar path * fix test_runner.js typo * add more debug info * check java version * add && instead of 9288 * fix java path * add logic to check if selenium is running or not * add some deugging info * initial commit to get chromedriver * add chromedriver flag * add get_chromedriver.sh to package.json and .travel * change browser to chrome for now * fix path issue * update chromdriver path * fix path issue again * more debugging * add debug msg * fix typo * minor fix for getting chromedriver * install latest chrome browser * clean up pakcage.json * use npm target for test run * remove removing trailing comma * fix another trailing comma * updated travis test target * clean up scripts * not sure nmp run preinstall * redirect selenium log to tmp file * revert writing console log to file * update test summary * more clean up * minor clean up before pull request * resolved closure-library conflict 1. add closure-library to dependencies instead of devDependencies. 2. add lint back in scripts block * fix typo (adding comma) in script section * Renames Blockly.workspaceDragSurface to Blockly.WorkspaceDragSurface. Fixes google#880. * Ensure useDragSurface is a boolean. Fixed google#988 * use pretest instead of preinstall in package.json (google#1043) * cherry pick for pretest fix * put pretest target to test_setup.sh * fix conflict * cherry pick for get_chromedriver.sh * add some sleep to wait download to finish * use node.js stable * use npm test target * field_angle renders degree symbol consistently. Fixes google#973 * bumpNeighbours_ function moved to block_svg. Fixed google#1009 * Update RegEx in js-to-json to match windowi eol (google#1050) The current regex only works with the "\n" line endings as it expects no characters after the optional ";" at the end of the line. In windows, if it adds the "\r" it counts as a characters and is not part of the line terminator so it doesn't match. * Fix French translation of "colour with rgb" block (google#1053) "colorier", which is currently used, is a verb and proposed "couleur" is a noun: the block in question does not change colour of anything, it creates new colour instead, thus noun is more applicable. Also, noun is used in French translation of "random colour" block: "couleur aléatoire". * Enforcing non-empty names on value inputs and statement inputs. (google#1054) * Correcting google#1054 (google#1056) single quotes. better logic. * Created a variable model with name, id, and type. Created a jsunit test file for variable model. * Change how blockly handles cursors. The old way was quite slow becau… (google#1057) * Change how blockly handles cursors. The old way was quite slow because it changed the stylesheet directly. See issue google#981 for more details on implementation and tradeoffs. This changes makes the following high level changes: deprecate Blockly.Css.setCursor, use built in open and closed hand cursor instead of custom .cur files, add css to draggable objects to set the open and closed hand cursors. * Rebuild blockly_uncompressed to pick up a testing change to make travis happy. Fix a build warning from a multi-line string in the process. (google#1059) * Merge master into develop (google#1063) - pick up translation changes - clean up trailing spaces * Rebuild for translations * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Cherrypick a fix for google#1069 and rebuild (google#1075) * Fix google#1069 (google#1073) * rebuild * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Develop to master (google#1209) * Adding new minimap demo * Basic code style changes. Adding a few more comments. Return early if disableScrollChange in onScrollChange listener. * Adding horizontal scrolling. Changed scroll change callbacks from onScroll_ to setHandlePosition. onScroll_ is not challed when workspace is dragged. * Registering mousemove and mouseup listener in mousedown event. Mousemove and Mouseup events are now listening over document. * Adding the remove variable modal and functionality to accessible Blockly. (google#1011) * Minimap position bug fix for browsers other than chrome. Added touch support. * Adding an add variable modal to accessible Blockly. (google#1015) * Adding the remove variable modal and functionality to accessible Blockly. * Adding the add variable modal for accessible Blockly. * Block browser context menu in the toolbox and flyout * Add links to the dev registration form and contributor guidelines * Miscellaneous comment cleanup * Adding the common modal class. (google#1017) Centralizes accessible modal behavior. * - Changed error message referencing 'procedure' instead of 'function' (google#1019) - Added iOS specific UI messages - Fixed bug with js_to_json.py script where it didn't recognize ' character * - Allows use of Blockly's messaging format for category name, colour,… (google#1028) ...in toolbox XML. - Updated code editor demo to use this message format - Re-built blockly_compressed.js * Making text_count use a text color (like text_length, which also returns a number). (google#1027) * Enable google/blockly with continuous build on travis ci (google#1023) (google#1035) * create .travis for ci job * initial checkin for blocky-web travis ci job * rename file to .travis.yaml for typo * remove after_script * added cache * rename .travis.yaml to .travis.yml * Update .travis.yml * include build script * fix yaml file format issue * debug install part * debug build issue * Update .travis.yml * remove cache for now * Update .travis.yml * Update .travis.yml * Update .travis.yml * more debug info * Update .travis.yml * Update .travis.yml * fix typo * installing chrome browser * remove chrome setting config * run build.py as part of npm install * Update .travis.yml * update karma dependency * use karma as test runner * fix typo * remove karma test for now * Update .travis.yml * Update package.json * add npm test target * add browserstack-runner depdendency * update browser support * fix typo for test target * fix chrome typo * added closure dependency * add google-closure-library * include blockly_uncompressed.js and core.js dependency * uncomment out core/*.js files * add kama job as part of install * remove browserstack add on for now * fix karma config typo * add karma-closure * add os support * remove typo config * include more closure files * change os back to linux * use closure-library from node_modules * change log level back to INFO * change npm test target to use open browser command instead of karma * change travis test target to use open command instead of karma * list current directory * find what's in current dir * typo command * Update .travis.yml * typo again * open right index.html * use right path for index.html * xdg-open to open default browser on travis * exit browser after 5s wait * change timeout to 1 min * exit after opening up browser * use browser only * use karma * remove un-needed dependency * clean up script section * fix typo * update build status on readme * initial commit for selenium integration tests * update selenium jar path * fix test_runner.js typo * add more debug info * check java version * add && instead of 9288 * fix java path * add logic to check if selenium is running or not * add some deugging info * initial commit to get chromedriver * add chromedriver flag * add get_chromedriver.sh to package.json and .travel * change browser to chrome for now * fix path issue * update chromdriver path * fix path issue again * more debugging * add debug msg * fix typo * minor fix for getting chromedriver * install latest chrome browser * clean up pakcage.json * use npm target for test run * remove removing trailing comma * fix another trailing comma * updated travis test target * clean up scripts * not sure nmp run preinstall * redirect selenium log to tmp file * revert writing console log to file * update test summary * more clean up * minor clean up before pull request * resolved closure-library conflict 1. add closure-library to dependencies instead of devDependencies. 2. add lint back in scripts block * fix typo (adding comma) in script section * Renames Blockly.workspaceDragSurface to Blockly.WorkspaceDragSurface. Fixes google#880. * Ensure useDragSurface is a boolean. Fixed google#988 * use pretest instead of preinstall in package.json (google#1043) * cherry pick for pretest fix * put pretest target to test_setup.sh * fix conflict * cherry pick for get_chromedriver.sh * add some sleep to wait download to finish * use node.js stable * use npm test target * field_angle renders degree symbol consistently. Fixes google#973 * bumpNeighbours_ function moved to block_svg. Fixed google#1009 * Update RegEx in js-to-json to match windowi eol (google#1050) The current regex only works with the "\n" line endings as it expects no characters after the optional ";" at the end of the line. In windows, if it adds the "\r" it counts as a characters and is not part of the line terminator so it doesn't match. * Fix French translation of "colour with rgb" block (google#1053) "colorier", which is currently used, is a verb and proposed "couleur" is a noun: the block in question does not change colour of anything, it creates new colour instead, thus noun is more applicable. Also, noun is used in French translation of "random colour" block: "couleur aléatoire". * Enforcing non-empty names on value inputs and statement inputs. (google#1054) * Correcting google#1054 (google#1056) single quotes. better logic. * Created a variable model with name, id, and type. Created a jsunit test file for variable model. * Change how blockly handles cursors. The old way was quite slow becau… (google#1057) * Change how blockly handles cursors. The old way was quite slow because it changed the stylesheet directly. See issue google#981 for more details on implementation and tradeoffs. This changes makes the following high level changes: deprecate Blockly.Css.setCursor, use built in open and closed hand cursor instead of custom .cur files, add css to draggable objects to set the open and closed hand cursors. * Rebuild blockly_uncompressed to pick up a testing change to make travis happy. Fix a build warning from a multi-line string in the process. (google#1059) * Merge master into develop (google#1063) - pick up translation changes - clean up trailing spaces * use goog.string.startswith instead of string.startswith (google#1065) * New jsinterpreter demo includes wait block. Both demos have improved UI for clarity. (google#1001) Refactor of interpreter demo * Renamed demos/interpreter/index.html as demos/interpreter/step-execution.html (including redirect), and added demos/interpreter/async-execution.html. * Refactored code to automatically generate/parse the blocks, eliminating the need for a "Parse JavaScript" button. Code is still shown in alert upon stepping to the first statement. Print statements now write to output <textarea> instead of modal dialogs. * VariableMap and functions added. * Create separate file for VariableMap and its functions. * Fix google#1069 (google#1073) * VariableMap and functions added. * Fix google#1051 (google#1084) * Improve errors when validating JSON block definitions. (google#1086) goog.asserts to not run from blockly_compressed.js. User data validation should always run. * Dragging changes, rebased on develop (google#1078) * Add block drag surface translateSurfaceBy * Add dragged connection manager * Add gesture.js * Add GestureHandler * Implemented gesture skeleton * Most basic workspace dragging * Add dragged connection manager * cleanup * doc * more cleanup * Add gesture handler * Add translateSurfaceInternal * core/block_dragger.js * cleanup * Pull in changes to dragged connection manager * Pull in changes to dragged connection manager * comments * more annotations * Add workspace dragger * Add coordinate annotations * Start on block dragging * Limit number of concurrent gestures * Add some TODOs * start using dragged connection manager * Set origin correctly for dragging blocks * Connect or delete at the end of a block drag. * cleanup * handle field clicks and block + workspace right-clicks * move code into BlockDragger class, but still reach into Gesture internals a lot * Clean up block dragger * Call blockDragger constructor with correct arguments * Enable block dragging in a mutator workspace * Add workspace dragger * click todos * Drag flyout with background * more dragging from flyout * nit * fix dragging from flyouts * Remove unused code and rename gestureHandler to gestureDB * Rename gesture handler * Added some jsdoc in gesture.js * Update some docs * Move some code to block_svg and clean up code * Lots of coordinate annotations * Fix block dragging when zoomed. * Remove built files from branch * More dragging work (google#1026) -- Drag bubbles while dragging blocks -- Use bindEventWithChecks to work in touch on Android. Not tested anywhere else yet. -- Handle dragging blocks while zoomed -- Handle dragging blocks in mutators -- Handle right-clicks (I hope) -- Removed lots of unused code * More dragging work (google#1048) - Removed gestureDB - Removing uses of terminateDrag - Cleaned up disposal code * Dragging bugfixes (google#1058) - Get rid of flyout.dragMode_ and blockly.dragMode_ - Make drags from the flyout start from the top block in the group - Block tooltips from being scheduled or shown during gestures - Don't resize mutator bubbles mid-drag * Fix events in new dragging (google#1060) * rebuild for testing * unbuild * Fix events * rebuild * Fix up cursors * Use language files from develop * Remove handled TODOS * attempt to fix IE rerendering bug, and recalculate workspace positions on scroll * Rebuild all the things * Comment cleanup; annotations; delete unused variables. * Tidy up context menu code. (google#1081) * add osx travis test run job (google#1074) * Names are correctly fetched from VariableModels! * add more wait time for test setup (google#1091) * Work around timing issue with travis osx issue (google#1092) * add more wait time for test setup * increase selenium wait time * add more wait * Fix google#1077 by adding a rule to cover the toolbox labels too. (google#1099) * Assign variable UUID to field_variable dropdown. * Change registration link to a static one (google#1106) This lets us redirect to a different form if we change it in the future. * Edit generators to read in Variable Models. * Add VariableMap requirement to workspace. * Changed parameter name in workspace for clarity. * Add type, id, and info to the generated xml. Add xml tests for fieldToDom. Update workspace tests to pass with new changes. * Fix apostrophe in tooltips and helpurls (google#1111) * Click events on shadow blocks have the correct id (google#1089) * Add image_onclick option (google#1080) * Cleanup: semicolons, spacing, etc. (google#1116) * Spelling. Spelling is hard. * Add variable info to xml generated in variables.js * Add missing CLAs info to the contributing file (google#1119) * Add missing CLAs info to the contributing file * Added larger changes paragraph * Replacing latest prettifier hosted in repo with latest version at rawgit CDN. (google#1120) * Forgot update code demo (google#1121) * Move audio code to a new file (google#1122) * move audio code to a new file * dispose * null check * Make flyout get variables from target workspace's variableMap. * Require VariableModel in field_variable.js. * Update contributing.md (google#1126) * Include variables at top of serialization. * Move blockSvg.getHeightWidth to block_render_svg.js (google#1118) * Deserialization variables at top. * Create grid object (google#1131) * Create grid object * Doc * Units! Thanks @RoboErikG * Appease eslint: semicolons and such. * Deserialization variables at top. * Setting up accessible Blockly for Closure compilation. (google#1134) Moving closure compilation into the build file. Fixing up goog.requires for accessible blockly. Adding accessible to the build script. * Fix google#1109 * Adding command-line options to the buildscript. (google#1136) * Fix for travis-ci testing failure (google#1141) It looks like the default configuration for Travis might have changed. Adding a manual step to install webdriverio. * Convert text_join block to JSON + mutator format (google#1140) * Clean up and create test utilities file. * Add BLOCK events and constructor tests. * Convert more text blocks to json (google#1147) * Convert more text blocks to json Converts the mutator blocks for text_join and the text_append block to JSON format. * Fixing modals so they're announced on focus, and changing variables t… (google#1030) * Fixing modals so they're announced on focus, and changing variables to only react to enter, not onChange. * Adding a temp index. * Whoops - added it in the wrong spot. * Adding automatically-generated variable lists to the accessible toolbox. (google#1149) Fixing a bug with the core-only uncompressed file not finding its own directory. * Field Variable setValue() looks up variable. * Wrap Error in Try Finally Block. * Changing the build file to allow forced rebuilding of the msg files. (google#1158) * Split flyout into flyout_base, flyout_horizontal, and flyou_vertical * Rename flyout to flyout_base * flyout_base minus horizontal and vertical code * Add flyout_vertical and flyout_horizontal * review fixes + toolbox and workspace use * Fix hat block case * rebuild uncompressed * Fix travis problem * Fix build problem * Add VAR events. * Correctly named block events called. * Fire VAR events and test. * Create utility function for checking variable values. * In DropdownCreate check for Msg.DELETE_VARIABLE. * Test Delete Variable Twice. * Convert more text blocks to JSON format (google#1163) * Convert more text blocks to JSON format Converts text_charAt, text_indexOf, text_isEmpty, and text_length to JSON. Includes a rebuild to pick up message changes. * Fixing the accessible variable stuff so it interacts correctly with (google#1170) variableMap. * createVariable in workspaceSvg takes in id and type. * Followup RefreshToolbox. * Fixing an error with block messages and ordering. (google#1171) * Remove out of date todo comments. * Fix checkbox delete bug. * Fixing variable dropdowns so they select the correct option. (google#1184) * Always open flyout fields are editable. * Fixing the tree service so it doesn't treat unknown block deletion (google#1182) as an error, and turning off keypresses on the workspace when the variable modals are open. * Revamping mostly gesture tests. * Merge master to develop (google#1189) * Merge master into develop (google#1063) - pick up translation changes - clean up trailing spaces * Rebuild for translations * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Cherrypick a fix for google#1069 and rebuild (google#1075) * Fix google#1069 (google#1073) * rebuild * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Rebuild compressed files * Add some translatewiki annotations back into msg/messages.js * Rebuild msg files * Fix flyout dropdown bug. * Fix python and php procedures. * Dropdown Create does not create a missing variable twice. * Fire field variable change event with variable value, not name. * Fix google#1160 (google#1197) Fix "Connection UI Effect not playing on block connect" * Only add a block in the flyout if it is not disabled (google#1204) * Only add a block in the flyout if it is not disabled * PR feedback * remove previous fix * Fix issue with compression stripping dropdown options (google#1207) * Get some accessible files back from develop * rebuild * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Rebuild all the things * Fix Blockly.Procedures.isNameUsed return values. Add tests for Procedures.isNameUsed() so this bug never happens again. * rebuild * rebuild
1 parent c8ef454 commit 2df0b15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+31439
-30171
lines changed

blockly_accessible_compressed.js

Lines changed: 325 additions & 215 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blockly_accessible_uncompressed.js

Lines changed: 1532 additions & 1532 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blockly_compressed.js

Lines changed: 430 additions & 321 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blockly_uncompressed.js

Lines changed: 1501 additions & 1501 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blocks_compressed.js

Lines changed: 63 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.py

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def run(self):
145145
base_path = calcdeps.FindClosureBasePath(self.search_paths)
146146
for dep in calcdeps.BuildDependenciesFromFiles(self.search_paths):
147147
add_dependency.append(calcdeps.GetDepsLine(dep, base_path))
148+
add_dependency.sort() # Deterministic build.
148149
add_dependency = '\n'.join(add_dependency)
149150
# Find the Blockly directory name and replace it with a JS variable.
150151
# This allows blockly_uncompressed.js to be compiled on one computer and be
@@ -158,7 +159,7 @@ def run(self):
158159
for dep in calcdeps.BuildDependenciesFromFiles(self.search_paths):
159160
if not dep.filename.startswith(os.pardir + os.sep): # '../'
160161
provides.extend(dep.provides)
161-
provides.sort()
162+
provides.sort() # Deterministic build.
162163
f.write('\n')
163164
f.write('// Load Blockly.\n')
164165
for provide in provides:
@@ -229,6 +230,35 @@ def gen_core(self):
229230
# Read in all the source files.
230231
filenames = calcdeps.CalculateDependencies(self.search_paths,
231232
[os.path.join("core", "blockly.js")])
233+
filenames.sort() # Deterministic build.
234+
for filename in filenames:
235+
# Filter out the Closure files (the compiler will add them).
236+
if filename.startswith(os.pardir + os.sep): # '../'
237+
continue
238+
f = open(filename)
239+
params.append(("js_code", "".join(f.readlines())))
240+
f.close()
241+
242+
self.do_compile(params, target_filename, filenames, "")
243+
244+
def gen_accessible(self):
245+
target_filename = "blockly_accessible_compressed.js"
246+
# Define the parameters for the POST request.
247+
params = [
248+
("compilation_level", "SIMPLE_OPTIMIZATIONS"),
249+
("use_closure_library", "true"),
250+
("language_out", "ES5"),
251+
("output_format", "json"),
252+
("output_info", "compiled_code"),
253+
("output_info", "warnings"),
254+
("output_info", "errors"),
255+
("output_info", "statistics"),
256+
]
257+
258+
# Read in all the source files.
259+
filenames = calcdeps.CalculateDependencies(self.search_paths,
260+
[os.path.join("accessible", "app.component.js")])
261+
filenames.sort() # Deterministic build.
232262
for filename in filenames:
233263
# Filter out the Closure files (the compiler will add them).
234264
if filename.startswith(os.pardir + os.sep): # '../'
@@ -282,6 +312,7 @@ def gen_blocks(self):
282312
# Add Blockly.Blocks to be compatible with the compiler.
283313
params.append(("js_code", "goog.provide('Blockly.Blocks');"))
284314
filenames = glob.glob(os.path.join("blocks", "*.js"))
315+
filenames.sort() # Deterministic build.
285316
for filename in filenames:
286317
f = open(filename)
287318
params.append(("js_code", "".join(f.readlines())))
@@ -308,6 +339,7 @@ def gen_generator(self, language):
308339
params.append(("js_code", "goog.provide('Blockly.Generator');"))
309340
filenames = glob.glob(
310341
os.path.join("generators", language, "*.js"))
342+
filenames.sort() # Deterministic build.
311343
filenames.insert(0, os.path.join("generators", language + ".js"))
312344
for filename in filenames:
313345
f = open(filename)
@@ -372,31 +404,6 @@ def file_lookup(name):
372404

373405
code = HEADER + "\n" + json_data["compiledCode"]
374406
code = code.replace(remove, "")
375-
376-
# Trim down Google's Apache licences.
377-
# The Closure Compiler used to preserve these until August 2015.
378-
# Delete this in a few months if the licences don't return.
379-
LICENSE = re.compile("""/\\*
380-
381-
[\w ]+
382-
383-
(Copyright \\d+ Google Inc.)
384-
https://developers.google.com/blockly/
385-
386-
Licensed under the Apache License, Version 2.0 \(the "License"\);
387-
you may not use this file except in compliance with the License.
388-
You may obtain a copy of the License at
389-
390-
http://www.apache.org/licenses/LICENSE-2.0
391-
392-
Unless required by applicable law or agreed to in writing, software
393-
distributed under the License is distributed on an "AS IS" BASIS,
394-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
395-
See the License for the specific language governing permissions and
396-
limitations under the License.
397-
\\*/""")
398-
code = re.sub(LICENSE, r"\n// \1 Apache License 2.0", code)
399-
400407
stats = json_data["statistics"]
401408
original_b = stats["originalSize"]
402409
compressed_b = stats["compressedSize"]
@@ -519,8 +526,10 @@ def run(self):
519526

520527
core_search_paths = calcdeps.ExpandDirectories(
521528
["core", os.path.join(os.path.pardir, "closure-library")])
529+
core_search_paths.sort() # Deterministic build.
522530
full_search_paths = calcdeps.ExpandDirectories(
523531
["accessible", "core", os.path.join(os.path.pardir, "closure-library")])
532+
full_search_paths.sort() # Deterministic build.
524533

525534
if (len(sys.argv) == 1):
526535
args = ['core', 'accessible', 'generators', 'defaultlangfiles']

core/block.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,8 @@ Blockly.Block.newFieldTextInputFromJson_ = function(options) {
12451245
*/
12461246
Blockly.Block.newFieldVariableFromJson_ = function(options) {
12471247
var varname = Blockly.utils.replaceMessageReferences(options['variable']);
1248-
return new Blockly.FieldVariable(varname);
1248+
var variableTypes = options['variableTypes'];
1249+
return new Blockly.FieldVariable(varname, null, variableTypes);
12491250
};
12501251

12511252

core/block_svg.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ Blockly.BlockSvg.prototype.showContextMenu_ = function(e) {
690690
menuOptions.push(helpOption);
691691

692692
// Allow the block to add or modify menuOptions.
693-
if (this.customContextMenu && !block.isInFlyout) {
693+
if (this.customContextMenu) {
694694
this.customContextMenu(menuOptions);
695695
}
696696

@@ -901,10 +901,8 @@ Blockly.BlockSvg.disposeUiStep_ = function(clone, rtl, start, workspaceScale) {
901901
var scale = (1 - percent) * workspaceScale;
902902
clone.setAttribute('transform', 'translate(' + x + ',' + y + ')' +
903903
' scale(' + scale + ')');
904-
var closure = function() {
905-
Blockly.BlockSvg.disposeUiStep_(clone, rtl, start, workspaceScale);
906-
};
907-
setTimeout(closure, 10);
904+
setTimeout(Blockly.BlockSvg.disposeUiStep_, 10, clone, rtl, start,
905+
workspaceScale);
908906
}
909907
};
910908

@@ -949,10 +947,8 @@ Blockly.BlockSvg.connectionUiStep_ = function(ripple, start, workspaceScale) {
949947
} else {
950948
ripple.setAttribute('r', percent * 25 * workspaceScale);
951949
ripple.style.opacity = 1 - percent;
952-
var closure = function() {
953-
Blockly.BlockSvg.connectionUiStep_(ripple, start, workspaceScale);
954-
};
955-
Blockly.BlockSvg.disconnectUiStop_.pid_ = setTimeout(closure, 10);
950+
Blockly.BlockSvg.disconnectUiStop_.pid_ = setTimeout(
951+
Blockly.BlockSvg.connectionUiStep_, 10, ripple, start, workspaceScale);
956952
}
957953
};
958954

@@ -996,11 +992,10 @@ Blockly.BlockSvg.disconnectUiStep_ = function(group, magnitude, start) {
996992
var skew = Math.round(Math.sin(percent * Math.PI * WIGGLES) *
997993
(1 - percent) * magnitude);
998994
group.skew_ = 'skewX(' + skew + ')';
999-
var closure = function() {
1000-
Blockly.BlockSvg.disconnectUiStep_(group, magnitude, start);
1001-
};
1002995
Blockly.BlockSvg.disconnectUiStop_.group = group;
1003-
Blockly.BlockSvg.disconnectUiStop_.pid = setTimeout(closure, 10);
996+
Blockly.BlockSvg.disconnectUiStop_.pid =
997+
setTimeout(Blockly.BlockSvg.disconnectUiStep_, 10, group, magnitude,
998+
start);
1004999
}
10051000
group.setAttribute('transform', group.translate_ + group.skew_);
10061001
};

core/extensions.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Blockly.Extensions.MUTATOR_PROPERTIES_ =
5555
* handlers and mutators. These are applied using Block.applyExtension(), or
5656
* the JSON "extensions" array attribute.
5757
* @param {string} name The name of this extension.
58-
* @param {function} initFn The function to initialize an extended block.
58+
* @param {Function} initFn The function to initialize an extended block.
5959
* @throws {Error} if the extension name is empty, the extension is already
6060
* registered, or extensionFn is not a function.
6161
*/
@@ -92,7 +92,7 @@ Blockly.Extensions.registerMixin = function(name, mixinObj) {
9292
* decompose are defined on the mixin.
9393
* @param {string} name The name of this mutator extension.
9494
* @param {!Object} mixinObj The values to mix in.
95-
* @param {function()=} opt_helperFn An optional function to apply after mixing
95+
* @param {(function())=} opt_helperFn An optional function to apply after mixing
9696
* in the object.
9797
* @param {Array.<string>=} opt_blockList A list of blocks to appear in the
9898
* flyout of the mutator dialog.
@@ -103,8 +103,10 @@ Blockly.Extensions.registerMutator = function(name, mixinObj, opt_helperFn,
103103
var errorPrefix = 'Error when registering mutator "' + name + '": ';
104104

105105
// Sanity check the mixin object before registering it.
106-
Blockly.Extensions.checkHasFunction_(errorPrefix, mixinObj, 'domToMutation');
107-
Blockly.Extensions.checkHasFunction_(errorPrefix, mixinObj, 'mutationToDom');
106+
Blockly.Extensions.checkHasFunction_(errorPrefix, mixinObj.domToMutation,
107+
'domToMutation');
108+
Blockly.Extensions.checkHasFunction_(errorPrefix, mixinObj.mutationToDom,
109+
'mutationToDom');
108110

109111
var hasMutatorDialog = Blockly.Extensions.checkMutatorDialog_(mixinObj,
110112
errorPrefix);
@@ -162,20 +164,19 @@ Blockly.Extensions.apply = function(name, block, isMutator) {
162164
};
163165

164166
/**
165-
* Check that the given object has a property with the given name, and that the
166-
* property is a function.
167+
* Check that the given value is a function.
167168
* @param {string} errorPrefix The string to prepend to any error message.
168-
* @param {!Object} object The object to check.
169+
* @param {*} func Function to check.
169170
* @param {string} propertyName Which property to check.
170171
* @throws {Error} if the property does not exist or is not a function.
171172
* @private
172173
*/
173-
Blockly.Extensions.checkHasFunction_ = function(errorPrefix, object,
174+
Blockly.Extensions.checkHasFunction_ = function(errorPrefix, func,
174175
propertyName) {
175-
if (!object.hasOwnProperty(propertyName)) {
176+
if (!func) {
176177
throw new Error(errorPrefix +
177178
'missing required property "' + propertyName + '"');
178-
} else if (typeof object[propertyName] !== "function") {
179+
} else if (typeof func != 'function') {
179180
throw new Error(errorPrefix +
180181
'" required property "' + propertyName + '" must be a function');
181182
}
@@ -442,5 +443,3 @@ Blockly.Extensions.extensionParentTooltip_ = function() {
442443
};
443444
Blockly.Extensions.register('parent_tooltip_when_inline',
444445
Blockly.Extensions.extensionParentTooltip_);
445-
446-

core/field_image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ goog.require('goog.userAgent');
3838
* @param {number} width Width of the image.
3939
* @param {number} height Height of the image.
4040
* @param {string=} opt_alt Optional alt text for when block is collapsed.
41-
* @param {function=} opt_onClick Optional function to be called when image is clicked
41+
* @param {Function=} opt_onClick Optional function to be called when image is clicked
4242
* @extends {Blockly.Field}
4343
* @constructor
4444
*/

0 commit comments

Comments
 (0)