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