Files
SkyArtShop/website/admin/test-logout-click.html
Local Server e4b3de4a46 Updatweb
2025-12-19 20:44:46 -06:00

41 lines
1.4 KiB
HTML

<!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>