kopia lustrzana https://github.com/backface/turtlestitch
support user-forced line-breaks in custom block labels
Creating a custom block label-fragment named “$br” forces a new line in all block instances. You can also select “line break” from the label-fragment’s context menu, same as selecting a symbol. This is really ugly, I know, I know. But I need it to play with the micro:bit and the calliope boards.upd4.1
rodzic
40150ddb78
commit
dad77eb25a
7
byob.js
7
byob.js
|
@ -107,7 +107,7 @@ SymbolMorph, isNil, CursorMorph, VariableFrame, WatcherMorph, Variable*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.byob = '2017-January-03';
|
||||
modules.byob = '2017-January-20';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -236,6 +236,8 @@ CustomBlockDefinition.prototype.blockSpec = function () {
|
|||
parts.forEach(function (part) {
|
||||
if (part[0] === '%' && part.length > 1) {
|
||||
spec = myself.typeOf(part.slice(1));
|
||||
} else if (part === '$br') {
|
||||
spec = '%br';
|
||||
} else {
|
||||
spec = part;
|
||||
}
|
||||
|
@ -2463,6 +2465,8 @@ BlockLabelFragmentMorph.prototype.userMenu = function () {
|
|||
name
|
||||
);
|
||||
});
|
||||
menu.addLine();
|
||||
menu.addItem('\u03A0 ' + localize('line break'), 'br');
|
||||
return menu;
|
||||
};
|
||||
|
||||
|
@ -2922,6 +2926,7 @@ InputSlotDialogMorph.prototype.symbolMenu = function () {
|
|||
'$' + symbol
|
||||
]);
|
||||
});
|
||||
symbols.push(['\u03A0 ' + localize('line break'), 'br']);
|
||||
return symbols;
|
||||
};
|
||||
|
||||
|
|
|
@ -3319,3 +3319,4 @@ Fixes:
|
|||
------
|
||||
* Blocks: improved inspectability of local variables
|
||||
* GUI: improved library browser, thanks, Michael!
|
||||
* BYOB: support user-forced line-breaks in custom block labels
|
||||
|
|
Ładowanie…
Reference in New Issue