diff options
Diffstat (limited to 'app/posts')
-rw-r--r-- | app/posts/templates/posts/note_form.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/posts/templates/posts/note_form.html b/app/posts/templates/posts/note_form.html index c3de7be..2f3ac15 100644 --- a/app/posts/templates/posts/note_form.html +++ b/app/posts/templates/posts/note_form.html @@ -15,4 +15,22 @@ </main> {% 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]; + } + } +}; +var title = GetURLParameter('title'); +var description = GetURLParameter('description'); +var url = GetURLParameter('url'); +document.getElementById('id_title').value = title; +document.getElementById('id_url').value = url; +document.getElementById('id_body_markdown').value = description; +</script> {% endblock%} |