From 50e84f8890079c45bb32e001eece4c3544fd1641 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 12 Jan 2015 10:15:56 +0100 Subject: Check project for compatibility notify users of potential incompatibilities when opening projects created in other forks (e.g. BeetleBlocks) --- gui.js | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'gui.js') diff --git a/gui.js b/gui.js index 8cd9403..d862463 100644 --- a/gui.js +++ b/gui.js @@ -9,7 +9,7 @@ written by Jens Mönig jens@moenig.org - Copyright (C) 2014 by Jens Mönig + Copyright (C) 2015 by Jens Mönig This file is part of Snap!. @@ -69,7 +69,7 @@ SpeechBubbleMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2014-December-04'; +modules.gui = '2015-January-12'; // Declarations @@ -300,7 +300,6 @@ IDE_Morph.prototype.openIn = function (world) { this.inform('Snap!', motd); } */ - function interpretUrlAnchors() { var dict; if (location.hash.substr(0, 6) === '#open:') { @@ -2509,7 +2508,7 @@ IDE_Morph.prototype.aboutSnap = function () { world = this.world(); aboutTxt = 'Snap! 4.0\nBuild Your Own Blocks\n\n--- beta ---\n\n' - + 'Copyright \u24B8 2014 Jens M\u00F6nig and ' + + 'Copyright \u24B8 2015 Jens M\u00F6nig and ' + 'Brian Harvey\n' + 'jens@moenig.org, bh@cs.berkeley.edu\n\n' @@ -2943,12 +2942,18 @@ IDE_Morph.prototype.rawOpenProjectString = function (str) { StageMorph.prototype.enableCodeMapping = false; if (Process.prototype.isCatchingErrors) { try { - this.serializer.openProject(this.serializer.load(str), this); + this.serializer.openProject( + this.serializer.load(str, this), + this + ); } catch (err) { this.showMessage('Load failed: ' + err); } } else { - this.serializer.openProject(this.serializer.load(str), this); + this.serializer.openProject( + this.serializer.load(str, this), + this + ); } this.stopFastTracking(); }; @@ -2980,7 +2985,10 @@ IDE_Morph.prototype.rawOpenCloudDataString = function (str) { model = this.serializer.parse(str); this.serializer.loadMediaModel(model.childNamed('media')); this.serializer.openProject( - this.serializer.loadProjectModel(model.childNamed('project')), + this.serializer.loadProjectModel( + model.childNamed('project'), + this + ), this ); } catch (err) { @@ -2990,7 +2998,10 @@ IDE_Morph.prototype.rawOpenCloudDataString = function (str) { model = this.serializer.parse(str); this.serializer.loadMediaModel(model.childNamed('media')); this.serializer.openProject( - this.serializer.loadProjectModel(model.childNamed('project')), + this.serializer.loadProjectModel( + model.childNamed('project'), + this + ), this ); } @@ -3974,6 +3985,9 @@ IDE_Morph.prototype.cloudResponse = function () { IDE_Morph.prototype.cloudError = function () { var myself = this; + // try finding an eplanation what's going on + // has some issues, commented out for now + /* function getURL(url) { try { var request = new XMLHttpRequest(); @@ -3987,13 +4001,15 @@ IDE_Morph.prototype.cloudError = function () { return null; } } + */ return function (responseText, url) { // first, try to find out an explanation for the error // and notify the user about it, // if none is found, show an error dialog box var response = responseText, - explanation = getURL('http://snap.berkeley.edu/cloudmsg.txt'); + // explanation = getURL('http://snap.berkeley.edu/cloudmsg.txt'), + explanation = null; if (myself.shield) { myself.shield.destroy(); myself.shield = null; @@ -4044,14 +4060,7 @@ IDE_Morph.prototype.setCloudURL = function () { null, { 'Snap!Cloud' : - 'https://snapcloud.miosoft.com/miocon/app/' + - 'login?_app=SnapCloud', - 'local network lab' : - '192.168.2.107:8087/miocon/app/login?_app=SnapCloud', - 'local network office' : - '192.168.186.146:8087/miocon/app/login?_app=SnapCloud', - 'localhost dev' : - 'localhost/miocon/app/login?_app=SnapCloud' + 'https://snap.apps.miosoft.com/SnapCloud' } ); }; -- cgit v1.3.1 From 667193b9f02331b3372fefbb9fd4a424d5b86d7e Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 12 Jan 2015 13:05:14 +0100 Subject: Force Chrome to show GUI messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add additional yields to nextSteps() to work around a bug recently introduced to Chrome (other browsers don’t need this kludge). Remember to take those yields out again when and if Chrome (ever) fixes this (which, for all I know, may be never) --- gui.js | 6 ++++++ history.txt | 1 + 2 files changed, 7 insertions(+) (limited to 'gui.js') diff --git a/gui.js b/gui.js index d862463..521f27e 100644 --- a/gui.js +++ b/gui.js @@ -352,6 +352,7 @@ IDE_Morph.prototype.openIn = function (world) { function () { msg = myself.showMessage('Opening project...'); }, + function () {nop(); }, // yield (bug in Chrome) function () { if (projectData.indexOf(' Date: Tue, 13 Jan 2015 08:37:33 +0100 Subject: fixed #680 --- gui.js | 11 ++++++++++- history.txt | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'gui.js') diff --git a/gui.js b/gui.js index 521f27e..46d47e5 100644 --- a/gui.js +++ b/gui.js @@ -69,7 +69,7 @@ SpeechBubbleMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2015-January-12'; +modules.gui = '2015-January-13'; // Declarations @@ -3343,6 +3343,15 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) { }).forEach(function (s) { s.adjustScrollBars(); }); + // prevent rotation and draggability controls from + // showing for the stage + if (this.currentSprite === this.stage) { + this.spriteBar.children.forEach(function (child) { + if (child instanceof PushButtonMorph) { + child.hide(); + } + }); + } } this.setExtent(this.world().extent()); // resume trackChanges }; diff --git a/history.txt b/history.txt index 3ca41f8..b621772 100755 --- a/history.txt +++ b/history.txt @@ -2413,3 +2413,8 @@ ______ * Objects: Disable clones from being edited via their context menus or double-click * Italian translation update, thanks, Alberto Firpo! * GUI: add additional yields to nextSteps() (work around a bug in Chrome) + +150113 +------ +* BYOB: fixed #702 +* GUI: fixed #680 -- cgit v1.3.1 From fee92b65f292ee46b83cc499bf623eb269dc6565 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 21 Jan 2015 12:18:46 +0100 Subject: Generate ScriptsPaneTexture programmatically --- byob.js | 4 ++-- gui.js | 24 ++++++++++++++++++++---- history.txt | 1 + manifest.mf | 3 +-- scriptsPaneTexture.gif | Bin 155 -> 0 bytes store.js | 4 ++-- 6 files changed, 26 insertions(+), 10 deletions(-) delete mode 100755 scriptsPaneTexture.gif (limited to 'gui.js') diff --git a/byob.js b/byob.js index 9e7dfc8..ec714f1 100644 --- a/byob.js +++ b/byob.js @@ -106,7 +106,7 @@ SymbolMorph, isNil*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2015-January-13'; +modules.byob = '2015-January-21'; // Declarations @@ -1651,7 +1651,7 @@ BlockEditorMorph.prototype.init = function (definition, target) { scripts = new ScriptsMorph(target); scripts.isDraggable = false; scripts.color = IDE_Morph.prototype.groupColor; - scripts.texture = IDE_Morph.prototype.scriptsPaneTexture; + scripts.cachedTexture = IDE_Morph.prototype.scriptsPaneTexture; scripts.cleanUpMargin = 10; proto = new PrototypeHatBlockMorph(this.definition); diff --git a/gui.js b/gui.js index 46d47e5..9b8b51a 100644 --- a/gui.js +++ b/gui.js @@ -69,7 +69,7 @@ SpeechBubbleMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2015-January-13'; +modules.gui = '2015-January-21'; // Declarations @@ -119,7 +119,7 @@ IDE_Morph.prototype.setDefaultDesign = function () { ]; IDE_Morph.prototype.rotationStyleColors = IDE_Morph.prototype.tabColors; IDE_Morph.prototype.appModeColor = new Color(); - IDE_Morph.prototype.scriptsPaneTexture = 'scriptsPaneTexture.gif'; + IDE_Morph.prototype.scriptsPaneTexture = this.scriptsTexture(); IDE_Morph.prototype.padding = 5; SpriteIconMorph.prototype.labelColor @@ -172,6 +172,22 @@ IDE_Morph.prototype.setFlatDesign = function () { = IDE_Morph.prototype.buttonLabelColor; }; +IDE_Morph.prototype.scriptsTexture = function () { + var pic = newCanvas(new Point(100, 100)), // bigger scales faster + ctx = pic.getContext('2d'), + i; + for (i = 0; i < 100; i += 4) { + ctx.fillStyle = this.frameColor.toString(); + ctx.fillRect(i, 0, 1, 100); + ctx.fillStyle = this.groupColor.lighter(6).toString(); + ctx.fillRect(i + 1, 0, 1, 100); + ctx.fillRect(i + 3, 0, 1, 100); + ctx.fillStyle = this.groupColor.toString(); + ctx.fillRect(i + 2, 0, 1, 100); + } + return pic; +}; + IDE_Morph.prototype.setDefaultDesign(); // IDE_Morph instance creation: @@ -1152,7 +1168,7 @@ IDE_Morph.prototype.createSpriteEditor = function () { if (this.currentTab === 'scripts') { scripts.isDraggable = false; scripts.color = this.groupColor; - scripts.texture = this.scriptsPaneTexture; + scripts.cachedTexture = this.scriptsPaneTexture; this.spriteEditor = new ScrollFrameMorph( scripts, @@ -3527,7 +3543,7 @@ IDE_Morph.prototype.userSetBlocksScale = function () { sample = new FrameMorph(); sample.acceptsDrops = false; - sample.texture = this.scriptsPaneTexture; + sample.cachedTexture = this.scriptsPaneTexture; sample.setExtent(new Point(250, 180)); scrpt.setPosition(sample.position().add(10)); sample.add(scrpt); diff --git a/history.txt b/history.txt index 1880e45..ff472c7 100755 --- a/history.txt +++ b/history.txt @@ -2422,3 +2422,4 @@ ______ 150121 ------ * Objects: Keep layering of nested sprites thru drag & drop +* GUI, Store, BYOB: Generate ScriptsPaneTexture programmatically diff --git a/manifest.mf b/manifest.mf index 353d47f..d040961 100644 --- a/manifest.mf +++ b/manifest.mf @@ -10,5 +10,4 @@ threads.js widgets.js store.js xml.js -scriptsPaneTexture.gif -snap_logo_sm.gif +snap_logo_sm.png diff --git a/scriptsPaneTexture.gif b/scriptsPaneTexture.gif deleted file mode 100755 index 846c77f..0000000 Binary files a/scriptsPaneTexture.gif and /dev/null differ diff --git a/store.js b/store.js index 9dd851d..056767f 100644 --- a/store.js +++ b/store.js @@ -61,7 +61,7 @@ SyntaxElementMorph, Variable*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2015-January-12'; +modules.store = '2015-January-21'; // XML_Serializer /////////////////////////////////////////////////////// @@ -861,7 +861,7 @@ SnapSerializer.prototype.loadScripts = function (scripts, model) { // private var myself = this, scale = SyntaxElementMorph.prototype.scale; - scripts.texture = 'scriptsPaneTexture.gif'; + scripts.cachedTexture = IDE_Morph.prototype.scriptsPaneTexture; model.children.forEach(function (child) { var element; if (child.tag === 'script') { -- cgit v1.3.1 From 386ff338951135bed9d8b7bd33c973b46e63e89f Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 21 Jan 2015 12:26:54 +0100 Subject: Fix Zoom Dialog’s sample background in “flat” design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui.js | 1 + history.txt | 1 + 2 files changed, 2 insertions(+) (limited to 'gui.js') diff --git a/gui.js b/gui.js index 9b8b51a..73fffe9 100644 --- a/gui.js +++ b/gui.js @@ -3543,6 +3543,7 @@ IDE_Morph.prototype.userSetBlocksScale = function () { sample = new FrameMorph(); sample.acceptsDrops = false; + sample.color = IDE_Morph.prototype.groupColor; sample.cachedTexture = this.scriptsPaneTexture; sample.setExtent(new Point(250, 180)); scrpt.setPosition(sample.position().add(10)); diff --git a/history.txt b/history.txt index ff472c7..4de8ee1 100755 --- a/history.txt +++ b/history.txt @@ -2423,3 +2423,4 @@ ______ ------ * Objects: Keep layering of nested sprites thru drag & drop * GUI, Store, BYOB: Generate ScriptsPaneTexture programmatically +* GUI: Fix Zoom Dialog’s sample background in “flat” design -- cgit v1.3.1