From 3ff69d47fe5525826c59f70c475a64fa715e5eed Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Wed, 29 Apr 2015 20:26:04 -0700 Subject: [PATCH] Inject can now take an ID. Also, fix unit tests. --- blockly_compressed.js | 4 ++-- core/inject.js | 8 ++++++-- demos/blockfactory/factory.js | 7 ++----- demos/code/code.js | 2 +- demos/fixed/index.html | 2 +- demos/generator/index.html | 2 +- demos/graph/index.html | 2 +- demos/interpreter/index.html | 2 +- demos/maxBlocks/index.html | 2 +- demos/plane/plane.js | 2 +- demos/rtl/index.html | 6 +++--- demos/storage/index.html | 2 +- demos/toolbox/index.html | 2 +- tests/generators/index.html | 26 ++++++++++++-------------- tests/jsunit/blockly_test.js | 22 +++++++++++----------- tests/jsunit/workspace_test.js | 8 ++++---- tests/playground.html | 16 ++++++++-------- 17 files changed, 57 insertions(+), 58 deletions(-) diff --git a/blockly_compressed.js b/blockly_compressed.js index 8c039df0e..d5dfcd985 100644 --- a/blockly_compressed.js +++ b/blockly_compressed.js @@ -1320,8 +1320,8 @@ Blockly.WidgetDiv={};Blockly.WidgetDiv.DIV=null;Blockly.WidgetDiv.owner_=null;Bl Blockly.WidgetDiv.hide=function(){Blockly.WidgetDiv.owner_&&(Blockly.WidgetDiv.DIV.style.display="none",Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_(),Blockly.WidgetDiv.owner_=null,Blockly.WidgetDiv.dispose_=null,goog.dom.removeChildren(Blockly.WidgetDiv.DIV))};Blockly.WidgetDiv.isVisible=function(){return!!Blockly.WidgetDiv.owner_};Blockly.WidgetDiv.hideIfOwner=function(a){Blockly.WidgetDiv.owner_==a&&Blockly.WidgetDiv.hide()}; Blockly.WidgetDiv.position=function(a,b,c,d,e){bc.width+d.x&&(a=c.width+d.x):a 1) { diff --git a/demos/code/code.js b/demos/code/code.js index d29ecdb33..2fed68b40 100644 --- a/demos/code/code.js +++ b/demos/code/code.js @@ -372,7 +372,7 @@ Code.init = function() { window.addEventListener('resize', onresize, false); var toolbox = document.getElementById('toolbox'); - Code.workspace = Blockly.inject(document.getElementById('content_blocks'), + Code.workspace = Blockly.inject('content_blocks', {grid: {spacing: 25, length: 3, diff --git a/demos/fixed/index.html b/demos/fixed/index.html index baa3a510d..d2fa53e70 100644 --- a/demos/fixed/index.html +++ b/demos/fixed/index.html @@ -38,7 +38,7 @@ diff --git a/demos/generator/index.html b/demos/generator/index.html index eadd4f6a3..f8e3dbec2 100644 --- a/demos/generator/index.html +++ b/demos/generator/index.html @@ -113,7 +113,7 @@ diff --git a/tests/generators/index.html b/tests/generators/index.html index c8e1e7417..8d135ab65 100644 --- a/tests/generators/index.html +++ b/tests/generators/index.html @@ -47,10 +47,11 @@ @@ -145,15 +146,12 @@ h1 { font-weight: normal; font-size: 140%; } -#svg { +#blocklyDiv { float: right; height: 95%; width: 69%; margin-top: 5px; } -.blocklySvg { - border: 1px solid #000; -} #importExport { height: 100%; width: 100%; @@ -162,7 +160,7 @@ h1 { -
+