diff options
Diffstat (limited to 'blocks.js')
| -rw-r--r-- | blocks.js | 41 |
1 files changed, 38 insertions, 3 deletions
@@ -9,7 +9,7 @@ written by Jens Mönig jens@moenig.org - Copyright (C) 2013 by Jens Mönig + Copyright (C) 2014 by Jens Mönig This file is part of Snap!. @@ -155,7 +155,8 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2013-December-27'; +modules.blocks = '2014-February-04'; + var SyntaxElementMorph; var BlockMorph; @@ -1014,7 +1015,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) { 'attributesMenu', true ); - part.isStatic = true; break; case '%fun': part = new InputSlotMorph( @@ -1056,6 +1056,33 @@ SyntaxElementMorph.prototype.labelPart = function (spec) { ); part.setContents(['encode URI']); break; + case '%stopChoices': + part = new InputSlotMorph( + null, + false, + { + 'all' : ['all'], + 'this script' : ['this script'], + 'this block' : ['this block'] + }, + true + ); + part.setContents(['all']); + part.isStatic = true; + break; + case '%stopOthersChoices': + part = new InputSlotMorph( + null, + false, + { + 'all but this script' : ['all but this script'], + 'other scripts in sprite' : ['other scripts in sprite'] + }, + true + ); + part.setContents(['all but this script']); + part.isStatic = true; + break; case '%typ': part = new InputSlotMorph( null, @@ -3284,6 +3311,7 @@ CommandBlockMorph.prototype.snap = function () { CommandBlockMorph.prototype.isStop = function () { return ([ + 'doStopThis', 'doStop', 'doStopBlock', 'doStopAll', @@ -6319,6 +6347,8 @@ InputSlotMorph.prototype.dropDownMenu = function () { if (Object.prototype.hasOwnProperty.call(choices, key)) { if (key[0] === '~') { menu.addLine(); + // } else if (key.indexOf('§_def') === 0) { + // menu.addItem(choices[key].blockInstance(), choices[key]); } else { menu.addItem(key, choices[key]); } @@ -6535,6 +6565,11 @@ InputSlotMorph.prototype.attributesMenu = function () { dict[name] = name; }); } + /* + obj.customBlocks.forEach(function (def, i) { + dict['§_def' + i] = def + }); + */ return dict; }; |
