kopia lustrzana https://github.com/backface/turtlestitch
allow parens in project names
rodzic
853b01c8e9
commit
1dfee04381
|
@ -4,13 +4,15 @@
|
||||||
* **New Features:**
|
* **New Features:**
|
||||||
* **Notable Changes:**
|
* **Notable Changes:**
|
||||||
* **Notable Fixes:**
|
* **Notable Fixes:**
|
||||||
* keep the order of sprites in the corral for newly created projects
|
* keep the order of sprites in the corral when saving newly created projects
|
||||||
|
* allow parens in project names
|
||||||
* **Documentation Updates:**
|
* **Documentation Updates:**
|
||||||
* **Translation Updates:**
|
* **Translation Updates:**
|
||||||
|
|
||||||
### 2021-12-14
|
### 2021-12-14
|
||||||
* new dev version
|
* new dev version
|
||||||
* store: keep the order of sprites in the corral for newly created projects
|
* store: keep the order of sprites in the corral when saving newly created projects
|
||||||
|
* gui: allow parens in project names
|
||||||
|
|
||||||
## 7.0.0:
|
## 7.0.0:
|
||||||
* **New Features:**
|
* **New Features:**
|
||||||
|
|
15
src/gui.js
15
src/gui.js
|
@ -3506,6 +3506,9 @@ IDE_Morph.prototype.newSceneName = function (name, ignoredScene) {
|
||||||
return this.newName(sName, all);
|
return this.newName(sName, all);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* // nicer version, commented out because some teachers
|
||||||
|
// require parens in project names. Sigh.
|
||||||
IDE_Morph.prototype.newName = function (name, elements) {
|
IDE_Morph.prototype.newName = function (name, elements) {
|
||||||
var ix = name.indexOf('('),
|
var ix = name.indexOf('('),
|
||||||
stem = (ix < 0) ? name : name.substring(0, ix),
|
stem = (ix < 0) ? name : name.substring(0, ix),
|
||||||
|
@ -3518,6 +3521,18 @@ IDE_Morph.prototype.newName = function (name, elements) {
|
||||||
}
|
}
|
||||||
return newName;
|
return newName;
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
IDE_Morph.prototype.newName = function (name, elements) {
|
||||||
|
var count = 1,
|
||||||
|
newName = name;
|
||||||
|
|
||||||
|
while (contains(elements, newName)) {
|
||||||
|
count += 1;
|
||||||
|
newName = name + '(' + count + ')';
|
||||||
|
}
|
||||||
|
return newName;
|
||||||
|
};
|
||||||
|
|
||||||
// IDE_Morph deleting scripts
|
// IDE_Morph deleting scripts
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue