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() {
Ardublockly.initLanguage();
// Inject Blockly into content_blocks
Ardublockly.injectBlockly(
document.getElementById('content_blocks'), 'ardublockly_toolbox.xml');
Ardublockly.injectBlockly(document.getElementById('content_blocks'),
'ardublockly_toolbox.xml', '../blockly/');
Ardublockly.designJsInit();
Ardublockly.initialiseIdeButtons();
......
......@@ -27,8 +27,14 @@ Ardublockly.BLOCKLY_INJECTED_ = false;
* file.
* @param {!Element} blocklyEl Element to inject Blockly into.
* @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
var request = Ardublockly.ajaxRequest();
......@@ -48,7 +54,7 @@ Ardublockly.injectBlockly = function(blocklyEl, toolboxPath) {
collapse: true,
comments: true,
disable: true,
media: '../blockly/media/',
media: blocklyPath + '/media/',
rtl: false,
scrollbars: true,
toolbox: xmlTree,
......@@ -286,7 +292,7 @@ Ardublockly.blocklyPaste = function() {
}
};
/** Wraps the blockly 'paste' functionality. */
/** Wraps the blockly 'delete' functionality. */
Ardublockly.blocklyDelete = function() {
if (Blockly.selected && Blockly.selected.isDeletable()) {
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