Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion login/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,5 @@ th {
.csh-button {
font-size: 1.1em;
font-weight: normal;
}
}

2 changes: 1 addition & 1 deletion login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ <h1>Cardshifter login</h1>
<input name="disconnect_websocket" id="disconnect_websocket" type="button" value="Disconnect WebSocket" class="btn btn-danger" />
</div>
</form>
</div>
</div>
108 changes: 108 additions & 0 deletions login/login_alt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
Enter file contents here<!DOCTYPE html>
<html>

<head>
<title>Cardshifter Login</title>

<!-- Link external libraries for page design via CDN -->
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" rel="stylesheet" /> -->

<link rel="stylesheet" type="text/css" href="login.css">

<!-- load angular and angular route via CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js"></script>
<script src="script.js"></script>
</head>

<body>

<nav class="navbar navbar-inverse">
<div class="container-fluid">

<!-- BRAND -->
<div class="navbar-header">
<div class="navbar-brand csh-top-link">Cardshifter Login</div>
</div>

<form class="navbar-form navbar-left" role="search">

<!-- USER NAME -->
<div class="form-group">
<label for="username" style="color: #FFFFFF;" aria-label="Username">Username:</label>
<input name="username" id="username" type="text" class="form-control" placeholder="User name" />
</div>

<!-- SERVER -->
<div class="form-group">
<label for="server" style="color: #FFFFFF;" aria-label="Server">Server:</label>
<select name="server" id="server" class="form-control">
<option value="ws://127.0.0.1:4243">Local host</option>
<option value="ws://dwarftowers.com:4243">dwarftowers.com</option>
<option value="ws://echo.websocket.org/">WebSocket.org echo test</option>
<option value="other">Other...</option>
</select>
</div>
<div class="form-group">
<div id="server_other">
<label for="server_other_input">Other Server:</label>
<input name="server_other_input" id="server_other_input" type="text" class="form-control" />
</div>
</div>
<!-- BUTTONS -->
<div class="form-group">
<input name="submit" id="submit" type="button" value="Log in" class="btn btn-success btn-sm" />
<input name="disconnect_websocket" id="disconnect_websocket" type="button" value="Log Out" class="btn btn-danger btn-sm" />
<input name="test_websocket" id="test_websocket" type="button" value="Test Msg" class="btn btn-primary btn-sm" />
</div>

</form>
</div>
</nav>

<div class="col-sm-9 col-md-10 main csh-body" data-th-fragment="content">
<noscript>To play CardShifter, please either enable JavaScript or use a JavaScript-enabled browser.</noscript>

<!-- <h1>Cardshifter login</h1> -->
<form name="login_information" id="login_information" class="login-form">
<div class="form-group">
<label for="server" aria-label="Server">Server:</label>
<select name="server" id="server" class="form-control">
<option value="ws://127.0.0.1:4243">Local host</option>
<option value="ws://dwarftowers.com:4243">dwarftowers.com</option>
<option value="ws://echo.websocket.org/">WebSocket.org echo test</option>
<option value="other">Other...</option>
</select>
</div>
<div class="form-group">
<div id="server_other">
<label for="server_other_input">Other Server:</label>
<input name="server_other_input" id="server_other_input" type="text" class="form-control" />
</div>
</div>
<div class="form-group">
<label for="username">Username:</label>
<input name="username" id="username" type="text" class="form-control" placeholder="Enter name..." />
</div>
<!-- TODO: Remove `test_message` section once login works correctly -->
<div class="form-group">
<label for="test_message">Test message to server:</label>
<input name="test_message" id="test_message" type="text" size="100" class="form-control" placeholder="Optional... Leave

blank unless using for testing." />
</div>
<!-- END `test_messate` section -->
<div class="form-group">
<input name="submit" id="submit" type="button" value="Log in" class="btn btn-success" />
<input name="test_websocket" id="test_websocket" type="button" value="Test WebSocket" class="btn btn-primary" />
<input name="disconnect_websocket" id="disconnect_websocket" type="button" value="Disconnect WebSocket" class="btn btn-

danger" />
</div>
</form>
<script src="login.js"></script>
</div>
</body>

</html>
9 changes: 8 additions & 1 deletion login/login_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ CardshifterApp.controller("LoginController", function($scope) {

CardshifterServerAPI.init(finalServer, $scope.is_secure);
var login = new CardshifterServerAPI.messageTypes.LoginMessage($scope.username);
//CardshifterServerAPI.sendMessage(login);

// TODO: Need to find a way to make this work;
// As written it tries to sendMessage the instant that the socket is created, in which case the socket is not ready
/* try {
CardshifterServerAPI.sendMessage(login);
} catch (e) {
console.log(e);
}*/
}
});