-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: janusweb
action: commit
revision:
path_from:
revision_from: 946d347230e7aad8d650d683b09ec7a64d2a202a:
path_to:
revision_to:

git.thebackupbox.net

janusweb

git://git.thebackupbox.net/janusweb

commit 946d347230e7aad8d650d683b09ec7a64d2a202a
Author: James Baicoianu <james_github@baicoianu.com>
Date:   Tue Dec 21 20:19:24 2021 -0800

    Added janus.createRoom() for dynamic room creation

diff --git a/scripts/janusweb.js b/scripts/janusweb.js

index a0d8b89ba60819558bd35ec46ae0db851b4623c8..

index ..384154a514b1562ffc147a47d9f96d97bdf28ae5 100644

--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -172,6 +172,7 @@ elation.require([
         load:              ['function', 'navigateTo'],
         setActiveRoom:     ['function', 'setActiveRoom'],
         preload:           ['function', 'preload'],
+        createRoom:        ['function', 'createRoom'],
         navhome:           ['function', 'navigateHome'],
         chatsend:          ['function', 'sendChatMessage'],
         sync:              ['function', 'currentroom.sync'],
@@ -412,6 +413,23 @@ elation.require([
     this.preload = function(url, stripreferrer) {
       return this.load(url, false, null, stripreferrer);
     }
+    this.createRoom = function(url, makeactive=true) {
+      let newroom = this.spawn('janusroom', url, {
+        url: url,
+        janus: this,
+        corsproxy: this.corsproxy,
+        deferload: true
+      });
+
+      this.rooms[newroom.roomid] = newroom;
+      //console.log('made new room', url, room);
+      this.loading = false;
+      if (newroom && makeactive) {
+        this.setActiveRoom(newroom);
+      }
+      this.initScripting();
+      return newroom.getProxyObject();
+    }
     this.getFixedURL = function(url) {
       // Our 'clean' client URLs don't contain a : because many services have problems parsing them
       var m = url.match(/^(https?)\/\/?(.*)$/i);

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 18:22:28 2024