Browse files

Got some cleaner login stuff working.

  • Loading branch information...
1 parent 9e3b352 commit 4d0b468e169e049a1abe3e942c1cd595877b4e17 @klnusbaum klnusbaum committed Sep 15, 2012
Showing with 16 additions and 10 deletions.
  1. +9 −6 popup.html
  2. +7 −4 popup.js
View
15 popup.html
@@ -35,11 +35,14 @@
</head>
<body>
- <h1>Sign in</h1>
- <label for="username">Username:</label><input type="text" id="username"/>
- <br/>
- <label for="password">Password:</label><input type="password" id="password"/>
- </br>
- <button id="loginbutton">Login</button>
+ <div id="login-page">
+ <h1>Sign in</h1>
+ <label for="username">Username:</label><input type="text" id="username"/>
+ <br/>
+ <label for="password">Password:</label><input type="password" id="password"/>
+ </br>
+ <button id="loginbutton">Login</button>
+ <p id="login_status"></p>
+ </div>
</body>
</html>
View
11 popup.js
@@ -20,17 +20,18 @@
$(document).ready(function(){
function doLogin(){
function loginSuccess(data){
- alert("Login awesome! " + data);
+ localStorage['ticket_hash'] = data['ticket_hash']
+ $("#login_status").html("Logged in!");
}
function loginError(jqXHR, textStatus, error){
- alert("Login error! \n" + textStatus + "\nError: " + error);
+ $("#login_status").html("Login Failed!");
}
var enteredUsername = $("#username").val();
var enteredPassword = $("#password").val();
-
- alert("Attempting login with: " + enteredUsername + " and password " + enteredPassword);
+
+ $("#login_status").html("Logging in...");
$.ajax({
type : 'POST',
url : "https://www.udjplayer.com/udj/0_6/auth",
@@ -41,5 +42,7 @@ $(document).ready(function(){
}
$("#loginbutton").click(doLogin)
+
+
});

0 comments on commit 4d0b468

Please sign in to comment.