kopia lustrzana https://github.com/backface/turtlestitch
allow parens in project names
rodzic
853b01c8e9
commit
1dfee04381
|
@ -4,13 +4,15 @@
|
|||
* **New Features:**
|
||||
* **Notable Changes:**
|
||||
* **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:**
|
||||
* **Translation Updates:**
|
||||
|
||||
### 2021-12-14
|
||||
* 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:
|
||||
* **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);
|
||||
};
|
||||
|
||||
|
||||
/* // nicer version, commented out because some teachers
|
||||
// require parens in project names. Sigh.
|
||||
IDE_Morph.prototype.newName = function (name, elements) {
|
||||
var ix = name.indexOf('('),
|
||||
stem = (ix < 0) ? name : name.substring(0, ix),
|
||||
|
@ -3518,6 +3521,18 @@ IDE_Morph.prototype.newName = function (name, elements) {
|
|||
}
|
||||
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
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue