-- 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: 416c7a21c077cc3d17a3d8ae78d33f93b2928bb2:
path_to:
revision_to:

git.thebackupbox.net

janusweb

git://git.thebackupbox.net/janusweb

commit 416c7a21c077cc3d17a3d8ae78d33f93b2928bb2
Author: James Baicoianu <james_github@baicoianu.com>
Date:   Tue Jul 25 15:41:35 2017 -0700

    Added 'muted' option to client

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

index 804b470aad8ffb27122af84ac169fbabd8dae72b..

index ..9624ed07b38de0100c95a9f3e3ac0b176fb4aebd 100644

--- a/scripts/client.js
+++ b/scripts/client.js
@@ -64,6 +64,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
       networking: args.networking,
       autoload: args.autoload,
       stats: args.stats,
+      muted: args.muted,
       urltemplate: args.urltemplate,
       useWebVRPolyfill: args.useWebVRPolyfill,
       server: args.server,
@@ -129,6 +130,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
           autoload: this.args.autoload,
           urltemplate: this.args.urltemplate,
           server: this.args.server,
+          muted: this.args.muted,
         }
       });
       this.janusweb = things.children.janusweb;
diff --git a/scripts/janusweb.js b/scripts/janusweb.js

index 2b9255decac3beba59c4f58172e5a5605be651ca..

index ..97576d2d711d0bce129990e551b34cbce89a08b6 100644

--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -66,6 +66,7 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
         server:         { type: 'string', default: null },
         port:           { type: 'integer', default: null },
         urltemplate:    { type: 'string', default: false },
+        muted:          { type: 'boolean', default: false },
       });
       elation.events.add(window, 'popstate', elation.bind(this, this.handlePopstate));

@@ -87,6 +88,10 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
       });
       this.engine.systems.controls.activateContext('janus');

+      if (this.muted) {
+        this.mute();
+      }
+
       this.network = elation.janusweb.multiplayermanager({
         janusweb: this,
         server: this.server,
@@ -400,7 +405,7 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
       }
     }
     this.mute = function(ev) {
-      if (ev.value == 1) {
+      if (!ev || ev.value == 1) {
         this.engine.systems.sound.toggleMute();
       }
     }

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

-- Response ended

-- Page fetched on Sun Jun 2 15:20:55 2024