My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 304 attachment: index.htm (7.4 KB)

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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<link rel='stylesheet' type='text/css' href='css/theme.css' />
<link rel='stylesheet' type='text/css' href='css/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='css/calendar_custom.css' />

<link rel='stylesheet' type='text/css' href='css/uibox.css' />




<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>

<!--- GAiello - custom HACK to get MORE events working based on version 1.4.7 (7/5/10) --->
<script type='text/javascript' src='js/fullcalendar_custom.js'></script>

<script type='text/javascript'>

$(document).ready(function() {

var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();

$('#calendar').fullCalendar({
theme: true,
header: {
left: 'prev',
center: 'title',
right: 'today next '
},
editable: false,

dayClick: function(date, allDay, jsEvent, view) {

calDate = $('#calendar').fullCalendar('getDate');
m = calDate.getMonth()+1;
y = calDate.getFullYear();
d = date.getDate();

// skip this item if it is a lightbox of MORE items
var blnSkip = false;
$(this).children("div").children("div").each(function() {
if ((this.tagName == 'DIV') && $(this).html() != '' && ($(this).attr('id') == 'uibox_content_' + y + '-' + String("0" + m).slice(-3) + '-' + String("0" + d).slice(-2) ) ) {
if ($('#uibox_'+ + y + '-' + String("0" + m).slice(-3) + '-' + String("0" + d).slice(-2) ).css('display') != 'none') {
blnSkip = true;
}
}
});





// GAiello - skip days on NonCurrent Months
if ( ($(this).andSelf("td").hasClass('fc-other-month') == false ) && (blnSkip == false) ){

//set hidden field with day we clicked on, case we need that value later
$('#hidSelectedDay').val(d);

// reset the day's background color back to white for those that have the selcted color before
$("td").each(function(){
if (this.style.backgroundColor == "rgb(229, 229, 194)") {
$(this).css('background-color', '');
}
});
// change the day's background color to Selected
$(this).css('background-color', 'rgb(229, 229, 194)');

//first remove all highlights then highlight the clicked row
// reset the day's background color back to white for those that have the selcted color before
$('tr').each(function(){
$(this).removeClass("highLight");
});

if (imode == 2) { // Week mode
//Check if Week Radio button is set then highlight the week
$('tr').click(function(){
if (this.rowIndex > 0) {
// change the day's background color to Selected
$(this).addClass("highLight");
}
$(this).unbind('click'); // unbind not doing what it is supposed to so i added below
$(this).removeAttr("onclick"); // need this so we do not keep firing, for some reason jquery remembers the last click and will fire again
});
}
else if (imode == 1) { // Month mode, highlight whole month skip top
$('tr').each(function(){
if (this.rowIndex > 0) {
$(this).addClass("highLight");
}
});
}
}

},
eventClick: function(calEvent, jsEvent, view) {
if ($(this).andSelf("td").hasClass('more') == false) {
getEventDetails(calEvent.id);
window.scrollTo(0,0);
}

},

events: function(start, end, callback) {
mStart = start.getMonth()+1;
dStart = start.getDate();
mEnd = end.getMonth()+1;
dEnd = end.getDate() - 1;

d = $('#calendar').fullCalendar('getDate');
currMonth = d.getMonth()+1;
currYear = d.getFullYear();

$.ajax({ type: "POST",
url: "/cfcs/calendar_new.cfc?method=getEvents&returnFormat=JSON",
//data: {'startMonth': mStart, 'startDay':dStart, 'endMonth':mEnd, 'endDay':dEnd },
data: {'iYear': currYear,'iMonth': currMonth,'blnCommemorates': 1},
cache: false,
success: function(QCommemorativeEvents) {
var events = [];
var obj = $.parseJSON(QCommemorativeEvents);
$.each(obj.DATA, function(index, value) {

if (value[6] == 0 ) { // for monthly holiday's default to first of month for display purposes GAiello
var lastDayOfMonth = new Date(currYear, String("0" + value[5]).slice(-2), 0);
events.push({
id: value[10],
title: value[11].replace('\\',''),
start: currYear + '-' + String("0" + value[5]).slice(-2) + '-01',
end: currYear + '-' + String("0" + value[5]).slice(-2) + '-' + lastDayOfMonth.getDate(),
className: 'star'
});
}
else {
events.push({
id: value[10],
title: value[11].replace('\\',''),
start: currYear + '-' + String("0" + value[5]).slice(-2) + '-' + String("0" + value[6]).slice(-2),
className: 'star'
});

}



});

callback(events);

/*************************************************/
calDate = $('#calendar').fullCalendar('getDate');
m = calDate.getMonth()+1;
y = calDate.getFullYear();
d = calDate.getDate();

// reset the day's background color back to white for those that have the selcted color before
$("td").each(function(){
if (this.style.backgroundColor == "rgb(229, 229, 194)") {
$(this).css('background-color', '');
}
});
// change the day's background color to Selected
//$(this).css('background-color', 'rgb(229, 229, 194)');
/*************************************************/
},

error: function(XMLHttpRequest, textStatus, errorThrown) { // I get a text with the whole exception's data. Since I am only interested in the error message itself, I look at the "title" tag.
start = XMLHttpRequest.responseText.search("<title>") + 7;
end = XMLHttpRequest.responseText.search("</title>");
if (start > 0 && end > 0)
alert("errorMsg [" + XMLHttpRequest.responseText.substring(start, end) + "]");
}
});
}
});

});

function reFire(dayClicked) {
iDay = dayClicked - 1
$("td").each(function(){
if ($(this).children("div").hasClass('fc-day-number') && $(this).children("div").html() == dayClicked && $(this).hasClass("fc-other-month") == 0) {
$(this).bind('click', function() {
//alert( $(this).text()); //do nothing
});
$(this).click()
}
});
}
</script>

<div id="containerDiv">
<ul id="ulCalEvents">
<li id="liCalendar">
<div style="text-align:left">
<div class="teacherCenter_label1">Calendar</div>
</div>
<br /><br />

<div id='calendar'></div>
</li>
</ul>
</div>
<div id="calEvents_overlay" class="transparent_class" style="display:none;" align="center"><div align="center" id="formLoader_bg"><div id="formLoader"></div></div></div>


Powered by Google Project Hosting