diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-09-16 23:52:59 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-09-16 23:52:59 (GMT) |
commit | 83335d60815eb622e82edec9f9c042b036af0b55 (patch) | |
tree | 8e7551a492314ab98ccc5b4b079887c91cb41f73 | |
parent | 4e25ed2e6ff1c1fb13e03fdf2db5b90e6d70257e (diff) |
requesting authtoken works now
-rw-r--r-- | index.html | 34 |
1 files changed, 23 insertions, 11 deletions
@@ -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> |