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

Issue 808 attachment: selectable.html (3.7 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery-1.4.4.min.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-1.8.6.custom.min.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript'>
function countCalHeigth(){
var innerHeight = window.innerHeight;
if(!innerHeight){
innerHeight = document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;
}
return innerHeight - ($('#adds_layout').height() + $('#menu_layout').height() + $('#footer_layout').height());
}
function countCalWidth(){
var innerWidth = window.innerWidth;
if(!innerWidth){
innerWidth = document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;
}
return innerWidth - 22; //without vertical scrollbar
}
$(document).ready(function() {

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

var calendar = $('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
height: callendarHeigth,
defaultView: 'agendaWeek',
selectable: true,
selectHelper: true,
select: function(start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent',
{
title: title,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
}
calendar.fullCalendar('unselect');
},
editable: true,
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d-5),
end: new Date(y, m, d-2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d-3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d+4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d+1, 19, 0),
end: new Date(y, m, d+1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});

});
$(window).resize(
function() {
$('#calendar').fullCalendar('option', 'height', countCalHeigth());
//$('#calendar').fullCalendar('getView').setWidth(countCalWidth());
}
);

</script>
<style type='text/css'>

body {
margin: 0px;
text-align: center;
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}

</style>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td id="adds_layout" height="1px">adds</td></tr>
<tr><td id="menu_layout" height="1px"><p style="font-size:15">MENU</p></td></tr>
<tr><td><div id='calendar' style="width:100%"></div></td></tr>
<tr><td id="footer_layout" height="1px"><p style="text-align: right">test footer</p></td></tr>
</table>
<div id='calendar' style="width:100%"></div>
</body>
</html>
Powered by Google Project Hosting