kopia lustrzana https://github.com/backface/turtlestitch
fixed #2108 (added drop-down menu to "letter _ of _ ")
rodzic
7478f6039f
commit
990ecc1eb5
|
@ -4141,3 +4141,7 @@ in development:
|
||||||
180609
|
180609
|
||||||
------
|
------
|
||||||
* Objects, Threads: Also trigger "When I am stopped" when programmatically calling "stop all"
|
* Objects, Threads: Also trigger "When I am stopped" when programmatically calling "stop all"
|
||||||
|
|
||||||
|
180611
|
||||||
|
------
|
||||||
|
* Objects, Threads: fixed #2108 (added drop-down menu to "letter _ of _ ")
|
||||||
|
|
|
@ -83,7 +83,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
|
||||||
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph,
|
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph,
|
||||||
AlignmentMorph, Process, XML_Element, VectorPaintEditorMorph*/
|
AlignmentMorph, Process, XML_Element, VectorPaintEditorMorph*/
|
||||||
|
|
||||||
modules.objects = '2018-June-09';
|
modules.objects = '2018-June-11';
|
||||||
|
|
||||||
var SpriteMorph;
|
var SpriteMorph;
|
||||||
var StageMorph;
|
var StageMorph;
|
||||||
|
@ -1020,7 +1020,7 @@ SpriteMorph.prototype.initBlocks = function () {
|
||||||
reportLetter: {
|
reportLetter: {
|
||||||
type: 'reporter',
|
type: 'reporter',
|
||||||
category: 'operators',
|
category: 'operators',
|
||||||
spec: 'letter %n of %s',
|
spec: 'letter %idx of %s',
|
||||||
defaults: [1, localize('world')]
|
defaults: [1, localize('world')]
|
||||||
},
|
},
|
||||||
reportStringSize: {
|
reportStringSize: {
|
||||||
|
|
11
threads.js
11
threads.js
|
@ -62,7 +62,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
|
||||||
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
|
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
|
||||||
TableFrameMorph, ColorSlotMorph, isSnapObject*/
|
TableFrameMorph, ColorSlotMorph, isSnapObject*/
|
||||||
|
|
||||||
modules.threads = '2018-June-09';
|
modules.threads = '2018-June-11';
|
||||||
|
|
||||||
var ThreadManager;
|
var ThreadManager;
|
||||||
var Process;
|
var Process;
|
||||||
|
@ -2695,10 +2695,17 @@ Process.prototype.reportJoinWords = function (aList) {
|
||||||
// Process string ops
|
// Process string ops
|
||||||
|
|
||||||
Process.prototype.reportLetter = function (idx, string) {
|
Process.prototype.reportLetter = function (idx, string) {
|
||||||
|
var i;
|
||||||
if (string instanceof List) { // catch a common user error
|
if (string instanceof List) { // catch a common user error
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
var i = +(idx || 0),
|
if (this.inputOption(idx) === 'any') {
|
||||||
|
idx = this.reportRandom(1, string.length);
|
||||||
|
}
|
||||||
|
if (this.inputOption(idx) === 'last') {
|
||||||
|
idx = string.length;
|
||||||
|
}
|
||||||
|
i = +(idx || 0),
|
||||||
str = isNil(string) ? '' : string.toString();
|
str = isNil(string) ? '' : string.toString();
|
||||||
return str[i - 1] || '';
|
return str[i - 1] || '';
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue