diff options
| author | jmoenig <jens@moenig.org> | 2014-05-20 09:43:31 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-05-20 09:43:31 +0200 |
| commit | a1b9d3e3964fd363cdb169c9de9287b54e736637 (patch) | |
| tree | 7e80144916260298c1f23858b2c9904f80af7f29 /gui.js | |
| parent | 295de115a387d24ded700146203c07ba7c522d16 (diff) | |
| download | snap-byow-a1b9d3e3964fd363cdb169c9de9287b54e736637.tar.gz snap-byow-a1b9d3e3964fd363cdb169c9de9287b54e736637.zip | |
Search Blocks feature, keyboard shortcuts
Thanks, Kyle, for designing and architecting the search blocks feature!!
Diffstat (limited to 'gui.js')
| -rw-r--r-- | gui.js | 49 |
1 files changed, 29 insertions, 20 deletions
@@ -68,7 +68,7 @@ sb, CommentMorph, CommandBlockMorph, BlockLabelPlaceHolderMorph, Audio*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2014-February-13'; +modules.gui = '2014-May-20'; // Declarations @@ -848,7 +848,7 @@ IDE_Morph.prototype.createCategories = function () { this.add(this.categories); }; -IDE_Morph.prototype.createPalette = function () { +IDE_Morph.prototype.createPalette = function (forSearching) { // assumes that the logo pane has already been created // needs the categories pane for layout var myself = this; @@ -857,7 +857,15 @@ IDE_Morph.prototype.createPalette = function () { this.palette.destroy(); } - this.palette = this.currentSprite.palette(this.currentCategory); + if (forSearching) { + this.palette = new ScrollFrameMorph( + null, + null, + this.currentSprite.sliderColor + ); + } else { + this.palette = this.currentSprite.palette(this.currentCategory); + } this.palette.isDraggable = false; this.palette.acceptsDrops = true; this.palette.contents.acceptsDrops = false; @@ -882,6 +890,7 @@ IDE_Morph.prototype.createPalette = function () { this.add(this.palette); this.palette.scrollX(this.palette.padding); this.palette.scrollY(this.palette.padding); + return this.palette; }; IDE_Morph.prototype.createStage = function () { @@ -2273,23 +2282,7 @@ IDE_Morph.prototype.projectMenu = function () { } ); menu.addItem('Open...', 'openProjectsBrowser'); - menu.addItem( - 'Save', - function () { - if (myself.source === 'examples') { - myself.source = 'local'; // cannot save to examples - } - if (myself.projectName) { - if (myself.source === 'local') { // as well as 'examples' - myself.saveProject(myself.projectName); - } else { // 'cloud' - myself.saveProjectToCloud(myself.projectName); - } - } else { - myself.saveProjectsBrowser(); - } - } - ); + menu.addItem('Save', "save"); if (shiftClicked) { menu.addItem( 'Save to disk', @@ -2720,6 +2713,22 @@ IDE_Morph.prototype.newProject = function () { this.fixLayout(); }; +IDE_Morph.prototype.save = function () { + if (this.source === 'examples') { + this.source = 'local'; // cannot save to examples + } + if (this.projectName) { + if (this.source === 'local') { // as well as 'examples' + this.saveProject(this.projectName); + } else { // 'cloud' + this.saveProjectToCloud(this.projectName); + } + } else { + this.saveProjectsBrowser(); + } +}; + + IDE_Morph.prototype.saveProject = function (name) { var myself = this; this.nextSteps([ |
