aboutsummaryrefslogtreecommitdiff
path: root/t_idea
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-09 12:31:44 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-09 12:31:44 +0200
commitf63164d92fc06968d03e509e749e1df1a318a798 (patch)
tree729a92cc36d0fbf97f77e08ef1da6fa87e05dd28 /t_idea
parent01679e4633eac76ce43d9d07dfa57b2548c97cc5 (diff)
Add typescript code
- Migrated javascript to typescript for type safety and learning - created a tsconfig.json for frontendjavascript Note: We keep the javascript file because this makes it easier to deploy
Diffstat (limited to 't_idea')
-rw-r--r--t_idea/index.html20
1 files changed, 1 insertions, 19 deletions
diff --git a/t_idea/index.html b/t_idea/index.html
index 4b1d6c0..691f8be 100644
--- a/t_idea/index.html
+++ b/t_idea/index.html
@@ -7,9 +7,9 @@
<meta property="og:description" content="Ideez is an app that you can storm with ideas, hoping to facilitate plans and brainstorms."/>
<meta property="og:image" content="/static/favicon.ico" />
<link rel="stylesheet" href="/static/main.css">
+ <script src="/static/index.js" defer></script>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<title>Ideas</title>
-
</head>
<body>
{{ with .Error }}
@@ -41,22 +41,4 @@
{{ end }}
</ul>
</body>
- <script>
- let dels = document.querySelectorAll("form[action=\"/idea/delete/\"]");
- for (let el of dels) {
- el.addEventListener("submit", function(e) {
- e.preventDefault();
- if (confirm("are you sure?") === true) {
- this.submit();
- }
- })
- }
- let eels = document.querySelectorAll("button.edit");
- for (let el of eels) {
- el.onclick = function() {
- let title = el.getAttribute("data-title");
- location.href = "/idea/edit?t=" + title;
- }
- }
- </script>
</html>