summaryrefslogtreecommitdiff
path: root/gui.js
diff options
context:
space:
mode:
authorMichael Ball <cycomachead@gmail.com>2014-05-24 22:02:00 -0700
committerMichael Ball <cycomachead@gmail.com>2014-05-24 22:02:00 -0700
commitbf03185eb083ea4171121d25ffda3041d91be8e7 (patch)
tree6c5c5522a2ef79992cee682b4ebeec8ba7e7502b /gui.js
parent01b9417b87688b591fe3df2a55ec367dd72f027d (diff)
parent089d1500b41f00611603de936a65093d0dbb15ec (diff)
downloadsnap-bf03185eb083ea4171121d25ffda3041d91be8e7.tar.gz
snap-bf03185eb083ea4171121d25ffda3041d91be8e7.zip
Merge pull request #33 from jmoenig/master
update cs10 fork
Diffstat (limited to 'gui.js')
-rw-r--r--gui.js49
1 files changed, 29 insertions, 20 deletions
diff --git a/gui.js b/gui.js
index 0f4f2eb..4de6b3d 100644
--- a/gui.js
+++ b/gui.js
@@ -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([