diff options
author | FChannel <> | 2021-07-02 13:40:12 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-02 13:40:12 -0700 |
commit | 9bd4e03d926c045dc82ce844cb02b078843ce787 (patch) | |
tree | 79623ee401d67601239e910c7cdd70a830bea752 /static | |
parent | f3cc97e35c66e752ad4f0639dea8eaaecc94eba4 (diff) |
removed javascript for post validation because it broke board creation
Diffstat (limited to 'static')
-rw-r--r-- | static/admin.html | 2 | ||||
-rw-r--r-- | static/main.html | 31 |
2 files changed, 1 insertions, 32 deletions
diff --git a/static/admin.html b/static/admin.html index a4c61c1..f238ec0 100644 --- a/static/admin.html +++ b/static/admin.html @@ -6,7 +6,7 @@ <body> <div style="margin: 0 auto; width: 400px;"> <h3>Add Board</h3> - <form id="new-post" action="/{{ .Key }}/addboard" method="post" enctype="application/x-www-form-urlencoded"> + <form id="new-board" action="/{{ .Key }}/addboard" method="post" enctype="application/x-www-form-urlencoded"> <label>Name:</label><br> <input type="text" name="name" placeholder="g" required><br> <label>Prefered Name:</label><br> diff --git a/static/main.html b/static/main.html index af9947f..70e3c23 100644 --- a/static/main.html +++ b/static/main.html @@ -8,37 +8,6 @@ <meta property="og:locale" content="en_US" /> <meta property="og:type" content="website" /> <link rel="icon" type="image/png" href="/static/favicon.png"> - <script> - window.addEventListener('DOMContentLoaded', function(){ - var np = document.getElementById("new-post") - if(np){ - np.setAttribute("onsubmit", "validatePost(this);return false;") - } - var np = document.getElementById("reply-post") - if(np){ - np.setAttribute("onsubmit", "validatePost(this);return false;") - } - var np = document.getElementById("report-post") - if(np){ - np.setAttribute("onsubmit", "validatePost(this);return false;") - } - }) - function validatePost(form) - { - var data = new FormData(form) - fetch(form.action, { - method: "POST", - body: data - }).then((r) => { - if(r.redirected){ - document.location = r.url - } else { - r.text().then((t) => {alert(t)}) - } - }) - return false - } - </script> <style> a, a:link, a:visited, a:hover, a:active { text-decoration: none |