forked from myasonik/PDP-Front-end
/
ref.html
75 lines (73 loc) · 2.66 KB
/
ref.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:tal="http://xml.zope.org/namespaces/tal">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
<link rel='stylesheet' type='text/css' href='fullcalendar.css' />
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript' src='fullcalendar.js'></script>
<script type='text/javascript' src='gcal.js'></script>
<script>
function addEvent() {
var name = $("input#name").val();
var starttime = $("input#starttime").val();
var endtime = $("input#endtime").val();
var date = $("input#date").val();
var closedate = $("input#closedate").val()
var dataString = 'name=' + name + '&starttime=' + starttime + '&endtime=' + endtime + '&date=' + date + '$closedate=' + closedate;
$.ajax({
type: "POST",
url: "/ntid/DAS/PDP/calendar/addevent",
data: dataString,
success: function(data) {
//$('#loginDIV').empty('');
console.log(data)
//$('#userNumber').text(data.userNumber)
//changeService("play");
}
});
}
</script>
<script>
$(document).ready(function() {
// page is now ready, initialize the calendar...
var calendar = $('#calendar').fullCalendar({
// put your options and callbacks here
//events: 'https://www.google.com/calendar/feeds/rvkgqt49saqhg4i17fo48u8uk0%40group.calendar.google.com/public/basic',
events: '/calendar/events',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
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"
);
jQuery.post(
"/calendar/addevent" // your url
, { // re-use event's data
title: title,
start: start,
end: end,
allDay: allDay,
location: '',
description: ''
}
);
}
calendar.fullCalendar('unselect');
},
})
});
</script>
<div id='calendar'></div>
</html>