kopia lustrzana https://github.com/backface/turtlestitch
refactored variable refactoring code
rodzic
bb8154a211
commit
0f006d3965
24
blocks.js
24
blocks.js
|
@ -150,7 +150,7 @@ CustomCommandBlockMorph*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.blocks = '2017-January-04';
|
modules.blocks = '2017-January-05';
|
||||||
|
|
||||||
var SyntaxElementMorph;
|
var SyntaxElementMorph;
|
||||||
var BlockMorph;
|
var BlockMorph;
|
||||||
|
@ -3104,9 +3104,15 @@ BlockMorph.prototype.refactorThisVar = function (justTheTemplate) {
|
||||||
oldValue, newWatcher;
|
oldValue, newWatcher;
|
||||||
|
|
||||||
cpy.addShadow();
|
cpy.addShadow();
|
||||||
new DialogBoxMorph(
|
new DialogBoxMorph(this, renameVarTo, this).prompt(
|
||||||
this,
|
'Variable name',
|
||||||
function (newName) {
|
oldName,
|
||||||
|
this.world(),
|
||||||
|
cpy.fullImage(), // pic
|
||||||
|
InputSlotMorph.prototype.getVarNamesDict.call(this)
|
||||||
|
);
|
||||||
|
|
||||||
|
function renameVarTo (newName) {
|
||||||
var definer;
|
var definer;
|
||||||
|
|
||||||
if (this.parent instanceof SyntaxElementMorph) {
|
if (this.parent instanceof SyntaxElementMorph) {
|
||||||
|
@ -3223,15 +3229,7 @@ BlockMorph.prototype.refactorThisVar = function (justTheTemplate) {
|
||||||
|
|
||||||
ide.flushBlocksCache('variables');
|
ide.flushBlocksCache('variables');
|
||||||
ide.refreshPalette();
|
ide.refreshPalette();
|
||||||
},
|
}
|
||||||
this
|
|
||||||
).prompt(
|
|
||||||
'Variable name',
|
|
||||||
oldName,
|
|
||||||
this.world(),
|
|
||||||
cpy.fullImage(), // pic
|
|
||||||
InputSlotMorph.prototype.getVarNamesDict.call(this)
|
|
||||||
);
|
|
||||||
|
|
||||||
function varExistsError (where) {
|
function varExistsError (where) {
|
||||||
ide.inform(
|
ide.inform(
|
||||||
|
|
|
@ -3247,6 +3247,10 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
|
||||||
* Variable refactoring, yay! Thanks, Bernat!!
|
* Variable refactoring, yay! Thanks, Bernat!!
|
||||||
* Threads: fixed #1602
|
* Threads: fixed #1602
|
||||||
|
|
||||||
|
170105
|
||||||
|
------
|
||||||
|
* Blocks: refactored variable refactoring code
|
||||||
|
|
||||||
|
|
||||||
== v4.10 === (in development)
|
== v4.10 === (in development)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue