Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (63 sloc) 3.02 KB
<link rel="canonical" href="/login/"/>
<div id="questions">
<script src=""></script>
<script src=""></script>
<meta name="google-signin-client_id"
<script src="" async defer></script>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<script type="text/javascript">
var rootUrl = "";
function onSignIn(googleUser) {
var profile = googleUser.getAuthResponse();
var queryUrl = rootUrl + "?email=" + googleUser.getBasicProfile().getEmail();
$.get(queryUrl).then(function (x) {
if (x === false) {
$("#reg_form").css("display", "block");
} else if ("id" in x) {
$.cookie("af_id",, {path: '/', expires: 100});
$.cookie("af_name",, {path: '/', expires: 100});
$('#login_welcome a').attr("href", "/player/?id=" +;
$('#welcome-user, #log-in').attr("href", "/player/?id=" +;
$('#login_welcome').css("display", "block");
<div style="display:none" id="login_welcome">
<p>Welcome, <a href="" id="welcome-user"></a></p>
<p>We're still developing the software, so new profiles don't appear to be working just yet.</p>
<form style="display:none" id="reg_form" method="post" enctype="multipart/form-data"
<h2>Register account</h2>
Your user ID:
<input type="text" name="id" placeholder="3 or more a-z characters, e.g. drakas" pattern="[a-z]{3,}"/>
Your username:
<input type="text" name="name"
placeholder="Simple name, can be capitalised, 3 or more a-z characters, e.g. Drakas"
In-game nickname:
<input type="text" name="nickname" placeholder="In-game nickname, e.g. w00p|Drakas" pattern="[^\s]+{3,}"/>
<input type="hidden" name="token" id="token"/>
<input type="hidden" name="redirect" value="true"/>
<button type="submit">Submit it</button>
<script type="text/javascript">
function sub_me() {
$.post(rootUrl, $('#reg_form').serialize()).then(function (x) {
console.log("Got it", x);