-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (39 loc) · 1.58 KB
/
index.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
45
46
47
48
49
(() => {
let searchText = "";
function loop() {
patch();
setTimeout(() => {
loop()
}, 1000)
}
loop();
function patch() {
const $ = window.$;
if ($) {
$serchContainer = $("#agep-search-container");
if ($serchContainer.length === 0) {
$('body').append("<div id='agep-search-container' style='position:fixed;background-color:lightgray;top:0;left:0;'>" +
"<label for='agep-search'>Filter Activities</label>" +
"<input type='text' id='agep-search'/>" +
"<button id='agep-submit'>filter</button>" +
"<button id='agep-clear'>clear</button>" +
"</div>");
$('#agep-submit').click(() => {
searchText = $('#agep-search').val()
});
$('#agep-clear').click(() => {
searchText = '';
$('#agep-search').val('')
})
}
$contents = $('iframe').contents();
const $activityTable = $contents.find("[columnlist='.ActivityID .ActivityName .internalName ']");
if (searchText) {
$activityTable.find('tr.cellCont:not(:has(span:contains(' + searchText + ')))').css("display", "none");
$activityTable.find('tr.cellCont:has(span:contains(' + searchText + '))').css("display", "table-row");
} else {
$activityTable.find('tr.cellCont').css("display", "table-row");
}
}
}
})();