From 3fe1daa733595089bbff1726d9bb3befbda2f404 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 12 May 2016 21:58:33 -0400 Subject: [PATCH 1/4] Fix glow to new getBlockById --- core/workspace_svg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index dd4af4a397..b90c629bfe 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -478,7 +478,7 @@ Blockly.WorkspaceSvg.prototype.highlightBlock = function(id) { Blockly.WorkspaceSvg.prototype.glowBlock = function(id, isGlowingBlock) { var block = null; if (id) { - block = Blockly.Block.getById(id); + block = this.getBlockById(id); if (!block) { throw 'Tried to glow block that does not exist.'; } @@ -494,7 +494,7 @@ Blockly.WorkspaceSvg.prototype.glowBlock = function(id, isGlowingBlock) { Blockly.WorkspaceSvg.prototype.glowStack = function(id, isGlowingStack) { var block = null; if (id) { - block = Blockly.Block.getById(id); + block = this.getBlockById(id); if (!block) { throw 'Tried to glow stack on block that does not exist.'; } From 2fc4ecd520c6b9c945689256908694582bc9b838 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 12 May 2016 22:00:34 -0400 Subject: [PATCH 2/4] Fix deprecated call to domToBlock in flyout --- core/flyout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/flyout.js b/core/flyout.js index 4971ddbefd..300d863eaf 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -1036,7 +1036,7 @@ Blockly.Flyout.prototype.placeNewBlock_ = function(originBlock, workspace) { // Create the new block by cloning the block in the flyout (via XML). var xml = Blockly.Xml.blockToDom(originBlock); - var block = Blockly.Xml.domToBlock(workspace, xml); + var block = Blockly.Xml.domToBlock(xml, workspace); var blockSvgNew = block.getSvgRoot(); if (!blockSvgNew) { throw 'block is not rendered.'; From e3b3390159698287aca1d8679cf05b1912ed1ac3 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 12 May 2016 22:05:20 -0400 Subject: [PATCH 3/4] Add check for iconmenu's parentBlock_ --- core/field_iconmenu.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/field_iconmenu.js b/core/field_iconmenu.js index f991a6236c..76d2e10987 100644 --- a/core/field_iconmenu.js +++ b/core/field_iconmenu.js @@ -121,7 +121,10 @@ Blockly.FieldIconMenu.prototype.setValue = function(newValue) { * @private */ Blockly.FieldIconMenu.prototype.setParentFieldImage = function(src) { - if (this.sourceBlock_) { + // Only attempt if we have a set sourceBlock_ and parentBlock_ + // It's possible that this function could be called before + // a parent block is set; in that case, fail silently. + if (this.sourceBlock_ && this.sourceBlock_.parentBlock_) { var parentBlock = this.sourceBlock_.parentBlock_; // Loop through all inputs' fields to find the first FieldImage for (var i = 0, input; input = parentBlock.inputList[i]; i++) { From 5fbc7f4acf42b20844770836f97f4ea99b0a0fbd Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 12 May 2016 22:09:01 -0400 Subject: [PATCH 4/4] Remove mirror demo --- demos/mirror/icon.png | Bin 2464 -> 0 bytes demos/mirror/index.html | 76 ---------------------------------------- 2 files changed, 76 deletions(-) delete mode 100644 demos/mirror/icon.png delete mode 100644 demos/mirror/index.html diff --git a/demos/mirror/icon.png b/demos/mirror/icon.png deleted file mode 100644 index 45e2a9a290cd7378b3c933f5e5e9e1dbf0df4a16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2464 zcmV;R319Y!P)SWDViciOhs!Nf*@2;7Uj*#qV5X2ymq<$<1Wi87#Ef} zYdD{o{eye%o_qFu&-tC-?|uP+Kp+qZ1OkCTAP@)y0)apv5C{YUfj}Ub>`1_rU>V5g zvi;36S?J{-8EFTP)n zv$r2-Z@(X1sZf4)A6AwK%QFv2cP@#h<4hGAl}vo})WCO$af4F znMa;KHe7kmS<0U_&LrGuBpaEY(W=vwWH!!=B7{NOYRlPYR*%>X-&!4mPCbaVrJg;N z$|4%@G&_Cj+q9Hekeru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GD3o33-?Ag zs1nj|Wm9Gp2}ydwv9a^1eUt@|?xxI~N~BJU%k9Q`(TUa8MMq0L>sROSaaG&61Q{~8 z)PQ&L0ZMoOfkz+wa=oRUZi;1Il9C%YmRAKN20&}aCG-&kSZ!Sl`kWer&htT7hXf&? z{k@DGHF~h0p~4b)Hrd_i@Z%rs%`9es>J&mWys(PU6A8_PSL=ufDNwBwt5n$soDALW4WVdZtWeV zGvcCi13p89!8Kt9S8hxPmTZO?HDTU_pez6=apVFu45V z8U|PC{N$L4$+BXnDF?7t6XLB%Tg_E8)*Qy!d3G#&&9g*8i8n@iKjCV{;Cj7q4|}}_ zsE@&Qwj0opz9fV1ER7)?AA_so7`sZWIDmN5Y*wX35$a=b4W-k=2AA@}(3EuxiN0e3 zufe6f=NP}ib=j^vP+j_~7e6Z9d!&vJ{#{cF1fC+aS?#65;PNwHv7Di3=g)I%>f1|; z4xb)ja6S9zw - - - - Blockly Demo: Mirrored Blockly - - - - - - -

Blockly > - Demos > Mirrored Blockly

- -

This is a simple demo of a master Blockly that controls a slave Blockly. - Open the JavaScript console to see the event passing.

- -

→ More info on events

- - - - - - -
-
-
-
-
- - - - - - -