repo: janusweb action: commit revision: path_from: revision_from: 8bcd8e2637b49238e0782964f216f6feb0c4596b: path_to: revision_to:
commit 8bcd8e2637b49238e0782964f216f6feb0c4596b Author: James BaicoianuDate: Mon May 27 13:33:08 2024 -0700 Improved URL hash handling logic diff --git a/scripts/janusweb.js b/scripts/janusweb.js
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -485,9 +485,22 @@ elation.require([
var hashurl = hashargs['janus.url'];
if (hashurl && hashurl != this.properties.url && !this.loading) {
this.setActiveRoom(hashurl, this.currentroom.url, true);
- } else if (!hashurl && this.properties.url != this.homepage && !document.location.hash) {
+ } else if (!hashurl && this.properties.url != this.homepage) { // && !document.location.hash) {
this.setActiveRoom(this.homepage);
}
+ if (document.location.hash && document.location.hash.substr(1) in room.objects) {
+ let jumpto = room.objects[document.location.hash.substr(1)];
+ if (typeof jumpto.activate == 'function') {
+ jumpto.activate();
+ } else if (typeof jumpto.navigate == 'function') {
+ jumpto.navigate();
+ } else {
+ player.pos = jumpto.pos;
+ player.xdir.copy(jumpto.xdir);
+ player.ydir.copy(jumpto.ydir);
+ player.zdir.copy(jumpto.zdir);
+ }
+ }
}
}
-----END OF PAGE-----