You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MaryS94 edited this page Feb 29, 2016
·
1 revision
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 call Blockly.Accessibility.NewFile.method() and vice versa.