/usr/share/horde/nag/js/calendar.js is in php-horde-nag 4.2.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /**
* calendar.js - Calendar related javascript.
*
* Copyright 2010-2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @package Nag
*/
var NagCalendar =
{
calendarSelect: function(e)
{
var prefix, radio;
switch (e.element().identify()) {
case 'dueimg':
prefix = 'due';
radio = 'due_type_specified';
break;
case 'recur_endimg':
prefix = 'recur_end';
radio = 'recur_end_specified';
break;
case 'startimg':
prefix = 'start';
radio = 'start_date_specified';
break;
default:
return;
}
$(prefix + '_date').setValue(e.memo.toString(Nag.conf.date_format));
$(radio).setValue(1);
this.updateWday(prefix);
},
updateWday: function(p)
{
var d = this.getFormDate(p);
if (d) {
$(p + '_wday').update('(' + Horde_Calendar.fullweekdays[d.getDay()] + ')');
}
},
getFormDate: function(p)
{
return Date.parseExact($F(p + '_date'), Nag.conf.date_format);
},
clickHandler: function(e)
{
if (e.isRightClick()) {
return;
}
var elt = e.element(),
id = elt.readAttribute('id');
switch (id) {
case 'dueimg':
case 'startimg':
case 'recur_endimg':
Horde_Calendar.open(elt, this.getFormDate(id.slice(0, -3)));
e.stop();
break;
case 'due_am_pm_am':
case 'due_am_pm_am_label':
case 'due_am_pm_pm':
case 'due_am_pm_pm_label':
$('due_type_specified').setValue(1);
break;
}
},
changeHandler: function(e)
{
switch (e.element().readAttribute('id')) {
case 'due_date':
this.updateWday('due');
// Fall-through
case 'due_time':
$('due_type_specified').setValue(1);
break;
case 'start_date':
this.updateWday('start');
// Fall-through
case 'start_time':
$('start_date_specified').setValue(1);
break;
case 'alarm_unit':
case 'alarm_value':
$('alarmon').setValue(1);
break;
}
},
onDomLoad: function()
{
this.updateWday('due');
this.updateWday('start');
this.updateWday('recur_end');
$('nag_form_task_active').observe('click', this.clickHandler.bindAsEventListener(this));
$('nag_form_task_active').observe('change', this.changeHandler.bindAsEventListener(this));
}
};
document.observe('dom:loaded', NagCalendar.onDomLoad.bind(NagCalendar));
document.observe('Horde_Calendar:select', NagCalendar.calendarSelect.bindAsEventListener(NagCalendar));
|