1 $(document
).ready(function() {
2 $('#report_mode_form input').on('change', function() {
3 set_report_mode(this.value
);
5 set_report_mode($('#report_mode_form input:checked').val());
7 $("#report_period").bind('change', function() {
8 show_calendar($(this).val());
10 show_calendar($('#report_period').val());
12 // reset options and reload page
13 $('#new_report').click(function() {
14 var base_uri
= _site_domain
+ _index_page
+ '/' + _current_uri
;
15 self
.location
.href
= base_uri
;
18 $('.comments').editable(_site_domain
+ _index_page
+ '/alert_history/add_comment', {
19 data: function(value
) {
21 that
.addClass('editing-comments').on('blur', 'input', function() {
22 that
.removeClass('editing-comments');
24 return $(value
).filter('.content').text()
26 submitdata: function(value
, settings
) {
27 $(this).removeClass('editing-comments');
28 var eventrow
= $(this).parents('.eventrow');
30 timestamp
: eventrow
.data('timestamp'),
31 event_type
: eventrow
.data('statecode'),
32 host_name
: eventrow
.data('hostname'),
33 service_description
: eventrow
.data('servicename'),
34 comment
: $('input', this).val() // (today) you cannot use value, because it's the original HTML
40 $('.toggle-long-output').on('click', function() {
41 var toggler
= $(this);
42 var span
= toggler
.parent().siblings('.alert-history-long-output');
43 if (toggler
.text() === '+') {
46 } else if (toggler
.text() === '-') {
53 function set_report_mode(type
)
57 $('.standard').show();
61 $('.standard').hide();