Skip to content

Commit ae30580

Browse files
authored
Update trainingMouseProtector.user.js
1 parent f9b1635 commit ae30580

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/trainingMouseProtector.user.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name [LSS] Training Mouse Protector
33
// @name:de [LSS] Ausbildungs-Mausschoner
44
// @namespace https://jxn.lss-manager.de
5-
// @version 2025.07.23+1453
5+
// @version 2025.08.13+1655
66
// @author Jan (jxn_30)
77
// @description Protects your mouse by reducing the amount of unnecessary clicks to train much staff.
88
// @description:de Schützt deine Maus, indem die Anzahl der unnötigen Klicks reduziert wird, um viel Personal auszubilden.
@@ -324,10 +324,12 @@ const setRoomSelection = schools => {
324324
};
325325

326326
const eduField = form.elements.education_select;
327-
const getTrainingDuration = () => {
328-
const parts = (eduField.value || '').split(':');
329-
return parseInt(parts[1] || '0', 10);
330-
};
327+
const getTrainingDuration = () =>
328+
parseInt(
329+
eduField
330+
.querySelector('option:checked')
331+
?.textContent?.match(/(?<=\()\d+(?=\s*.*?\)$)/)?.[0] ?? '0'
332+
);
331333

332334
const confirmDialogId = 'jxn-training_mouse-protector_confirm-dialog';
333335

0 commit comments

Comments
 (0)