-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevidence.js
125 lines (108 loc) · 2.77 KB
/
evidence.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
var show_entity = true;
var show_mac = true;
var show_ip = true;
var show_specific = true;
var show_optional = true;
var show_expand = false;
var show_expand_latest = false;
$(function() {
// used in host.php
$('#evidence_info').click(function(event) {
event.preventDefault();
$.get(urlPath+'plugins/evidence/evidence.php?host_id='+$('#evidence_info').data('evidence_id'))
.done(function(data) {
$('#ping_results').html(data);
hostInfoHeight = $('.hostInfoHeader').height();
})
.fail(function(data) {
getPresentHTTPError(data);
});
})
// in tab
$('#clear').unbind().on('click', function() {
clearFilter();
});
$('#filter').unbind().on('change', function() {
applyFilter();
});
$('#form_evidence').unbind().on('submit', function(event) {
event.preventDefault();
applyFilter();
});
// open date
$('dd').hide();
$('dt').click(function () {
$(this).next('dd').slideToggle(250);
});
// expand/hide all dates
$('#ch_expand').off('click').on('click', function() {
if (show_expand) {
show_expand = false;
$('dd').hide();
} else {
show_expand = true;
$('dd').slideToggle(250);
}
});
// display/hide paragraphs
$('#ch_entity').off('click').on('click', function() {
if (show_entity) {
show_entity = false;
$('.paragraph_entity').css('display','none');
} else {
show_entity = true;
$('.paragraph_entity').css('display','inline-block');
}
});
// expand/hide latest date
$('#ch_expand_latest').off('click').on('click', function() {
$('.latest').click();
});
$('#ch_mac').off('click').on('click', function() {
if (show_mac) {
show_mac = false;
$('.paragraph_mac').css('display','none');
} else {
show_mac = true;
$('.paragraph_mac').css('display','inline-block');
}
});
$('#ch_ip').off('click').on('click', function() {
if (show_ip) {
show_ip = false;
$('.paragraph_ip').css('display','none');
} else {
show_ip = true;
$('.paragraph_ip').css('display','inline-block');
}
});
$('#ch_specific').off('click').on('click', function() {
if (show_specific) {
show_specific = false;
$('.paragraph_specific').css('display','none');
} else {
show_optional = true;
$('.paragraph_specific').css('display','inline-block');
}
});
$('#ch_optional').off('click').on('click', function() {
if (show_optional) {
show_optional = false;
$('.paragraph_optional').css('display','none');
} else {
show_optional = true;
$('.paragraph_optional').css('display','inline-block');
}
});
});
// used in evidence_tab.php
function applyFilter() {
strURL = 'evidence_tab.php' +
'?host_id=' + $('#host_id').val() +
'&header=false&action=find';
loadPageNoHeader(strURL);
}
function clearFilter() {
strURL = 'evidence_tab.php?clear=1&header=false';
loadPageNoHeader(strURL);
}