Commit 2319b139 authored by Tobias Zeumer's avatar Tobias Zeumer
Browse files

WebSMM v0.2

parent 16371a2d
// ==UserScript==
// @name LBS WebSMM-Widdewiddewitt-Mode
// @name LBS WebSMM: Widdewiddewitt-Mode
// @namespace https://collaborating.tuhh.de/tobias.zeumer/Tampermonkey/
// @version 0.0.1
// @version 0.0.2
// @updateURL https://collaborating.tuhh.de/tobias.zeumer/Tampermonkey/raw/master/tub/lbs/WebSMM.user.js
// @description Seit LBS 2.11.4 läuft das SMM via Webinterface - Handling verbessern
// @author Tobias Zeumer
......@@ -13,23 +13,40 @@
(function() {
'use strict';
// Anpassungen nach Adresse (vielleicht später mehr)
if (location.href.search('administration/users')) {
// Sort Select menus numerically
let selectMitarbeiter = document.getElementById('user_num');
sortNodesByNumber(selectMitarbeiter);
}
else if (location.href.search('ous/regulations/')) {
// Sort Ausleihreglements alphabetically
let selectTabelle = document.getElementById('parameter_id');
sortNodesAlphabetically(selectTabelle);
}
else if (location.href.search('/forms/')) {
// Sort Select menus alphabetically
let selectFormulare = document.getElementById('formnr');
sortNodesAlphabetically(selectFormulare);
}
// Könnte man auch mit Tampermonkey via @run-at document-end machen, aber wozu...
window.addEventListener("load", function () {
/*
// EVENTS: CLICK
document.addEventListener('click', function (event) {
if (event.target.matches('.blub, #bla')) {
...
}
}, true);
// EVENTS: CHANGE
document.addEventListener('change', function (event) {
if (event.target.matches('.blub, #bla')) {
user_conditions.call(event.target);
}
}, true);
*/
// EVENTS: FOCUS
document.addEventListener('focus', function (event) {
// Mitarbeiter-Select sortieren (nach Kennungen/Nummern) [administration/users]
if (event.target.matches('#user_num')) {
sortNodesAlphabetically(event.target);
}
// Ausleihreglements [ous/regulations] und Formulare [forms] alphabetisch sortieren
if (event.target.matches('#parameter_id, #formnr')) {
sortNodesByNumber(event.target);
}
}, true);
});
/**
* Sort node's child elements by alphabet (as found); ES6 Syntax
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment