This commit is contained in:
Jonathan Bernard 2011-04-10 17:20:43 -05:00
commit d0aab2d0c6
12 changed files with 71 additions and 12 deletions

View File

@ -4,6 +4,8 @@ TEST_MODS = $(wildcard test/*.erl)
TEST_BEAMS = $(TEST_MODS:test/%.erl=test/%.beam)
TS_ROOT=/usr/lib/yaws/jdb-labs/timestamper
default: compile
all : compile test
compile : $(BEAMS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@
start() ->
ok = application:load(mnesia),
ok = application:set_env(mnesia, dir, "/usr/lib/yaws"),
ok = application:set_env(mnesia, dir, "/home/jdbernard/projects/timestamper/web-app/db/test"),
ok = mnesia:start(),
error_logger:info_report("TimeStampter app started."),
ok.

View File

@ -16,11 +16,10 @@ joe_user() -> #ts_user{username=joeuser, name="Joe User", pwd="ohmy",
% ======== TESTS ======== %
new_delete_test_() ->
%new_delete_test_() ->
% test data
JoeUser = joe_user(),
{setup, fun setup/0, fun cleanup/1, {inorder, [
?_test(new(JoeUser)),
?_test(lookup(JoeUser#ts_user.username, JoeUser)),
%JoeUser = joe_user(),
%{setup, fun setup/0, fun cleanup/1, {inorder, [
% ?_test(new(JoeUser)),
% ?_test(lookup(JoeUser#ts_user.username, JoeUser)),

View File

@ -241,8 +241,6 @@ body {
#login-dialog {
font-size: small; }
#login-dialog label, #login-dialog input {
display: block; }
#login-dialog input.text {
margin-bottom: 1em;
width: 95%;
@ -256,3 +254,9 @@ body {
#ui-dialog-title-login-dialog, .ui-dialog-buttonset {
font-size: medium; }
.signup {
display: none; }
#signup-checkbox {
display: inline; }

View File

@ -307,7 +307,7 @@ body {
#login-dialog {
font-size: small;
label, input { display: block }
//label, input { display: block }
input.text {
margin-bottom: 1em;
width: 95%;
@ -324,3 +324,7 @@ body {
#ui-dialog-title-login-dialog, .ui-dialog-buttonset {
font-size: medium;
}
.signup { display: none; }
#signup-checkbox { display: inline; }

View File

@ -7,8 +7,15 @@
<link rel="stylesheet" media="screen" href="/css/ts-screen.css" type="text/css"/>
<!-- Needed for IE, but I'm not going to support IE with this tool. -->
<!--<script type="text/javascript" src="/js/json2.js"></script>-->
<!-- PROD -->
<!--
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
-->
<!-- DEV -->
<script type="text/javascript" src="/js/jquery-1.5.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.10.custom.min.js"></script>
<script type="text/javascript" src="/js/underscore-min.js"></script>
<script type="text/javascript" src="/js/ICanHaz.js"></script>
<script type="text/javascript" src="/js/ts.js"></script>
@ -168,9 +175,28 @@
<label for="login-name">Username:</label>
<input type="text" name="login-name" id="login-name"
class="text ui-widget-content ui-corner-all"></input>
<div class="signup">
<label for="signup-fullname">Full name:</label>
<input type="text" name="signup-fullname" id="signup-fullname"
class="text ui-widget-content ui-corner-all"></input>
<label for="signup-email">eMail address:</label>
<input type="text" name="signup-email" id="signup-email"
class="text ui-widget-content ui-corner-all"></input>
</div>
<label for="login-password">Password:</label>
<input type="password" name="login-password" id="login-password"
class="text ui-widget-content ui-corner-all"></input>
<div class="signup">
<label for="confirm-password">Confirm password:</label>
<input type="password" name="confirm-password" id="confirm-password"
class="text ui-widget-content ui-corner-all"></input>
</div>
<label for="signup-checkbox">
<input type="checkbox" id="signup-checkbox" name="signup-checkbox"
onclick="toggleSignUp(event)"/>
I'm a new user!
</label>
</fieldset>
</form>

View File

@ -9,6 +9,8 @@ var moreEntriesbar;
var currentEntryOffset = 0;
var loadLength = 20;
var loginTop;
/* Setup after the document is ready for manipulation. */
$(document).ready(function(){
@ -22,7 +24,9 @@ $(document).ready(function(){
height: 300,
width: 300,
modal: true,
buttons: { Login: function(){login()} }
buttons: {
"Sign Up": function(){signup()},
Login: function(){login()} }
});
// TODO: add a hook to AJAX requests to check for 401 unauth
@ -73,6 +77,26 @@ function login() {
}});
}
function toggleSignUp(event) {
var signUpCB = $("#signup-checkbox");
if (signUpCB.attr("checked")) {
loginTop = $("#login-dialog").dialog("widget").offset().top;
$("#login-dialog").animate({height: 350}, 500);
$("#login-dialog").dialog("widget").animate({top: loginTop - 200}, 500);
$(".signup").slideDown("slow");
} else {
$("#login-dialog").animate({height: 180}, 500);
$("#login-dialog").dialog("widget").animate({top: loginTop}, 500);
$(".signup").slideUp("slow");
}
}
function signUp() {
}
/* End the current user session and expire any session credentials we
* have aquired. */
function logout(event) {

View File

@ -1,7 +1,7 @@
ebin_dir = /home/jdbernard/projects/timestamper/web-app/ebin
#include_dir = /home/jdbernard/projects/timestamper/web-app/src
runmod = timestamper
runmod = timestamper_dev
<server timestamper.jdb-labs-local>
port = 8000