mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Started refactoring
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,22 +1,21 @@
|
||||
$(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");
|
||||
}
|
||||
if(window.location.hash == "#failed") {
|
||||
window.location.hash = "";
|
||||
Materialize.toast("Couldn't find a user with that username or password..", 4000, "red lighten");
|
||||
}
|
||||
window.addEventListener("DOMContentLoaded", function() {
|
||||
document.getElementById("login_button").addEventListener("click", function(event) {
|
||||
this.preventDefault();
|
||||
document.querySelector("#login_form").submit();
|
||||
});
|
||||
|
||||
|
||||
$(document).on("submit", "#login_form", function(e){
|
||||
document.getElementById("login_form").addEventListener("submit", function(event) {
|
||||
if(this.password.value == "" || this.username.value == ""){
|
||||
e.preventDefault();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
if(window.location.pathname == "/signup/" || window.location.pathname == "/signup"){
|
||||
document.querySelector("#login_form").insertAdjacentHTML("afterbegin", "<input type='text' name='token' placeholder='Token' required autocomplete='off' />");
|
||||
document.querySelector("#login_form").setAttribute("action", "/signup");
|
||||
}
|
||||
if(window.location.hash == "#failed") {
|
||||
window.location.hash = "";
|
||||
M.toast({ html: "Couldn't find a user with that username or password..", displayLength: 4000, classes: "red lighten"});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,19 +15,14 @@
|
||||
<meta property="og:description" content="Zoff admin panel">
|
||||
<meta property="og:type" content="website">
|
||||
<link rel="icon" id="favicon" type="image/png" href="https://zoff.me/assets/images/favicon.png">
|
||||
<script
|
||||
src="https://code.jquery.com/jquery-2.2.4.min.js"
|
||||
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
|
||||
crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/css/materialize.min.css">
|
||||
|
||||
<!-- Compiled and minified JavaScript -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/js/materialize.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://zoff.me/assets/css/style.css" title="Default" />
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.0/socket.io.slim.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/{{{where_get}}}/js/main.js"></script>
|
||||
<style>
|
||||
.preloader-wrapper {
|
||||
margin-top:15%;
|
||||
@@ -66,5 +61,6 @@
|
||||
</head>
|
||||
<body>
|
||||
{{{body}}}
|
||||
<script type="text/javascript" src="/assets/admin/{{{where_get}}}/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user