kopia lustrzana https://github.com/backface/turtlestitch
multi-line and monospaced "code" input slots for custom blocks
rodzic
1f82d77498
commit
39edea8f43
|
@ -12,6 +12,7 @@
|
|||
* new "object" reporter in the Sensing category for getting a sprite by its name
|
||||
* blocks for changing and querying the "flat line ends" setting
|
||||
* selectors for changing and querying "draggable" and "rotation style" settings
|
||||
* multi-line and monospaced "code" input slots for custom blocks
|
||||
* new "string" library, thanks, Brian
|
||||
* added "neg" selector to monadic function reporter in "Operators" category
|
||||
* enhances support for embedding Snap in other website, thanks, Bernat!
|
||||
|
@ -34,6 +35,9 @@
|
|||
* Greek, thanks, Alexandros!
|
||||
* German
|
||||
|
||||
### 2019-02-01
|
||||
* BYOB: new experimental feature: special multi-line and monospaced input slot types
|
||||
|
||||
### 2019-01-28
|
||||
* Threads, Objects: new "object" reporter in the Sensing category
|
||||
* Blocks, Objects, Threads: added "flat line ends" option to "turbo mode" accessor blocks
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<script type="text/javascript" src="src/gui.js?version=2019-01-28"></script>
|
||||
<script type="text/javascript" src="src/paint.js?version=2018-10-02"></script>
|
||||
<script type="text/javascript" src="src/lists.js?version=2019-01-10"></script>
|
||||
<script type="text/javascript" src="src/byob.js?version=2019-01-21"></script>
|
||||
<script type="text/javascript" src="src/byob.js?version=2019-02-01"></script>
|
||||
<script type="text/javascript" src="src/tables.js?version=2018-10-02"></script>
|
||||
<script type="text/javascript" src="src/symbols.js?version=2019-01-14"></script>
|
||||
<script type="text/javascript" src="src/sketch.js?version=2018-10-02"></script>
|
||||
|
|
29
src/byob.js
29
src/byob.js
|
@ -108,7 +108,7 @@ BooleanSlotMorph, XML_Serializer, SnapTranslator*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.byob = '2019-January-21';
|
||||
modules.byob = '2019-February-01';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -3619,7 +3619,10 @@ InputSlotDialogMorph.prototype.addSlotsMenu = function () {
|
|||
var myself = this;
|
||||
|
||||
this.slots.userMenu = function () {
|
||||
if (contains(['%s', '%n', '%txt', '%anyUE'], myself.fragment.type)) {
|
||||
if (contains(
|
||||
['%s', '%n', '%txt', '%anyUE', '%mlt', '%code'],
|
||||
myself.fragment.type)
|
||||
) {
|
||||
var menu = new MenuMorph(myself),
|
||||
on = '\u2611 ',
|
||||
off = '\u2610 ';
|
||||
|
@ -3631,9 +3634,11 @@ InputSlotDialogMorph.prototype.addSlotsMenu = function () {
|
|||
!myself.fragment.isReadOnly;
|
||||
}
|
||||
);
|
||||
menu.addLine();
|
||||
menu.addMenu('special', myself.specialSlotsMenu());
|
||||
return menu;
|
||||
}
|
||||
return Morph.prototype.userMenu.call(myself);
|
||||
return myself.specialSlotsMenu();
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -3657,6 +3662,24 @@ InputSlotDialogMorph.prototype.editSlotOptions = function () {
|
|||
);
|
||||
};
|
||||
|
||||
InputSlotDialogMorph.prototype.specialSlotsMenu = function () {
|
||||
var menu = new MenuMorph(this.setSlotType, null, this),
|
||||
myself = this,
|
||||
on = '\u2611 ',
|
||||
off = '\u2610 ';
|
||||
|
||||
function addSpecialSlotType(label, spec) {
|
||||
menu.addItem(
|
||||
(myself.fragment.type === spec ? on : off) + localize(label),
|
||||
spec
|
||||
);
|
||||
}
|
||||
|
||||
addSpecialSlotType('multi-line', '%mlt');
|
||||
addSpecialSlotType('code', '%code');
|
||||
return menu;
|
||||
};
|
||||
|
||||
// InputSlotDialogMorph hiding and showing:
|
||||
|
||||
/*
|
||||
|
|
Ładowanie…
Reference in New Issue