Download script.js from thgrerf955/userwatch-admin-dashboard: direct link, hf CLI and curl.
- Browser
- Download file 1.87 kB
-
https://huggingface.co/spaces/thgrerf955/userwatch-admin-dashboard/resolve/main/script.js
- Command line
-
hf download hf://spaces/thgrerf955/userwatch-admin-dashboard/script.js
-
curl -L -o script.js https://huggingface.co/spaces/thgrerf955/userwatch-admin-dashboard/resolve/main/script.js
1.87 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Toggle user details | |
| document.querySelectorAll('h2').forEach(header => { | |
| header.addEventListener('click', function() { | |
| const details = this.parentElement.nextElementSibling; | |
| details.classList.toggle('active'); | |
| // Rotate icon if exists | |
| const icon = this.querySelector('i'); | |
| if (icon) { | |
| if (details.classList.contains('active')) { | |
| icon.style.transform = 'rotate(180deg)'; | |
| } else { | |
| icon.style.transform = 'rotate(0deg)'; | |
| } | |
| } | |
| }); | |
| }); | |
| // Action buttons functionality | |
| document.querySelectorAll('.action-ban').forEach(btn => { | |
| btn.addEventListener('click', function(e) { | |
| e.stopPropagation(); | |
| const username = this.closest('.flex').previousElementSibling.textContent; | |
| if (confirm(`Êtes-vous sûr de vouloir bannir ${username} ?`)) { | |
| alert(`${username} a été banni.`); | |
| } | |
| }); | |
| }); | |
| document.querySelectorAll('.action-suspend').forEach(btn => { | |
| btn.addEventListener('click', function(e) { | |
| e.stopPropagation(); | |
| const username = this.closest('.flex').previousElementSibling.textContent; | |
| if (confirm(`Êtes-vous sûr de vouloir suspendre ${username} ?`)) { | |
| alert(`${username} a été suspendu.`); | |
| } | |
| }); | |
| }); | |
| document.querySelectorAll('.action-view').forEach(btn => { | |
| btn.addEventListener('click', function(e) { | |
| e.stopPropagation(); | |
| const username = this.closest('.flex').previousElementSibling.textContent; | |
| alert(`Ouverture des messages privés de ${username}`); | |
| }); | |
| }); | |
| }); |