kopia lustrzana https://github.com/backface/turtlestitch
preserve nested reporters in "kicked out" variadic inputs
instead of "swallowing" them. also new: floor() function in monadic math reporter's drop-downpull/3/merge
rodzic
eb8aef28c8
commit
5f88fc93bb
12
blocks.js
12
blocks.js
|
@ -412,7 +412,7 @@ SyntaxElementMorph.prototype.allEmptySlots = function () {
|
||||||
|
|
||||||
SyntaxElementMorph.prototype.replaceInput = function (oldArg, newArg) {
|
SyntaxElementMorph.prototype.replaceInput = function (oldArg, newArg) {
|
||||||
var scripts = this.parentThatIsA(ScriptsMorph),
|
var scripts = this.parentThatIsA(ScriptsMorph),
|
||||||
replacement,
|
replacement = newArg,
|
||||||
idx = this.children.indexOf(oldArg),
|
idx = this.children.indexOf(oldArg),
|
||||||
nb;
|
nb;
|
||||||
|
|
||||||
|
@ -424,10 +424,13 @@ SyntaxElementMorph.prototype.replaceInput = function (oldArg, newArg) {
|
||||||
newArg.parent.removeChild(newArg);
|
newArg.parent.removeChild(newArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldArg instanceof MultiArgMorph && this.dynamicInputLabels) {
|
if (oldArg instanceof MultiArgMorph) {
|
||||||
|
oldArg.inputs().forEach(function (inp) { // preserve nested reporters
|
||||||
|
oldArg.replaceInput(inp, new InputSlotMorph());
|
||||||
|
});
|
||||||
|
if (this.dynamicInputLabels) {
|
||||||
replacement = new ArgLabelMorph(newArg);
|
replacement = new ArgLabelMorph(newArg);
|
||||||
} else {
|
}
|
||||||
replacement = newArg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
replacement.parent = this;
|
replacement.parent = this;
|
||||||
|
@ -969,6 +972,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
||||||
false,
|
false,
|
||||||
{
|
{
|
||||||
abs : ['abs'],
|
abs : ['abs'],
|
||||||
|
floor : ['floor'],
|
||||||
sqrt : ['sqrt'],
|
sqrt : ['sqrt'],
|
||||||
sin : ['sin'],
|
sin : ['sin'],
|
||||||
cos : ['cos'],
|
cos : ['cos'],
|
||||||
|
|
|
@ -1803,3 +1803,5 @@ ______
|
||||||
130711
|
130711
|
||||||
------
|
------
|
||||||
* Blocks: fixed occasional flickering in scripting areas (caused by deleted feedback morphs, a bug that surfaced in Chrome 28 on OSX and may be due to a possible Chrome GC issue)
|
* Blocks: fixed occasional flickering in scripting areas (caused by deleted feedback morphs, a bug that surfaced in Chrome 28 on OSX and may be due to a possible Chrome GC issue)
|
||||||
|
* Blocks: preserve nested blocks in the scripting area when replacing a variadic input list with another input ("kick out" the nested blocks instead of "swallowing" them)
|
||||||
|
* Blocks, Threads: new floor() function in monadic math reporter's drop-down
|
||||||
|
|
|
@ -185,7 +185,7 @@ SnapTranslator.dict.de = {
|
||||||
'translator_e-mail':
|
'translator_e-mail':
|
||||||
'jens@moenig.org', // optional
|
'jens@moenig.org', // optional
|
||||||
'last_changed':
|
'last_changed':
|
||||||
'2013-07-02', // this, too, will appear in the Translators tab
|
'2013-07-11', // this, too, will appear in the Translators tab
|
||||||
|
|
||||||
// GUI
|
// GUI
|
||||||
// control bar:
|
// control bar:
|
||||||
|
@ -1176,6 +1176,8 @@ SnapTranslator.dict.de = {
|
||||||
// math functions
|
// math functions
|
||||||
'abs':
|
'abs':
|
||||||
'Betrag',
|
'Betrag',
|
||||||
|
'floor':
|
||||||
|
'Abgerundet',
|
||||||
'sqrt':
|
'sqrt':
|
||||||
'Wurzel',
|
'Wurzel',
|
||||||
'sin':
|
'sin':
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
/*global modules, contains*/
|
/*global modules, contains*/
|
||||||
|
|
||||||
modules.locale = '2013-July-02';
|
modules.locale = '2013-July-11';
|
||||||
|
|
||||||
// Global stuff
|
// Global stuff
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ SnapTranslator.dict.de = {
|
||||||
'translator_e-mail':
|
'translator_e-mail':
|
||||||
'jens@moenig.org',
|
'jens@moenig.org',
|
||||||
'last_changed':
|
'last_changed':
|
||||||
'2013-07-02'
|
'2013-07-11'
|
||||||
};
|
};
|
||||||
|
|
||||||
SnapTranslator.dict.it = {
|
SnapTranslator.dict.it = {
|
||||||
|
|
|
@ -83,7 +83,7 @@ ArgLabelMorph, localize*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.threads = '2013-July-09';
|
modules.threads = '2013-July-11';
|
||||||
|
|
||||||
var ThreadManager;
|
var ThreadManager;
|
||||||
var Process;
|
var Process;
|
||||||
|
@ -1876,6 +1876,9 @@ Process.prototype.reportMonadic = function (fname, n) {
|
||||||
case 'abs':
|
case 'abs':
|
||||||
result = Math.abs(x);
|
result = Math.abs(x);
|
||||||
break;
|
break;
|
||||||
|
case 'floor':
|
||||||
|
result = Math.floor(x);
|
||||||
|
break;
|
||||||
case 'sqrt':
|
case 'sqrt':
|
||||||
result = Math.sqrt(x);
|
result = Math.sqrt(x);
|
||||||
break;
|
break;
|
||||||
|
|
Ładowanie…
Reference in New Issue