-
Notifications
You must be signed in to change notification settings - Fork 6
Creating a New File
Here is how to add a new file to ./blockly/accessibleBlockly through closure.
-
Create the file in the accessibleBlockly folder
./blockly/accessibleBlockly/newFile.js -
At the top of the file write:
goog.provide('Blockly.Accessibility.NewFile');
goog.require('Blockly.Accessibility'); -
Open ./blockly/blockly_uncompressed.js
-
Search for "accessible" or scroll to about line 178.
-
Add to the end of the list of dependencies for accessibleBlockly as follows:
goog.addDependency("../../../" + dir + "/accessibleblockly/newFile.js", ['Blockly.Accessibility.NewFile'], []); -
Scroll to line 228 and add to the list of requires:
goog.require('Blockly.Accessibility.NewFile'); -
You're done! Now if you want to call functions from your file in any other file simply put
goog.require('Blockly.Accessibility.NewFile');at the top of that file and callBlockly.Accessibility.NewFile.method()and vice versa.