-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhospital_filter.user.js
44 lines (39 loc) · 1.43 KB
/
hospital_filter.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ==UserScript==
// @name hospital filter
// @version 1.0
// @description
// @author Nzxtime
// @include *://www.leitstellenspiel.de/
// @include *://www.leitstellenspiel.de/*
// @include *://www.missionchief.com/*
// @include *://www.missionchief.com/
// @include *://www.meldkamerspel.com/*
// @include *://www.meldkamerspel.com/
// @grant none
// ==/UserScript==
(function ($) {
'use strict';
function filter() {
$('.col-md-9 tbody > tr').each(function () {
var el = $(this);
var beds = parseInt(el.find('td:nth-child(3)').text().trim());
var duty = el.find('td:nth-child(4)').text().trim();
console.log(duty);
var maxDuty = "40";
var elegible = ((el.find(':nth-child(4)').text()
.trim().indexOf('%') === -1) ? el.find(
'td:nth-child(4)').text() : el.find(
':nth-child(5)').text()).trim() === "Ja";
if (beds < 1 || !elegible || (!(duty.charAt(0) <= maxDuty.charAt(0)) && !(duty === "Ja"))) {
el.hide();
} else {
el.show();
}
if(arrow === "↓") el.show();
});
}
var sprechwunsch = $('#h2_sprechwunsch');
if (sprechwunsch.length > 0 && sprechwunsch.parent().text().indexOf("Krankenhaus") > 0) {
filter();
}
})(jQuery);