Files
zoff/server/public/assets/admin/not_authenticated/js/main.js
Kasper Rynning-Tønnesen 01a42c7d68 Added adminpanel to this repo
2018-02-05 19:46:03 +01:00

19 lines
547 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$(document).on("click", "#login_button", function(e){
e.preventDefault();
$("#login_form").submit();
})
$(document).ready(function(){
if(window.location.pathname == "/signup/" || window.location.pathname == "/signup"){
$("#login_form").prepend("<input type='text' name='token' placeholder='Token' required autocomplete='off' />");
$("#login_form").attr("action", "/signup");
}
});
$(document).on("submit", "#login_form", function(e){
if(this.password.value == "" || this.username.value == ""){
e.preventDefault();
}
})