summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-09-16 23:52:59 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-09-16 23:52:59 (GMT)
commit83335d60815eb622e82edec9f9c042b036af0b55 (patch)
tree8e7551a492314ab98ccc5b4b079887c91cb41f73 /index.html
parent4e25ed2e6ff1c1fb13e03fdf2db5b90e6d70257e (diff)
requesting authtoken works now
Diffstat (limited to 'index.html')
-rw-r--r--index.html34
1 files changed, 23 insertions, 11 deletions
diff --git a/index.html b/index.html
index bfa7ea7..8ebe537 100644
--- a/index.html
+++ b/index.html
@@ -2,25 +2,37 @@
<html>
<head>
<title>Radio Helsinki - Automation Import</title>
+ <meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/styles/import.css" />
<script src="/javascript/jquery/jquery.min.js"></script>
<script type="text/javascript">
- function authenticate()
+ function authSuccess(data) {
+ alert("username: " + data.username + "\ntoken: " + data.token );
+ }
+
+ function auth()
{
- alert("hello world");
+ $.get("/authtoken.json", authSuccess, "json");
}
+
+ $("#loginform").submit(function(event) {
+ auth()
+ event.preventDefault();
+ });
</script>
</head>
<body>
<h1>Radio Helsinki - Automation Import</h1>
- <p>
- <form onSubmit="authenticate()">
- <ul>
- <li><label for="name">Benutzername:</label> <input type="text" id="username" value=""> </li>
- <li> <label for="pass">Kennwort:</label> <input type="password" id="password" value=""> </li>
- <li> <input type="submit" value="Einloggen"> </li>
- </ul>
- </form>
- </p>
+ <form id="loginform">
+ <ul>
+ <li> <label for="name">Benutzername:</label> <input type="text" id="username" value=""> </li>
+ <li> <label for="pass">Kennwort:</label> <input type="password" id="password" value=""> </li>
+ <li> <input type="submit" value="Einloggen"> </li>
+ </ul>
+ </form>
+
+ <script type="text/javascript">
+ $("#loginform").submit(function(event) { auth(); event.preventDefault(); });
+ </script>
</body>
</html>