allow parens in project names

snap7
jmoenig 2021-12-14 18:09:15 +01:00
rodzic 853b01c8e9
commit 1dfee04381
2 zmienionych plików z 19 dodań i 2 usunięć

Wyświetl plik

@ -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:**

Wyświetl plik

@ -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