diff options
author | luxagraf <sng@luxagraf.net> | 2023-07-19 16:09:08 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-07-19 16:09:08 -0500 |
commit | 54f9e8a401c95dfee97a78efce69aa1f74fc96de (patch) | |
tree | 637c76f3ad2f20630ae68b953b51ff58807b608e | |
parent | fa6cb45333d3c597893ed3d1809038d3363bdef4 (diff) |
posts: simplified URL param script
-rw-r--r-- | app/posts/templates/posts/note_form.html | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/app/posts/templates/posts/note_form.html b/app/posts/templates/posts/note_form.html index b9aa78f..43b2a06 100644 --- a/app/posts/templates/posts/note_form.html +++ b/app/posts/templates/posts/note_form.html @@ -16,21 +16,10 @@ {% endblock %} {% block js %} <script type="text/javascript"> -function GetURLParameter(sParam){ - var sPageURL = window.location.search.substring(1); - var sURLVariables = sPageURL.split('&'); - for (var i = 0; i < sURLVariables.length; i++) { - var sParameterName = sURLVariables[i].split('='); - if (sParameterName[0] == sParam) { - return sParameterName[1]; - } - } -}; let params = new URL(document.location).searchParams; -let title = params.get("title") let url = params.get("url") let description = params.get("description") -document.getElementById('id_title').value = title; +document.getElementById('id_title').value = params.get("title"); document.getElementById('id_url').value = url; document.getElementById('id_body_markdown').value = description; </script> |