Filter des Dropdowns angepasst
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// ==UserScript==
|
||||
// @name academyFIVE::AddSelectBox
|
||||
// @namespace dakp/academyfive
|
||||
// @version 2026.04.001
|
||||
// @description Füge Selectbox für Kohorten hinzu
|
||||
// @version 2026.04.002
|
||||
// @description Füge Selectbox für Kohorten/Planungsgruppen hinzu
|
||||
// @author Dims Akpan
|
||||
// @match https://a5.fhdw-hannover.de/*
|
||||
// @match https://a5.fhdw.de/*
|
||||
@@ -15,20 +15,29 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function getDropdownSelector() {
|
||||
const url = window.location.href;
|
||||
if (url.includes('/course/planning-group/list')) {
|
||||
return 'select[name="cohort-ids[]"]';
|
||||
}
|
||||
if (url.includes('/course/list')) {
|
||||
return 'select[name="planningGroupIds[]"]';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function addSelectButtons() {
|
||||
// Prüfe ob wir auf der richtigen Seite sind
|
||||
if (!window.location.href.includes('/course/list') && !window.location.href.includes('/course/planning-group/list')) {
|
||||
const selector = getDropdownSelector();
|
||||
if (!selector) return;
|
||||
|
||||
const dropdown = document.querySelector(selector);
|
||||
|
||||
if (!dropdown) {
|
||||
console.log('Dropdown nicht gefunden:', selector);
|
||||
return;
|
||||
}
|
||||
|
||||
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 dropdownContainer = dropdown.closest('.btn-group.bootstrap-select');
|
||||
const searchBox = dropdownContainer?.querySelector('.bs-searchbox');
|
||||
|
||||
if (!searchBox) {
|
||||
@@ -41,7 +50,7 @@
|
||||
console.log('Select/Deselect Buttons bereits vorhanden');
|
||||
return;
|
||||
}
|
||||
// Füge die Buttons hinzu
|
||||
|
||||
const actionsBox = document.createElement('div');
|
||||
actionsBox.className = 'bs-actionsbox';
|
||||
actionsBox.innerHTML = `
|
||||
|
||||
Reference in New Issue
Block a user