summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-07-08 15:27:25 +0200
committerjmoenig <jens@moenig.org>2014-07-08 15:27:25 +0200
commit92c5c8bedfc47a333755d4d4aa49939fc5594194 (patch)
tree7ac2c0c4fc74db6cdc4d3dc9704fa8fa107bbf2b
parentff513ba4391bd6cd44d2add5e2f54c02465b6629 (diff)
downloadsnap-92c5c8bedfc47a333755d4d4aa49939fc5594194.tar.gz
snap-92c5c8bedfc47a333755d4d4aa49939fc5594194.zip
add keyboard shortcut for “new project”: ctr-n
note: some browsers (actually, most ^^) override this before Snap gets a chance to do its thing :-(
-rw-r--r--gui.js22
-rwxr-xr-xhistory.txt1
-rw-r--r--objects.js3
3 files changed, 14 insertions, 12 deletions
diff --git a/gui.js b/gui.js
index d1cac6c..1454ba3 100644
--- a/gui.js
+++ b/gui.js
@@ -2266,18 +2266,7 @@ IDE_Morph.prototype.projectMenu = function () {
menu = new MenuMorph(this);
menu.addItem('Project notes...', 'editProjectNotes');
menu.addLine();
- menu.addItem(
- 'New',
- function () {
- myself.confirm(
- 'Replace the current project with a new one?',
- 'New Project',
- function () {
- myself.newProject();
- }
- );
- }
- );
+ menu.addItem('New', 'createNewProject');
menu.addItem('Open...', 'openProjectsBrowser');
menu.addItem('Save', "save");
if (shiftClicked) {
@@ -3360,6 +3349,15 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall) {
}
};
+IDE_Morph.prototype.createNewProject = function () {
+ var myself = this;
+ this.confirm(
+ 'Replace the current project with a new one?',
+ 'New Project',
+ function () {myself.newProject(); }
+ );
+};
+
IDE_Morph.prototype.openProjectsBrowser = function () {
new ProjectDialogMorph(this, 'open').popUp();
};
diff --git a/history.txt b/history.txt
index 84c9f92..06a29ab 100755
--- a/history.txt
+++ b/history.txt
@@ -2183,3 +2183,4 @@ ______
* Threads: adjust to Doug Crockford’s latest infuriating nitpickings in JSLint
* GUI: show username in ‘logout’ entry of cloud menu
* GUI, Objects: fixed scrolling glitch in the palette, thanks, Kunal!
+* GUI, Objects: add keyboard shortcut for “new project”: ctr-n
diff --git a/objects.js b/objects.js
index e76126c..1a9bb63 100644
--- a/objects.js
+++ b/objects.js
@@ -4581,6 +4581,9 @@ StageMorph.prototype.fireKeyEvent = function (key) {
if (evt === 'ctrl f') {
return this.parentThatIsA(IDE_Morph).currentSprite.searchBlocks();
}
+ if (evt === 'ctrl n') {
+ return this.parentThatIsA(IDE_Morph).createNewProject();
+ }
if (evt === 'ctrl o') {
return this.parentThatIsA(IDE_Morph).openProjectsBrowser();
}