diff --git a/src/editor/Collaboration.js b/src/editor/Collaboration.js index b168af58b20..fe83d9b404b 100644 --- a/src/editor/Collaboration.js +++ b/src/editor/Collaboration.js @@ -14,6 +14,10 @@ define(function (require, exports, module) { // TODO : Shift this to config. url: "localhost:8888" }); + //To be moved to the bramble API. + var query = (new URL(window.location.href)).searchParams; + this.room = query.get("collaboration") || Math.random().toString(36).substring(7); + console.log(this.room); this.webrtc = webrtc; this.pending = []; // pending clients that need to be initialized. this.changing = false; @@ -21,7 +25,7 @@ define(function (require, exports, module) { Collaboration.prototype.init = function(codemirror) { var self = this; - this.webrtc.joinRoom('thimble', function() { + this.webrtc.joinRoom(this.room, function() { self.codemirror = codemirror; self.webrtc.sendToAll("new client", {}); self.webrtc.on("createdPeer", function(peer) {