From 0116b93f31170c18298addc8d0a166617ca6c5e6 Mon Sep 17 00:00:00 2001 From: Juan Carlos Ponce Campuzano <37394697+jcponce@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:24:58 +1000 Subject: [PATCH] ok --- 3d-plotter/index.html | 4 +++- 3d-plotter/main.js | 20 +++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/3d-plotter/index.html b/3d-plotter/index.html index f745f3c..5a0a355 100644 --- a/3d-plotter/index.html +++ b/3d-plotter/index.html @@ -142,9 +142,11 @@
-
+
diff --git a/3d-plotter/main.js b/3d-plotter/main.js index 27840e8..afe1796 100644 --- a/3d-plotter/main.js +++ b/3d-plotter/main.js @@ -55,12 +55,7 @@ function initEquation() { } }); - $("#createLink").click(function () { - var search = "?equation=" + encodeURIComponent(graph.currEquation); - var url = location.href.split("?")[0] + search; - prompt("Use this URL to shere or save the current equation.", url); - }); function update() { const equation = equationInput.val(); @@ -588,21 +583,12 @@ function animate() { requestAnimationFrame(animate); }; -//function readURLParms() { -// var hash = decodeURIComponent(location.hash.substring(1)); //"substr" is deprecated -// if (hash.length > 1) $("#equations").val(hash); -//} - function readURLParms() { - location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { - value = decodeURIComponent(value); - if (key == "equation") { - graph.currEquation = value; - $("#equations").val(value); - } - }); + var hash = decodeURIComponent(location.hash.substring(1)); //"substr" is deprecated + if (hash.length > 1) $("#equations").val(hash); } + $(window).resize(onResize); window.onerror = function (message, src, line, col, err) {