From 74ad2abc66cd2652048de4b7906b1f9f015540e7 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Tue, 9 Apr 2013 18:03:44 +0200 Subject: [PATCH] Support for debugging shared projects --- gui.js | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--- history.txt | 1 + 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/gui.js b/gui.js index 675c51ae..3686c3b7 100644 --- a/gui.js +++ b/gui.js @@ -267,8 +267,8 @@ IDE_Morph.prototype.openIn = function (world) { myself.rawOpenCloudDataString(projectData); }, function () { - this.shield.destroy(); - this.shield = null; + myself.shield.destroy(); + myself.shield = null; msg.destroy(); myself.toggleAppMode(true); myself.runScripts(); @@ -1694,7 +1694,6 @@ IDE_Morph.prototype.cloudMenu = function () { null, new Color(100, 0, 0) ); - menu.addLine(); menu.addItem( 'export project as cloud data...', function () { @@ -1709,6 +1708,53 @@ IDE_Morph.prototype.cloudMenu = function () { null, new Color(100, 0, 0) ); + menu.addLine(); + menu.addItem( + 'open shared project from cloud...', + function () { + myself.prompt('Author nameā€¦', function (usr) { + myself.prompt('Project name...', function (prj) { + var id = 'Username=' + + encodeURIComponent(usr) + + '&ProjectName=' + + encodeURIComponent(prj); + myself.showMessage( + 'Fetching project\nfrom the cloud...' + ); + SnapCloud.getPublicProject( + id, + function (projectData) { + var msg; + if (!Process.prototype.isCatchingErrors) { + window.open( + 'data:text/xml,' + projectData + ); + } + myself.nextSteps([ + function () { + msg = myself.showMessage( + 'Opening project...' + ); + }, + function () { + myself.rawOpenCloudDataString( + projectData + ); + }, + function () { + msg.destroy(); + } + ]); + }, + myself.cloudError() + ); + + }); + }); + }, + null, + new Color(100, 0, 0) + ); } menu.popup(world, pos); }; diff --git a/history.txt b/history.txt index 370ec156..6637ee78 100755 --- a/history.txt +++ b/history.txt @@ -1606,3 +1606,4 @@ ______ * GUI: display shared project names bold typed in the project dialog * GUI: Feedback msg when sharing / unsharing projects * GUI: Shield (hide) IDE while opening a shared project for presentation +* GUI: Support for debugging shared projects