1
|
|
|
/* |
2
|
|
|
* ***************************************************************************** |
3
|
|
|
* Contributions to this work were made on behalf of the GÉANT project, a |
4
|
|
|
* project that has received funding from the European Union’s Framework |
5
|
|
|
* Programme 7 under Grant Agreements No. 238875 (GN3) and No. 605243 (GN3plus), |
6
|
|
|
* Horizon 2020 research and innovation programme under Grant Agreements No. |
7
|
|
|
* 691567 (GN4-1) and No. 731122 (GN4-2). |
8
|
|
|
* On behalf of the aforementioned projects, GEANT Association is the sole owner |
9
|
|
|
* of the copyright in all material which was developed by a member of the GÉANT |
10
|
|
|
* project. GÉANT Vereniging (Association) is registered with the Chamber of |
11
|
|
|
* Commerce in Amsterdam with registration number 40535155 and operates in the |
12
|
|
|
* UK as a branch of GÉANT Vereniging. |
13
|
|
|
* |
14
|
|
|
* Registered office: Hoekenrode 3, 1102BR Amsterdam, The Netherlands. |
15
|
|
|
* UK branch address: City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK |
16
|
|
|
* |
17
|
|
|
* License: see the web/copyright.inc.php file in the file structure or |
18
|
|
|
* <base_url>/copyright.php after deploying the software |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
/* various jquery scripts for the NRO admin page */ |
22
|
|
|
|
23
|
|
|
function row_filter(tbody) { |
24
|
|
|
var linked = tbody.find('[id^="unlinked_ck_"]').is(':checked'); |
25
|
|
|
var broken_cert = tbody.find('[id^="brokencert_ck_"]').is(':checked'); |
26
|
|
|
var or_warn = tbody.find('[id^="or_ck_"]').is(':checked'); |
27
|
|
|
var profile_warn = tbody.find('[id^="profile_ck_"]').is(':checked'); |
28
|
|
|
var input = tbody.find('[id^="qsearch_"]').val().toLowerCase(); |
29
|
|
|
var tr_visible; |
30
|
|
|
var inp_found; |
31
|
|
|
tbody.children("tr.idp_tr").each(function() { |
32
|
|
|
tr_visible = true; |
33
|
|
|
if (linked && $(this).hasClass('linked')) { |
34
|
|
|
tr_visible = false; |
35
|
|
|
} |
36
|
|
|
if (tr_visible && broken_cert && $(this).hasClass('certok')) { |
37
|
|
|
tr_visible = false; |
38
|
|
|
} |
39
|
|
|
if (tr_visible && or_warn && $(this).hasClass('orok')) { |
40
|
|
|
tr_visible = false; |
41
|
|
|
} |
42
|
|
|
if (tr_visible && profile_warn && $(this).hasClass('profileok')) { |
43
|
|
|
tr_visible = false; |
44
|
|
|
} |
45
|
|
|
if (tr_visible && input !== '') { |
46
|
|
|
inp_found = $(this).find("span.inst_name:contains('"+input+"')").length; |
47
|
|
|
if (inp_found == 0) { |
|
|
|
|
48
|
|
|
tr_visible = false; |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
if (tr_visible) { |
52
|
|
|
$(this).show(); |
53
|
|
|
} else { |
54
|
|
|
$(this).hide(); |
55
|
|
|
} |
56
|
|
|
}); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
function filter_action() { |
60
|
|
|
var this_tbody = $(this).parent().parent().parent(); |
61
|
|
|
row_filter(this_tbody); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
$(document).ready(function() { |
65
|
|
|
// realm diagnostics |
66
|
|
|
$("#realmcheck").on('click', function() { |
67
|
|
|
event.preventDefault(); |
|
|
|
|
68
|
|
|
document.location.href = '../diag/diag.php?admin=1&sp=1&realm='; |
69
|
|
|
}); |
70
|
|
|
|
71
|
|
|
// this gets the maximum width of the Organisation column and then sets this to all |
72
|
|
|
// thanks to this the width does not change as we filter out some, possibly wide names |
73
|
|
|
var instTdWidth = 0; |
74
|
|
|
$("td.inst_td").each(function() { |
75
|
|
|
instTdWidth = Math.max(instTdWidth, $(this).width()); |
76
|
|
|
}); |
77
|
|
|
$("td.inst_td").width(instTdWidth); |
78
|
|
|
|
79
|
|
|
// show/hide download statistics part of the window |
80
|
|
|
$("button.stat-button").on('click', function() { |
81
|
|
|
var stat_downloads = $(this).siblings("table").find(".stat-downloads"); |
82
|
|
|
if (stat_downloads.is(":visible")) { |
83
|
|
|
stat_downloads.hide(); |
84
|
|
|
$(this).css('position', 'absolute'); |
85
|
|
|
$(this).text(show_downloads); |
|
|
|
|
86
|
|
|
} else { |
87
|
|
|
stat_downloads.show(); |
88
|
|
|
$(this).css('position', 'static'); |
89
|
|
|
$(this).text(hide_downloads); |
|
|
|
|
90
|
|
|
} |
91
|
|
|
}); |
92
|
|
|
|
93
|
|
|
// handler for the text filter (must take into account possible filtering |
94
|
|
|
// on linked status |
95
|
|
|
$('[id^="qsearch_"]').keyup(filter_action); |
96
|
|
|
|
97
|
|
|
// the linked filter checkbox handler |
98
|
|
|
$(":checkbox").on('click', filter_action); |
99
|
|
|
|
100
|
|
|
$("#fed_selection").on('change', function() { |
101
|
|
|
fed = $("#fed_selection option:selected").val(); |
|
|
|
|
102
|
|
|
if (fed === "XX") { |
103
|
|
|
return; |
104
|
|
|
} |
105
|
|
|
$("#main_content").hide(); |
106
|
|
|
$("#loading_gif").show(); |
107
|
|
|
document.location.href = "overview_federation.php?fed_id="+fed; |
108
|
|
|
}); |
109
|
|
|
|
110
|
|
|
$("img.cat-icon").tooltip(); |
111
|
|
|
$("#loading_gif").hide(); |
112
|
|
|
$("tbody.fedlist").each(function() { |
113
|
|
|
row_filter($(this)); |
114
|
|
|
}); |
115
|
|
|
}); |
116
|
|
|
|
117
|
|
|
|
118
|
|
|
|
119
|
|
|
|