Updatweb
This commit is contained in:
40
website/admin/test-logout-click.html
Normal file
40
website/admin/test-logout-click.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Logout Click Test</title>
|
||||
<script src="/admin/js/auth.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing Logout Button Click</h1>
|
||||
<p>This page simulates the exact button setup from admin pages</p>
|
||||
|
||||
<button class="btn-logout" id="test1">Test Button 1 (class only)</button>
|
||||
<button class="btn-logout" onclick="logout()">Test Button 2 (with onclick)</button>
|
||||
<button data-logout id="test3">Test Button 3 (data attribute)</button>
|
||||
|
||||
<div id="results" style="margin-top: 20px; font-family: monospace;"></div>
|
||||
|
||||
<script>
|
||||
function log(msg) {
|
||||
const div = document.getElementById('results');
|
||||
div.innerHTML += msg + '<br>';
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
log('Page loaded');
|
||||
log('typeof window.logout: ' + typeof window.logout);
|
||||
|
||||
// Check if event listeners were attached
|
||||
setTimeout(() => {
|
||||
const buttons = document.querySelectorAll('.btn-logout, [data-logout]');
|
||||
log('Found ' + buttons.length + ' logout buttons');
|
||||
|
||||
buttons.forEach((btn, i) => {
|
||||
log('Button ' + (i+1) + ': ' + btn.outerHTML);
|
||||
});
|
||||
}, 500);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user