diff options
| author | Jens Mönig <jens@moenig.org> | 2015-06-25 16:32:45 +0200 |
|---|---|---|
| committer | Jens Mönig <jens@moenig.org> | 2015-06-25 16:32:45 +0200 |
| commit | 253d800b42c6f5ecb78fd35d6cd4d4fd3a19e7c8 (patch) | |
| tree | 1de17f2013cdb93071834db47690543cf1814496 | |
| parent | 8b9e7ea4eafb86f02db3b8891ee937233d9fa4b0 (diff) | |
| parent | e892ea80cb627961a0f84ebe61b7610528f67090 (diff) | |
| download | snap-253d800b42c6f5ecb78fd35d6cd4d4fd3a19e7c8.tar.gz snap-253d800b42c6f5ecb78fd35d6cd4d4fd3a19e7c8.zip | |
Merge pull request #624 from cycomachead/shared-url
Set location.hash to cloud URLs on project shares
| -rw-r--r-- | gui.js | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -5005,6 +5005,7 @@ ProjectDialogMorph.prototype.deleteProject = function () { ProjectDialogMorph.prototype.shareProject = function () { var myself = this, + ide = this.ide, proj = this.listField.selected, entry = this.listField.active; @@ -5035,6 +5036,15 @@ ProjectDialogMorph.prototype.shareProject = function () { myself.ide.cloudError(), [proj.ProjectName] ); + // Set the Shared URL if the project is currently open + if (proj.ProjectName === ide.projectName) { + var usr = SnapCloud.username, + projectId = 'Username=' + + encodeURIComponent(usr.toLowerCase()) + + '&ProjectName=' + + encodeURIComponent(proj.projectName); + location.hash = projectId; + } }, myself.ide.cloudError() ); @@ -5045,6 +5055,7 @@ ProjectDialogMorph.prototype.shareProject = function () { ProjectDialogMorph.prototype.unshareProject = function () { var myself = this, + ide = this.ide, proj = this.listField.selected, entry = this.listField.active; @@ -5076,6 +5087,10 @@ ProjectDialogMorph.prototype.unshareProject = function () { myself.ide.cloudError(), [proj.ProjectName] ); + // Remove the shared URL if the project is open. + if (proj.ProjectName === ide.projectName) { + location.hash = ''; + } }, myself.ide.cloudError() ); |
