kopia lustrzana https://github.com/backface/turtlestitch
add API procedure, Michael review
rodzic
954b2f828f
commit
e4f8751fce
|
@ -7558,12 +7558,11 @@ InputSlotMorph.prototype.dropDownMenu = function (enableKeyboard) {
|
||||||
menu.addLine();
|
menu.addLine();
|
||||||
// } else if (key.indexOf('§_def') === 0) {
|
// } else if (key.indexOf('§_def') === 0) {
|
||||||
// menu.addItem(choices[key].blockInstance(), choices[key]);
|
// menu.addItem(choices[key].blockInstance(), choices[key]);
|
||||||
} else if (key.charAt(key.length - 1) == '{') {
|
} else if (key[key.length - 1] == '{') {
|
||||||
// Submenu
|
// Submenu
|
||||||
// 0x25ba = Unicode "BLACK RIGHT-POINTING POINTER"
|
// 0x25ba = Unicode "BLACK RIGHT-POINTING POINTER"
|
||||||
// (not to be confused with "black right-pointing TRIANGLE")
|
// (not to be confused with "black right-pointing TRIANGLE")
|
||||||
menu.addItem(key.substring(0,key.length - 1).
|
menu.addItem(key.substring(0,key.length - 1) + '\u25ba',
|
||||||
concat(String.fromCharCode(0x25ba)),
|
|
||||||
choices[key]);
|
choices[key]);
|
||||||
menuStack.push(menu);
|
menuStack.push(menu);
|
||||||
menu = new MenuMorph(
|
menu = new MenuMorph(
|
||||||
|
|
3
byob.js
3
byob.js
|
@ -299,8 +299,7 @@ CustomBlockDefinition.prototype.dropDownMenuOf = function (inputName) {
|
||||||
var pair = line.split('='),
|
var pair = line.split('='),
|
||||||
unique = pair[0];
|
unique = pair[0];
|
||||||
if (unique == '~' || unique == '}') {
|
if (unique == '~' || unique == '}') {
|
||||||
unique = unique.concat(gensym.toString());
|
unique += gensym++;
|
||||||
gensym++;
|
|
||||||
};
|
};
|
||||||
dict[unique] = isNil(pair[1]) ? unique : pair[1];
|
dict[unique] = isNil(pair[1]) ? unique : pair[1];
|
||||||
});
|
});
|
||||||
|
|
|
@ -7519,6 +7519,10 @@ MenuMorph.prototype.addLine = function (width) {
|
||||||
this.items.push([0, width || 1]);
|
this.items.push([0, width || 1]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MenuMorph.prototype.addSubmenu = function (key, submenu) {
|
||||||
|
this.addItem(key, key, , , , , , submenu);
|
||||||
|
|
||||||
|
|
||||||
MenuMorph.prototype.createLabel = function () {
|
MenuMorph.prototype.createLabel = function () {
|
||||||
var text;
|
var text;
|
||||||
if (this.label !== null) {
|
if (this.label !== null) {
|
||||||
|
|
Ładowanie…
Reference in New Issue