|
|
@@ -3002,7 +3002,15 @@ document.addEventListener("DOMContentLoaded", () => { |
|
|
|
|
|
|
|
|
unitSelector.addEventListener("input", selectNewUnit); |
|
|
unitSelector.addEventListener("input", selectNewUnit); |
|
|
|
|
|
|
|
|
param = new URL(window.location.href).searchParams.get("scene"); |
|
|
|
|
|
|
|
|
param = window.location.hash; |
|
|
|
|
|
|
|
|
|
|
|
// we now use the fragment for links, but we should still support old stuff: |
|
|
|
|
|
|
|
|
|
|
|
if (param.length > 0) { |
|
|
|
|
|
param = param.substring(1); |
|
|
|
|
|
} else { |
|
|
|
|
|
param = new URL(window.location.href).searchParams.get("scene"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
document.querySelector("#world").addEventListener("mousedown", e => { |
|
|
document.querySelector("#world").addEventListener("mousedown", e => { |
|
|
// only middle mouse clicks |
|
|
// only middle mouse clicks |
|
|
@@ -4418,7 +4426,7 @@ function b64DecodeUnicode(str) { |
|
|
|
|
|
|
|
|
function linkScene() { |
|
|
function linkScene() { |
|
|
loc = new URL(window.location); |
|
|
loc = new URL(window.location); |
|
|
const link = loc.protocol + "//" + loc.host + loc.pathname + "?scene=" + b64EncodeUnicode(JSON.stringify(exportScene())); |
|
|
|
|
|
|
|
|
const link = loc.protocol + "//" + loc.host + loc.pathname + "#" + b64EncodeUnicode(JSON.stringify(exportScene())); |
|
|
window.history.replaceState(null, "Macrovision", link); |
|
|
window.history.replaceState(null, "Macrovision", link); |
|
|
try { |
|
|
try { |
|
|
navigator.clipboard.writeText(link); |
|
|
navigator.clipboard.writeText(link); |
|
|
|