var playerId = "HomelessKevin.2452";var playerHash = "4fd85b722b59786ec959ad3546aaa514";var wallId = 0;var gameTitle = "Today's Wall";
//
$(document).ready(function(){
$("#SuccessAlert").hide();
$("#ErrorAlert").hide();
$("#DateToday").text(gameTitle);
$("#PlayerId").text(playerId);
$("#CopyLink").attr("href", "playas.php?player="+playerId+"&hash="+playerHash);
$("").attr("id", "EmailAddress")
.attr("type", "text")
.attr("class", "form-control")
.attr("placeholder", "Your email address")
.attr("aria-label", "Your email address")
.attr("aria-describedby", "SendEmail")
.appendTo("#DynamicForm");
$("").attr("id", "SendEmail")
.attr("type", "button")
.attr("class", "btn btn-outline-secondary")
.text("Send Email")
.appendTo("#DynamicForm");
$("#SendEmail").click(function(){
$("#SuccessAlert").hide();
$("#ErrorAlert").hide();
var email = $("#EmailAddress").val();
if (email != "") {
$("#SendEmail").prop('disabled', true);
$.post( "request_email.php", { name: playerId, playerHash: playerHash, email: encodeURIComponent(email) }).done(function( data ) {
if (data=="ok") {
$("#SuccessAlertMessage").html("The user link email has been sent to your address. If you do not see the email shortly, please check your junk or spam folder or settings. The email will be from noreply@thepuzzlewall.co.uk");
$("#SuccessAlert").show();
}
else {
$("#ErrorAlertMessage").html(data);
$("#ErrorAlert").show();
}
$("#SendEmail").prop('disabled', false);
});
}
});
});