summaryrefslogtreecommitdiff
path: root/gui.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-10 08:33:50 +0200
committerjmoenig <jens@moenig.org>2013-04-10 08:33:50 +0200
commitcb41576e5ac53707bac1c16c46b851a269a41a6b (patch)
treeda87defadb239d3ff7e57811c99ac45a626b6266 /gui.js
parent2fe044f0a36e7e8dedbc2279ee73420229ecc3d0 (diff)
downloadsnap-cb41576e5ac53707bac1c16c46b851a269a41a6b.tar.gz
snap-cb41576e5ac53707bac1c16c46b851a269a41a6b.zip
Load shared projects from different formats
cloud data and plain project format
Diffstat (limited to 'gui.js')
-rw-r--r--gui.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/gui.js b/gui.js
index 3686c3b..a387a6c 100644
--- a/gui.js
+++ b/gui.js
@@ -68,7 +68,7 @@ sb, CommentMorph, CommandBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.gui = '2013-April-09';
+modules.gui = '2013-April-10';
// Declarations
@@ -253,7 +253,6 @@ IDE_Morph.prototype.openIn = function (world) {
this.shield.color = this.color;
this.shield.setExtent(this.parent.extent());
this.parent.add(this.shield);
-
myself.showMessage('Fetching project\nfrom the cloud...');
SnapCloud.getPublicProject(
location.hash.substr(9),
@@ -264,7 +263,11 @@ IDE_Morph.prototype.openIn = function (world) {
msg = myself.showMessage('Opening project...');
},
function () {
- myself.rawOpenCloudDataString(projectData);
+ if (projectData.indexOf('<snapdata') === 0) {
+ myself.rawOpenCloudDataString(projectData);
+ } else if (projectData.indexOf('<project') === 0) {
+ myself.rawOpenProjectString(projectData);
+ }
},
function () {
myself.shield.destroy();