Commit 0dd88a65 authored by carlosperate's avatar carlosperate

Remove relative blockly path from ardublockly_blockly.js, now a func argument.

parent 92d4574e
...@@ -27,8 +27,8 @@ Ardublockly.init = function() { ...@@ -27,8 +27,8 @@ Ardublockly.init = function() {
Ardublockly.initLanguage(); Ardublockly.initLanguage();
// Inject Blockly into content_blocks // Inject Blockly into content_blocks
Ardublockly.injectBlockly( Ardublockly.injectBlockly(document.getElementById('content_blocks'),
document.getElementById('content_blocks'), 'ardublockly_toolbox.xml'); 'ardublockly_toolbox.xml', '../blockly/');
Ardublockly.designJsInit(); Ardublockly.designJsInit();
Ardublockly.initialiseIdeButtons(); Ardublockly.initialiseIdeButtons();
......
...@@ -27,8 +27,14 @@ Ardublockly.BLOCKLY_INJECTED_ = false; ...@@ -27,8 +27,14 @@ Ardublockly.BLOCKLY_INJECTED_ = false;
* file. * file.
* @param {!Element} blocklyEl Element to inject Blockly into. * @param {!Element} blocklyEl Element to inject Blockly into.
* @param {!string} toolboxPath String containing the toolbox XML file path. * @param {!string} toolboxPath String containing the toolbox XML file path.
* @param {!string} blocklyPath String containing the Blockly directory path.
*/ */
Ardublockly.injectBlockly = function(blocklyEl, toolboxPath) { Ardublockly.injectBlockly = function(blocklyEl, toolboxPath, blocklyPath) {
// Remove any trailing slashes in the blockly path
if (blocklyPath.substr(-1) === '/') {
blocklyPath = blocklyPath.slice(0, -1);
}
// Create a an XML HTTP request // Create a an XML HTTP request
var request = Ardublockly.ajaxRequest(); var request = Ardublockly.ajaxRequest();
...@@ -48,7 +54,7 @@ Ardublockly.injectBlockly = function(blocklyEl, toolboxPath) { ...@@ -48,7 +54,7 @@ Ardublockly.injectBlockly = function(blocklyEl, toolboxPath) {
collapse: true, collapse: true,
comments: true, comments: true,
disable: true, disable: true,
media: '../blockly/media/', media: blocklyPath + '/media/',
rtl: false, rtl: false,
scrollbars: true, scrollbars: true,
toolbox: xmlTree, toolbox: xmlTree,
...@@ -286,7 +292,7 @@ Ardublockly.blocklyPaste = function() { ...@@ -286,7 +292,7 @@ Ardublockly.blocklyPaste = function() {
} }
}; };
/** Wraps the blockly 'paste' functionality. */ /** Wraps the blockly 'delete' functionality. */
Ardublockly.blocklyDelete = function() { Ardublockly.blocklyDelete = function() {
if (Blockly.selected && Blockly.selected.isDeletable()) { if (Blockly.selected && Blockly.selected.isDeletable()) {
Blockly.hideChaff(); Blockly.hideChaff();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment