Files
A5-Tampermonkey/academyFIVE__AddSelectBox.user.js
2025-11-25 09:58:36 +01:00

47 lines
1.8 KiB
JavaScript

// ==UserScript==
// @name academyFIVE::AddSelectBox
// @namespace dakp/academyfive
// @version 2025-11-24
// @description Füge Selectbox für Kohorten hinzu
// @author Dims Akpan
// @match https://a5.fhdw-hannover.de/course/planning-group/list*
// @match https://a5.fhdw.de/course/planning-group/list*
// @match https://fhdw.academyfive-preview.net/course/planning-group/list*
// @match https://fhdw-hannover.academyfive-preview.net/course/planning-group/list*
// @grant none
// @icon https://www.academyfive.com/typo3conf/ext/sitepackage/Resources/Public/build/assets/images/favicon-academyfive.ico
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load', function() {
const cohortsDropdown = document.querySelector('select[name="cohort-ids[]"]');
if (!cohortsDropdown) {
console.log('Kohorten-Dropdown nicht gefunden');
return;
}
const dropdownContainer = cohortsDropdown.closest('.btn-group.bootstrap-select');
const searchBox = dropdownContainer.querySelector('.bs-searchbox');
if (!searchBox) {
console.log('Searchbox nicht gefunden');
return;
}
const actionsBox = document.createElement('div');
actionsBox.className = 'bs-actionsbox';
actionsBox.innerHTML = `
<div class="btn-group btn-group-sm btn-block">
<button type="button" class="actions-btn bs-select-all btn btn-default">Alles auswählen</button>
<button type="button" class="actions-btn bs-deselect-all btn btn-default">Nichts auswählen</button>
</div>
`;
searchBox.insertAdjacentElement('afterend', actionsBox);
console.log('Select/Deselect Buttons erfolgreich eingefügt');
});
})();