/
calendarview.html
91 lines (87 loc) · 2.71 KB
/
calendarview.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CalendarView — JavaScript Calendar Widget</title>
<link rel="stylesheet" href="../stylesheets/calendarview.css">
<style>
body {
font-family: Trebuchet MS;
}
div.calendar {
max-width: 240px;
margin-left: auto;
margin-right: auto;
}
div.calendar table {
width: 100%;
}
div.dateField {
width: 140px;
padding: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
color: #555;
background-color: white;
margin-left: auto;
margin-right: auto;
text-align: center;
}
div#popupDateField:hover {
background-color: #cde;
cursor: pointer;
}
</style>
<script src="../javascripts/prototype.js"></script>
<script src="../javascripts/calendarview.js"></script>
<script>
function setupCalendars() {
// Embedded Calendar
Calendar.setup(
{
dateField: 'embeddedDateField',
parentElement: 'embeddedCalendar'
}
)
// Popup Calendar
Calendar.setup(
{
dateField: 'popupDateField',
triggerElement: 'popupDateField'
}
)
}
Event.observe(window, 'load', function() { setupCalendars() })
</script>
</head>
<body>
<div style="float: left; width: 50%">
<div style="height: 400px; background-color: #efefef; padding: 10px; -webkit-border-radius: 12px; -moz-border-radius: 12px; margin-right: 10px">
<h3 style="text-align: center; background-color: white; -webkit-border-radius: 10px; -moz-border-radius: 10px; margin-top: 0px; margin-bottom: 20px; padding: 8px">
Embedded Calendar
</h3>
<div id="embeddedExample" style="">
<div id="embeddedCalendar" style="margin-left: auto; margin-right: auto">
</div>
<br />
<div id="embeddedDateField" class="dateField">
Select Date
</div>
<br />
</div>
</div>
</div>
<div style="float: right; width: 50%">
<div style="height: 400px; background-color: #efefef; padding: 10px; -webkit-border-radius: 12px; -moz-border-radius: 12px; margin-left: 10px">
<h3 style="text-align: center; background-color: white; -webkit-border-radius: 10px; -moz-border-radius: 10px; margin-top: 0px; margin-bottom: 20px; padding: 8px">
Popup Calendar
</h3>
<div id="popupExample">
<div id="popupDateField" class="dateField" style="margin-top: 160px">
Show Calendar
</div>
</div>
</div>
</div>
</body>
</html>