Browse Source

Missed one

main
parent
commit
899cae39aa
Signed by: aayla GPG Key ID: 630A04EE35E56530
1 changed files with 0 additions and 42 deletions
  1. +0
    -42
      res/js/adminpanel.js

+ 0
- 42
res/js/adminpanel.js View File

@ -1,42 +0,0 @@
// Copyright (C) 2021 Aayla Semyonova
//
// This file is part of website.
//
// website is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// website is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with website. If not, see <http://www.gnu.org/licenses/>.
function redirectPost(url, data) {
// Function taken from StackOverflow answer
// https://stackoverflow.com/a/38445519
var form = document.createElement('form');
document.body.appendChild(form);
form.method = 'post';
form.action = url;
for (var name in data) {
var input = document.createElement('input');
input.type = 'hidden';
input.name = name;
input.value = data[name];
form.appendChild(input);
}
form.submit();
}
function select(location) {
// The user has selected a location to manage. Direct them there.
redirectPost('/admin/manage.php', { "selection": location });
}
window.onload = function() {
console.log("Admin panel JS loaded");
}

Loading…
Cancel
Save