clean up logout script

This commit is contained in:
Benjamin Bärthlein
2020-04-27 21:21:54 +02:00
parent 3dee004b2d
commit dfba93a18d
2 changed files with 14 additions and 14 deletions
+12 -12
View File
@@ -54,7 +54,7 @@ $("button.add, button.edit").click(function () {
return false;
});
function logOut(){
$("#logout").click(function (){
try {
// This is for Firefox
$.ajax({
@@ -77,17 +77,7 @@ function logOut(){
document.location = "http://reset:reset@" + document.location.hostname + document.location.pathname;
}
}
}
function randomHash() {
let chars = "abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>ABCDEFGHIJKLMNOP1234567890";
let pass = "";
for (let x = 0; x < 32; x++) {
let i = Math.floor(Math.random() * chars.length);
pass += chars.charAt(i);
}
return pass;
}
});
$("button.copyToClipboard").click(function () {
let id;
@@ -103,6 +93,16 @@ $("button.copyToClipboard").click(function () {
document.execCommand("copy");
});
function randomHash() {
let chars = "abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>ABCDEFGHIJKLMNOP1234567890";
let pass = "";
for (let x = 0; x < 32; x++) {
let i = Math.floor(Math.random() * chars.length);
pass += chars.charAt(i);
}
return pass;
}
$("button.generateHash").click(function () {
let id;
if ($(this).hasClass('username')) {