mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Merge pull request #366 from zoff-music/refactor/jquery-less-admin
Refactor/jquery less admin
This commit is contained in:
@@ -32,6 +32,7 @@ app.set('view engine', 'handlebars');
|
||||
app.set('trust proxy', '127.0.0.1');
|
||||
app.enable('view cache');
|
||||
app.set('views', publicPath);
|
||||
app.use( bodyParser.json() ); // to support JSON-encoded bodies
|
||||
app.use(bodyParser.urlencoded({
|
||||
extended: true
|
||||
}));
|
||||
|
||||
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();
|
||||
})
|
||||
window.addEventListener("DOMContentLoaded", function() {
|
||||
document.getElementById("login_button").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
document.querySelector("#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");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(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"});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="api_keys" class="col s12">
|
||||
<div id="api_keys" class="col s12" style="display:none;">
|
||||
<div class="row header-api-fields">
|
||||
<div class="col s3">
|
||||
Name
|
||||
@@ -128,11 +128,11 @@
|
||||
<i class="material-icons check hide">check</i>
|
||||
<i class="material-icons uncheck hide">close</i>
|
||||
</div>
|
||||
<a href="#" class="btn waves-effect green col s1 update_api_token"><i class="material-icons check hide">check</i></a>
|
||||
<a href="#" class="btn waves-effect green col s1 update_api_token"><i class="material-icons check">check</i></a>
|
||||
<a href="#" class="btn waves-effect red col s1 delete_api_token">X</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="thumbnails" class="col s12">
|
||||
<div id="thumbnails" class="col s12" style="display:none;">
|
||||
<div class="row">
|
||||
<div class="input-field col s8 m10">
|
||||
<select id="remove_thumbnail">
|
||||
@@ -147,7 +147,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="descriptions" class="col s12">
|
||||
<div id="descriptions" class="col s12" style="display:none;">
|
||||
<div class="row">
|
||||
<div class="input-field col s8 m10">
|
||||
<select id="remove_description">
|
||||
@@ -162,7 +162,7 @@
|
||||
<div id="descriptions_cont" class="col s12">
|
||||
</div>
|
||||
</div>
|
||||
<div id="names" class="col s12">
|
||||
<div id="names" class="col s12" style="display:none;">
|
||||
<div class="row names-container">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>
|
||||
Zoff Admin
|
||||
@@ -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>
|
||||
<!-- Compiled and minified JavaScript -->
|
||||
<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%;
|
||||
@@ -63,8 +58,9 @@
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
</head>
|
||||
<body>
|
||||
{{{body}}}
|
||||
</body>
|
||||
<script type="text/javascript" src="/assets/admin/{{{where_get}}}/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user