-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working on invites, doing some refactoring and testing as well
- Loading branch information
1 parent
20bb5bc
commit fe54bd8
Showing
11 changed files
with
250 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
<html> | ||
|
||
<head> | ||
<title> | ||
Invite | ||
</title> | ||
</head> | ||
|
||
<body> | ||
|
||
<script src="js/sha.js"></script> | ||
<script src="js/jquery.js"></script> | ||
|
||
<script src="js/fairywren.js"></script> | ||
<script src="js/invite.js"></script> | ||
|
||
<link rel="stylesheet" type="text/css" href="torrents.css"> | ||
|
||
<div id="main" align="center"> | ||
|
||
<div id="message" style="color:red;"> | ||
|
||
</div> | ||
|
||
<div class="contentBox" style="text-align:center; align:center;width:26em;min-width:23em;"> | ||
<div class="contentBoxHeader" style="align:center;">Register</div> | ||
<form> | ||
<label for="username">Username:</label> <input id="username" type="text" size="24"/><br /> | ||
<label for="password">Password:</label> <input id="password0" type="password" size="24"/> <br /> | ||
<label for="password">Confirm Password:</label> <input id="password1" type="password" size="24"/> <br /> | ||
<input id="register" type="submit" value="Register" onclick="Fairywren.register(); return false;"/> | ||
</form> | ||
</div> | ||
|
||
</div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
$(document).ready(function(){ | ||
var hash = window.location.hash; | ||
|
||
var registerButton = $("input#register"); | ||
|
||
if(hash.length === 0) | ||
{ | ||
//User got here on accident or something. Display error message | ||
//and depart | ||
} | ||
|
||
var inviteHref = hash.slice(1); | ||
|
||
//Retrieve the invite, check to see if it is valid | ||
jQuery.get(inviteHref). | ||
done( | ||
function(data) | ||
{ | ||
//Check to see if it has been claimed | ||
|
||
|
||
} | ||
).fail(function(jqXhr,textStatus,errorThrown) | ||
{ | ||
Fairywren.serverErrorHandler(jqXhr,textStatus,errorThrown,$("#message")); | ||
|
||
}); | ||
|
||
}); | ||
|
||
Fairywren.register = function() | ||
{ | ||
var errDisplay = $("#message"); | ||
errDisplay.text(''); | ||
var username = $("input#username"); | ||
|
||
var validUsername = Fairywren.validateUsername(username.val()); | ||
|
||
if(validUsername !== null) | ||
{ | ||
errDisplay.text(validUsername); | ||
return; | ||
} | ||
|
||
var password0 = $("input#password0"); | ||
var password1 = $("input#password1"); | ||
|
||
|
||
var validPassword = Fairywren.validatePassword(password0.val()); | ||
if( validPassword !== null) | ||
{ | ||
errDisplay.text(validPassword); | ||
return; | ||
} | ||
|
||
if(password0.val() !== password1.val()) | ||
{ | ||
errDisplay.text("Password does not match"); | ||
return; | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.