Spaces:
Running
Running
Download script.js from Amamia/grademaster-pro: direct link, hf CLI and curl.
- Browser
- Download file 2.41 kB
-
https://huggingface.co/spaces/Amamia/grademaster-pro/resolve/main/script.js
- Command line
-
hf download hf://spaces/Amamia/grademaster-pro/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Amamia/grademaster-pro/resolve/main/script.js
2.41 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize tooltips | |
| const tooltipElements = document.querySelectorAll('[data-tooltip]'); | |
| // Add event listeners for table actions | |
| const editButtons = document.querySelectorAll('button:contains("Изменить")'); | |
| const deleteButtons = document.querySelectorAll('button:contains("Удалить")'); | |
| editButtons.forEach(button => { | |
| button.addEventListener('click', function() { | |
| const studentName = this.closest('tr').querySelector('td:first-child div.text-sm.font-medium').textContent; | |
| console.log(`Редактирование студента: ${studentName}`); | |
| // Here would be the edit functionality | |
| }); | |
| }); | |
| deleteButtons.forEach(button => { | |
| button.addEventListener('click', function() { | |
| const studentName = this.closest('tr').querySelector('td:first-child div.text-sm.font-medium').textContent; | |
| if (confirm(`Вы уверены, что хотите удалить студента ${studentName}?`)) { | |
| console.log(`Удаление студента: ${studentName}`); | |
| // Here would be the delete functionality | |
| } | |
| }); | |
| }); | |
| // Pagination functionality | |
| const paginationButtons = document.querySelectorAll('[aria-label="Pagination"] button'); | |
| paginationButtons.forEach(button => { | |
| button.addEventListener('click', function() { | |
| if (!this.hasAttribute('aria-current')) { | |
| // Here would be pagination logic | |
| console.log(`Переход на страницу ${this.textContent.trim()}`); | |
| } | |
| }); | |
| }); | |
| // Export button functionality | |
| const exportButton = document.querySelector('button:contains("Экспорт")'); | |
| if (exportButton) { | |
| exportButton.addEventListener('click', function() { | |
| console.log('Экспорт данных'); | |
| // Here would be export functionality | |
| }); | |
| } | |
| // Filter button functionality | |
| const filterButton = document.querySelector('button:contains("Фильтр")'); | |
| if (filterButton) { | |
| filterButton.addEventListener('click', function() { | |
| console.log('Открытие фильтров'); | |
| // Here would be filter functionality | |
| }); | |
| } | |
| }); |