summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Mönig <jens@moenig.org>2015-06-25 16:32:45 +0200
committerJens Mönig <jens@moenig.org>2015-06-25 16:32:45 +0200
commit253d800b42c6f5ecb78fd35d6cd4d4fd3a19e7c8 (patch)
tree1de17f2013cdb93071834db47690543cf1814496
parent8b9e7ea4eafb86f02db3b8891ee937233d9fa4b0 (diff)
parente892ea80cb627961a0f84ebe61b7610528f67090 (diff)
downloadsnap-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.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/gui.js b/gui.js
index 66514ba..f711847 100644
--- a/gui.js
+++ b/gui.js
@@ -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()
);