Version Description
- Ensured manage calendar JavaScript only loads on manage calendar page in admin panel
- Switched to GPL compatible JavaScript date picker
Download this release
Release Info
Developer | KieranOShea |
Plugin | Calendar |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.2
- calendar.php +182 -27
- javascript.js +608 -1467
- readme.txt +8 -2
calendar.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.kieranoshea.com
|
|
5 |
Description: This plugin allows you to display a calendar of all your events and appointments as a page on your site.
|
6 |
Author: Kieran O'Shea
|
7 |
Author URI: http://www.kieranoshea.com
|
8 |
-
Version: 1.3.
|
9 |
*/
|
10 |
|
11 |
/* Copyright 2008 Kieran O'Shea (email : kieran@kieranoshea.com)
|
@@ -120,8 +120,8 @@ function calendar_menu()
|
|
120 |
}
|
121 |
if (function_exists('add_submenu_page'))
|
122 |
{
|
123 |
-
add_submenu_page('calendar', __('Manage Calendar','calendar'), __('Manage Calendar','calendar'), $allowed_group, 'calendar', 'edit_calendar');
|
124 |
-
add_action( "admin_head", 'calendar_add_javascript' );
|
125 |
// Note only admin can change calendar options
|
126 |
add_submenu_page('calendar', __('Manage Categories','calendar'), __('Manage Categories','calendar'), 'manage_options', 'calendar-categories', 'manage_categories');
|
127 |
add_submenu_page('calendar', __('Calendar Config','calendar'), __('Calendar Options','calendar'), 'manage_options', 'calendar-config', 'edit_calendar_config');
|
@@ -134,7 +134,163 @@ function calendar_add_javascript()
|
|
134 |
echo '<script type="text/javascript" src="';
|
135 |
bloginfo('wpurl');
|
136 |
echo '/wp-content/plugins/calendar/javascript.js"></script>
|
137 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
';
|
139 |
}
|
140 |
|
@@ -742,14 +898,8 @@ function wp_events_edit_form($mode='add', $event_id=false)
|
|
742 |
</tr>
|
743 |
<tr>
|
744 |
<td><legend><?php _e('Start Date','calendar'); ?></legend></td>
|
745 |
-
<td>
|
746 |
-
|
747 |
-
cal_begin.setWeekStartDay(<?php echo get_option('start_of_week'); ?>);
|
748 |
-
function unifydates() {
|
749 |
-
document.forms['quoteform'].event_end.value = document.forms['quoteform'].event_begin.value;
|
750 |
-
}
|
751 |
-
</script>
|
752 |
-
<input type="text" name="event_begin" class="input" size="12"
|
753 |
value="<?php
|
754 |
if ( !empty($data) )
|
755 |
{
|
@@ -759,24 +909,22 @@ function wp_events_edit_form($mode='add', $event_id=false)
|
|
759 |
{
|
760 |
echo date("Y-m-d",ctwo());
|
761 |
}
|
762 |
-
?>" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
763 |
</td>
|
764 |
</tr>
|
765 |
<tr>
|
766 |
<td><legend><?php _e('End Date','calendar'); ?></legend></td>
|
767 |
-
<td>
|
768 |
-
|
769 |
-
unifydates();
|
770 |
-
var cal_end = new CalendarPopup('pop_up_cal');
|
771 |
-
cal_end.setWeekStartDay(<?php echo get_option('start_of_week'); ?>);
|
772 |
-
var newDate = new Date();
|
773 |
-
newDate.setFullYear(document.forms['quoteform'].event_begin.value.split('-')[0],document.forms['quoteform'].event_begin.value.split('-')[1]-1,document.forms['quoteform'].event_begin.value.split('-')[2]);
|
774 |
-
newDate.setDate(newDate.getDate()-1);
|
775 |
-
cal_end.addDisabledDates(null, formatDate(newDate, "yyyy-MM-dd"));
|
776 |
-
cal_end.select(document.forms['quoteform'].event_end,'event_end_anchor','yyyy-MM-dd');
|
777 |
-
}
|
778 |
-
</script>
|
779 |
-
<input type="text" name="event_end" class="input" size="12"
|
780 |
value="<?php
|
781 |
if ( !empty($data) )
|
782 |
{
|
@@ -786,7 +934,14 @@ function wp_events_edit_form($mode='add', $event_id=false)
|
|
786 |
{
|
787 |
echo date("Y-m-d",ctwo());
|
788 |
}
|
789 |
-
?>" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
790 |
</td>
|
791 |
</tr>
|
792 |
<tr>
|
5 |
Description: This plugin allows you to display a calendar of all your events and appointments as a page on your site.
|
6 |
Author: Kieran O'Shea
|
7 |
Author URI: http://www.kieranoshea.com
|
8 |
+
Version: 1.3.2
|
9 |
*/
|
10 |
|
11 |
/* Copyright 2008 Kieran O'Shea (email : kieran@kieranoshea.com)
|
120 |
}
|
121 |
if (function_exists('add_submenu_page'))
|
122 |
{
|
123 |
+
$calendar_manage_menu = add_submenu_page('calendar', __('Manage Calendar','calendar'), __('Manage Calendar','calendar'), $allowed_group, 'calendar', 'edit_calendar');
|
124 |
+
add_action( "admin_head-".$calendar_manage_menu, 'calendar_add_javascript' );
|
125 |
// Note only admin can change calendar options
|
126 |
add_submenu_page('calendar', __('Manage Categories','calendar'), __('Manage Categories','calendar'), 'manage_options', 'calendar-categories', 'manage_categories');
|
127 |
add_submenu_page('calendar', __('Calendar Config','calendar'), __('Calendar Options','calendar'), 'manage_options', 'calendar-config', 'edit_calendar_config');
|
134 |
echo '<script type="text/javascript" src="';
|
135 |
bloginfo('wpurl');
|
136 |
echo '/wp-content/plugins/calendar/javascript.js"></script>
|
137 |
+
<style type="text/css">
|
138 |
+
.bcal-container{
|
139 |
+
background-color: #fff;
|
140 |
+
border-radius: 4px;
|
141 |
+
-moz-border-radius: 4px;
|
142 |
+
-webkit-border-radius: 4px;
|
143 |
+
float: left;
|
144 |
+
padding: 5px;
|
145 |
+
border: solid 1px #ccc;
|
146 |
+
box-shadow: 0 0 3px #C0C0C0;
|
147 |
+
}
|
148 |
+
.bcal-table{
|
149 |
+
border-collapse: separate;
|
150 |
+
border-spacing: 0;
|
151 |
+
border: solid 1px #A2A6AF;
|
152 |
+
font-family: Tahoma, sans-serif;
|
153 |
+
font-size: 11px;
|
154 |
+
font-weight: normal;
|
155 |
+
float: left;
|
156 |
+
margin: 1px;
|
157 |
+
padding: 0;
|
158 |
+
width: 200px;
|
159 |
+
}
|
160 |
+
.bcal-table,
|
161 |
+
.bcal-table th,
|
162 |
+
.bcal-table td {
|
163 |
+
box-sizing: border-box;
|
164 |
+
-moz-box-sizing: border-box;
|
165 |
+
-webkit-box-sizing: border-box;
|
166 |
+
}
|
167 |
+
.bcal-table thead tr{
|
168 |
+
background-color: #CECED2;
|
169 |
+
border: 1px solid #A2A6AF;
|
170 |
+
background-image: linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
|
171 |
+
background-image: -o-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
|
172 |
+
background-image: -moz-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
|
173 |
+
background-image: -webkit-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
|
174 |
+
background-image: -ms-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
|
175 |
+
background-image: -webkit-gradient(
|
176 |
+
linear,
|
177 |
+
left bottom,
|
178 |
+
left top,
|
179 |
+
color-stop(0.37, rgb(206,206,210)),
|
180 |
+
color-stop(0.69, rgb(241,240,242))
|
181 |
+
);
|
182 |
+
}
|
183 |
+
.bcal-table thead tr:first-child{
|
184 |
+
line-height: 23px;
|
185 |
+
}
|
186 |
+
.bcal-table thead th{
|
187 |
+
font-weight: bold;
|
188 |
+
color: #404D5D;
|
189 |
+
height: 20px;
|
190 |
+
text-align: center;
|
191 |
+
}
|
192 |
+
.bcal-table tbody td{
|
193 |
+
color: #3B4959;
|
194 |
+
cursor: pointer;
|
195 |
+
font-weight: normal;
|
196 |
+
height: 25px;
|
197 |
+
padding: 0 0 1px 1px;
|
198 |
+
width: 25px;
|
199 |
+
text-align: center;
|
200 |
+
}
|
201 |
+
.bcal-table tbody tr:first-child td{
|
202 |
+
border-top: solid 1px #fff;
|
203 |
+
}
|
204 |
+
.bcal-table tbody td:first-child{
|
205 |
+
border-left: none;
|
206 |
+
padding: 0 0 1px;
|
207 |
+
}
|
208 |
+
.bcal-table .bcal-wday,
|
209 |
+
.bcal-table .bcal-wnum{
|
210 |
+
font-weight: normal;
|
211 |
+
border-right: 1px solid #A2A6AF;
|
212 |
+
border-top: 1px solid #A2A6AF;
|
213 |
+
border-bottom: 1px solid #A2A6AF;
|
214 |
+
padding: 1px 1px 2px 2px;
|
215 |
+
}
|
216 |
+
.bcal-table .bcal-wnum{
|
217 |
+
border-right: 1px solid #A2A6AF;
|
218 |
+
border-bottom: 1px solid #A2A6AF;
|
219 |
+
color: #CC6600;
|
220 |
+
background-image: linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
|
221 |
+
background-image: -o-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
|
222 |
+
background-image: -moz-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
|
223 |
+
background-image: -webkit-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
|
224 |
+
background-image: -ms-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
|
225 |
+
background-image: -webkit-gradient(
|
226 |
+
linear,
|
227 |
+
left bottom,
|
228 |
+
left top,
|
229 |
+
color-stop(0.23, rgb(255,225,159)),
|
230 |
+
color-stop(0.62, rgb(255,250,234))
|
231 |
+
);
|
232 |
+
}
|
233 |
+
.bcal-table .bcal-wday:last-child{
|
234 |
+
border-right: none;
|
235 |
+
}
|
236 |
+
.bcal-table .bcal-empty{
|
237 |
+
background-color: #F6F6F7;
|
238 |
+
border-right: solid 1px #fff;
|
239 |
+
border-bottom: solid 1px #fff;
|
240 |
+
color: #999;
|
241 |
+
cursor: default;
|
242 |
+
}
|
243 |
+
.bcal-table tr:last-child .bcal-empty,
|
244 |
+
.bcal-table tr:last-child .bcal-week,
|
245 |
+
.bcal-table tr:last-child .bcal-date{
|
246 |
+
border-bottom: none;
|
247 |
+
}
|
248 |
+
.bcal-table .bcal-date{
|
249 |
+
border-right: solid 1px #fff;
|
250 |
+
border-bottom: solid 1px #fff;
|
251 |
+
background-color: #ECECEE;
|
252 |
+
}
|
253 |
+
.bcal-table .bcal-past{
|
254 |
+
background-color: #e6e6e6;
|
255 |
+
color: #999;
|
256 |
+
cursor: default;
|
257 |
+
}
|
258 |
+
.bcal-table .bcal-today{
|
259 |
+
background-color: #D6D6D1;
|
260 |
+
color: #333;
|
261 |
+
}
|
262 |
+
.bcal-table .bcal-week{
|
263 |
+
background-color: #FEF3DA;
|
264 |
+
border-right: solid 1px #fff;
|
265 |
+
border-bottom: solid 1px #fff;
|
266 |
+
color: #CC6600;
|
267 |
+
cursor: default;
|
268 |
+
}
|
269 |
+
.bcal-table .bcal-selected{
|
270 |
+
background-color: #BDBDBD;
|
271 |
+
color: #F2F2F2;
|
272 |
+
}
|
273 |
+
.bcal-table .bcal-over,
|
274 |
+
.bcal-table .bcal-date:hover{
|
275 |
+
background-color: #B2B2A9;
|
276 |
+
color: #fff;
|
277 |
+
}
|
278 |
+
.bcal-table .bcal-date:last-child,
|
279 |
+
.bcal-table .bcal-empty:last-child{
|
280 |
+
border-right: none;
|
281 |
+
}
|
282 |
+
.bcal-table .bcal-past:hover{
|
283 |
+
background-color: #e0e0e0;
|
284 |
+
color: #666;
|
285 |
+
}
|
286 |
+
.bcal-table .bcal-month,
|
287 |
+
.bcal-table .bcal-navi,
|
288 |
+
.bcal-table .bcal-wnum,
|
289 |
+
.bcal-table .bcal-wday,
|
290 |
+
.bcal-table .bcal-week{
|
291 |
+
cursor: text;
|
292 |
+
}
|
293 |
+
</style>
|
294 |
';
|
295 |
}
|
296 |
|
898 |
</tr>
|
899 |
<tr>
|
900 |
<td><legend><?php _e('Start Date','calendar'); ?></legend></td>
|
901 |
+
<td>
|
902 |
+
<input type="text" name="event_begin" id="event_begin" class="input" size="12"
|
|
|
|
|
|
|
|
|
|
|
|
|
903 |
value="<?php
|
904 |
if ( !empty($data) )
|
905 |
{
|
909 |
{
|
910 |
echo date("Y-m-d",ctwo());
|
911 |
}
|
912 |
+
?>" />
|
913 |
+
<script type="text/javascript">
|
914 |
+
var cal_1 = new Calendar({
|
915 |
+
element: 'event_begin',
|
916 |
+
startDay: <?php echo get_option('start_of_week'); ?>,
|
917 |
+
onSelect: function unifydates(element) {
|
918 |
+
document.forms['quoteform'].event_end.value = document.forms['quoteform'].event_begin.value;
|
919 |
+
}
|
920 |
+
});
|
921 |
+
</script>
|
922 |
</td>
|
923 |
</tr>
|
924 |
<tr>
|
925 |
<td><legend><?php _e('End Date','calendar'); ?></legend></td>
|
926 |
+
<td>
|
927 |
+
<input type="text" name="event_end" id="event_end" class="input" size="12"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
value="<?php
|
929 |
if ( !empty($data) )
|
930 |
{
|
934 |
{
|
935 |
echo date("Y-m-d",ctwo());
|
936 |
}
|
937 |
+
?>" />
|
938 |
+
<script type="text/javascript">
|
939 |
+
var cal_2 = new Calendar({
|
940 |
+
element: 'event_end',
|
941 |
+
startDay: <?php echo get_option('start_of_week'); ?>,
|
942 |
+
minDate: new Date(parseInt(document.forms['quoteform'].event_begin.value.split('-')[0]),parseInt(document.forms['quoteform'].event_begin.value.split('-')[1]-1),parseInt(document.forms['quoteform'].event_begin.value.split('-')[2]))
|
943 |
+
});
|
944 |
+
</script>
|
945 |
</td>
|
946 |
</tr>
|
947 |
<tr>
|
javascript.js
CHANGED
@@ -1,1467 +1,608 @@
|
|
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 |
-
function
|
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 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
}
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
if (
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
if(
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
var
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
if (this.divName != null) {
|
610 |
-
// Show the DIV object
|
611 |
-
if (this.use_gebi) {
|
612 |
-
document.getElementById(this.divName).style.left = this.x + "px";
|
613 |
-
document.getElementById(this.divName).style.top = this.y + "px";
|
614 |
-
document.getElementById(this.divName).style.visibility = "visible";
|
615 |
-
}
|
616 |
-
else if (this.use_css) {
|
617 |
-
document.all[this.divName].style.left = this.x;
|
618 |
-
document.all[this.divName].style.top = this.y;
|
619 |
-
document.all[this.divName].style.visibility = "visible";
|
620 |
-
}
|
621 |
-
else if (this.use_layers) {
|
622 |
-
document.layers[this.divName].left = this.x;
|
623 |
-
document.layers[this.divName].top = this.y;
|
624 |
-
document.layers[this.divName].visibility = "visible";
|
625 |
-
}
|
626 |
-
}
|
627 |
-
else {
|
628 |
-
if (this.popupWindow == null || this.popupWindow.closed) {
|
629 |
-
// If the popup window will go off-screen, move it so it doesn't
|
630 |
-
if (this.x<0) { this.x=0; }
|
631 |
-
if (this.y<0) { this.y=0; }
|
632 |
-
if (screen && screen.availHeight) {
|
633 |
-
if ((this.y + this.height) > screen.availHeight) {
|
634 |
-
this.y = screen.availHeight - this.height;
|
635 |
-
}
|
636 |
-
}
|
637 |
-
if (screen && screen.availWidth) {
|
638 |
-
if ((this.x + this.width) > screen.availWidth) {
|
639 |
-
this.x = screen.availWidth - this.width;
|
640 |
-
}
|
641 |
-
}
|
642 |
-
var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
|
643 |
-
this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
|
644 |
-
}
|
645 |
-
this.refresh();
|
646 |
-
}
|
647 |
-
}
|
648 |
-
// Hide the popup
|
649 |
-
function PopupWindow_hidePopup() {
|
650 |
-
if (this.divName != null) {
|
651 |
-
if (this.use_gebi) {
|
652 |
-
document.getElementById(this.divName).style.visibility = "hidden";
|
653 |
-
}
|
654 |
-
else if (this.use_css) {
|
655 |
-
document.all[this.divName].style.visibility = "hidden";
|
656 |
-
}
|
657 |
-
else if (this.use_layers) {
|
658 |
-
document.layers[this.divName].visibility = "hidden";
|
659 |
-
}
|
660 |
-
}
|
661 |
-
else {
|
662 |
-
if (this.popupWindow && !this.popupWindow.closed) {
|
663 |
-
this.popupWindow.close();
|
664 |
-
this.popupWindow = null;
|
665 |
-
}
|
666 |
-
}
|
667 |
-
}
|
668 |
-
// Pass an event and return whether or not it was the popup DIV that was clicked
|
669 |
-
function PopupWindow_isClicked(e) {
|
670 |
-
if (this.divName != null) {
|
671 |
-
if (this.use_layers) {
|
672 |
-
var clickX = e.pageX;
|
673 |
-
var clickY = e.pageY;
|
674 |
-
var t = document.layers[this.divName];
|
675 |
-
if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
|
676 |
-
return true;
|
677 |
-
}
|
678 |
-
else { return false; }
|
679 |
-
}
|
680 |
-
else if (document.all) { // Need to hard-code this to trap IE for error-handling
|
681 |
-
var t = window.event.srcElement;
|
682 |
-
while (t.parentElement != null) {
|
683 |
-
if (t.id==this.divName) {
|
684 |
-
return true;
|
685 |
-
}
|
686 |
-
t = t.parentElement;
|
687 |
-
}
|
688 |
-
return false;
|
689 |
-
}
|
690 |
-
else if (this.use_gebi && e) {
|
691 |
-
var t = e.originalTarget;
|
692 |
-
while (t.parentNode != null) {
|
693 |
-
if (t.id==this.divName) {
|
694 |
-
return true;
|
695 |
-
}
|
696 |
-
t = t.parentNode;
|
697 |
-
}
|
698 |
-
return false;
|
699 |
-
}
|
700 |
-
return false;
|
701 |
-
}
|
702 |
-
return false;
|
703 |
-
}
|
704 |
-
|
705 |
-
// Check an onMouseDown event to see if we should hide
|
706 |
-
function PopupWindow_hideIfNotClicked(e) {
|
707 |
-
if (this.autoHideEnabled && !this.isClicked(e)) {
|
708 |
-
this.hidePopup();
|
709 |
-
}
|
710 |
-
}
|
711 |
-
// Call this to make the DIV disable automatically when mouse is clicked outside it
|
712 |
-
function PopupWindow_autoHide() {
|
713 |
-
this.autoHideEnabled = true;
|
714 |
-
}
|
715 |
-
// This global function checks all PopupWindow objects onmouseup to see if they should be hidden
|
716 |
-
function PopupWindow_hidePopupWindows(e) {
|
717 |
-
for (var i=0; i<popupWindowObjects.length; i++) {
|
718 |
-
if (popupWindowObjects[i] != null) {
|
719 |
-
var p = popupWindowObjects[i];
|
720 |
-
p.hideIfNotClicked(e);
|
721 |
-
}
|
722 |
-
}
|
723 |
-
}
|
724 |
-
// Run this immediately to attach the event listener
|
725 |
-
function PopupWindow_attachListener() {
|
726 |
-
if (document.layers) {
|
727 |
-
document.captureEvents(Event.MOUSEUP);
|
728 |
-
}
|
729 |
-
window.popupWindowOldEventListener = document.onmouseup;
|
730 |
-
if (window.popupWindowOldEventListener != null) {
|
731 |
-
document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
|
732 |
-
}
|
733 |
-
else {
|
734 |
-
document.onmouseup = PopupWindow_hidePopupWindows;
|
735 |
-
}
|
736 |
-
}
|
737 |
-
// CONSTRUCTOR for the PopupWindow object
|
738 |
-
// Pass it a DIV name to use a DHTML popup, otherwise will default to window popup
|
739 |
-
function PopupWindow() {
|
740 |
-
if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
|
741 |
-
if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
|
742 |
-
if (!window.listenerAttached) {
|
743 |
-
window.listenerAttached = true;
|
744 |
-
PopupWindow_attachListener();
|
745 |
-
}
|
746 |
-
this.index = popupWindowIndex++;
|
747 |
-
popupWindowObjects[this.index] = this;
|
748 |
-
this.divName = null;
|
749 |
-
this.popupWindow = null;
|
750 |
-
this.width=0;
|
751 |
-
this.height=0;
|
752 |
-
this.populated = false;
|
753 |
-
this.visible = false;
|
754 |
-
this.autoHideEnabled = false;
|
755 |
-
|
756 |
-
this.contents = "";
|
757 |
-
this.url="";
|
758 |
-
this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
|
759 |
-
if (arguments.length>0) {
|
760 |
-
this.type="DIV";
|
761 |
-
this.divName = arguments[0];
|
762 |
-
}
|
763 |
-
else {
|
764 |
-
this.type="WINDOW";
|
765 |
-
}
|
766 |
-
this.use_gebi = false;
|
767 |
-
this.use_css = false;
|
768 |
-
this.use_layers = false;
|
769 |
-
if (document.getElementById) { this.use_gebi = true; }
|
770 |
-
else if (document.all) { this.use_css = true; }
|
771 |
-
else if (document.layers) { this.use_layers = true; }
|
772 |
-
else { this.type = "WINDOW"; }
|
773 |
-
this.offsetX = 0;
|
774 |
-
this.offsetY = 0;
|
775 |
-
// Method mappings
|
776 |
-
this.getXYPosition = PopupWindow_getXYPosition;
|
777 |
-
this.populate = PopupWindow_populate;
|
778 |
-
this.setUrl = PopupWindow_setUrl;
|
779 |
-
this.setWindowProperties = PopupWindow_setWindowProperties;
|
780 |
-
this.refresh = PopupWindow_refresh;
|
781 |
-
this.showPopup = PopupWindow_showPopup;
|
782 |
-
this.hidePopup = PopupWindow_hidePopup;
|
783 |
-
this.setSize = PopupWindow_setSize;
|
784 |
-
this.isClicked = PopupWindow_isClicked;
|
785 |
-
this.autoHide = PopupWindow_autoHide;
|
786 |
-
this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
|
787 |
-
}
|
788 |
-
|
789 |
-
/* SOURCE FILE: CalendarPopup.js */
|
790 |
-
|
791 |
-
// HISTORY
|
792 |
-
// ------------------------------------------------------------------
|
793 |
-
// Feb 7, 2005: Fixed a CSS styles to use px unit
|
794 |
-
// March 29, 2004: Added check in select() method for the form field
|
795 |
-
// being disabled. If it is, just return and don't do anything.
|
796 |
-
// March 24, 2004: Fixed bug - when month name and abbreviations were
|
797 |
-
// changed, date format still used original values.
|
798 |
-
// January 26, 2004: Added support for drop-down month and year
|
799 |
-
// navigation (Thanks to Chris Reid for the idea)
|
800 |
-
// September 22, 2003: Fixed a minor problem in YEAR calendar with
|
801 |
-
// CSS prefix.
|
802 |
-
// August 19, 2003: Renamed the function to get styles, and made it
|
803 |
-
// work correctly without an object reference
|
804 |
-
// August 18, 2003: Changed showYearNavigation and
|
805 |
-
// showYearNavigationInput to optionally take an argument of
|
806 |
-
// true or false
|
807 |
-
// July 31, 2003: Added text input option for year navigation.
|
808 |
-
// Added a per-calendar CSS prefix option to optionally use
|
809 |
-
// different styles for different calendars.
|
810 |
-
// July 29, 2003: Fixed bug causing the Today link to be clickable
|
811 |
-
// even though today falls in a disabled date range.
|
812 |
-
// Changed formatting to use pure CSS, allowing greater control
|
813 |
-
// over look-and-feel options.
|
814 |
-
// June 11, 2003: Fixed bug causing the Today link to be unselectable
|
815 |
-
// under certain cases when some days of week are disabled
|
816 |
-
// March 14, 2003: Added ability to disable individual dates or date
|
817 |
-
// ranges, display as light gray and strike-through
|
818 |
-
// March 14, 2003: Removed dependency on graypixel.gif and instead
|
819 |
-
/// use table border coloring
|
820 |
-
// March 12, 2003: Modified showCalendar() function to allow optional
|
821 |
-
// start-date parameter
|
822 |
-
// March 11, 2003: Modified select() function to allow optional
|
823 |
-
// start-date parameter
|
824 |
-
/*
|
825 |
-
DESCRIPTION: This object implements a popup calendar to allow the user to
|
826 |
-
select a date, month, quarter, or year.
|
827 |
-
|
828 |
-
COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
|
829 |
-
positioning errors - usually with Window positioning - occur on the
|
830 |
-
Macintosh platform.
|
831 |
-
The calendar can be modified to work for any location in the world by
|
832 |
-
changing which weekday is displayed as the first column, changing the month
|
833 |
-
names, and changing the column headers for each day.
|
834 |
-
|
835 |
-
USAGE:
|
836 |
-
// Create a new CalendarPopup object of type WINDOW
|
837 |
-
var cal = new CalendarPopup();
|
838 |
-
|
839 |
-
// Create a new CalendarPopup object of type DIV using the DIV named 'mydiv'
|
840 |
-
var cal = new CalendarPopup('mydiv');
|
841 |
-
|
842 |
-
// Easy method to link the popup calendar with an input box.
|
843 |
-
cal.select(inputObject, anchorname, dateFormat);
|
844 |
-
// Same method, but passing a default date other than the field's current value
|
845 |
-
cal.select(inputObject, anchorname, dateFormat, '01/02/2000');
|
846 |
-
// This is an example call to the popup calendar from a link to populate an
|
847 |
-
// input box. Note that to use this, date.js must also be included!!
|
848 |
-
<A HREF="#" onClick="cal.select(document.forms[0].date,'anchorname','MM/dd/yyyy'); return false;">Select</A>
|
849 |
-
|
850 |
-
// Set the type of date select to be used. By default it is 'date'.
|
851 |
-
cal.setDisplayType(type);
|
852 |
-
|
853 |
-
// When a date, month, quarter, or year is clicked, a function is called and
|
854 |
-
// passed the details. You must write this function, and tell the calendar
|
855 |
-
// popup what the function name is.
|
856 |
-
// Function to be called for 'date' select receives y, m, d
|
857 |
-
cal.setReturnFunction(functionname);
|
858 |
-
// Function to be called for 'month' select receives y, m
|
859 |
-
cal.setReturnMonthFunction(functionname);
|
860 |
-
// Function to be called for 'quarter' select receives y, q
|
861 |
-
cal.setReturnQuarterFunction(functionname);
|
862 |
-
// Function to be called for 'year' select receives y
|
863 |
-
cal.setReturnYearFunction(functionname);
|
864 |
-
|
865 |
-
// Show the calendar relative to a given anchor
|
866 |
-
cal.showCalendar(anchorname);
|
867 |
-
|
868 |
-
// Hide the calendar. The calendar is set to autoHide automatically
|
869 |
-
cal.hideCalendar();
|
870 |
-
|
871 |
-
// Set the month names to be used. Default are English month names
|
872 |
-
cal.setMonthNames("January","February","March",...);
|
873 |
-
|
874 |
-
// Set the month abbreviations to be used. Default are English month abbreviations
|
875 |
-
cal.setMonthAbbreviations("Jan","Feb","Mar",...);
|
876 |
-
|
877 |
-
// Show navigation for changing by the year, not just one month at a time
|
878 |
-
cal.showYearNavigation();
|
879 |
-
|
880 |
-
// Show month and year dropdowns, for quicker selection of month of dates
|
881 |
-
cal.showNavigationDropdowns();
|
882 |
-
|
883 |
-
// Set the text to be used above each day column. The days start with
|
884 |
-
// sunday regardless of the value of WeekStartDay
|
885 |
-
cal.setDayHeaders("S","M","T",...);
|
886 |
-
|
887 |
-
// Set the day for the first column in the calendar grid. By default this
|
888 |
-
// is Sunday (0) but it may be changed to fit the conventions of other
|
889 |
-
// countries.
|
890 |
-
cal.setWeekStartDay(1); // week is Monday - Sunday
|
891 |
-
|
892 |
-
// Set the weekdays which should be disabled in the 'date' select popup. You can
|
893 |
-
// then allow someone to only select week end dates, or Tuedays, for example
|
894 |
-
cal.setDisabledWeekDays(0,1); // To disable selecting the 1st or 2nd days of the week
|
895 |
-
|
896 |
-
// Selectively disable individual days or date ranges. Disabled days will not
|
897 |
-
// be clickable, and show as strike-through text on current browsers.
|
898 |
-
// Date format is any format recognized by parseDate() in date.js
|
899 |
-
// Pass a single date to disable:
|
900 |
-
cal.addDisabledDates("2003-01-01");
|
901 |
-
// Pass null as the first parameter to mean "anything up to and including" the
|
902 |
-
// passed date:
|
903 |
-
cal.addDisabledDates(null, "01/02/03");
|
904 |
-
// Pass null as the second parameter to mean "including the passed date and
|
905 |
-
// anything after it:
|
906 |
-
cal.addDisabledDates("Jan 01, 2003", null);
|
907 |
-
// Pass two dates to disable all dates inbetween and including the two
|
908 |
-
cal.addDisabledDates("January 01, 2003", "Dec 31, 2003");
|
909 |
-
|
910 |
-
// When the 'year' select is displayed, set the number of years back from the
|
911 |
-
// current year to start listing years. Default is 2.
|
912 |
-
// This is also used for year drop-down, to decide how many years +/- to display
|
913 |
-
cal.setYearSelectStartOffset(2);
|
914 |
-
|
915 |
-
// Text for the word "Today" appearing on the calendar
|
916 |
-
cal.setTodayText("Today");
|
917 |
-
|
918 |
-
// The calendar uses CSS classes for formatting. If you want your calendar to
|
919 |
-
// have unique styles, you can set the prefix that will be added to all the
|
920 |
-
// classes in the output.
|
921 |
-
// For example, normal output may have this:
|
922 |
-
// <SPAN CLASS="cpTodayTextDisabled">Today<SPAN>
|
923 |
-
// But if you set the prefix like this:
|
924 |
-
cal.setCssPrefix("Test");
|
925 |
-
// The output will then look like:
|
926 |
-
// <SPAN CLASS="TestcpTodayTextDisabled">Today<SPAN>
|
927 |
-
// And you can define that style somewhere in your page.
|
928 |
-
|
929 |
-
// When using Year navigation, you can make the year be an input box, so
|
930 |
-
// the user can manually change it and jump to any year
|
931 |
-
cal.showYearNavigationInput();
|
932 |
-
|
933 |
-
// Set the calendar offset to be different than the default. By default it
|
934 |
-
// will appear just below and to the right of the anchorname. So if you have
|
935 |
-
// a text box where the date will go and and anchor immediately after the
|
936 |
-
// text box, the calendar will display immediately under the text box.
|
937 |
-
cal.offsetX = 20;
|
938 |
-
cal.offsetY = 20;
|
939 |
-
|
940 |
-
NOTES:
|
941 |
-
1) Requires the functions in AnchorPosition.js and PopupWindow.js
|
942 |
-
|
943 |
-
2) Your anchor tag MUST contain both NAME and ID attributes which are the
|
944 |
-
same. For example:
|
945 |
-
<A NAME="test" ID="test"> </A>
|
946 |
-
|
947 |
-
3) There must be at least a space between <A> </A> for IE5.5 to see the
|
948 |
-
anchor tag correctly. Do not do <A></A> with no space.
|
949 |
-
|
950 |
-
4) When a CalendarPopup object is created, a handler for 'onmouseup' is
|
951 |
-
attached to any event handler you may have already defined. Do NOT define
|
952 |
-
an event handler for 'onmouseup' after you define a CalendarPopup object
|
953 |
-
or the autoHide() will not work correctly.
|
954 |
-
|
955 |
-
5) The calendar popup display uses style sheets to make it look nice.
|
956 |
-
|
957 |
-
*/
|
958 |
-
|
959 |
-
// CONSTRUCTOR for the CalendarPopup Object
|
960 |
-
function CalendarPopup() {
|
961 |
-
var c;
|
962 |
-
if (arguments.length>0) {
|
963 |
-
c = new PopupWindow(arguments[0]);
|
964 |
-
}
|
965 |
-
else {
|
966 |
-
c = new PopupWindow();
|
967 |
-
c.setSize(150,175);
|
968 |
-
}
|
969 |
-
c.offsetX = -152;
|
970 |
-
c.offsetY = 25;
|
971 |
-
c.autoHide();
|
972 |
-
// Calendar-specific properties
|
973 |
-
c.monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
|
974 |
-
c.monthAbbreviations = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
|
975 |
-
c.dayHeaders = new Array("S","M","T","W","T","F","S");
|
976 |
-
c.returnFunction = "CP_tmpReturnFunction";
|
977 |
-
c.returnMonthFunction = "CP_tmpReturnMonthFunction";
|
978 |
-
c.returnQuarterFunction = "CP_tmpReturnQuarterFunction";
|
979 |
-
c.returnYearFunction = "CP_tmpReturnYearFunction";
|
980 |
-
c.weekStartDay = 0;
|
981 |
-
c.isShowYearNavigation = false;
|
982 |
-
c.displayType = "date";
|
983 |
-
c.disabledWeekDays = new Object();
|
984 |
-
c.disabledDatesExpression = "";
|
985 |
-
c.yearSelectStartOffset = 2;
|
986 |
-
c.currentDate = null;
|
987 |
-
c.todayText="Today";
|
988 |
-
c.cssPrefix="";
|
989 |
-
c.isShowNavigationDropdowns=false;
|
990 |
-
c.isShowYearNavigationInput=false;
|
991 |
-
window.CP_calendarObject = null;
|
992 |
-
window.CP_targetInput = null;
|
993 |
-
window.CP_dateFormat = "MM/dd/yyyy";
|
994 |
-
// Method mappings
|
995 |
-
c.copyMonthNamesToWindow = CP_copyMonthNamesToWindow;
|
996 |
-
c.setReturnFunction = CP_setReturnFunction;
|
997 |
-
c.setReturnMonthFunction = CP_setReturnMonthFunction;
|
998 |
-
c.setReturnQuarterFunction = CP_setReturnQuarterFunction;
|
999 |
-
c.setReturnYearFunction = CP_setReturnYearFunction;
|
1000 |
-
c.setMonthNames = CP_setMonthNames;
|
1001 |
-
c.setMonthAbbreviations = CP_setMonthAbbreviations;
|
1002 |
-
c.setDayHeaders = CP_setDayHeaders;
|
1003 |
-
c.setWeekStartDay = CP_setWeekStartDay;
|
1004 |
-
c.setDisplayType = CP_setDisplayType;
|
1005 |
-
c.setDisabledWeekDays = CP_setDisabledWeekDays;
|
1006 |
-
c.addDisabledDates = CP_addDisabledDates;
|
1007 |
-
c.setYearSelectStartOffset = CP_setYearSelectStartOffset;
|
1008 |
-
c.setTodayText = CP_setTodayText;
|
1009 |
-
c.showYearNavigation = CP_showYearNavigation;
|
1010 |
-
c.showCalendar = CP_showCalendar;
|
1011 |
-
c.hideCalendar = CP_hideCalendar;
|
1012 |
-
c.getStyles = getCalendarStyles;
|
1013 |
-
c.refreshCalendar = CP_refreshCalendar;
|
1014 |
-
c.getCalendar = CP_getCalendar;
|
1015 |
-
c.select = CP_select;
|
1016 |
-
c.setCssPrefix = CP_setCssPrefix;
|
1017 |
-
c.showNavigationDropdowns = CP_showNavigationDropdowns;
|
1018 |
-
c.showYearNavigationInput = CP_showYearNavigationInput;
|
1019 |
-
c.copyMonthNamesToWindow();
|
1020 |
-
// Return the object
|
1021 |
-
return c;
|
1022 |
-
}
|
1023 |
-
function CP_copyMonthNamesToWindow() {
|
1024 |
-
// Copy these values over to the date.js
|
1025 |
-
if (typeof(window.MONTH_NAMES)!="undefined" && window.MONTH_NAMES!=null) {
|
1026 |
-
window.MONTH_NAMES = new Array();
|
1027 |
-
for (var i=0; i<this.monthNames.length; i++) {
|
1028 |
-
window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthNames[i];
|
1029 |
-
}
|
1030 |
-
for (var i=0; i<this.monthAbbreviations.length; i++) {
|
1031 |
-
window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthAbbreviations[i];
|
1032 |
-
}
|
1033 |
-
}
|
1034 |
-
}
|
1035 |
-
// Temporary default functions to be called when items clicked, so no error is thrown
|
1036 |
-
function CP_tmpReturnFunction(y,m,d) {
|
1037 |
-
if (window.CP_targetInput!=null) {
|
1038 |
-
var dt = new Date(y,m-1,d,0,0,0);
|
1039 |
-
if (window.CP_calendarObject!=null) { window.CP_calendarObject.copyMonthNamesToWindow(); }
|
1040 |
-
window.CP_targetInput.value = formatDate(dt,window.CP_dateFormat);
|
1041 |
-
// Kieran - fixed issue with end date not becoming begin date after begin date is set
|
1042 |
-
if (CP_targetInput.name == 'event_begin') {
|
1043 |
-
document.forms['quoteform'].event_end.value = formatDate(dt,window.CP_dateFormat);
|
1044 |
-
}
|
1045 |
-
}
|
1046 |
-
else {
|
1047 |
-
alert('Use setReturnFunction() to define which function will get the clicked results!');
|
1048 |
-
}
|
1049 |
-
}
|
1050 |
-
function CP_tmpReturnMonthFunction(y,m) {
|
1051 |
-
alert('Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , month='+m);
|
1052 |
-
}
|
1053 |
-
function CP_tmpReturnQuarterFunction(y,q) {
|
1054 |
-
alert('Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , quarter='+q);
|
1055 |
-
}
|
1056 |
-
function CP_tmpReturnYearFunction(y) {
|
1057 |
-
alert('Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year='+y);
|
1058 |
-
}
|
1059 |
-
|
1060 |
-
// Set the name of the functions to call to get the clicked item
|
1061 |
-
function CP_setReturnFunction(name) { this.returnFunction = name; }
|
1062 |
-
function CP_setReturnMonthFunction(name) { this.returnMonthFunction = name; }
|
1063 |
-
function CP_setReturnQuarterFunction(name) { this.returnQuarterFunction = name; }
|
1064 |
-
function CP_setReturnYearFunction(name) { this.returnYearFunction = name; }
|
1065 |
-
|
1066 |
-
// Over-ride the built-in month names
|
1067 |
-
function CP_setMonthNames() {
|
1068 |
-
for (var i=0; i<arguments.length; i++) { this.monthNames[i] = arguments[i]; }
|
1069 |
-
this.copyMonthNamesToWindow();
|
1070 |
-
}
|
1071 |
-
|
1072 |
-
// Over-ride the built-in month abbreviations
|
1073 |
-
function CP_setMonthAbbreviations() {
|
1074 |
-
for (var i=0; i<arguments.length; i++) { this.monthAbbreviations[i] = arguments[i]; }
|
1075 |
-
this.copyMonthNamesToWindow();
|
1076 |
-
}
|
1077 |
-
|
1078 |
-
// Over-ride the built-in column headers for each day
|
1079 |
-
function CP_setDayHeaders() {
|
1080 |
-
for (var i=0; i<arguments.length; i++) { this.dayHeaders[i] = arguments[i]; }
|
1081 |
-
}
|
1082 |
-
|
1083 |
-
// Set the day of the week (0-7) that the calendar display starts on
|
1084 |
-
// This is for countries other than the US whose calendar displays start on Monday(1), for example
|
1085 |
-
function CP_setWeekStartDay(day) { this.weekStartDay = day; }
|
1086 |
-
|
1087 |
-
// Show next/last year navigation links
|
1088 |
-
function CP_showYearNavigation() { this.isShowYearNavigation = (arguments.length>0)?arguments[0]:true; }
|
1089 |
-
|
1090 |
-
// Which type of calendar to display
|
1091 |
-
function CP_setDisplayType(type) {
|
1092 |
-
if (type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year") { alert("Invalid display type! Must be one of: date,week-end,month,quarter,year"); return false; }
|
1093 |
-
this.displayType=type;
|
1094 |
-
}
|
1095 |
-
|
1096 |
-
// How many years back to start by default for year display
|
1097 |
-
function CP_setYearSelectStartOffset(num) { this.yearSelectStartOffset=num; }
|
1098 |
-
|
1099 |
-
// Set which weekdays should not be clickable
|
1100 |
-
function CP_setDisabledWeekDays() {
|
1101 |
-
this.disabledWeekDays = new Object();
|
1102 |
-
for (var i=0; i<arguments.length; i++) { this.disabledWeekDays[arguments[i]] = true; }
|
1103 |
-
}
|
1104 |
-
|
1105 |
-
// Disable individual dates or ranges
|
1106 |
-
// Builds an internal logical test which is run via eval() for efficiency
|
1107 |
-
function CP_addDisabledDates(start, end) {
|
1108 |
-
if (arguments.length==1) { end=start; }
|
1109 |
-
if (start==null && end==null) { return; }
|
1110 |
-
if (this.disabledDatesExpression!="") { this.disabledDatesExpression+= "||"; }
|
1111 |
-
if (start!=null) { start = parseDate(start); start=""+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate());}
|
1112 |
-
if (end!=null) { end=parseDate(end); end=""+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate());}
|
1113 |
-
if (start==null) { this.disabledDatesExpression+="(ds<="+end+")"; }
|
1114 |
-
else if (end ==null) { this.disabledDatesExpression+="(ds>="+start+")"; }
|
1115 |
-
else { this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")"; }
|
1116 |
-
}
|
1117 |
-
|
1118 |
-
// Set the text to use for the "Today" link
|
1119 |
-
function CP_setTodayText(text) {
|
1120 |
-
this.todayText = text;
|
1121 |
-
}
|
1122 |
-
|
1123 |
-
// Set the prefix to be added to all CSS classes when writing output
|
1124 |
-
function CP_setCssPrefix(val) {
|
1125 |
-
this.cssPrefix = val;
|
1126 |
-
}
|
1127 |
-
|
1128 |
-
// Show the navigation as an dropdowns that can be manually changed
|
1129 |
-
function CP_showNavigationDropdowns() { this.isShowNavigationDropdowns = (arguments.length>0)?arguments[0]:true; }
|
1130 |
-
|
1131 |
-
// Show the year navigation as an input box that can be manually changed
|
1132 |
-
function CP_showYearNavigationInput() { this.isShowYearNavigationInput = (arguments.length>0)?arguments[0]:true; }
|
1133 |
-
|
1134 |
-
// Hide a calendar object
|
1135 |
-
function CP_hideCalendar() {
|
1136 |
-
if (arguments.length > 0) { window.popupWindowObjects[arguments[0]].hidePopup(); }
|
1137 |
-
else { this.hidePopup(); }
|
1138 |
-
}
|
1139 |
-
|
1140 |
-
// Refresh the contents of the calendar display
|
1141 |
-
function CP_refreshCalendar(index) {
|
1142 |
-
var calObject = window.popupWindowObjects[index];
|
1143 |
-
if (arguments.length>1) {
|
1144 |
-
calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));
|
1145 |
-
}
|
1146 |
-
else {
|
1147 |
-
calObject.populate(calObject.getCalendar());
|
1148 |
-
}
|
1149 |
-
calObject.refresh();
|
1150 |
-
}
|
1151 |
-
|
1152 |
-
// Populate the calendar and display it
|
1153 |
-
function CP_showCalendar(anchorname) {
|
1154 |
-
if (arguments.length>1) {
|
1155 |
-
if (arguments[1]==null||arguments[1]=="") {
|
1156 |
-
this.currentDate=new Date();
|
1157 |
-
}
|
1158 |
-
else {
|
1159 |
-
this.currentDate=new Date(parseDate(arguments[1]));
|
1160 |
-
}
|
1161 |
-
}
|
1162 |
-
this.populate(this.getCalendar());
|
1163 |
-
this.showPopup(anchorname);
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
// Simple method to interface popup calendar with a text-entry box
|
1167 |
-
function CP_select(inputobj, linkname, format) {
|
1168 |
-
var selectedDate=(arguments.length>3)?arguments[3]:null;
|
1169 |
-
if (!window.getDateFromFormat) {
|
1170 |
-
alert("calendar.select: To use this method you must also include 'date.js' for date formatting");
|
1171 |
-
return;
|
1172 |
-
}
|
1173 |
-
if (this.displayType!="date"&&this.displayType!="week-end") {
|
1174 |
-
alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");
|
1175 |
-
return;
|
1176 |
-
}
|
1177 |
-
if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") {
|
1178 |
-
alert("calendar.select: Input object passed is not a valid form input object");
|
1179 |
-
window.CP_targetInput=null;
|
1180 |
-
return;
|
1181 |
-
}
|
1182 |
-
if (inputobj.disabled) { return; } // Can't use calendar input on disabled form input!
|
1183 |
-
window.CP_targetInput = inputobj;
|
1184 |
-
window.CP_calendarObject = this;
|
1185 |
-
this.currentDate=null;
|
1186 |
-
var time=0;
|
1187 |
-
if (selectedDate!=null) {
|
1188 |
-
time = getDateFromFormat(selectedDate,format)
|
1189 |
-
}
|
1190 |
-
else if (inputobj.value!="") {
|
1191 |
-
time = getDateFromFormat(inputobj.value,format);
|
1192 |
-
}
|
1193 |
-
if (selectedDate!=null || inputobj.value!="") {
|
1194 |
-
if (time==0) { this.currentDate=null; }
|
1195 |
-
else { this.currentDate=new Date(time); }
|
1196 |
-
}
|
1197 |
-
window.CP_dateFormat = format;
|
1198 |
-
this.showCalendar(linkname);
|
1199 |
-
}
|
1200 |
-
|
1201 |
-
// Get style block needed to display the calendar correctly
|
1202 |
-
function getCalendarStyles() {
|
1203 |
-
var result = "";
|
1204 |
-
var p = "";
|
1205 |
-
if (this!=null && typeof(this.cssPrefix)!="undefined" && this.cssPrefix!=null && this.cssPrefix!="") { p=this.cssPrefix; }
|
1206 |
-
result += "<STYLE>\n";
|
1207 |
-
result += "."+p+"cpYearNavigation,."+p+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";
|
1208 |
-
result += "."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"cpTodayText,."+p+"cpTodayTextDisabled,."+p+"cpText { font-family:arial; font-size:8pt; }\n";
|
1209 |
-
result += "TD."+p+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";
|
1210 |
-
result += "."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate { text-align:right; text-decoration:none; }\n";
|
1211 |
-
result += "."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";
|
1212 |
-
result += "."+p+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";
|
1213 |
-
result += "."+p+"cpOtherMonthDate { color:#808080; }\n";
|
1214 |
-
result += "TD."+p+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";
|
1215 |
-
result += "TD."+p+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";
|
1216 |
-
result += "TD."+p+"cpTodayText, TD."+p+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";
|
1217 |
-
result += "A."+p+"cpTodayText, SPAN."+p+"cpTodayTextDisabled { height:20px; }\n";
|
1218 |
-
result += "A."+p+"cpTodayText { color:black; }\n";
|
1219 |
-
result += "."+p+"cpTodayTextDisabled { color:#D0D0D0; }\n";
|
1220 |
-
result += "."+p+"cpBorder { border:solid thin #808080; }\n";
|
1221 |
-
result += "</STYLE>\n";
|
1222 |
-
return result;
|
1223 |
-
}
|
1224 |
-
|
1225 |
-
// Return a string containing all the calendar code to be displayed
|
1226 |
-
function CP_getCalendar() {
|
1227 |
-
var now = new Date();
|
1228 |
-
// Reference to window
|
1229 |
-
if (this.type == "WINDOW") { var windowref = "window.opener."; }
|
1230 |
-
else { var windowref = ""; }
|
1231 |
-
var result = "";
|
1232 |
-
// If POPUP, write entire HTML document
|
1233 |
-
if (this.type == "WINDOW") {
|
1234 |
-
result += "<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";
|
1235 |
-
result += '<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n';
|
1236 |
-
}
|
1237 |
-
else {
|
1238 |
-
result += '<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';
|
1239 |
-
result += '<TR><TD ALIGN=CENTER>\n';
|
1240 |
-
result += '<CENTER>\n';
|
1241 |
-
}
|
1242 |
-
// Code for DATE display (default)
|
1243 |
-
// -------------------------------
|
1244 |
-
if (this.displayType=="date" || this.displayType=="week-end") {
|
1245 |
-
if (this.currentDate==null) { this.currentDate = now; }
|
1246 |
-
if (arguments.length > 0) { var month = arguments[0]; }
|
1247 |
-
else { var month = this.currentDate.getMonth()+1; }
|
1248 |
-
if (arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]) { var year = arguments[1]; }
|
1249 |
-
else { var year = this.currentDate.getFullYear(); }
|
1250 |
-
var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
|
1251 |
-
if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) {
|
1252 |
-
daysinmonth[2] = 29;
|
1253 |
-
}
|
1254 |
-
var current_month = new Date(year,month-1,1);
|
1255 |
-
var display_year = year;
|
1256 |
-
var display_month = month;
|
1257 |
-
var display_date = 1;
|
1258 |
-
var weekday= current_month.getDay();
|
1259 |
-
var offset = 0;
|
1260 |
-
|
1261 |
-
offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ;
|
1262 |
-
if (offset > 0) {
|
1263 |
-
display_month--;
|
1264 |
-
if (display_month < 1) { display_month = 12; display_year--; }
|
1265 |
-
display_date = daysinmonth[display_month]-offset+1;
|
1266 |
-
}
|
1267 |
-
var next_month = month+1;
|
1268 |
-
var next_month_year = year;
|
1269 |
-
if (next_month > 12) { next_month=1; next_month_year++; }
|
1270 |
-
var last_month = month-1;
|
1271 |
-
var last_month_year = year;
|
1272 |
-
if (last_month < 1) { last_month=12; last_month_year--; }
|
1273 |
-
var date_class;
|
1274 |
-
if (this.type!="WINDOW") {
|
1275 |
-
result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
|
1276 |
-
}
|
1277 |
-
result += '<TR>\n';
|
1278 |
-
var refresh = windowref+'CP_refreshCalendar';
|
1279 |
-
var refreshLink = 'javascript:' + refresh;
|
1280 |
-
if (this.isShowNavigationDropdowns) {
|
1281 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+'('+this.index+',this.options[this.selectedIndex].value-0,'+(year-0)+');">';
|
1282 |
-
for( var monthCounter=1; monthCounter<=12; monthCounter++ ) {
|
1283 |
-
var selected = (monthCounter==month) ? 'SELECTED' : '';
|
1284 |
-
result += '<option value="'+monthCounter+'" '+selected+'>'+this.monthNames[monthCounter-1]+'</option>';
|
1285 |
-
}
|
1286 |
-
result += '</select></TD>';
|
1287 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"> </TD>';
|
1288 |
-
|
1289 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+'('+this.index+','+month+',this.options[this.selectedIndex].value-0);">';
|
1290 |
-
for( var yearCounter=year-this.yearSelectStartOffset; yearCounter<=year+this.yearSelectStartOffset; yearCounter++ ) {
|
1291 |
-
var selected = (yearCounter==year) ? 'SELECTED' : '';
|
1292 |
-
result += '<option value="'+yearCounter+'" '+selected+'>'+yearCounter+'</option>';
|
1293 |
-
}
|
1294 |
-
result += '</select></TD>';
|
1295 |
-
}
|
1296 |
-
else {
|
1297 |
-
if (this.isShowYearNavigation) {
|
1298 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');"><</A></TD>';
|
1299 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+'</SPAN></TD>';
|
1300 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">></A></TD>';
|
1301 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"> </TD>';
|
1302 |
-
|
1303 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year-1)+');"><</A></TD>';
|
1304 |
-
if (this.isShowYearNavigationInput) {
|
1305 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+'('+this.index+','+month+',this.value-0);"></TD>';
|
1306 |
-
}
|
1307 |
-
else {
|
1308 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+'</SPAN></TD>';
|
1309 |
-
}
|
1310 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year+1)+');">></A></TD>';
|
1311 |
-
}
|
1312 |
-
else {
|
1313 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');"><<</A></TD>\n';
|
1314 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+' '+year+'</SPAN></TD>\n';
|
1315 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">>></A></TD>\n';
|
1316 |
-
}
|
1317 |
-
}
|
1318 |
-
result += '</TR></TABLE>\n';
|
1319 |
-
result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n';
|
1320 |
-
result += '<TR>\n';
|
1321 |
-
for (var j=0; j<7; j++) {
|
1322 |
-
|
1323 |
-
result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';
|
1324 |
-
}
|
1325 |
-
result += '</TR>\n';
|
1326 |
-
for (var row=1; row<=6; row++) {
|
1327 |
-
result += '<TR>\n';
|
1328 |
-
for (var col=1; col<=7; col++) {
|
1329 |
-
var disabled=false;
|
1330 |
-
if (this.disabledDatesExpression!="") {
|
1331 |
-
var ds=""+display_year+LZ(display_month)+LZ(display_date);
|
1332 |
-
eval("disabled=("+this.disabledDatesExpression+")");
|
1333 |
-
}
|
1334 |
-
var dateClass = "";
|
1335 |
-
if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) {
|
1336 |
-
dateClass = "cpCurrentDate";
|
1337 |
-
}
|
1338 |
-
else if (display_month == month) {
|
1339 |
-
dateClass = "cpCurrentMonthDate";
|
1340 |
-
}
|
1341 |
-
else {
|
1342 |
-
dateClass = "cpOtherMonthDate";
|
1343 |
-
}
|
1344 |
-
if (disabled || this.disabledWeekDays[col-1]) {
|
1345 |
-
result += ' <TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';
|
1346 |
-
}
|
1347 |
-
else {
|
1348 |
-
var selected_date = display_date;
|
1349 |
-
var selected_month = display_month;
|
1350 |
-
var selected_year = display_year;
|
1351 |
-
if (this.displayType=="week-end") {
|
1352 |
-
var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);
|
1353 |
-
d.setDate(d.getDate() + (7-col));
|
1354 |
-
selected_year = d.getYear();
|
1355 |
-
if (selected_year < 1000) { selected_year += 1900; }
|
1356 |
-
selected_month = d.getMonth()+1;
|
1357 |
-
selected_date = d.getDate();
|
1358 |
-
}
|
1359 |
-
result += ' <TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';
|
1360 |
-
}
|
1361 |
-
display_date++;
|
1362 |
-
if (display_date > daysinmonth[display_month]) {
|
1363 |
-
display_date=1;
|
1364 |
-
display_month++;
|
1365 |
-
}
|
1366 |
-
if (display_month > 12) {
|
1367 |
-
display_month=1;
|
1368 |
-
display_year++;
|
1369 |
-
}
|
1370 |
-
}
|
1371 |
-
result += '</TR>';
|
1372 |
-
}
|
1373 |
-
var current_weekday = now.getDay() - this.weekStartDay;
|
1374 |
-
if (current_weekday < 0) {
|
1375 |
-
current_weekday += 7;
|
1376 |
-
}
|
1377 |
-
result += '<TR>\n';
|
1378 |
-
result += ' <TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';
|
1379 |
-
if (this.disabledDatesExpression!="") {
|
1380 |
-
var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());
|
1381 |
-
eval("disabled=("+this.disabledDatesExpression+")");
|
1382 |
-
}
|
1383 |
-
if (disabled || this.disabledWeekDays[current_weekday+1]) {
|
1384 |
-
result += ' <SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+'</SPAN>\n';
|
1385 |
-
}
|
1386 |
-
else {
|
1387 |
-
result += ' <A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+'(\''+now.getFullYear()+'\',\''+(now.getMonth()+1)+'\',\''+now.getDate()+'\');'+windowref+'CP_hideCalendar(\''+this.index+'\');">'+this.todayText+'</A>\n';
|
1388 |
-
}
|
1389 |
-
result += ' <BR>\n';
|
1390 |
-
result += ' </TD></TR></TABLE></CENTER></TD></TR></TABLE>\n';
|
1391 |
-
}
|
1392 |
-
|
1393 |
-
// Code common for MONTH, QUARTER, YEAR
|
1394 |
-
// ------------------------------------
|
1395 |
-
if (this.displayType=="month" || this.displayType=="quarter" || this.displayType=="year") {
|
1396 |
-
if (arguments.length > 0) { var year = arguments[0]; }
|
1397 |
-
else {
|
1398 |
-
if (this.displayType=="year") { var year = now.getFullYear()-this.yearSelectStartOffset; }
|
1399 |
-
else { var year = now.getFullYear(); }
|
1400 |
-
}
|
1401 |
-
if (this.displayType!="year" && this.isShowYearNavigation) {
|
1402 |
-
result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
|
1403 |
-
result += '<TR>\n';
|
1404 |
-
result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-1)+');"><<</A></TD>\n';
|
1405 |
-
result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+'</TD>\n';
|
1406 |
-
result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+1)+');">>></A></TD>\n';
|
1407 |
-
result += '</TR></TABLE>\n';
|
1408 |
-
}
|
1409 |
-
}
|
1410 |
-
|
1411 |
-
// Code for MONTH display
|
1412 |
-
// ----------------------
|
1413 |
-
if (this.displayType=="month") {
|
1414 |
-
// If POPUP, write entire HTML document
|
1415 |
-
result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';
|
1416 |
-
for (var i=0; i<4; i++) {
|
1417 |
-
result += '<TR>';
|
1418 |
-
for (var j=0; j<3; j++) {
|
1419 |
-
var monthindex = ((i*3)+j);
|
1420 |
-
result += '<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+'('+year+','+(monthindex+1)+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+'</A></TD>';
|
1421 |
-
}
|
1422 |
-
result += '</TR>';
|
1423 |
-
}
|
1424 |
-
result += '</TABLE></CENTER></TD></TR></TABLE>\n';
|
1425 |
-
}
|
1426 |
-
|
1427 |
-
// Code for QUARTER display
|
1428 |
-
// ------------------------
|
1429 |
-
if (this.displayType=="quarter") {
|
1430 |
-
result += '<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n';
|
1431 |
-
for (var i=0; i<2; i++) {
|
1432 |
-
result += '<TR>';
|
1433 |
-
for (var j=0; j<2; j++) {
|
1434 |
-
var quarter = ((i*2)+j+1);
|
1435 |
-
result += '<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+'('+year+','+quarter+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+'</A><BR><BR></TD>';
|
1436 |
-
}
|
1437 |
-
result += '</TR>';
|
1438 |
-
}
|
1439 |
-
result += '</TABLE></CENTER></TD></TR></TABLE>\n';
|
1440 |
-
}
|
1441 |
-
|
1442 |
-
// Code for YEAR display
|
1443 |
-
// ---------------------
|
1444 |
-
if (this.displayType=="year") {
|
1445 |
-
var yearColumnSize = 4;
|
1446 |
-
result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
|
1447 |
-
result += '<TR>\n';
|
1448 |
-
result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-(yearColumnSize*2))+');"><<</A></TD>\n';
|
1449 |
-
result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+(yearColumnSize*2))+');">>></A></TD>\n';
|
1450 |
-
result += '</TR></TABLE>\n';
|
1451 |
-
result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';
|
1452 |
-
for (var i=0; i<yearColumnSize; i++) {
|
1453 |
-
for (var j=0; j<2; j++) {
|
1454 |
-
var currentyear = year+(j*yearColumnSize)+i;
|
1455 |
-
result += '<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+'('+currentyear+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+currentyear+'</A></TD>';
|
1456 |
-
}
|
1457 |
-
result += '</TR>';
|
1458 |
-
}
|
1459 |
-
result += '</TABLE></CENTER></TD></TR></TABLE>\n';
|
1460 |
-
}
|
1461 |
-
// Common
|
1462 |
-
if (this.type == "WINDOW") {
|
1463 |
-
result += "</BODY></HTML>\n";
|
1464 |
-
}
|
1465 |
-
return result;
|
1466 |
-
}
|
1467 |
-
|
1 |
+
/*
|
2 |
+
* CalendarJS v1.5
|
3 |
+
*
|
4 |
+
* Copyright 2011-2012, Dimitar Ivanov (http://www.bulgaria-web-developers.com/projects/javascript/calendar/)
|
5 |
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL Version 3
|
6 |
+
* (http://www.opensource.org/licenses/gpl-3.0.html) license.
|
7 |
+
*
|
8 |
+
* Date: Thu Jul 26 23:15:56 2012 +0300
|
9 |
+
*/
|
10 |
+
(function (window, undefined) {
|
11 |
+
var now = new Date(),
|
12 |
+
today = [now.getFullYear(), now.getMonth(), now.getDate()].join('-'),
|
13 |
+
midnight = new Date(now.getFullYear(), now.getMonth(), now.getDate()),
|
14 |
+
d = window.document;
|
15 |
+
|
16 |
+
function Calendar(options) {
|
17 |
+
this.version = "1.5";
|
18 |
+
this.isOpen = false;
|
19 |
+
this.focus = false;
|
20 |
+
this.id = null;
|
21 |
+
this.container = null;
|
22 |
+
this.element = null;
|
23 |
+
this.selectedDate = null;
|
24 |
+
this.opts = {
|
25 |
+
year: new Date().getFullYear(),
|
26 |
+
month: new Date().getMonth(),
|
27 |
+
dayNames: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
28 |
+
dayNamesFull: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
29 |
+
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
30 |
+
monthNamesFull: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
31 |
+
startDay: 0,
|
32 |
+
weekNumbers: false,
|
33 |
+
selectOtherMonths: false,
|
34 |
+
showOtherMonths: true,
|
35 |
+
showNavigation: true,
|
36 |
+
months: 1,
|
37 |
+
inline: false,
|
38 |
+
disablePast: false,
|
39 |
+
dateFormat: 'Y-m-d',
|
40 |
+
position: 'right',
|
41 |
+
minDate: null,
|
42 |
+
onBeforeOpen: function () {},
|
43 |
+
onBeforeClose: function () {},
|
44 |
+
onOpen: function () {},
|
45 |
+
onClose: function () {},
|
46 |
+
onSelect: function () {},
|
47 |
+
onBeforeShowDay: function () {
|
48 |
+
return [true, ''];
|
49 |
+
}
|
50 |
+
};
|
51 |
+
for (var key in options) {
|
52 |
+
if (options.hasOwnProperty(key)) {
|
53 |
+
this.opts[key] = options[key];
|
54 |
+
}
|
55 |
+
}
|
56 |
+
this.init.call(this);
|
57 |
+
}
|
58 |
+
/* Static functions */
|
59 |
+
Calendar.Util = {
|
60 |
+
addClass: function (ele, cls) {
|
61 |
+
if (ele && !this.hasClass(ele, cls)) {
|
62 |
+
ele.className += ele.className.length > 0 ? " " + cls : cls;
|
63 |
+
}
|
64 |
+
},
|
65 |
+
hasClass: function (ele, cls) {
|
66 |
+
if (ele && typeof ele.className != 'undefined' && typeof ele.nodeType != 'undefined' && ele.nodeType === 1) {
|
67 |
+
return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
|
68 |
+
}
|
69 |
+
return false;
|
70 |
+
},
|
71 |
+
removeClass: function (ele, cls) {
|
72 |
+
if (this.hasClass(ele, cls)) {
|
73 |
+
var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
|
74 |
+
ele.className = ele.className.replace(reg, ' ');
|
75 |
+
}
|
76 |
+
},
|
77 |
+
addEvent: function (obj, type, fn) {
|
78 |
+
if (obj.addEventListener) {
|
79 |
+
obj.addEventListener(type, fn, false);
|
80 |
+
} else if (obj.attachEvent) {
|
81 |
+
obj["e" + type + fn] = fn;
|
82 |
+
obj[type + fn] = function () {
|
83 |
+
obj["e" + type + fn](window.event);
|
84 |
+
};
|
85 |
+
obj.attachEvent("on" + type, obj[type + fn]);
|
86 |
+
} else {
|
87 |
+
obj["on" + type] = obj["e" + type + fn];
|
88 |
+
}
|
89 |
+
},
|
90 |
+
getElementsByClass: function (searchClass, node, tag) {
|
91 |
+
var classElements = [];
|
92 |
+
if (node === null) {
|
93 |
+
node = d;
|
94 |
+
}
|
95 |
+
if (tag === null) {
|
96 |
+
tag = '*';
|
97 |
+
}
|
98 |
+
var els = node.getElementsByTagName(tag);
|
99 |
+
var elsLen = els.length;
|
100 |
+
var pattern = new RegExp("(^|\\s)" + searchClass + "(\\s|$)");
|
101 |
+
for (var i = 0, j = 0; i < elsLen; i++) {
|
102 |
+
if (pattern.test(els[i].className)) {
|
103 |
+
classElements[j] = els[i];
|
104 |
+
j++;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
return classElements;
|
108 |
+
},
|
109 |
+
getEventTarget: function (e) {
|
110 |
+
var targ;
|
111 |
+
if (!e) {
|
112 |
+
e = window.event;
|
113 |
+
}
|
114 |
+
if (e.target) {
|
115 |
+
targ = e.target;
|
116 |
+
} else if (e.srcElement) {
|
117 |
+
targ = e.srcElement;
|
118 |
+
}
|
119 |
+
if (targ.nodeType == 3) {
|
120 |
+
targ = targ.parentNode;
|
121 |
+
}
|
122 |
+
return targ;
|
123 |
+
}
|
124 |
+
};
|
125 |
+
/* Private functions */
|
126 |
+
function emptyRow(weekNumbers) {
|
127 |
+
var i, cell, cols = weekNumbers ? 8 : 7,
|
128 |
+
row = d.createElement('tr');
|
129 |
+
for (i = 0; i < cols; i++) {
|
130 |
+
cell = d.createElement('td');
|
131 |
+
Calendar.Util.addClass(cell, 'bcal-empty');
|
132 |
+
row.appendChild(cell);
|
133 |
+
}
|
134 |
+
return row;
|
135 |
+
}
|
136 |
+
/**
|
137 |
+
* @param Object obj
|
138 |
+
* @return Array
|
139 |
+
*/
|
140 |
+
function findPos(obj) {
|
141 |
+
var curleft = 0, curtop = 0;
|
142 |
+
if (obj.offsetParent) {
|
143 |
+
do {
|
144 |
+
curleft += obj.offsetLeft;
|
145 |
+
curtop += obj.offsetTop;
|
146 |
+
} while (obj = obj.offsetParent);
|
147 |
+
return [curleft, curtop];
|
148 |
+
}
|
149 |
+
}
|
150 |
+
/**
|
151 |
+
* @param Number i
|
152 |
+
* @param Number month
|
153 |
+
* @return Number
|
154 |
+
*/
|
155 |
+
function getIndex(i, months) {
|
156 |
+
if (i > 0 && i < months - 1) {
|
157 |
+
return 0;
|
158 |
+
} else if (i > 0 && i === months - 1) {
|
159 |
+
return 2;
|
160 |
+
} else if (i === 0 && i === months - 1) {
|
161 |
+
return 3;
|
162 |
+
} else if (i === 0 && i < months - 1) {
|
163 |
+
return 1;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
/**
|
167 |
+
* Format date
|
168 |
+
*
|
169 |
+
* @param String format
|
170 |
+
* @param Number date
|
171 |
+
* @return String
|
172 |
+
*/
|
173 |
+
function _formatDate(format, date) {
|
174 |
+
|
175 |
+
function pad(input) {
|
176 |
+
return (input + "").length === 2 ? input : "0" + input;
|
177 |
+
}
|
178 |
+
|
179 |
+
var i, len, f,
|
180 |
+
output = [],
|
181 |
+
dt = new Date(date);
|
182 |
+
for (i = 0, len = format.length; i < len; i++) {
|
183 |
+
f = format.charAt(i);
|
184 |
+
switch (f) {
|
185 |
+
case 'Y':
|
186 |
+
output.push(dt.getFullYear());
|
187 |
+
break;
|
188 |
+
case 'y':
|
189 |
+
output.push((dt.getFullYear() + "").slice(-2));
|
190 |
+
break;
|
191 |
+
case 'm':
|
192 |
+
output.push(pad(dt.getMonth() + 1));
|
193 |
+
break;
|
194 |
+
case 'n':
|
195 |
+
output.push(dt.getMonth() + 1);
|
196 |
+
break;
|
197 |
+
case 'F':
|
198 |
+
output.push(this.opts.monthNamesFull[dt.getMonth()]);
|
199 |
+
break;
|
200 |
+
case 'M':
|
201 |
+
output.push(this.opts.monthNames[dt.getMonth()]);
|
202 |
+
break;
|
203 |
+
case 'd':
|
204 |
+
output.push(pad(dt.getDate()));
|
205 |
+
break;
|
206 |
+
case 'j':
|
207 |
+
output.push(dt.getDate());
|
208 |
+
break;
|
209 |
+
case 'D':
|
210 |
+
output.push(this.opts.dayNamesFull[dt.getDay()].slice(0, 3));
|
211 |
+
break;
|
212 |
+
case 'l':
|
213 |
+
output.push(this.opts.dayNamesFull[dt.getDay()]);
|
214 |
+
break;
|
215 |
+
default:
|
216 |
+
output.push(f);
|
217 |
+
}
|
218 |
+
}
|
219 |
+
return output.join("");
|
220 |
+
}
|
221 |
+
|
222 |
+
function is(type, obj) {
|
223 |
+
var clas = Object.prototype.toString.call(obj).slice(8, -1);
|
224 |
+
return obj !== undefined && obj !== null && clas === type;
|
225 |
+
}
|
226 |
+
|
227 |
+
Calendar.prototype = {
|
228 |
+
/**
|
229 |
+
* @return Instance of calendar
|
230 |
+
*/
|
231 |
+
init: function () {
|
232 |
+
var self = this,
|
233 |
+
i = 0, attrname,
|
234 |
+
body = d.getElementsByTagName("body")[0],
|
235 |
+
div = d.createElement('div');
|
236 |
+
self.id = Math.floor(Math.random() * 9999999);
|
237 |
+
self.element = d.getElementById(self.opts.element);
|
238 |
+
if (!self.element) {
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
if (self.element.nodeType === 1 && self.element.nodeName == "INPUT" && self.element.value.length > 0) {
|
242 |
+
var now = new Date(self.element.value);
|
243 |
+
self.selectedDate = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate());
|
244 |
+
self.opts.year = self.selectedDate.getFullYear();
|
245 |
+
self.opts.month = self.selectedDate.getMonth();
|
246 |
+
}
|
247 |
+
self.element.style.cursor = 'pointer';
|
248 |
+
div.setAttribute('id', ['bcal-container', self.id].join('-'));
|
249 |
+
Calendar.Util.addClass(div, 'bcal-container');
|
250 |
+
if (!self.opts.inline) {
|
251 |
+
div.style.display = 'none';
|
252 |
+
div.style.position = 'absolute';
|
253 |
+
Calendar.Util.addEvent(self.element, 'focus', function (e) {
|
254 |
+
if (self.isOpen) {
|
255 |
+
self.close();
|
256 |
+
} else {
|
257 |
+
self.open();
|
258 |
+
}
|
259 |
+
});
|
260 |
+
Calendar.Util.addEvent(self.element, 'blur', function (e) {
|
261 |
+
if (self.isOpen && !self.focus) {
|
262 |
+
self.close();
|
263 |
+
}
|
264 |
+
});
|
265 |
+
Calendar.Util.addEvent(self.element, 'keydown', function (e) {
|
266 |
+
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
|
267 |
+
switch (key) {
|
268 |
+
case 9: //Tab
|
269 |
+
self.close();
|
270 |
+
break;
|
271 |
+
case 27: //Escape
|
272 |
+
self.close();
|
273 |
+
break;
|
274 |
+
}
|
275 |
+
});
|
276 |
+
Calendar.Util.addEvent(document, "mousedown", function (e) {
|
277 |
+
var target = Calendar.Util.getEventTarget(e);
|
278 |
+
if (Calendar.Util.hasClass(target, "bcal-container") ||
|
279 |
+
Calendar.Util.hasClass(target, "bcal-table") ||
|
280 |
+
Calendar.Util.hasClass(target, "bcal-date") ||
|
281 |
+
Calendar.Util.hasClass(target, "bcal-today") ||
|
282 |
+
Calendar.Util.hasClass(target, "bcal-empty") ||
|
283 |
+
Calendar.Util.hasClass(target, "bcal-selected") ||
|
284 |
+
Calendar.Util.hasClass(target, "bcal-week") ||
|
285 |
+
Calendar.Util.hasClass(target, "bcal-nav") ||
|
286 |
+
Calendar.Util.hasClass(target, "bcal-navi") ||
|
287 |
+
Calendar.Util.hasClass(target, "bcal-month") ||
|
288 |
+
Calendar.Util.hasClass(target, "bcal-wday") ||
|
289 |
+
Calendar.Util.hasClass(target, "bcal-wnum") ||
|
290 |
+
Calendar.Util.hasClass(target.parentNode, "bcal-container") ||
|
291 |
+
Calendar.Util.hasClass(target.parentNode, "bcal-table")) {
|
292 |
+
|
293 |
+
} else {
|
294 |
+
self.close();
|
295 |
+
}
|
296 |
+
});
|
297 |
+
body.appendChild(div);
|
298 |
+
} else {
|
299 |
+
self.element.appendChild(div);
|
300 |
+
}
|
301 |
+
self.container = div;
|
302 |
+
var y = self.opts.year, m = self.opts.month;
|
303 |
+
for (i = 0; i < self.opts.months; i++) {
|
304 |
+
self.draw(y, m + i, getIndex(i, self.opts.months));
|
305 |
+
}
|
306 |
+
return self;
|
307 |
+
},
|
308 |
+
/**
|
309 |
+
* @param String format
|
310 |
+
* @param Number date
|
311 |
+
* @return String
|
312 |
+
*/
|
313 |
+
formatDate: function () {
|
314 |
+
return _formatDate.apply(this, arguments);
|
315 |
+
},
|
316 |
+
/**
|
317 |
+
* @param Number year
|
318 |
+
* @param Number month
|
319 |
+
* @param Number index (0 - without navigation, 1 - prev navigation, 2 - next navigation, 3 - prev and next navigation)
|
320 |
+
* @param Number id
|
321 |
+
*/
|
322 |
+
draw: function (year, month, index, id) {
|
323 |
+
var self = this,
|
324 |
+
autoId = typeof id === 'undefined' ? Math.floor(Math.random() * 9999999) : id,
|
325 |
+
firstOfMonth = new Date(year, month, 1),
|
326 |
+
daysInMonth = new Date(year, month + 1, 0).getDate(),
|
327 |
+
daysInPrevMonth = new Date(year, month, 0).getDate(),
|
328 |
+
startDay = firstOfMonth.getUTCDay(),
|
329 |
+
first = firstOfMonth.getDay(),
|
330 |
+
i, day, date, rows = 0, cols = self.opts.weekNumbers ? 8 : 7,
|
331 |
+
table = d.createElement('table'),
|
332 |
+
thead = d.createElement('thead'),
|
333 |
+
tbody = d.createElement('tbody'),
|
334 |
+
row, cell, text, a, b, jsdate, current, oBsd,
|
335 |
+
s_arr, si, slen,
|
336 |
+
minDate = false;
|
337 |
+
|
338 |
+
if (self.opts.minDate !== null) {
|
339 |
+
minDate = true;
|
340 |
+
}
|
341 |
+
|
342 |
+
row = d.createElement('tr');
|
343 |
+
// Prev month link
|
344 |
+
cell = d.createElement('th');
|
345 |
+
if (self.opts.showNavigation && (index === 1 || index === 3)) {
|
346 |
+
Calendar.Util.addEvent(cell, 'click', function (e) {
|
347 |
+
self.container.innerHTML = '';
|
348 |
+
for (i = 0; i < self.opts.months; i++) {
|
349 |
+
self.draw(year, month - self.opts.months + i, getIndex(i, self.opts.months));
|
350 |
+
if (i === 0) {
|
351 |
+
self.opts.month = month - self.opts.months;
|
352 |
+
self.opts.year = year;
|
353 |
+
}
|
354 |
+
}
|
355 |
+
});
|
356 |
+
cell.style.cursor = 'pointer';
|
357 |
+
Calendar.Util.addClass(cell, "bcal-nav");
|
358 |
+
text = d.createTextNode('<');
|
359 |
+
cell.appendChild(text);
|
360 |
+
} else {
|
361 |
+
Calendar.Util.addClass(cell, "bcal-navi");
|
362 |
+
}
|
363 |
+
row.appendChild(cell);
|
364 |
+
|
365 |
+
// Month name, Year
|
366 |
+
cell = d.createElement('th');
|
367 |
+
cell.colSpan = (cols === 7) ? 5 : 6;
|
368 |
+
Calendar.Util.addClass(cell, "bcal-month");
|
369 |
+
cell.appendChild(d.createTextNode(self.opts.monthNamesFull[firstOfMonth.getMonth()] + ' ' + firstOfMonth.getFullYear()));
|
370 |
+
row.appendChild(cell);
|
371 |
+
|
372 |
+
// Next month link
|
373 |
+
cell = d.createElement('th');
|
374 |
+
if (self.opts.showNavigation && (index === 2 || index === 3)) {
|
375 |
+
cell.style.cursor = 'pointer';
|
376 |
+
Calendar.Util.addClass(cell, "bcal-nav");
|
377 |
+
text = d.createTextNode('>');
|
378 |
+
Calendar.Util.addEvent(cell, 'click', function (e) {
|
379 |
+
self.container.innerHTML = '';
|
380 |
+
for (i = 0; i < self.opts.months; i++) {
|
381 |
+
self.draw(year, month + i + 1, getIndex(i, self.opts.months));
|
382 |
+
if (i === 0) {
|
383 |
+
self.opts.month = month + 1;
|
384 |
+
self.opts.year = year;
|
385 |
+
}
|
386 |
+
}
|
387 |
+
});
|
388 |
+
cell.appendChild(text);
|
389 |
+
} else {
|
390 |
+
Calendar.Util.addClass(cell, "bcal-navi");
|
391 |
+
}
|
392 |
+
row.appendChild(cell);
|
393 |
+
thead.appendChild(row);
|
394 |
+
|
395 |
+
row = d.createElement('tr');
|
396 |
+
if (self.opts.weekNumbers) {
|
397 |
+
cell = d.createElement('th');
|
398 |
+
cell.appendChild(d.createTextNode('wk'));
|
399 |
+
Calendar.Util.addClass(cell, "bcal-wnum");
|
400 |
+
row.appendChild(cell);
|
401 |
+
}
|
402 |
+
|
403 |
+
for (i = 0; i < 7; i++) {
|
404 |
+
cell = d.createElement('th');
|
405 |
+
text = d.createTextNode(self.opts.dayNames[(self.opts.startDay + i) % 7]);
|
406 |
+
Calendar.Util.addClass(cell, "bcal-wday");
|
407 |
+
cell.appendChild(text);
|
408 |
+
row.appendChild(cell);
|
409 |
+
}
|
410 |
+
thead.appendChild(row);
|
411 |
+
table.appendChild(thead);
|
412 |
+
|
413 |
+
day = self.opts.startDay + 1 - first;
|
414 |
+
while (day > 1) {
|
415 |
+
day -= 7;
|
416 |
+
}
|
417 |
+
while (day <= daysInMonth) {
|
418 |
+
jsdate = new Date(year, month, day + startDay);
|
419 |
+
row = d.createElement('tr');
|
420 |
+
if (self.opts.weekNumbers) {
|
421 |
+
cell = d.createElement('td');
|
422 |
+
Calendar.Util.addClass(cell, 'bcal-week');
|
423 |
+
a = new Date(jsdate.getFullYear(), jsdate.getMonth(), jsdate.getDate() - (jsdate.getDay() || 7) + 3);
|
424 |
+
b = new Date(a.getFullYear(), 0, 4);
|
425 |
+
cell.appendChild(d.createTextNode(1 + Math.round((a - b) / 864e5 / 7)));
|
426 |
+
row.appendChild(cell);
|
427 |
+
}
|
428 |
+
|
429 |
+
for (i = 0; i < 7; i++) {
|
430 |
+
cell = d.createElement('td');
|
431 |
+
if (day > 0 && day <= daysInMonth) {
|
432 |
+
current = new Date(year, month, day);
|
433 |
+
cell.setAttribute('bcal-date', current.getTime());
|
434 |
+
Calendar.Util.addClass(cell, 'bcal-date');
|
435 |
+
if (today === [current.getFullYear(), current.getMonth(), current.getDate()].join('-')) {
|
436 |
+
Calendar.Util.addClass(cell, 'bcal-today');
|
437 |
+
}
|
438 |
+
text = d.createTextNode(day);
|
439 |
+
cell.appendChild(text);
|
440 |
+
oBsd = self.opts.onBeforeShowDay.apply(self, [current]);
|
441 |
+
if (self.opts.disablePast === true && current < midnight) {
|
442 |
+
Calendar.Util.addClass(cell, 'bcal-past');
|
443 |
+
} else if (minDate && current < self.opts.minDate) {
|
444 |
+
Calendar.Util.addClass(cell, 'bcal-past');
|
445 |
+
} else if (oBsd[0] === false) {
|
446 |
+
Calendar.Util.addClass(cell, oBsd[1]);
|
447 |
+
} else {
|
448 |
+
self.bind.call(self, cell);
|
449 |
+
}
|
450 |
+
|
451 |
+
} else {
|
452 |
+
if (self.opts.showOtherMonths) {
|
453 |
+
var _day = day > 0 ? day - daysInMonth: daysInPrevMonth + day,
|
454 |
+
_month = day > 0 ? month + 1 : month - 1;
|
455 |
+
text = d.createTextNode(_day);
|
456 |
+
cell.appendChild(text);
|
457 |
+
|
458 |
+
current = new Date(year, _month, _day);
|
459 |
+
cell.setAttribute('bcal-date', current.getTime());
|
460 |
+
|
461 |
+
if (self.opts.selectOtherMonths) {
|
462 |
+
self.bind.call(self, cell);
|
463 |
+
}
|
464 |
+
}
|
465 |
+
Calendar.Util.addClass(cell, 'bcal-empty');
|
466 |
+
}
|
467 |
+
if (self.selectedDate !== null && self.selectedDate.getTime() === current.getTime() && self.opts.month === month) {
|
468 |
+
Calendar.Util.addClass(cell, 'bcal-selected');
|
469 |
+
}
|
470 |
+
row.appendChild(cell);
|
471 |
+
tbody.appendChild(row);
|
472 |
+
day++;
|
473 |
+
}
|
474 |
+
rows++;
|
475 |
+
}
|
476 |
+
if (rows === 5) {
|
477 |
+
tbody.appendChild(emptyRow(self.opts.weekNumbers));
|
478 |
+
} else if (rows === 4) {
|
479 |
+
tbody.appendChild(emptyRow(self.opts.weekNumbers));
|
480 |
+
tbody.appendChild(emptyRow(self.opts.weekNumbers));
|
481 |
+
}
|
482 |
+
|
483 |
+
Calendar.Util.addClass(table, 'bcal-table');
|
484 |
+
table.setAttribute('id', ['bcal-table', autoId].join('-'));
|
485 |
+
table.appendChild(tbody);
|
486 |
+
|
487 |
+
Calendar.Util.addEvent(table, 'click', function (e) {
|
488 |
+
self.focus = true;
|
489 |
+
});
|
490 |
+
|
491 |
+
var tbl = d.getElementById(['bcal-table', autoId].join('-'));
|
492 |
+
if (tbl) {
|
493 |
+
self.container.removeChild(tbl);
|
494 |
+
}
|
495 |
+
self.container.appendChild(table);
|
496 |
+
},
|
497 |
+
bind: function (cell) {
|
498 |
+
var self = this,
|
499 |
+
s_arr, si, slen;
|
500 |
+
Calendar.Util.addEvent(cell, 'click', (function (self, cell) {
|
501 |
+
return function () {
|
502 |
+
s_arr = Calendar.Util.getElementsByClass('bcal-selected', self.container, 'td');
|
503 |
+
for (si = 0, slen = s_arr.length; si < slen; si++) {
|
504 |
+
Calendar.Util.removeClass(s_arr[si], 'bcal-selected');
|
505 |
+
}
|
506 |
+
Calendar.Util.addClass(cell, 'bcal-selected');
|
507 |
+
var ts = parseInt(cell.getAttribute('bcal-date'), 10);
|
508 |
+
self.selectedDate = new Date(ts);
|
509 |
+
self.opts.year = self.selectedDate.getFullYear();
|
510 |
+
self.opts.month = self.selectedDate.getMonth();
|
511 |
+
if (self.opts.element && !self.opts.inline) {
|
512 |
+
self.close();
|
513 |
+
self.element.value = self.formatDate(self.opts.dateFormat, ts);
|
514 |
+
}
|
515 |
+
self.opts.onSelect.apply(self, [self.element, self.formatDate(self.opts.dateFormat, ts), ts, cell]);
|
516 |
+
self.refresh.call(self);
|
517 |
+
};
|
518 |
+
})(self, cell));
|
519 |
+
},
|
520 |
+
/**
|
521 |
+
* @return Instance of calendar
|
522 |
+
*/
|
523 |
+
open: function () {
|
524 |
+
var self = this,
|
525 |
+
pos = findPos(self.element),
|
526 |
+
result;
|
527 |
+
result = self.opts.onBeforeOpen.apply(self, []);
|
528 |
+
if (result === false) {
|
529 |
+
return self;
|
530 |
+
}
|
531 |
+
switch (self.opts.position) {
|
532 |
+
case 'right':
|
533 |
+
self.container.style.top = (pos[1]) + 'px';
|
534 |
+
self.container.style.left = (pos[0]+self.element.offsetWidth) + 'px';
|
535 |
+
break;
|
536 |
+
case 'bottom':
|
537 |
+
self.container.style.top = (pos[1] + self.element.offsetHeight) + 'px';
|
538 |
+
self.container.style.left = pos[0] + 'px';
|
539 |
+
break;
|
540 |
+
case 'top':
|
541 |
+
self.container.style.display = '';
|
542 |
+
self.container.style.top = (pos[1] - self.container.offsetHeight) + 'px';
|
543 |
+
self.container.style.left = pos[0] + 'px';
|
544 |
+
break;
|
545 |
+
}
|
546 |
+
|
547 |
+
self.container.style.display = '';
|
548 |
+
self.opts.onOpen.apply(self, [self.element]);
|
549 |
+
self.isOpen = true;
|
550 |
+
self.focus = true;
|
551 |
+
return self;
|
552 |
+
},
|
553 |
+
/**
|
554 |
+
* @return Instance of calendar
|
555 |
+
*/
|
556 |
+
close: function () {
|
557 |
+
var self = this,
|
558 |
+
result;
|
559 |
+
result = self.opts.onBeforeClose.apply(self, []);
|
560 |
+
if (result === false) {
|
561 |
+
return self;
|
562 |
+
}
|
563 |
+
self.container.style.display = 'none';
|
564 |
+
self.opts.onClose.apply(self, []);
|
565 |
+
self.isOpen = false;
|
566 |
+
self.focus = false;
|
567 |
+
return self;
|
568 |
+
},
|
569 |
+
detach: function () {
|
570 |
+
var self = this;
|
571 |
+
self.element.style.cursor = 'text';
|
572 |
+
self.container.parentNode.removeChild(self.container);
|
573 |
+
return self.element;
|
574 |
+
},
|
575 |
+
option: function (optName) {
|
576 |
+
var self = this;
|
577 |
+
switch (arguments.length) {
|
578 |
+
case 1:
|
579 |
+
if (is('String', optName) && self.opts[optName]) {
|
580 |
+
return self.opts[optName];
|
581 |
+
} else if (is('Object', optName)) {
|
582 |
+
for (var x in optName) {
|
583 |
+
if (optName.hasOwnProperty(x)) {
|
584 |
+
self.opts[x] = optName[x];
|
585 |
+
}
|
586 |
+
}
|
587 |
+
}
|
588 |
+
break;
|
589 |
+
case 2:
|
590 |
+
if (self.opts[optName]) {
|
591 |
+
self.opts[optName] = arguments[1];
|
592 |
+
}
|
593 |
+
break;
|
594 |
+
}
|
595 |
+
return self;
|
596 |
+
},
|
597 |
+
refresh: function () {
|
598 |
+
var self = this;
|
599 |
+
self.container.innerHTML = '';
|
600 |
+
var y = self.opts.year, m = self.opts.month;
|
601 |
+
for (i = 0; i < self.opts.months; i++) {
|
602 |
+
self.draw(y, m + i, getIndex(i, self.opts.months));
|
603 |
+
}
|
604 |
+
return self;
|
605 |
+
}
|
606 |
+
};
|
607 |
+
return (window.Calendar = Calendar);
|
608 |
+
})(window);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: KieranOShea
|
|
3 |
Donate link: http://www.kieranoshea.com
|
4 |
Tags: calendar, dates, times, events
|
5 |
Requires at least: 2.0
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.3.
|
8 |
|
9 |
A simple but effective Calendar plugin for WordPress that allows you to
|
10 |
manage your events and appointments and display them to the world.
|
@@ -148,3 +148,9 @@ Uninstalling:
|
|
148 |
4. The category management screen of calendar
|
149 |
|
150 |
5. The options screen of Calendar
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Donate link: http://www.kieranoshea.com
|
4 |
Tags: calendar, dates, times, events
|
5 |
Requires at least: 2.0
|
6 |
+
Tested up to: 3.5
|
7 |
+
Stable tag: 1.3.2
|
8 |
|
9 |
A simple but effective Calendar plugin for WordPress that allows you to
|
10 |
manage your events and appointments and display them to the world.
|
148 |
4. The category management screen of calendar
|
149 |
|
150 |
5. The options screen of Calendar
|
151 |
+
|
152 |
+
== Changelog ==
|
153 |
+
|
154 |
+
= 1.3.2 =
|
155 |
+
* Ensured manage calendar JavaScript only loads on manage calendar page in admin panel
|
156 |
+
* Switched to GPL compatible JavaScript date picker
|