Version Description
- You can now edit post contents, title, and time directly in the calendar. You can also schedule a post for publication.
- The layout of posts in the calendar has been optimized to you can see the maximum number of posts in a single day without scrolling.
- The calendar is now available for Authors and grays out the posts the current user doesn't have permission to edit.
- The calendar has been translated into Czech. Thanks to Lukáš Adamec, who uses the Calendar on his blog Horni Hrad.
- Added a link to view published posts directly from the calendar.
- The calendar will now use the WordPress preference for the first day of the week and fall back on the server locale if it isn't set.
- The calendar is also using the WordPress preferences for time format.
- The calendar is now loading JavaScript libraries for just the calendar page. That makes other pages load faster and avoids potential JavaScript conflicts with other plugins.
- The visible weeks preference in the screen options is now a dropdown instead of a text box.
Download this release
Release Info
Developer | zgrossbart |
Plugin | Editorial Calendar |
Version | 0.7 |
Comparing to | |
See all releases |
Code changes from version 0.6 to 0.7
- edcal.css +154 -21
- edcal.js +591 -206
- edcal.php +240 -49
- images/loading.gif +0 -0
- images/loading_post.gif +0 -0
- images/loading_post_hover.gif +0 -0
- images/tip_close.gif +0 -0
- languages/editorial-calendar-cs_CZ.mo +0 -0
- languages/editorial-calendar-cs_CZ.po +190 -0
- lib/date.extras.js +332 -0
- lib/edcallib.min.js +101 -92
- lib/jquery.timepicker.js +291 -0
- lib/jquery.tooltip.css +0 -9
- lib/jquery.tooltip.js +0 -302
- lib/languages/date-cs-CZ.js +104 -0
- lib/lib.txt +5 -4
- lib/timePicker.css +26 -0
- readme.txt +42 -14
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
edcal.css
CHANGED
@@ -63,7 +63,7 @@
|
|
63 |
background: #fff;
|
64 |
}
|
65 |
|
66 |
-
.day-active {
|
67 |
background-color: lightyellow;
|
68 |
}
|
69 |
|
@@ -120,8 +120,11 @@
|
|
120 |
margin-left: 2px;
|
121 |
margin-right: 2px;
|
122 |
font-size: 10px;
|
123 |
-
padding:
|
124 |
-
|
|
|
|
|
|
|
125 |
}
|
126 |
|
127 |
.post.draggable .postlink {
|
@@ -219,7 +222,7 @@
|
|
219 |
text-decoration: none;
|
220 |
}
|
221 |
|
222 |
-
.publish {
|
223 |
color: #a4a4a4;
|
224 |
font-weight:normal;
|
225 |
}
|
@@ -233,7 +236,7 @@
|
|
233 |
background-repeat: no-repeat;
|
234 |
position: absolute;
|
235 |
width: 43px;
|
236 |
-
height:
|
237 |
display: block;
|
238 |
left: 20em;
|
239 |
top: -1.5em;
|
@@ -261,6 +264,37 @@
|
|
261 |
color: #21759B;
|
262 |
}*/
|
263 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
#tooltip p {
|
265 |
margin-left: 1.5em;
|
266 |
}
|
@@ -269,22 +303,122 @@
|
|
269 |
max-width: 20em;
|
270 |
margin-bottom: -10px;
|
271 |
padding-right: 15px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
|
274 |
#tooltip {
|
275 |
background: white;
|
276 |
-
opacity: 1;
|
277 |
padding: 1em;
|
278 |
padding-bottom: 0em;
|
279 |
border: thin solid lightgray;
|
280 |
-
-moz-border-radius:
|
281 |
-
-webkit-border-radius:
|
282 |
-
-moz-box-shadow:0 4px
|
|
|
|
|
283 |
}
|
284 |
|
285 |
.newposttip {
|
286 |
-
padding: 1em;
|
287 |
-
|
288 |
}
|
289 |
|
290 |
#edcal-title {
|
@@ -298,24 +432,20 @@
|
|
298 |
|
299 |
#edcal-title-new-field {
|
300 |
padding: 0.25em;
|
301 |
-
width:
|
302 |
}
|
303 |
|
304 |
#edcal-title-new-section {
|
305 |
-
padding-top:
|
306 |
padding-bottom: 0.5em;
|
307 |
}
|
308 |
|
309 |
#tipclose {
|
310 |
-
width:
|
311 |
-
height:
|
312 |
position: absolute;
|
313 |
-
top:
|
314 |
-
right: -
|
315 |
-
}
|
316 |
-
|
317 |
-
.tooltip {
|
318 |
-
position: relative;
|
319 |
}
|
320 |
|
321 |
#edcal-title-box {
|
@@ -332,3 +462,6 @@
|
|
332 |
font-size:12px;
|
333 |
}
|
334 |
|
|
|
|
|
|
63 |
background: #fff;
|
64 |
}
|
65 |
|
66 |
+
.day.day-active {
|
67 |
background-color: lightyellow;
|
68 |
}
|
69 |
|
120 |
margin-left: 2px;
|
121 |
margin-right: 2px;
|
122 |
font-size: 10px;
|
123 |
+
padding: 0px;
|
124 |
+
}
|
125 |
+
|
126 |
+
.posttime {
|
127 |
+
font-weight: bold;
|
128 |
}
|
129 |
|
130 |
.post.draggable .postlink {
|
222 |
text-decoration: none;
|
223 |
}
|
224 |
|
225 |
+
.publish, .post.readonly {
|
226 |
color: #a4a4a4;
|
227 |
font-weight:normal;
|
228 |
}
|
236 |
background-repeat: no-repeat;
|
237 |
position: absolute;
|
238 |
width: 43px;
|
239 |
+
height: 43px;
|
240 |
display: block;
|
241 |
left: 20em;
|
242 |
top: -1.5em;
|
264 |
color: #21759B;
|
265 |
}*/
|
266 |
|
267 |
+
#edit-slug-buttons {
|
268 |
+
position: relative;
|
269 |
+
}
|
270 |
+
|
271 |
+
#newPostScheduleButton {
|
272 |
+
position: absolute;
|
273 |
+
right: 20px;
|
274 |
+
top: -5px;
|
275 |
+
}
|
276 |
+
|
277 |
+
#newPostScheduleButton.disabled {
|
278 |
+
color: #AAAAAA;
|
279 |
+
}
|
280 |
+
|
281 |
+
#tooltip {
|
282 |
+
min-width: 35em;
|
283 |
+
}
|
284 |
+
|
285 |
+
#tooltip .mceEditor {
|
286 |
+
height: 15em;
|
287 |
+
margin-left: -6px;
|
288 |
+
}
|
289 |
+
|
290 |
+
#tooltiptitle {
|
291 |
+
font-weight:bold;
|
292 |
+
left: 0.5em;
|
293 |
+
position:absolute;
|
294 |
+
top: -8px;
|
295 |
+
text-shadow: #fff 0px 1px 0px;
|
296 |
+
}
|
297 |
+
|
298 |
#tooltip p {
|
299 |
margin-left: 1.5em;
|
300 |
}
|
303 |
max-width: 20em;
|
304 |
margin-bottom: -10px;
|
305 |
padding-right: 15px;
|
306 |
+
margin-top: 1em;
|
307 |
+
font-size: 13px;
|
308 |
+
font-weight: bold;
|
309 |
+
}
|
310 |
+
|
311 |
+
#tooltip h4 {
|
312 |
+
margin: 0 0 3px 0;
|
313 |
+
font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
314 |
+
font-style: italic;
|
315 |
+
font-weight: normal;
|
316 |
+
}
|
317 |
+
|
318 |
+
#tooltip #edcal-time-status-section h4 {
|
319 |
+
display: inline;
|
320 |
+
}
|
321 |
+
|
322 |
+
#tooltip #edcal-time {
|
323 |
+
width: 8em;
|
324 |
+
background-color: white;
|
325 |
+
}
|
326 |
+
|
327 |
+
#tooltip #edcal-time-section h4, #tooltip #edcal-status-section h4 {
|
328 |
+
top: 3px;
|
329 |
+
}
|
330 |
+
|
331 |
+
#edcal-time-status-section {
|
332 |
+
position: relative;
|
333 |
+
height: 5em;
|
334 |
+
}
|
335 |
+
|
336 |
+
#edcal-time-section {
|
337 |
+
position: absolute;
|
338 |
+
top: 0px;
|
339 |
+
left: 0px;
|
340 |
+
width: 48%;
|
341 |
+
}
|
342 |
+
|
343 |
+
#edcal-status-section {
|
344 |
+
position: absolute;
|
345 |
+
top: 0px;
|
346 |
+
left: 50%;
|
347 |
+
width: 48%;
|
348 |
+
}
|
349 |
+
|
350 |
+
#tooltip .edcal-form-row {
|
351 |
+
margin-bottom: 5px;
|
352 |
+
margin-top: 1em;
|
353 |
+
position: relative;
|
354 |
+
}
|
355 |
+
|
356 |
+
#edcal-title-row, #edcal-time-section, #edcal-status-section {
|
357 |
+
height: 2em;
|
358 |
+
}
|
359 |
+
|
360 |
+
#edcal-status-section {
|
361 |
+
top: -3em;
|
362 |
+
left: 16em;
|
363 |
+
}
|
364 |
+
|
365 |
+
#tooltip .edcal-form-label {
|
366 |
+
position: absolute;
|
367 |
+
left: 0px;
|
368 |
+
top: 0px;
|
369 |
+
width: 5.5em;
|
370 |
+
text-align: right;
|
371 |
+
}
|
372 |
+
|
373 |
+
#tooltip .edcal-form-control {
|
374 |
+
position: absolute;
|
375 |
+
left: 7em;
|
376 |
+
top: 0px;
|
377 |
+
width: 75%;
|
378 |
+
}
|
379 |
+
|
380 |
+
#tooltip #edcal-content-row .edcal-form-label {
|
381 |
+
position: static;
|
382 |
+
float: left;
|
383 |
+
}
|
384 |
+
|
385 |
+
#tooltip #edcal-content-row .edcal-form-control {
|
386 |
+
position: static;
|
387 |
+
margin-left: 7em;
|
388 |
+
}
|
389 |
+
|
390 |
+
#tooltip #edcal-status-section h4 {
|
391 |
+
width: 4em;
|
392 |
+
}
|
393 |
+
|
394 |
+
#edcal-status-section .edcal-form-control {
|
395 |
+
left: 6em;
|
396 |
+
width: auto;
|
397 |
+
}
|
398 |
+
|
399 |
+
#tooltip #cal_mediabar {
|
400 |
+
font-size: 11px;
|
401 |
+
}
|
402 |
+
|
403 |
+
#tooltip #media-buttons {
|
404 |
+
padding: 5px 0;
|
405 |
}
|
406 |
|
407 |
#tooltip {
|
408 |
background: white;
|
|
|
409 |
padding: 1em;
|
410 |
padding-bottom: 0em;
|
411 |
border: thin solid lightgray;
|
412 |
+
-moz-border-radius:6px;
|
413 |
+
-webkit-border-radius:6px;
|
414 |
+
-moz-box-shadow:0 4px 8px #C8C8C8;
|
415 |
+
position: relative;
|
416 |
+
z-index: 25;
|
417 |
}
|
418 |
|
419 |
.newposttip {
|
420 |
+
padding: 1em 1em 1em 0.5em;
|
421 |
+
position: relative;
|
422 |
}
|
423 |
|
424 |
#edcal-title {
|
432 |
|
433 |
#edcal-title-new-field {
|
434 |
padding: 0.25em;
|
435 |
+
width: 100%;
|
436 |
}
|
437 |
|
438 |
#edcal-title-new-section {
|
439 |
+
padding-top: 1em;
|
440 |
padding-bottom: 0.5em;
|
441 |
}
|
442 |
|
443 |
#tipclose {
|
444 |
+
width: 16px;
|
445 |
+
height: 15px;
|
446 |
position: absolute;
|
447 |
+
top: -5px;
|
448 |
+
right: -4px;
|
|
|
|
|
|
|
|
|
449 |
}
|
450 |
|
451 |
#edcal-title-box {
|
462 |
font-size:12px;
|
463 |
}
|
464 |
|
465 |
+
#edcal_weeks_pref {
|
466 |
+
width: 4em;
|
467 |
+
}
|
edcal.js
CHANGED
@@ -99,7 +99,10 @@ var edcal = {
|
|
99 |
* This is the first day of the next month
|
100 |
*/
|
101 |
firstDayOfNextMonth: null,
|
102 |
-
|
|
|
|
|
|
|
103 |
wp_dateFormat: "yyyy-MM-dd",
|
104 |
|
105 |
/*
|
@@ -151,6 +154,14 @@ var edcal = {
|
|
151 |
* The date since the previous move
|
152 |
*/
|
153 |
moveDate: null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
/*
|
156 |
A cache of all the posts we have loaded so far. The
|
@@ -215,13 +226,34 @@ var edcal = {
|
|
215 |
calendar.
|
216 |
*/
|
217 |
createDaysHeader: function() {
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
jQuery("#cal_cont").prepend(html);
|
227 |
|
@@ -286,10 +318,10 @@ var edcal = {
|
|
286 |
if (edcal.inDrag) {
|
287 |
return;
|
288 |
}
|
289 |
-
|
290 |
var createLink = jQuery("#" + dayid + " a.daynewlink");
|
291 |
createLink.css("display", "block");
|
292 |
-
edcal.
|
293 |
},
|
294 |
|
295 |
/*
|
@@ -297,7 +329,8 @@ var edcal = {
|
|
297 |
outside of the calendar day.
|
298 |
*/
|
299 |
hideAddPostLink: function(/*string*/ dayid) {
|
300 |
-
jQuery("#" + dayid + " a.daynewlink").hide();
|
|
|
301 |
},
|
302 |
|
303 |
/*
|
@@ -429,7 +462,7 @@ var edcal = {
|
|
429 |
jQuery(post).each(function() {
|
430 |
var postObj = edcal.findPostForId(jQuery(this).parent().parent().parent().attr("id"),
|
431 |
jQuery(this).attr("id"));
|
432 |
-
if (edcal.
|
433 |
jQuery(this).draggable({
|
434 |
revert: 'invalid',
|
435 |
appendTo: 'body',
|
@@ -446,7 +479,7 @@ var edcal = {
|
|
446 |
edcal.handleDrag(event, ui);
|
447 |
},
|
448 |
scroll: false,
|
449 |
-
refreshPositions: true
|
450 |
});
|
451 |
jQuery(this).addClass("draggable");
|
452 |
}
|
@@ -488,7 +521,7 @@ var edcal = {
|
|
488 |
*/
|
489 |
setTimeout(function() {
|
490 |
edcal.isDragScrolling = false;
|
491 |
-
},
|
492 |
},
|
493 |
|
494 |
/*
|
@@ -530,21 +563,21 @@ var edcal = {
|
|
530 |
},
|
531 |
|
532 |
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
deletePost: function(/*Post ID*/ postId) {
|
537 |
-
|
538 |
-
|
539 |
edcal.output("Calling AJAX URL: " + url);
|
540 |
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
edcal.removePostItem(res.post.date, "post-" + res.post.id);
|
549 |
if (res.error) {
|
550 |
/*
|
@@ -554,9 +587,9 @@ var edcal = {
|
|
554 |
if (res.error === edcal.NONCE_ERROR) {
|
555 |
edcal.showError(edcal.checksum_error);
|
556 |
}
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
},
|
561 |
error: function(xhr) {
|
562 |
edcal.showError(edcal.general_error);
|
@@ -576,7 +609,7 @@ var edcal = {
|
|
576 |
confirmDelete: function(/*string*/ posttitle) {
|
577 |
if (confirm(edcal.str_del_msg1 + posttitle + edcal.str_del_msg2)) {
|
578 |
return true;
|
579 |
-
|
580 |
} else {
|
581 |
return false;
|
582 |
}
|
@@ -656,52 +689,295 @@ var edcal = {
|
|
656 |
|
657 |
/*
|
658 |
Switches back to the normal tooltip title view
|
659 |
-
and closes the tooltip.
|
660 |
*/
|
661 |
closeTooltip: function() {
|
662 |
edcal.cancelEditTitle();
|
663 |
jQuery("#tooltip").hide();
|
664 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
665 |
|
666 |
/*
|
667 |
-
*
|
|
|
|
|
668 |
*/
|
669 |
-
|
670 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
return;
|
672 |
}
|
673 |
|
674 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
675 |
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
'</div>' +
|
687 |
-
'<div id="edit-slug-buttons">' +
|
688 |
-
'<a class="save button disabled" id="newPostButton" href="#" adddate="' + date + '">' + edcal.str_savedraft + '</a> ' +
|
689 |
-
'<a class="save button disabled" id="newPostEditButton" href="#" adddate="' + date + '">' + edcal.str_saveandedit + '</a> ' +
|
690 |
-
'<a href="#" onclick="jQuery(\'#tooltip\').hide(); return false;" class="cancel">' + edcal.str_cancel + '</a>' +
|
691 |
-
'</div>' +
|
692 |
-
'</div>';
|
693 |
-
return tooltip;
|
694 |
-
},
|
695 |
-
showHandler: function() {
|
696 |
-
/*
|
697 |
-
* Put the focus in the post title field when the tooltip opens.
|
698 |
-
*/
|
699 |
-
jQuery("#edcal-title-new-field").focus();
|
700 |
-
jQuery("#edcal-title-new-field").select();
|
701 |
-
}
|
702 |
-
});
|
703 |
|
704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
},
|
706 |
|
707 |
/*
|
@@ -740,13 +1016,12 @@ var edcal = {
|
|
740 |
removePostItem: function(/*string*/ dayobjId, /*string*/ postId) {
|
741 |
if (edcal.findPostForId(dayobjId, postId)) {
|
742 |
for (var i = 0; i < edcal.posts[dayobjId].length; i++) {
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
}
|
751 |
},
|
752 |
|
@@ -768,36 +1043,16 @@ var edcal = {
|
|
768 |
return postsString;
|
769 |
},
|
770 |
|
771 |
-
/*
|
772 |
-
When you hover your mouse over a post we show the edit, delete,
|
773 |
-
and view links below it. If there was another post below we don't
|
774 |
-
want it to jump around. To make that work we set a padding on the
|
775 |
-
bottom of the post equal to the height of the div containing
|
776 |
-
the links. When the div is shown we remove the padding on the
|
777 |
-
bottom.
|
778 |
-
|
779 |
-
This function determines the right size for that padding. We
|
780 |
-
call it once when we first get posts and again if we resize the
|
781 |
-
window. The boolean indicates which case this is.
|
782 |
-
*/
|
783 |
-
updatePostPadding: function(/*boolean*/ resized) {
|
784 |
-
if (resized || !edcal.actionButtonHeight) {
|
785 |
-
edcal.actionButtonHeight = jQuery("div.postactions").height();
|
786 |
-
jQuery(".post").css("padding-bottom", edcal.actionButtonHeight + "px");
|
787 |
-
}
|
788 |
-
},
|
789 |
-
|
790 |
/*
|
791 |
This function shows the action links for the post with the
|
792 |
specified ID.
|
793 |
*/
|
794 |
showActionLinks: function(/*string*/ postid) {
|
795 |
-
|
|
|
|
|
796 |
return;
|
797 |
}
|
798 |
-
jQuery('#' + postid).css({
|
799 |
-
'padding-bottom': '0px'
|
800 |
-
});
|
801 |
jQuery('#' + postid + ' > div.postactions').show();
|
802 |
},
|
803 |
|
@@ -806,17 +1061,34 @@ var edcal = {
|
|
806 |
post ID.
|
807 |
*/
|
808 |
hideActionLinks: function(/*string*/ postid) {
|
809 |
-
jQuery('#' + postid).css({
|
810 |
-
'padding-bottom': edcal.actionButtonHeight + "px"
|
811 |
-
});
|
812 |
jQuery('#' + postid + ' > div.postactions').hide();
|
813 |
},
|
814 |
|
815 |
/*
|
816 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
817 |
*/
|
818 |
isPostEditable: function(/*post*/ post) {
|
819 |
-
return post.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
820 |
},
|
821 |
|
822 |
/*
|
@@ -845,19 +1117,21 @@ var edcal = {
|
|
845 |
|
846 |
posttitle = '<span class="posttime">' + post.formattedtime + '</span> ' + posttitle;
|
847 |
|
848 |
-
if (edcal.
|
849 |
return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
|
850 |
'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
|
851 |
-
'id="post-' + post.id + '" class="post ' + post.status + '"><div class="postlink">' + posttitle + '</div>' +
|
852 |
-
'<div class="postactions"><a href="'
|
853 |
'<a href="' + post.dellink + '" onclick="return edcal.confirmDelete(\'' + post.title + '\');">' + edcal.str_del + '</a> | ' +
|
854 |
'<a href="' + post.permalink + '">' + edcal.str_view + '</a>' +
|
855 |
'</div></li>';
|
856 |
} else {
|
857 |
return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
|
858 |
'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
|
859 |
-
'id="post-' + post.id + '" class="post ' + post.status + '"><div class="postlink">' + posttitle + '</div>' +
|
860 |
-
'<div class="postactions"
|
|
|
|
|
861 |
'</div></li>';
|
862 |
}
|
863 |
},
|
@@ -895,6 +1169,13 @@ var edcal = {
|
|
895 |
up into the past.
|
896 |
*/
|
897 |
move: function(steps, direction) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
898 |
/*
|
899 |
The working date is a marker for the last calendar row we created.
|
900 |
If we are moving forward that will be the last row, if we are moving
|
@@ -1007,81 +1288,99 @@ var edcal = {
|
|
1007 |
* http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml
|
1008 |
*/
|
1009 |
nextStartOfWeek: function(/*date*/ date) {
|
1010 |
-
if (edcal.
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
edcal.endsWith(local, "
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1076 |
} else {
|
1077 |
-
|
|
|
|
|
|
|
|
|
1078 |
}
|
1079 |
-
} else {
|
1080 |
-
/*
|
1081 |
-
* If we have no locale set we'll assume American style
|
1082 |
-
*/
|
1083 |
-
return date.next().sunday();
|
1084 |
}
|
|
|
|
|
1085 |
},
|
1086 |
|
1087 |
/*
|
@@ -1141,8 +1440,6 @@ var edcal = {
|
|
1141 |
bottom: cal.offset().top + cal.height()
|
1142 |
};
|
1143 |
|
1144 |
-
edcal.updatePostPadding(true);
|
1145 |
-
|
1146 |
/*
|
1147 |
When the user drags a post they get a "helper" element that clones
|
1148 |
the post and displays it during the drag. This means they get all
|
@@ -1279,28 +1576,35 @@ var edcal = {
|
|
1279 |
}
|
1280 |
jQuery(window).bind("resize", resizeWindow);
|
1281 |
|
1282 |
-
jQuery("#
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
|
|
1288 |
});
|
1289 |
|
1290 |
-
jQuery("#edcal-title-new-field").
|
1291 |
-
if (jQuery("#edcal-title-new-field").val().length > 0) {
|
1292 |
-
jQuery("#
|
1293 |
-
jQuery("#newPostEditButton").removeClass("disabled");
|
1294 |
} else {
|
1295 |
-
jQuery("#
|
1296 |
-
jQuery("#newPostEditButton").addClass("disabled");
|
1297 |
}
|
1298 |
|
1299 |
if (evt.keyCode == 13) { // enter key
|
1300 |
/*
|
1301 |
* If the user presses enter we want to save the draft.
|
1302 |
*/
|
1303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1304 |
}
|
1305 |
});
|
1306 |
|
@@ -1311,7 +1615,6 @@ var edcal = {
|
|
1311 |
*/
|
1312 |
edcal.saveTitle(jQuery(this).attr("postid"));
|
1313 |
}
|
1314 |
-
|
1315 |
});
|
1316 |
|
1317 |
jQuery("#edcal_weeks_pref").live("keyup", function(evt) {
|
@@ -1330,6 +1633,12 @@ var edcal = {
|
|
1330 |
edcal.savePosition();
|
1331 |
|
1332 |
edcal.addOptionsSection();
|
|
|
|
|
|
|
|
|
|
|
|
|
1333 |
},
|
1334 |
|
1335 |
/*
|
@@ -1342,7 +1651,7 @@ var edcal = {
|
|
1342 |
* doEdit - should we edit the post immediately? if true we send the user
|
1343 |
* to the edit screen for their new post.
|
1344 |
*/
|
1345 |
-
createNewDraft: function(/*string*/ date, /*string*/ title, /*boolean*/ doEdit) {
|
1346 |
if (!title || title === "") {
|
1347 |
return;
|
1348 |
}
|
@@ -1354,13 +1663,16 @@ var edcal = {
|
|
1354 |
* put a default post time of 10:00 AM.
|
1355 |
*/
|
1356 |
var formattedDate = encodeURIComponent(edcal.getDayFromDayId(date).toString(edcal.wp_dateFormat) + " 10:00:00");
|
1357 |
-
var url = edcal.ajax_url() + "&action=edcal_newdraft&
|
1358 |
-
|
|
|
|
|
1359 |
|
1360 |
jQuery.ajax( {
|
1361 |
url: url,
|
1362 |
type: "POST",
|
1363 |
processData: false,
|
|
|
1364 |
timeout: 100000,
|
1365 |
dataType: "json",
|
1366 |
success: function(res) {
|
@@ -1424,24 +1736,25 @@ var edcal = {
|
|
1424 |
timeout: 100000,
|
1425 |
dataType: "json",
|
1426 |
success: function(res) {
|
1427 |
-
edcal.removePostItem(res.post.date, "post-" + res.post.id);
|
1428 |
-
edcal.addPostItem(res.post, res.post.date);
|
1429 |
-
edcal.addPostItemDragAndToolltip(res.post.date);
|
1430 |
-
|
1431 |
if (res.error) {
|
1432 |
/*
|
1433 |
* If there was an error we need to remove the dropped
|
1434 |
* post item.
|
1435 |
*/
|
|
|
1436 |
edcal.removePostItem(newdate, "post-" + res.post.id);
|
1437 |
if (res.error === edcal.CONCURRENCY_ERROR) {
|
1438 |
edcal.showError(edcal.concurrency_error + '<br />' + res.post.title);
|
1439 |
} else if (res.error === edcal.PERMISSION_ERROR) {
|
1440 |
-
edcal.showError(edcal.
|
1441 |
} else if (res.error === edcal.NONCE_ERROR) {
|
1442 |
edcal.showError(edcal.checksum_error);
|
1443 |
}
|
1444 |
}
|
|
|
|
|
|
|
|
|
1445 |
},
|
1446 |
error: function(xhr) {
|
1447 |
edcal.showError(edcal.general_error);
|
@@ -1548,7 +1861,6 @@ var edcal = {
|
|
1548 |
jQuery.each(postDates, function(i, postDate) {
|
1549 |
edcal.addPostItemDragAndToolltip(postDate);
|
1550 |
});
|
1551 |
-
edcal.updatePostPadding(false);
|
1552 |
}, 300);
|
1553 |
},
|
1554 |
error: function(xhr) {
|
@@ -1560,6 +1872,58 @@ var edcal = {
|
|
1560 |
});
|
1561 |
},
|
1562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1563 |
/*
|
1564 |
This function adds the scren options tab to the top of the screen. I wish
|
1565 |
WordPress had a hook so I could provide this in PHP, but as of version 2.9.1
|
@@ -1589,16 +1953,26 @@ var edcal = {
|
|
1589 |
Show the screen options section. We start by saving off the old HTML
|
1590 |
*/
|
1591 |
edcal.helpMeta = jQuery("#contextual-help-wrap").html();
|
1592 |
-
|
1593 |
-
|
1594 |
-
'<h5>' + edcal.str_optionsheader + '</h5>' +
|
1595 |
'<div class="metabox-prefs">' +
|
1596 |
-
edcal.str_show + '<
|
1597 |
-
|
1598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1599 |
edcal.str_show2 + '<br /><br />' +
|
1600 |
'<button id="edcal_applyoptions" onclick="edcal.saveOptions(); return false;" class="save button">' + edcal.str_apply + '</button>' +
|
1601 |
-
'</div>'
|
|
|
|
|
1602 |
|
1603 |
jQuery("#contextual-help-link-wrap").hide();
|
1604 |
|
@@ -1686,6 +2060,17 @@ var edcal = {
|
|
1686 |
}
|
1687 |
};
|
1688 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1689 |
jQuery(document).ready(function(){
|
1690 |
edcal.init();
|
1691 |
});
|
99 |
* This is the first day of the next month
|
100 |
*/
|
101 |
firstDayOfNextMonth: null,
|
102 |
+
|
103 |
+
/*
|
104 |
+
* The date format used by wordpress
|
105 |
+
*/
|
106 |
wp_dateFormat: "yyyy-MM-dd",
|
107 |
|
108 |
/*
|
154 |
* The date since the previous move
|
155 |
*/
|
156 |
moveDate: null,
|
157 |
+
|
158 |
+
/*
|
159 |
+
* This is a number from 0-6 indicating when the start
|
160 |
+
* of the week is. The user sets this in the Settings >
|
161 |
+
* General page and it is a single value for the entire
|
162 |
+
* server. We are setting this value in edcal.php
|
163 |
+
*/
|
164 |
+
startOfWeek: null,
|
165 |
|
166 |
/*
|
167 |
A cache of all the posts we have loaded so far. The
|
226 |
calendar.
|
227 |
*/
|
228 |
createDaysHeader: function() {
|
229 |
+
/*
|
230 |
+
* The first day of the week in the calendar depends on
|
231 |
+
* a wordpress setting and maybe the server locale. This
|
232 |
+
* means we need to determine the days of the week dynamically.
|
233 |
+
* Luckily the Date.js library already has these strings
|
234 |
+
* localized for us. All we need to do is figure out the
|
235 |
+
* first day of the week and then we can add a day from there.
|
236 |
+
*/
|
237 |
+
|
238 |
+
var date = Date.today().next().sunday();
|
239 |
+
|
240 |
+
/*
|
241 |
+
* We need to call nextStartOfWeek to make sure the
|
242 |
+
* edcal.startOfWeek variable gets initialized.
|
243 |
+
*/
|
244 |
+
edcal.nextStartOfWeek(date.clone());
|
245 |
+
|
246 |
+
|
247 |
+
var html = '<div class="dayheadcont"><div class="dayhead firstday">' +
|
248 |
+
date.add(edcal.startOfWeek).days().toString('dddd') +
|
249 |
+
'</div>';
|
250 |
+
|
251 |
+
html += '<div class="dayhead">' + date.add(1).days().toString('dddd') + '</div>';
|
252 |
+
html += '<div class="dayhead">' + date.add(1).days().toString('dddd') + '</div>';
|
253 |
+
html += '<div class="dayhead">' + date.add(1).days().toString('dddd') + '</div>';
|
254 |
+
html += '<div class="dayhead">' + date.add(1).days().toString('dddd') + '</div>';
|
255 |
+
html += '<div class="dayhead">' + date.add(1).days().toString('dddd') + '</div>';
|
256 |
+
html += '<div class="dayhead lastday">' + date.add(1).days().toString('dddd') + '</div>';
|
257 |
|
258 |
jQuery("#cal_cont").prepend(html);
|
259 |
|
318 |
if (edcal.inDrag) {
|
319 |
return;
|
320 |
}
|
321 |
+
|
322 |
var createLink = jQuery("#" + dayid + " a.daynewlink");
|
323 |
createLink.css("display", "block");
|
324 |
+
createLink.bind('click', edcal.addPost);
|
325 |
},
|
326 |
|
327 |
/*
|
329 |
outside of the calendar day.
|
330 |
*/
|
331 |
hideAddPostLink: function(/*string*/ dayid) {
|
332 |
+
var link = jQuery("#" + dayid + " a.daynewlink").hide();
|
333 |
+
link.unbind('click', edcal.addPost);
|
334 |
},
|
335 |
|
336 |
/*
|
462 |
jQuery(post).each(function() {
|
463 |
var postObj = edcal.findPostForId(jQuery(this).parent().parent().parent().attr("id"),
|
464 |
jQuery(this).attr("id"));
|
465 |
+
if (edcal.isPostMovable(postObj)) {
|
466 |
jQuery(this).draggable({
|
467 |
revert: 'invalid',
|
468 |
appendTo: 'body',
|
479 |
edcal.handleDrag(event, ui);
|
480 |
},
|
481 |
scroll: false,
|
482 |
+
refreshPositions: true,
|
483 |
});
|
484 |
jQuery(this).addClass("draggable");
|
485 |
}
|
521 |
*/
|
522 |
setTimeout(function() {
|
523 |
edcal.isDragScrolling = false;
|
524 |
+
}, 300);
|
525 |
},
|
526 |
|
527 |
/*
|
563 |
},
|
564 |
|
565 |
|
566 |
+
/*
|
567 |
+
Deletes the post specified. Will only be executed once the user clicks the confirm link to proceed.
|
568 |
+
*/
|
569 |
deletePost: function(/*Post ID*/ postId) {
|
570 |
+
|
571 |
+
var url = edcal.ajax_url() + "&action=edcal_deletepost&postid=" + postId;
|
572 |
edcal.output("Calling AJAX URL: " + url);
|
573 |
|
574 |
+
jQuery.ajax( {
|
575 |
+
url: url,
|
576 |
+
type: "POST",
|
577 |
+
processData: false,
|
578 |
+
timeout: 100000,
|
579 |
+
dataType: "json",
|
580 |
+
success: function(res) {
|
581 |
edcal.removePostItem(res.post.date, "post-" + res.post.id);
|
582 |
if (res.error) {
|
583 |
/*
|
587 |
if (res.error === edcal.NONCE_ERROR) {
|
588 |
edcal.showError(edcal.checksum_error);
|
589 |
}
|
590 |
+
} else {
|
591 |
+
edcal.output('Finished deleting the post: "' + res.post.title + '"');
|
592 |
+
}
|
593 |
},
|
594 |
error: function(xhr) {
|
595 |
edcal.showError(edcal.general_error);
|
609 |
confirmDelete: function(/*string*/ posttitle) {
|
610 |
if (confirm(edcal.str_del_msg1 + posttitle + edcal.str_del_msg2)) {
|
611 |
return true;
|
612 |
+
// [wes] might be better to call deletePost from here directly, rather than return control back to the agent... which will then follow the link and call deletePost
|
613 |
} else {
|
614 |
return false;
|
615 |
}
|
689 |
|
690 |
/*
|
691 |
Switches back to the normal tooltip title view
|
692 |
+
and closes the tooltip. (NOT USED)
|
693 |
*/
|
694 |
closeTooltip: function() {
|
695 |
edcal.cancelEditTitle();
|
696 |
jQuery("#tooltip").hide();
|
697 |
},
|
698 |
+
|
699 |
+
/*
|
700 |
+
NOT USED
|
701 |
+
*/
|
702 |
+
getMediaBar: function() {
|
703 |
+
return jQuery("#cal_mediabar").html();
|
704 |
+
},
|
705 |
+
|
706 |
+
/*
|
707 |
+
* Called when the "Add a post" link is clicked.
|
708 |
+
* Sets up a post object and displays the add form
|
709 |
+
*/
|
710 |
+
addPost: function( ) {
|
711 |
+
jQuery("#newPostScheduleButton").addClass("disabled");
|
712 |
+
|
713 |
+
var date = jQuery(this).parent().parent().attr("id");
|
714 |
+
|
715 |
+
var formattedtime = '10:00';
|
716 |
+
if (edcal.timeFormat !== 'H:i') {
|
717 |
+
formattedtime += " AM";
|
718 |
+
}
|
719 |
+
|
720 |
+
var post = {
|
721 |
+
id: 0,
|
722 |
+
date: date,
|
723 |
+
formatteddate: edcal.getDayFromDayId(date).toString("MMMM d"),
|
724 |
+
time: formattedtime
|
725 |
+
};
|
726 |
+
edcal.showForm(post);
|
727 |
+
return false;
|
728 |
+
},
|
729 |
|
730 |
/*
|
731 |
+
* Called when the Edit link for a post is clicked.
|
732 |
+
* Gets post details via an AJAX call and displays the edit form
|
733 |
+
* with the fields populated.
|
734 |
*/
|
735 |
+
editPost: function(/*int*/ post_id) {
|
736 |
+
// Un-disable the save buttons because we're editing
|
737 |
+
jQuery("#newPostScheduleButton").removeClass("disabled");
|
738 |
+
|
739 |
+
// Editing, so we need to make an ajax call to get body of post
|
740 |
+
edcal.getPost(post_id, edcal.showForm);
|
741 |
+
return false;
|
742 |
+
},
|
743 |
+
|
744 |
+
|
745 |
+
/*
|
746 |
+
* When the user presses the new post link on each calendar cell they get
|
747 |
+
* a tooltip which prompts them to add or edit a post. Once
|
748 |
+
* they hit save we call this function.
|
749 |
+
*
|
750 |
+
* post - post object containing data for the post
|
751 |
+
* doEdit - should we edit the post immediately? if true we send the user
|
752 |
+
* to the edit screen for their new post.
|
753 |
+
*/
|
754 |
+
savePost: function(/*object*/ post, /*boolean*/ doEdit, /*boolean*/ doPublish) {
|
755 |
+
if(typeof(post) === 'undefined' || post === null) {
|
756 |
+
post = edcal.serializePost();
|
757 |
+
}
|
758 |
+
|
759 |
+
if (!post.title || post.title === "") {
|
760 |
return;
|
761 |
}
|
762 |
|
763 |
+
edcal.output("savePost(" + post.date + ", " + post.title + ")");
|
764 |
+
|
765 |
+
jQuery("#edit-slug-buttons").addClass("tiploading");
|
766 |
+
|
767 |
+
/*
|
768 |
+
The date.js library has a bug where it gives the wrong
|
769 |
+
24 hour value for 12AM and 12PM. I've filed a bug report,
|
770 |
+
but we still need to work aorund the issue. Hackito
|
771 |
+
ergo sum.
|
772 |
+
*/
|
773 |
+
edcal.output("post.time: " + post.time);
|
774 |
+
if (post.time.toUpperCase() === "12:00 PM") {
|
775 |
+
post.time = "12:00";
|
776 |
+
} else if (post.time.toUpperCase() === "12:30 PM") {
|
777 |
+
post.time = "12:30";
|
778 |
+
} else if (post.time.toUpperCase() === "12:00 AM") {
|
779 |
+
post.time = "00:00";
|
780 |
+
} else if (post.time.toUpperCase() === "12:30 AM") {
|
781 |
+
post.time = "00:30";
|
782 |
+
}
|
783 |
+
|
784 |
+
edcal.output("post.time after: " + post.time);
|
785 |
|
786 |
+
var time;
|
787 |
+
if(post.time != '') {
|
788 |
+
time = Date.parse(post.time);
|
789 |
+
} else {
|
790 |
+
time = Date.parse('10:00:00'); // If we don't have a time set, default it to 10am
|
791 |
+
}
|
792 |
|
793 |
+
var formattedtime = time.format('H:i:s');
|
794 |
+
|
795 |
+
var formattedDate = encodeURIComponent(edcal.getDayFromDayId(post.date).toString(edcal.wp_dateFormat) + " " + formattedtime);
|
796 |
+
var url = edcal.ajax_url() + "&action=edcal_savepost&";
|
797 |
+
var postData = "date=" + formattedDate +
|
798 |
+
"&title=" + encodeURIComponent(post.title) +
|
799 |
+
"&content=" + encodeURIComponent(post.content) +
|
800 |
+
"&id=" + encodeURIComponent(post.id) +
|
801 |
+
"&status=" + encodeURIComponent(post.status);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
|
803 |
+
if (doPublish) {
|
804 |
+
postData += "&dopublish=" + encodeURIComponent('future');
|
805 |
+
}
|
806 |
+
|
807 |
+
jQuery.ajax( {
|
808 |
+
url: url,
|
809 |
+
type: "POST",
|
810 |
+
processData: false,
|
811 |
+
data: postData,
|
812 |
+
timeout: 100000,
|
813 |
+
dataType: "json",
|
814 |
+
success: function(res) {
|
815 |
+
jQuery("#edit-slug-buttons").removeClass("tiploading");
|
816 |
+
jQuery('#tooltip').hide();
|
817 |
+
if (res.error) {
|
818 |
+
/*
|
819 |
+
* If there was an error we need to remove the dropped
|
820 |
+
* post item.
|
821 |
+
*/
|
822 |
+
if (res.error === edcal.NONCE_ERROR) {
|
823 |
+
edcal.showError(edcal.checksum_error);
|
824 |
+
}
|
825 |
+
return;
|
826 |
+
}
|
827 |
+
|
828 |
+
if (!res.post) {
|
829 |
+
edcal.showError("There was an error creating a new post for your blog.");
|
830 |
+
} else {
|
831 |
+
if (doEdit) {
|
832 |
+
/*
|
833 |
+
* If the user wanted to edit the post then we redirect
|
834 |
+
* them to the edit page.
|
835 |
+
*/
|
836 |
+
window.location = res.post.editlink.replace("&", "&");
|
837 |
+
} else {
|
838 |
+
|
839 |
+
if (res.post.id) {
|
840 |
+
edcal.removePostItem(res.post.date, "post-" + res.post.id);
|
841 |
+
}
|
842 |
+
|
843 |
+
edcal.addPostItem(res.post, res.post.date);
|
844 |
+
edcal.addPostItemDragAndToolltip(res.post.date);
|
845 |
+
}
|
846 |
+
}
|
847 |
+
},
|
848 |
+
error: function(xhr) {
|
849 |
+
jQuery("#edit-slug-buttons").removeClass("tiploading");
|
850 |
+
jQuery('#tooltip').hide();
|
851 |
+
edcal.showError(edcal.general_error);
|
852 |
+
if (xhr.responseText) {
|
853 |
+
edcal.output("xhr.responseText: " + xhr.responseText);
|
854 |
+
}
|
855 |
+
}
|
856 |
+
});
|
857 |
+
return false;
|
858 |
+
},
|
859 |
+
|
860 |
+
/*
|
861 |
+
* Collects form values for the post inputted by the user into an object
|
862 |
+
*/
|
863 |
+
serializePost: function() {
|
864 |
+
var post = {};
|
865 |
+
|
866 |
+
jQuery('#tooltip').find('input, textarea, select').each(function() {
|
867 |
+
post[this.name] = this.value;
|
868 |
+
});
|
869 |
+
return post;
|
870 |
+
},
|
871 |
+
|
872 |
+
/*
|
873 |
+
* Accepts new or existing post data and then populates text fields as necessary
|
874 |
+
*/
|
875 |
+
showForm: function(post) {
|
876 |
+
edcal.resetForm();
|
877 |
+
|
878 |
+
// show tooltip
|
879 |
+
jQuery('#tooltip').center().show();
|
880 |
+
|
881 |
+
if(!post.id) {
|
882 |
+
jQuery('#tooltiptitle').text(edcal.str_newpost_title + post.formatteddate);
|
883 |
+
} else {
|
884 |
+
jQuery('#tooltiptitle').text(edcal.str_edit_post_title);
|
885 |
+
jQuery('#tooltip h3').html('<span class="tiptitle">' + post.title + '</span>');
|
886 |
+
|
887 |
+
// add post info to form
|
888 |
+
jQuery('#edcal-title-new-field').val(post.title);
|
889 |
+
jQuery('#content').val(post.content);
|
890 |
+
}
|
891 |
+
|
892 |
+
if (post.status === "future") {
|
893 |
+
jQuery('#newPostScheduleButton').text(edcal.str_update);
|
894 |
+
}
|
895 |
+
|
896 |
+
if (post.status) {
|
897 |
+
jQuery('#edcal-status').val(post.status);
|
898 |
+
if (post.status === 'future') {
|
899 |
+
jQuery('#newPostScheduleButton').text(edcal.str_publish);
|
900 |
+
} else {
|
901 |
+
jQuery('#newPostScheduleButton').text(edcal.str_save);
|
902 |
+
}
|
903 |
+
} else {
|
904 |
+
jQuery('#edcal-status').val('draft');
|
905 |
+
jQuery('#newPostScheduleButton').text(edcal.str_save);
|
906 |
+
}
|
907 |
+
|
908 |
+
/*
|
909 |
+
If you have a status that isn't draft or future we
|
910 |
+
just make it read only.
|
911 |
+
*/
|
912 |
+
if (post.status && post.status !== 'draft' && post.status !== 'future') {
|
913 |
+
jQuery('#edcal-status').attr('disabled', 'true');
|
914 |
+
jQuery('#edcal-status').append('<option class="temp" value="' + post.status + '">' + post.status + '</option>');
|
915 |
+
jQuery('#edcal-status').val(post.status);
|
916 |
+
}
|
917 |
+
|
918 |
+
|
919 |
+
|
920 |
+
if (edcal.getDayFromDayId(post.date).compareTo(Date.today()) == -1) {
|
921 |
+
/*
|
922 |
+
* We only allow drafts in the past
|
923 |
+
*/
|
924 |
+
jQuery('#edcal-status').attr('disabled', 'true');
|
925 |
+
}
|
926 |
+
|
927 |
+
var time = post.time;
|
928 |
+
jQuery('#edcal-time').val(time);
|
929 |
+
|
930 |
+
// set hidden fields: post.date, post.id
|
931 |
+
jQuery('#edcal-date').val(post.date);
|
932 |
+
jQuery('#edcal-id').val(post.id);
|
933 |
+
|
934 |
+
/*
|
935 |
+
* Put the focus in the post title field when the tooltip opens.
|
936 |
+
*/
|
937 |
+
|
938 |
+
jQuery("#edcal-title-new-field").focus();
|
939 |
+
jQuery("#edcal-title-new-field").select();
|
940 |
+
|
941 |
+
tb_init('a.thickbox, area.thickbox, input.thickbox');
|
942 |
+
|
943 |
+
edCanvas = document.getElementById('content');
|
944 |
+
edInsertContent = null;
|
945 |
+
|
946 |
+
jQuery('a.thickbox').click(function(){
|
947 |
+
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
|
948 |
+
tinyMCE.get('content').focus();
|
949 |
+
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
950 |
+
}
|
951 |
+
});
|
952 |
+
},
|
953 |
+
|
954 |
+
/*
|
955 |
+
* Hides the add/edit form
|
956 |
+
*/
|
957 |
+
hideForm: function( ) {
|
958 |
+
jQuery('#tooltip').hide();
|
959 |
+
edcal.cancelEditTitle();
|
960 |
+
edcal.resetForm();
|
961 |
+
},
|
962 |
+
|
963 |
+
/*
|
964 |
+
* Clears all the input values in the add/edit form
|
965 |
+
*/
|
966 |
+
resetForm: function( ) {
|
967 |
+
jQuery('#tooltip').find('input, textarea, select').each(function() {
|
968 |
+
this.value = '';
|
969 |
+
});
|
970 |
+
|
971 |
+
jQuery('#edcal-status').removeAttr('disabled');
|
972 |
+
|
973 |
+
jQuery('#newPostScheduleButton').text(edcal.str_publish);
|
974 |
+
|
975 |
+
jQuery('#tooltiptitle').text('');
|
976 |
+
jQuery('#tooltip h3').html('');
|
977 |
+
|
978 |
+
jQuery('#edcal-status').removeAttr('disabled');
|
979 |
+
|
980 |
+
jQuery('#edcal-status .temp').remove();
|
981 |
},
|
982 |
|
983 |
/*
|
1016 |
removePostItem: function(/*string*/ dayobjId, /*string*/ postId) {
|
1017 |
if (edcal.findPostForId(dayobjId, postId)) {
|
1018 |
for (var i = 0; i < edcal.posts[dayobjId].length; i++) {
|
1019 |
+
if (edcal.posts[dayobjId][i] &&
|
1020 |
+
"post-" + edcal.posts[dayobjId][i].id === postId) {
|
1021 |
+
edcal.posts[dayobjId][i] = null;
|
1022 |
+
jQuery("#" + postId).remove();
|
1023 |
+
}
|
1024 |
+
}
|
|
|
1025 |
}
|
1026 |
},
|
1027 |
|
1043 |
return postsString;
|
1044 |
},
|
1045 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1046 |
/*
|
1047 |
This function shows the action links for the post with the
|
1048 |
specified ID.
|
1049 |
*/
|
1050 |
showActionLinks: function(/*string*/ postid) {
|
1051 |
+
var post = edcal.findPostForId(jQuery('#' + postid).parent().parent().parent().attr('id'), postid);
|
1052 |
+
|
1053 |
+
if (edcal.inDrag || !edcal.isPostEditable(post)) {
|
1054 |
return;
|
1055 |
}
|
|
|
|
|
|
|
1056 |
jQuery('#' + postid + ' > div.postactions').show();
|
1057 |
},
|
1058 |
|
1061 |
post ID.
|
1062 |
*/
|
1063 |
hideActionLinks: function(/*string*/ postid) {
|
|
|
|
|
|
|
1064 |
jQuery('#' + postid + ' > div.postactions').hide();
|
1065 |
},
|
1066 |
|
1067 |
/*
|
1068 |
+
Returns true if the post is movable and false otherwise.
|
1069 |
+
This is based on the post date
|
1070 |
+
*/
|
1071 |
+
isPostMovable: function(/*post*/ post) {
|
1072 |
+
return post.editlink && post.status !== "publish";
|
1073 |
+
},
|
1074 |
+
|
1075 |
+
/*
|
1076 |
+
Returns true if the post is editable and false otherwise.
|
1077 |
+
This is based on user permissions
|
1078 |
*/
|
1079 |
isPostEditable: function(/*post*/ post) {
|
1080 |
+
return post.editlink;
|
1081 |
+
},
|
1082 |
+
|
1083 |
+
/*
|
1084 |
+
Returns readonly if the post isn't editable
|
1085 |
+
*/
|
1086 |
+
getPostEditableClass: function(/*post*/ post) {
|
1087 |
+
if (post.editlink) {
|
1088 |
+
return "";
|
1089 |
+
} else {
|
1090 |
+
return "readonly";
|
1091 |
+
}
|
1092 |
},
|
1093 |
|
1094 |
/*
|
1117 |
|
1118 |
posttitle = '<span class="posttime">' + post.formattedtime + '</span> ' + posttitle;
|
1119 |
|
1120 |
+
if (edcal.isPostMovable(post)) {
|
1121 |
return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
|
1122 |
'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
|
1123 |
+
'id="post-' + post.id + '" class="post ' + post.status + ' ' + edcal.getPostEditableClass(post) + '"><div class="postlink">' + posttitle + '</div>' +
|
1124 |
+
'<div class="postactions"><a href="#" onclick="edcal.editPost('+ post.id +'); return false;">' + edcal.str_edit + '</a> | ' +
|
1125 |
'<a href="' + post.dellink + '" onclick="return edcal.confirmDelete(\'' + post.title + '\');">' + edcal.str_del + '</a> | ' +
|
1126 |
'<a href="' + post.permalink + '">' + edcal.str_view + '</a>' +
|
1127 |
'</div></li>';
|
1128 |
} else {
|
1129 |
return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
|
1130 |
'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
|
1131 |
+
'id="post-' + post.id + '" class="post ' + post.status + ' ' + edcal.getPostEditableClass(post) + '"><div class="postlink">' + posttitle + '</div>' +
|
1132 |
+
'<div class="postactions">' +
|
1133 |
+
'<a href="' + post.editlink + '">' + edcal.str_republish + '</a> | ' +
|
1134 |
+
'<a href="' + post.permalink + '">' + edcal.str_view + '</a>' +
|
1135 |
'</div></li>';
|
1136 |
}
|
1137 |
},
|
1169 |
up into the past.
|
1170 |
*/
|
1171 |
move: function(steps, direction) {
|
1172 |
+
/*
|
1173 |
+
* If the add/edit post form is visible, don't go anywhere.
|
1174 |
+
*/
|
1175 |
+
if(jQuery('#tooltip').is(':visible')) {
|
1176 |
+
return;
|
1177 |
+
}
|
1178 |
+
|
1179 |
/*
|
1180 |
The working date is a marker for the last calendar row we created.
|
1181 |
If we are moving forward that will be the last row, if we are moving
|
1288 |
* http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml
|
1289 |
*/
|
1290 |
nextStartOfWeek: function(/*date*/ date) {
|
1291 |
+
if (edcal.startOfWeek === null) {
|
1292 |
+
if (edcal.locale) {
|
1293 |
+
var local = edcal.locale.toUpperCase();
|
1294 |
+
|
1295 |
+
if (edcal.endsWith(local, "AS") ||
|
1296 |
+
edcal.endsWith(local, "AZ") ||
|
1297 |
+
edcal.endsWith(local, "BW") ||
|
1298 |
+
edcal.endsWith(local, "CA") ||
|
1299 |
+
edcal.endsWith(local, "CN") ||
|
1300 |
+
edcal.endsWith(local, "FO") ||
|
1301 |
+
edcal.endsWith(local, "GB") ||
|
1302 |
+
edcal.endsWith(local, "GE") ||
|
1303 |
+
edcal.endsWith(local, "GL") ||
|
1304 |
+
edcal.endsWith(local, "GU") ||
|
1305 |
+
edcal.endsWith(local, "HK") ||
|
1306 |
+
edcal.endsWith(local, "IE") ||
|
1307 |
+
edcal.endsWith(local, "IL") ||
|
1308 |
+
edcal.endsWith(local, "IN") ||
|
1309 |
+
edcal.endsWith(local, "IS") ||
|
1310 |
+
edcal.endsWith(local, "JM") ||
|
1311 |
+
edcal.endsWith(local, "JP") ||
|
1312 |
+
edcal.endsWith(local, "KG") ||
|
1313 |
+
edcal.endsWith(local, "KR") ||
|
1314 |
+
edcal.endsWith(local, "LA") ||
|
1315 |
+
edcal.endsWith(local, "MH") ||
|
1316 |
+
edcal.endsWith(local, "MN") ||
|
1317 |
+
edcal.endsWith(local, "MO") ||
|
1318 |
+
edcal.endsWith(local, "MP") ||
|
1319 |
+
edcal.endsWith(local, "MT") ||
|
1320 |
+
edcal.endsWith(local, "NZ") ||
|
1321 |
+
edcal.endsWith(local, "PH") ||
|
1322 |
+
edcal.endsWith(local, "PK") ||
|
1323 |
+
edcal.endsWith(local, "SG") ||
|
1324 |
+
edcal.endsWith(local, "SY") ||
|
1325 |
+
edcal.endsWith(local, "TH") ||
|
1326 |
+
edcal.endsWith(local, "TT") ||
|
1327 |
+
edcal.endsWith(local, "TW") ||
|
1328 |
+
edcal.endsWith(local, "UM") ||
|
1329 |
+
edcal.endsWith(local, "US") ||
|
1330 |
+
edcal.endsWith(local, "UZ") ||
|
1331 |
+
edcal.endsWith(local, "VI") ||
|
1332 |
+
edcal.endsWith(local, "ZW")) {
|
1333 |
+
|
1334 |
+
/*
|
1335 |
+
* Sunday
|
1336 |
+
*/
|
1337 |
+
edcal.startOfWeek = 0;
|
1338 |
+
} else if (edcal.endsWith(local, "MV")) {
|
1339 |
+
/*
|
1340 |
+
* Friday
|
1341 |
+
*/
|
1342 |
+
edcal.startOfWeek = 5;
|
1343 |
+
} else if (edcal.endsWith(local, "AF") ||
|
1344 |
+
edcal.endsWith(local, "BH") ||
|
1345 |
+
edcal.endsWith(local, "DJ") ||
|
1346 |
+
edcal.endsWith(local, "DZ") ||
|
1347 |
+
edcal.endsWith(local, "EG") ||
|
1348 |
+
edcal.endsWith(local, "ER") ||
|
1349 |
+
edcal.endsWith(local, "ET") ||
|
1350 |
+
edcal.endsWith(local, "IQ") ||
|
1351 |
+
edcal.endsWith(local, "IR") ||
|
1352 |
+
edcal.endsWith(local, "JO") ||
|
1353 |
+
edcal.endsWith(local, "KE") ||
|
1354 |
+
edcal.endsWith(local, "KW") ||
|
1355 |
+
edcal.endsWith(local, "LY") ||
|
1356 |
+
edcal.endsWith(local, "MA") ||
|
1357 |
+
edcal.endsWith(local, "OM") ||
|
1358 |
+
edcal.endsWith(local, "QA") ||
|
1359 |
+
edcal.endsWith(local, "SA") ||
|
1360 |
+
edcal.endsWith(local, "SD") ||
|
1361 |
+
edcal.endsWith(local, "SO") ||
|
1362 |
+
edcal.endsWith(local, "TN") ||
|
1363 |
+
edcal.endsWith(local, "YE")) {
|
1364 |
+
/*
|
1365 |
+
* Sunday
|
1366 |
+
*/
|
1367 |
+
edcal.startOfWeek = 6;
|
1368 |
+
} else {
|
1369 |
+
/*
|
1370 |
+
* Monday
|
1371 |
+
*/
|
1372 |
+
edcal.startOfWeek = 1;
|
1373 |
+
}
|
1374 |
} else {
|
1375 |
+
/*
|
1376 |
+
* If we have no locale set we'll assume American style and
|
1377 |
+
* make it Sunday.
|
1378 |
+
*/
|
1379 |
+
edcal.startOfWeek = 0;
|
1380 |
}
|
|
|
|
|
|
|
|
|
|
|
1381 |
}
|
1382 |
+
|
1383 |
+
return date.next().sunday().add(edcal.startOfWeek).days();
|
1384 |
},
|
1385 |
|
1386 |
/*
|
1440 |
bottom: cal.offset().top + cal.height()
|
1441 |
};
|
1442 |
|
|
|
|
|
1443 |
/*
|
1444 |
When the user drags a post they get a "helper" element that clones
|
1445 |
the post and displays it during the drag. This means they get all
|
1576 |
}
|
1577 |
jQuery(window).bind("resize", resizeWindow);
|
1578 |
|
1579 |
+
jQuery("#newPostScheduleButton").live("click", function(evt) {
|
1580 |
+
// if the button is disabled, don't do anything
|
1581 |
+
if( jQuery(this).hasClass('disabled') ) {
|
1582 |
+
return false;
|
1583 |
+
}
|
1584 |
+
// Otherwise, save the post
|
1585 |
+
return edcal.savePost(null, false, true);
|
1586 |
});
|
1587 |
|
1588 |
+
jQuery("#edcal-title-new-field").bind("keyup", function(evt) {
|
1589 |
+
if (jQuery("#edcal-title-new-field").val().length > 0 && jQuery('#edcal-time').val().length > 0) {
|
1590 |
+
jQuery("#newPostScheduleButton").removeClass("disabled");
|
|
|
1591 |
} else {
|
1592 |
+
jQuery("#newPostScheduleButton").addClass("disabled");
|
|
|
1593 |
}
|
1594 |
|
1595 |
if (evt.keyCode == 13) { // enter key
|
1596 |
/*
|
1597 |
* If the user presses enter we want to save the draft.
|
1598 |
*/
|
1599 |
+
return edcal.savePost(null, true);
|
1600 |
+
}
|
1601 |
+
});
|
1602 |
+
|
1603 |
+
jQuery("#edcal-status").bind("change", function(evt) {
|
1604 |
+
if (jQuery('#edcal-status').val() === 'future') {
|
1605 |
+
jQuery('#newPostScheduleButton').text(edcal.str_publish);
|
1606 |
+
} else {
|
1607 |
+
jQuery('#newPostScheduleButton').text(edcal.str_save);
|
1608 |
}
|
1609 |
});
|
1610 |
|
1615 |
*/
|
1616 |
edcal.saveTitle(jQuery(this).attr("postid"));
|
1617 |
}
|
|
|
1618 |
});
|
1619 |
|
1620 |
jQuery("#edcal_weeks_pref").live("keyup", function(evt) {
|
1633 |
edcal.savePosition();
|
1634 |
|
1635 |
edcal.addOptionsSection();
|
1636 |
+
|
1637 |
+
jQuery('#edcal-time').timePicker({
|
1638 |
+
show24Hours: edcal.timeFormat === 'H:i',
|
1639 |
+
separator:':',
|
1640 |
+
step: 30
|
1641 |
+
});
|
1642 |
},
|
1643 |
|
1644 |
/*
|
1651 |
* doEdit - should we edit the post immediately? if true we send the user
|
1652 |
* to the edit screen for their new post.
|
1653 |
*/
|
1654 |
+
createNewDraft: function(/*string*/ date, /*string*/ title, /*string*/ content, /*boolean*/ doEdit) {
|
1655 |
if (!title || title === "") {
|
1656 |
return;
|
1657 |
}
|
1663 |
* put a default post time of 10:00 AM.
|
1664 |
*/
|
1665 |
var formattedDate = encodeURIComponent(edcal.getDayFromDayId(date).toString(edcal.wp_dateFormat) + " 10:00:00");
|
1666 |
+
var url = edcal.ajax_url() + "&action=edcal_newdraft&";
|
1667 |
+
var postData = "date=" + formattedDate +
|
1668 |
+
"&title=" + encodeURIComponent(title) +
|
1669 |
+
"&content=" + encodeURIComponent(content);
|
1670 |
|
1671 |
jQuery.ajax( {
|
1672 |
url: url,
|
1673 |
type: "POST",
|
1674 |
processData: false,
|
1675 |
+
data: postData,
|
1676 |
timeout: 100000,
|
1677 |
dataType: "json",
|
1678 |
success: function(res) {
|
1736 |
timeout: 100000,
|
1737 |
dataType: "json",
|
1738 |
success: function(res) {
|
|
|
|
|
|
|
|
|
1739 |
if (res.error) {
|
1740 |
/*
|
1741 |
* If there was an error we need to remove the dropped
|
1742 |
* post item.
|
1743 |
*/
|
1744 |
+
edcal.output('removePostItem(' + newdate + ', "post-" + ' + res.post.id + ');');
|
1745 |
edcal.removePostItem(newdate, "post-" + res.post.id);
|
1746 |
if (res.error === edcal.CONCURRENCY_ERROR) {
|
1747 |
edcal.showError(edcal.concurrency_error + '<br />' + res.post.title);
|
1748 |
} else if (res.error === edcal.PERMISSION_ERROR) {
|
1749 |
+
edcal.showError(edcal.permission_error);
|
1750 |
} else if (res.error === edcal.NONCE_ERROR) {
|
1751 |
edcal.showError(edcal.checksum_error);
|
1752 |
}
|
1753 |
}
|
1754 |
+
|
1755 |
+
edcal.removePostItem(res.post.date, "post-" + res.post.id);
|
1756 |
+
edcal.addPostItem(res.post, res.post.date);
|
1757 |
+
edcal.addPostItemDragAndToolltip(res.post.date);
|
1758 |
},
|
1759 |
error: function(xhr) {
|
1760 |
edcal.showError(edcal.general_error);
|
1861 |
jQuery.each(postDates, function(i, postDate) {
|
1862 |
edcal.addPostItemDragAndToolltip(postDate);
|
1863 |
});
|
|
|
1864 |
}, 300);
|
1865 |
},
|
1866 |
error: function(xhr) {
|
1872 |
});
|
1873 |
},
|
1874 |
|
1875 |
+
/*
|
1876 |
+
* Retreives a single post item based on the id
|
1877 |
+
* Can optionally pass a callback function that is triggered
|
1878 |
+
* when the call successfully completes. The post object is passed
|
1879 |
+
* as a parameter for the callback.
|
1880 |
+
*/
|
1881 |
+
getPost: function(/*int*/ postid, /*function*/ callback) {
|
1882 |
+
|
1883 |
+
if (postid === 0) {
|
1884 |
+
return false;
|
1885 |
+
}
|
1886 |
+
|
1887 |
+
// show loading
|
1888 |
+
jQuery("#loading").show();
|
1889 |
+
|
1890 |
+
var url = edcal.ajax_url() + "&action=edcal_getpost&postid=" + postid;
|
1891 |
+
|
1892 |
+
jQuery.ajax( {
|
1893 |
+
url: url,
|
1894 |
+
type: "GET",
|
1895 |
+
processData: false,
|
1896 |
+
timeout: 100000,
|
1897 |
+
dataType: "json",
|
1898 |
+
success: function(res) {
|
1899 |
+
// hide loading
|
1900 |
+
jQuery("#loading").hide();
|
1901 |
+
|
1902 |
+
edcal.output("xhr for getPost returned: " + res);
|
1903 |
+
if (res.error) {
|
1904 |
+
if (res.error === edcal.NONCE_ERROR) {
|
1905 |
+
edcal.showError(edcal.checksum_error);
|
1906 |
+
}
|
1907 |
+
return false;
|
1908 |
+
}
|
1909 |
+
if (typeof callback === 'function') {
|
1910 |
+
callback(res.post);
|
1911 |
+
}
|
1912 |
+
return res.post;
|
1913 |
+
},
|
1914 |
+
error: function(xhr) {
|
1915 |
+
// hide loading
|
1916 |
+
jQuery("#loading").hide();
|
1917 |
+
|
1918 |
+
edcal.showError(edcal.general_error);
|
1919 |
+
if (xhr.responseText) {
|
1920 |
+
edcal.output("xhr.responseText: " + xhr.responseText);
|
1921 |
+
}
|
1922 |
+
return false;
|
1923 |
+
}
|
1924 |
+
});
|
1925 |
+
},
|
1926 |
+
|
1927 |
/*
|
1928 |
This function adds the scren options tab to the top of the screen. I wish
|
1929 |
WordPress had a hook so I could provide this in PHP, but as of version 2.9.1
|
1953 |
Show the screen options section. We start by saving off the old HTML
|
1954 |
*/
|
1955 |
edcal.helpMeta = jQuery("#contextual-help-wrap").html();
|
1956 |
+
|
1957 |
+
var optionsHtml = '<h5>' + edcal.str_optionsheader + '</h5>' +
|
|
|
1958 |
'<div class="metabox-prefs">' +
|
1959 |
+
edcal.str_show + '<select id="edcal_weeks_pref" ' + 'class="screen-per-page" title="' + edcal.str_weekstt + '"> ';
|
1960 |
+
|
1961 |
+
var weeks = parseInt(edcal.weeksPref, 10);
|
1962 |
+
for (i = 1; i < 6; i++) {
|
1963 |
+
if (i === weeks) {
|
1964 |
+
optionsHtml += '<option selected="true">' + i + '</option>';
|
1965 |
+
} else {
|
1966 |
+
optionsHtml += '<option>' + i + '</option>';
|
1967 |
+
}
|
1968 |
+
}
|
1969 |
+
|
1970 |
+
optionsHtml += '</select>' +
|
1971 |
edcal.str_show2 + '<br /><br />' +
|
1972 |
'<button id="edcal_applyoptions" onclick="edcal.saveOptions(); return false;" class="save button">' + edcal.str_apply + '</button>' +
|
1973 |
+
'</div>';
|
1974 |
+
|
1975 |
+
jQuery("#contextual-help-wrap").html(optionsHtml);
|
1976 |
|
1977 |
jQuery("#contextual-help-link-wrap").hide();
|
1978 |
|
2060 |
}
|
2061 |
};
|
2062 |
|
2063 |
+
/*
|
2064 |
+
* Helper function for jQuery to center a div
|
2065 |
+
*/
|
2066 |
+
jQuery.fn.center = function () {
|
2067 |
+
this.css("position","absolute");
|
2068 |
+
this.css("top", ( jQuery(window).height() - this.outerHeight() ) / 2+jQuery(window).scrollTop() + "px");
|
2069 |
+
this.css("left", ( jQuery(window).width() - this.outerWidth() ) / 2+jQuery(window).scrollLeft() + "px");
|
2070 |
+
return this;
|
2071 |
+
};
|
2072 |
+
|
2073 |
+
|
2074 |
jQuery(document).ready(function(){
|
2075 |
edcal.init();
|
2076 |
});
|
edcal.php
CHANGED
@@ -18,19 +18,21 @@
|
|
18 |
/*
|
19 |
Plugin Name: WordPress Editorial Calendar
|
20 |
Description: An editorial calendar for managing the dates of your WordPress posts
|
21 |
-
Version: 0.
|
22 |
Author: Mary Vogt and Zack Grossbart
|
23 |
Author URI: http://www.zackgrossbart.com
|
24 |
*/
|
25 |
|
26 |
add_action('wp_ajax_edcal_saveoptions', 'edcal_saveoptions' );
|
27 |
add_action('wp_ajax_edcal_changedate', 'edcal_changedate' );
|
28 |
-
add_action('wp_ajax_edcal_newdraft', 'edcal_newdraft' );
|
|
|
29 |
add_action('wp_ajax_edcal_changetitle', 'edcal_changetitle' );
|
30 |
add_action('admin_menu', 'edcal_list_add_management_page');
|
31 |
add_action('wp_ajax_edcal_posts', 'edcal_posts' );
|
|
|
32 |
add_action('wp_ajax_edcal_deletepost', 'edcal_deletepost' );
|
33 |
-
add_action("admin_print_scripts", 'edcal_scripts');
|
34 |
add_action("init", 'edcal_load_language');
|
35 |
|
36 |
/*
|
@@ -58,7 +60,8 @@ function edcal_load_language() {
|
|
58 |
*/
|
59 |
function edcal_list_add_management_page( ) {
|
60 |
if ( function_exists('add_management_page') ) {
|
61 |
-
$page = add_posts_page( 'Calendar', __('Calendar', 'editorial-calendar'), '
|
|
|
62 |
}
|
63 |
}
|
64 |
|
@@ -91,11 +94,11 @@ function edcal_list_admin() {
|
|
91 |
* be used on this page and nowhere else.
|
92 |
*/
|
93 |
|
94 |
-
echo '<!-- This is the styles from
|
95 |
echo '<style type="text/css">';
|
96 |
-
echoEdCalFile(dirname( __FILE__ ) . "/lib/
|
97 |
echo '</style>';
|
98 |
-
|
99 |
echo '<!-- This is the styles from humanmsg.css -->';
|
100 |
echo '<style type="text/css">';
|
101 |
echoEdCalFile(dirname( __FILE__ ) . "/lib/humanmsg.css");
|
@@ -119,6 +122,9 @@ function edcal_list_admin() {
|
|
119 |
}
|
120 |
?>
|
121 |
|
|
|
|
|
|
|
122 |
/*
|
123 |
* We want to show the day of the first day of the week to match the user's
|
124 |
* country code. The problem is that we can't just use the WordPress locale.
|
@@ -140,16 +146,8 @@ function edcal_list_admin() {
|
|
140 |
edcal.str_by = <?php echo(edcal_json_encode(__('by', 'editorial-calendar'))) ?>;
|
141 |
edcal.str_at = <?php echo(edcal_json_encode(__('at', 'editorial-calendar'))) ?>;
|
142 |
|
143 |
-
edcal.str_addPostLink = <?php echo(edcal_json_encode(__('
|
144 |
|
145 |
-
edcal.str_day1 = <?php echo(edcal_json_encode(__('Sunday', 'editorial-calendar'))) ?>;
|
146 |
-
edcal.str_day2 = <?php echo(edcal_json_encode(__('Monday', 'editorial-calendar'))) ?>;
|
147 |
-
edcal.str_day3 = <?php echo(edcal_json_encode(__('Tuesday', 'editorial-calendar'))) ?>;
|
148 |
-
edcal.str_day4 = <?php echo(edcal_json_encode(__('Wednesday', 'editorial-calendar'))) ?>;
|
149 |
-
edcal.str_day5 = <?php echo(edcal_json_encode(__('Thursday', 'editorial-calendar'))) ?>;
|
150 |
-
edcal.str_day6 = <?php echo(edcal_json_encode(__('Friday', 'editorial-calendar'))) ?>;
|
151 |
-
edcal.str_day7 = <?php echo(edcal_json_encode(__('Saturday', 'editorial-calendar'))) ?>;
|
152 |
-
|
153 |
edcal.str_draft = <?php echo(edcal_json_encode(__(' [DRAFT]', 'editorial-calendar'))) ?>;
|
154 |
edcal.str_edit = <?php echo(edcal_json_encode(__('Edit', 'editorial-calendar'))) ?>;
|
155 |
edcal.str_del = <?php echo(edcal_json_encode(__('Delete', 'editorial-calendar'))) ?>;
|
@@ -157,10 +155,15 @@ function edcal_list_admin() {
|
|
157 |
edcal.str_republish = <?php echo(edcal_json_encode(__('Republish', 'editorial-calendar'))) ?>;
|
158 |
edcal.str_status = <?php echo(edcal_json_encode(__('Status:', 'editorial-calendar'))) ?>;
|
159 |
edcal.str_cancel = <?php echo(edcal_json_encode(__('Cancel', 'editorial-calendar'))) ?>;
|
160 |
-
edcal.str_posttitle = <?php echo(edcal_json_encode(__('
|
161 |
-
edcal.
|
162 |
-
edcal.str_saveandedit = <?php echo(edcal_json_encode(__('Save and Edit Draft', 'editorial-calendar'))) ?>;
|
163 |
edcal.str_newpost = <?php echo(edcal_json_encode(__('Add a new post on ', 'editorial-calendar'))) ?>;
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
edcal.str_del_msg1 = <?php echo(edcal_json_encode(__('You are about to delete the post "', 'editorial-calendar'))) ?>;
|
166 |
edcal.str_del_msg2 = <?php echo(edcal_json_encode(__('". Press Cancel to stop, OK to delete.', 'editorial-calendar'))) ?>;
|
@@ -176,17 +179,17 @@ function edcal_list_admin() {
|
|
176 |
edcal.str_show = <?php echo(edcal_json_encode(__('Show ', 'editorial-calendar'))) ?>;
|
177 |
edcal.str_show2 = <?php echo(edcal_json_encode(__('weeks at a time', 'editorial-calendar'))) ?>;
|
178 |
edcal.str_weekserror = <?php echo(edcal_json_encode(__('The calendar can only show between 1 and 5 weeks at a time.', 'editorial-calendar'))) ?>;
|
179 |
-
edcal.str_weekstt = <?php echo(edcal_json_encode(__('
|
180 |
});
|
181 |
</script>
|
182 |
|
183 |
<style type="text/css">
|
184 |
.loadingclass > .postlink, .loadingclass:hover > .postlink, .tiploading {
|
185 |
-
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/
|
186 |
}
|
187 |
|
188 |
#loading {
|
189 |
-
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading.gif")); ?>');
|
190 |
}
|
191 |
|
192 |
#tipclose {
|
@@ -196,6 +199,10 @@ function edcal_list_admin() {
|
|
196 |
.month-present .daylabel {
|
197 |
background: #F5F5F5 url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/month-present_bk.gif")); ?>') repeat-x left top;
|
198 |
}
|
|
|
|
|
|
|
|
|
199 |
|
200 |
.today .daylabel {
|
201 |
background: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/today_bk.gif")); ?>') repeat-x left top;
|
@@ -204,20 +211,6 @@ function edcal_list_admin() {
|
|
204 |
.dayheadcont {
|
205 |
background: #6D6D6D url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/../../../wp-admin/images/menu-bits.gif")); ?>') repeat-x scroll left top;
|
206 |
}
|
207 |
-
|
208 |
-
<?php
|
209 |
-
$userAgent = strToLower( $_SERVER['HTTP_USER_AGENT']);
|
210 |
-
if (strpos($userAgent, 'macintosh') || strpos($userAgent, 'mac platform x')) {
|
211 |
-
/*
|
212 |
-
* Bold titles look much better on Mac, but not on Window
|
213 |
-
*/
|
214 |
-
?>
|
215 |
-
.post.draggable .postlink {
|
216 |
-
font-weight: bold;
|
217 |
-
}
|
218 |
-
<?php
|
219 |
-
}
|
220 |
-
?>
|
221 |
</style>
|
222 |
|
223 |
<?php
|
@@ -255,6 +248,57 @@ function edcal_list_admin() {
|
|
255 |
<div id="cal"></div>
|
256 |
</div>
|
257 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
</div>
|
259 |
|
260 |
<?php
|
@@ -288,6 +332,15 @@ function edcal_filter_where($where = '') {
|
|
288 |
*
|
289 |
*/
|
290 |
function edcal_scripts() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
/*
|
292 |
* To get proper localization for dates we need to include the correct JavaScript file for the current
|
293 |
* locale. We can do this based on the locale in the localized bundle to make sure the date locale matches
|
@@ -295,6 +348,8 @@ function edcal_scripts() {
|
|
295 |
*/
|
296 |
wp_enqueue_script( "date", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/languages/date-".__('en-US', 'editorial-calendar').".js"), array( 'jquery' ) );
|
297 |
|
|
|
|
|
298 |
wp_enqueue_script( "edcal-lib", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/edcallib.min.js"), array( 'jquery' ) );
|
299 |
return;
|
300 |
|
@@ -307,11 +362,10 @@ function edcal_scripts() {
|
|
307 |
wp_enqueue_script( "ui-draggable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.draggable.js"), array( 'jquery' ) );
|
308 |
wp_enqueue_script( "ui-droppable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.droppable.js"), array( 'jquery' ) );
|
309 |
|
310 |
-
|
311 |
wp_enqueue_script( "bgiframe", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/jquery.bgiframe.js"), array( 'jquery' ) );
|
312 |
-
wp_enqueue_script( "tooltip", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/jquery.tooltip.js"), array( 'jquery' ) );
|
313 |
wp_enqueue_script( "humanMsg", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/humanmsg.js"), array( 'jquery' ) );
|
314 |
-
|
|
|
315 |
wp_enqueue_script( "scrollable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/tools.scrollable-1.1.2.js"), array( 'jquery' ) );
|
316 |
wp_enqueue_script( "mouse-wheel", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/tools.scrollable.mousewheel-1.0.1.js"), array( 'jquery' ) );
|
317 |
|
@@ -324,6 +378,7 @@ function edcal_scripts() {
|
|
324 |
*/
|
325 |
function edcal_posts() {
|
326 |
header("Content-Type: application/json");
|
|
|
327 |
if (!edcal_checknonce()) {
|
328 |
die();
|
329 |
}
|
@@ -347,7 +402,7 @@ function edcal_posts() {
|
|
347 |
<?php
|
348 |
$size = sizeof($myposts);
|
349 |
|
350 |
-
for($i = 0; $i < $size; $i++) {
|
351 |
/*
|
352 |
* Sticky posts are ones that stick to the front page.
|
353 |
* They do technically have a date, but it doesn't
|
@@ -369,6 +424,40 @@ function edcal_posts() {
|
|
369 |
die();
|
370 |
}
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
function edcal_json_encode($string) {
|
373 |
/*
|
374 |
* WordPress escapes apostrophe's when they show up in post titles as '
|
@@ -383,15 +472,24 @@ function edcal_json_encode($string) {
|
|
383 |
/*
|
384 |
* This function sets up the post data and prints out the values we
|
385 |
* care about in a JSON data structure. This prints out just the
|
386 |
-
* value part.
|
387 |
*/
|
388 |
-
function edcal_postJSON($post, $addComma = true) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
setup_postdata($post);
|
390 |
?>
|
391 |
{
|
392 |
"date" : "<?php the_time('d') ?><?php the_time('m') ?><?php the_time('Y') ?>",
|
393 |
"time" : "<?php the_time() ?>",
|
394 |
-
"formattedtime" : "<?php edcal_json_encode(the_time(
|
395 |
"url" : "<?php edcal_json_encode(the_permalink()); ?>",
|
396 |
"status" : "<?php echo(get_post_status()); ?>",
|
397 |
"title" : <?php echo(edcal_json_encode(get_the_title())); ?>,
|
@@ -406,6 +504,11 @@ function edcal_postJSON($post, $addComma = true) {
|
|
406 |
|
407 |
"permalink" : "<?php echo(get_permalink($id)); ?>",
|
408 |
"id" : "<?php the_ID(); ?>"
|
|
|
|
|
|
|
|
|
|
|
409 |
}
|
410 |
<?php
|
411 |
if ($addComma) {
|
@@ -426,6 +529,8 @@ function edcal_deletepost() {
|
|
426 |
}
|
427 |
|
428 |
header("Content-Type: application/json");
|
|
|
|
|
429 |
$edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
|
430 |
$post = get_post($edcal_postid, ARRAY_A);
|
431 |
$title = $post['post_title'];
|
@@ -471,6 +576,8 @@ function edcal_changetitle() {
|
|
471 |
}
|
472 |
|
473 |
header("Content-Type: application/json");
|
|
|
|
|
474 |
$edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
|
475 |
$edcal_newTitle = isset($_GET['title'])?$_GET['title']:null;
|
476 |
|
@@ -518,10 +625,13 @@ function edcal_newdraft() {
|
|
518 |
}
|
519 |
|
520 |
header("Content-Type: application/json");
|
521 |
-
|
|
|
|
|
522 |
|
523 |
$my_post = array();
|
524 |
-
$my_post['post_title'] = isset($
|
|
|
525 |
$my_post['post_status'] = 'draft';
|
526 |
|
527 |
$my_post['post_date'] = $edcal_date;
|
@@ -532,17 +642,17 @@ function edcal_newdraft() {
|
|
532 |
// Insert the post into the database
|
533 |
$my_post_id = wp_insert_post( $my_post );
|
534 |
|
535 |
-
|
536 |
/*
|
537 |
* We finish by returning the latest data for the post in the JSON
|
538 |
*/
|
539 |
global $post;
|
540 |
$post = get_post($my_post_id);
|
|
|
541 |
?>{
|
542 |
"post" :
|
543 |
<?php
|
544 |
|
545 |
-
edcal_postJSON($post);
|
546 |
|
547 |
?>
|
548 |
}
|
@@ -551,6 +661,72 @@ function edcal_newdraft() {
|
|
551 |
die();
|
552 |
}
|
553 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
/*
|
555 |
* This function checks the nonce for the URL. It returns
|
556 |
* true if the nonce checks out and outputs a JSON error
|
@@ -558,6 +734,8 @@ function edcal_newdraft() {
|
|
558 |
*/
|
559 |
function edcal_checknonce() {
|
560 |
header("Content-Type: application/json");
|
|
|
|
|
561 |
global $EDCAL_NONCE_ERROR;
|
562 |
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'edit-calendar')) {
|
563 |
/*
|
@@ -589,13 +767,15 @@ function edcal_changedate() {
|
|
589 |
die();
|
590 |
}
|
591 |
header("Content-Type: application/json");
|
|
|
|
|
592 |
global $edcal_startDate, $edcal_endDate;
|
593 |
$edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
|
594 |
$edcal_newDate = isset($_GET['newdate'])?$_GET['newdate']:null;
|
595 |
$edcal_oldDate = isset($_GET['olddate'])?$_GET['olddate']:null;
|
596 |
$edcal_postStatus = isset($_GET['postStatus'])?$_GET['postStatus']:null;
|
597 |
-
|
598 |
-
if (!current_user_can('
|
599 |
global $EDCAL_PERMISSION_ERROR;
|
600 |
/*
|
601 |
* This is just a sanity check to make sure that the current
|
@@ -740,6 +920,8 @@ function edcal_saveoptions() {
|
|
740 |
}
|
741 |
|
742 |
header("Content-Type: application/json");
|
|
|
|
|
743 |
$edcal_weeks = isset($_GET['weeks'])?$_GET['weeks']:null;
|
744 |
|
745 |
add_option("edcal_weeks_pref", $edcal_weeks, "", "yes");
|
@@ -756,3 +938,12 @@ function edcal_saveoptions() {
|
|
756 |
|
757 |
die();
|
758 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/*
|
19 |
Plugin Name: WordPress Editorial Calendar
|
20 |
Description: An editorial calendar for managing the dates of your WordPress posts
|
21 |
+
Version: 0.7
|
22 |
Author: Mary Vogt and Zack Grossbart
|
23 |
Author URI: http://www.zackgrossbart.com
|
24 |
*/
|
25 |
|
26 |
add_action('wp_ajax_edcal_saveoptions', 'edcal_saveoptions' );
|
27 |
add_action('wp_ajax_edcal_changedate', 'edcal_changedate' );
|
28 |
+
//add_action('wp_ajax_edcal_newdraft', 'edcal_newdraft' );
|
29 |
+
add_action('wp_ajax_edcal_savepost', 'edcal_savepost' );
|
30 |
add_action('wp_ajax_edcal_changetitle', 'edcal_changetitle' );
|
31 |
add_action('admin_menu', 'edcal_list_add_management_page');
|
32 |
add_action('wp_ajax_edcal_posts', 'edcal_posts' );
|
33 |
+
add_action('wp_ajax_edcal_getpost', 'edcal_getpost' );
|
34 |
add_action('wp_ajax_edcal_deletepost', 'edcal_deletepost' );
|
35 |
+
//add_action("admin_print_scripts", 'edcal_scripts');
|
36 |
add_action("init", 'edcal_load_language');
|
37 |
|
38 |
/*
|
60 |
*/
|
61 |
function edcal_list_add_management_page( ) {
|
62 |
if ( function_exists('add_management_page') ) {
|
63 |
+
$page = add_posts_page( __('Calendar', 'editorial-calendar'), __('Calendar', 'editorial-calendar'), 'edit_posts', 'cal', 'edcal_list_admin' );
|
64 |
+
add_action( "admin_print_scripts-$page", 'edcal_scripts' );
|
65 |
}
|
66 |
}
|
67 |
|
94 |
* be used on this page and nowhere else.
|
95 |
*/
|
96 |
|
97 |
+
echo '<!-- This is the styles from time picker.css -->';
|
98 |
echo '<style type="text/css">';
|
99 |
+
echoEdCalFile(dirname( __FILE__ ) . "/lib/timePicker.css");
|
100 |
echo '</style>';
|
101 |
+
|
102 |
echo '<!-- This is the styles from humanmsg.css -->';
|
103 |
echo '<style type="text/css">';
|
104 |
echoEdCalFile(dirname( __FILE__ ) . "/lib/humanmsg.css");
|
122 |
}
|
123 |
?>
|
124 |
|
125 |
+
edcal.startOfWeek = <?php echo(get_option("start_of_week")); ?>;
|
126 |
+
edcal.timeFormat = "<?php echo(get_option("time_format")); ?>";
|
127 |
+
|
128 |
/*
|
129 |
* We want to show the day of the first day of the week to match the user's
|
130 |
* country code. The problem is that we can't just use the WordPress locale.
|
146 |
edcal.str_by = <?php echo(edcal_json_encode(__('by', 'editorial-calendar'))) ?>;
|
147 |
edcal.str_at = <?php echo(edcal_json_encode(__('at', 'editorial-calendar'))) ?>;
|
148 |
|
149 |
+
edcal.str_addPostLink = <?php echo(edcal_json_encode(__('New Post', 'editorial-calendar'))) ?>;
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
edcal.str_draft = <?php echo(edcal_json_encode(__(' [DRAFT]', 'editorial-calendar'))) ?>;
|
152 |
edcal.str_edit = <?php echo(edcal_json_encode(__('Edit', 'editorial-calendar'))) ?>;
|
153 |
edcal.str_del = <?php echo(edcal_json_encode(__('Delete', 'editorial-calendar'))) ?>;
|
155 |
edcal.str_republish = <?php echo(edcal_json_encode(__('Republish', 'editorial-calendar'))) ?>;
|
156 |
edcal.str_status = <?php echo(edcal_json_encode(__('Status:', 'editorial-calendar'))) ?>;
|
157 |
edcal.str_cancel = <?php echo(edcal_json_encode(__('Cancel', 'editorial-calendar'))) ?>;
|
158 |
+
edcal.str_posttitle = <?php echo(edcal_json_encode(__('Title', 'editorial-calendar'))) ?>;
|
159 |
+
edcal.str_postcontent = <?php echo(edcal_json_encode(__('Content', 'editorial-calendar'))) ?>;
|
|
|
160 |
edcal.str_newpost = <?php echo(edcal_json_encode(__('Add a new post on ', 'editorial-calendar'))) ?>;
|
161 |
+
edcal.str_newpost_title = <?php echo(edcal_json_encode(__('New Post - ', 'editorial-calendar'))) ?>;
|
162 |
+
edcal.str_update = <?php echo(edcal_json_encode(__('Update', 'editorial-calendar'))) ?>;
|
163 |
+
edcal.str_publish = <?php echo(edcal_json_encode(__('Schedule', 'editorial-calendar'))) ?>;
|
164 |
+
edcal.str_save = <?php echo(edcal_json_encode(__('Save', 'editorial-calendar'))) ?>;
|
165 |
+
edcal.str_edit_post_title = <?php echo(edcal_json_encode(__('Edit Post', 'editorial-calendar'))) ?>;
|
166 |
+
edcal.str_scheduled = <?php echo(edcal_json_encode(__('Scheduled', 'editorial-calendar'))) ?>;
|
167 |
|
168 |
edcal.str_del_msg1 = <?php echo(edcal_json_encode(__('You are about to delete the post "', 'editorial-calendar'))) ?>;
|
169 |
edcal.str_del_msg2 = <?php echo(edcal_json_encode(__('". Press Cancel to stop, OK to delete.', 'editorial-calendar'))) ?>;
|
179 |
edcal.str_show = <?php echo(edcal_json_encode(__('Show ', 'editorial-calendar'))) ?>;
|
180 |
edcal.str_show2 = <?php echo(edcal_json_encode(__('weeks at a time', 'editorial-calendar'))) ?>;
|
181 |
edcal.str_weekserror = <?php echo(edcal_json_encode(__('The calendar can only show between 1 and 5 weeks at a time.', 'editorial-calendar'))) ?>;
|
182 |
+
edcal.str_weekstt = <?php echo(edcal_json_encode(__('Select the number of weeks for the calendar to show.', 'editorial-calendar'))) ?>;
|
183 |
});
|
184 |
</script>
|
185 |
|
186 |
<style type="text/css">
|
187 |
.loadingclass > .postlink, .loadingclass:hover > .postlink, .tiploading {
|
188 |
+
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/../../../wp-admin/images/loading.gif")); ?>');
|
189 |
}
|
190 |
|
191 |
#loading {
|
192 |
+
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/../../../wp-admin/images/loading.gif")); ?>');
|
193 |
}
|
194 |
|
195 |
#tipclose {
|
199 |
.month-present .daylabel {
|
200 |
background: #F5F5F5 url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/month-present_bk.gif")); ?>') repeat-x left top;
|
201 |
}
|
202 |
+
|
203 |
+
#tooltip {
|
204 |
+
background: white url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/../../../wp-admin/images/gray-grad.png")); ?>') repeat-x left top;
|
205 |
+
}
|
206 |
|
207 |
.today .daylabel {
|
208 |
background: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/today_bk.gif")); ?>') repeat-x left top;
|
211 |
.dayheadcont {
|
212 |
background: #6D6D6D url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/../../../wp-admin/images/menu-bits.gif")); ?>') repeat-x scroll left top;
|
213 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
</style>
|
215 |
|
216 |
<?php
|
248 |
<div id="cal"></div>
|
249 |
</div>
|
250 |
</div>
|
251 |
+
|
252 |
+
<div id="tooltip" style="display:none;">
|
253 |
+
<div class="tooltip newposttip">
|
254 |
+
<div id="tooltiptitle">
|
255 |
+
<?php _e('Edit Post', 'editorial-calendar') ?>
|
256 |
+
</div>
|
257 |
+
<a href="#" id="tipclose" onclick="edcal.hideForm(); return false;" title="close"> </a>
|
258 |
+
<h3><!-- Placeholder for the form title; added dynamically --></h3>
|
259 |
+
<div id="edcal-title-new-section">
|
260 |
+
<div id="edcal-title-row" class="edcal-form-row">
|
261 |
+
<h4 class="edcal-form-label"><?php _e('Title', 'editorial-calendar') ?></h4>
|
262 |
+
<input type="text" class="text_input edcal-form-control" id="edcal-title-new-field" name="title" /><br />
|
263 |
+
</div>
|
264 |
+
|
265 |
+
<div id="edcal-content-row" class="edcal-form-row">
|
266 |
+
<h4 class="edcal-form-label"><?php _e('Content', 'editorial-calendar') ?></h4>
|
267 |
+
<!--
|
268 |
+
<div id="cal_mediabar">
|
269 |
+
<?php if ( current_user_can( 'upload_files' ) ) : ?>
|
270 |
+
<div id="media-buttons" class="hide-if-no-js">
|
271 |
+
<?php do_action( 'media_buttons' ); ?>
|
272 |
+
</div>
|
273 |
+
<?php endif; ?>
|
274 |
+
</div>
|
275 |
+
-->
|
276 |
+
<div class="textarea-wrap edcal-form-control">
|
277 |
+
<textarea cols="15" rows="3" class="mceEditor" id="content" name="content"></textarea>
|
278 |
+
</div>
|
279 |
+
</div>
|
280 |
+
<div id="edcal-time-section" class="edcal-form-row">
|
281 |
+
<h4 class="edcal-form-label"><?php _e('Time', 'editorial-calendar') ?></h4>
|
282 |
+
<input type="text" class="edcal-form-control" id="edcal-time" name="time" value="" size="8" readonly="true" maxlength="8" autocomplete="off" />
|
283 |
+
</div>
|
284 |
+
<div id="edcal-status-section" class="edcal-form-row">
|
285 |
+
<h4 class="edcal-form-label"><?php _e('Status', 'editorial-calendar') ?></h4>
|
286 |
+
<select name="status" id="edcal-status" class="edcal-form-control">
|
287 |
+
<option id="futureoption" value="future"><?php _e('Scheduled', 'editorial-calendar') ?></option>
|
288 |
+
<!--<option value="pending">Pending Review</option>-->
|
289 |
+
<option value="draft"><?php _e('Draft', 'editorial-calendar') ?></option>
|
290 |
+
</select>
|
291 |
+
</div>
|
292 |
+
</div>
|
293 |
+
<div id="edit-slug-buttons" class="edcal-form-row">
|
294 |
+
<a class="button-primary disabled" id="newPostScheduleButton" href="#"><?php _e('Schedule', 'editorial-calendar') ?></a>
|
295 |
+
<a href="#" onclick="edcal.hideForm(); return false;" class="button-secondary cancel"><?php _e('Cancel', 'editorial-calendar') ?></a>
|
296 |
+
</div>
|
297 |
+
<input type="hidden" id="edcal-date" name="date" value="" />
|
298 |
+
<input type="hidden" id="edcal-id" name="id" value="" />
|
299 |
+
</div>
|
300 |
+
</div>
|
301 |
+
|
302 |
</div>
|
303 |
|
304 |
<?php
|
332 |
*
|
333 |
*/
|
334 |
function edcal_scripts() {
|
335 |
+
if ( user_can_richedit() )
|
336 |
+
wp_enqueue_script('editor');
|
337 |
+
add_thickbox();
|
338 |
+
?>
|
339 |
+
<link rel='stylesheet' id='thickbox-css' href='<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/../../../wp-includes/js/thickbox/thickbox.css?ver=20090514")); ?>' type='text/css' media='all' />
|
340 |
+
<?php
|
341 |
+
wp_enqueue_script('media-upload');
|
342 |
+
|
343 |
+
|
344 |
/*
|
345 |
* To get proper localization for dates we need to include the correct JavaScript file for the current
|
346 |
* locale. We can do this based on the locale in the localized bundle to make sure the date locale matches
|
348 |
*/
|
349 |
wp_enqueue_script( "date", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/languages/date-".__('en-US', 'editorial-calendar').".js"), array( 'jquery' ) );
|
350 |
|
351 |
+
//wp_enqueue_script( "date-extras", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/date.extras.js"), array( 'jquery' ) );
|
352 |
+
|
353 |
wp_enqueue_script( "edcal-lib", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/edcallib.min.js"), array( 'jquery' ) );
|
354 |
return;
|
355 |
|
362 |
wp_enqueue_script( "ui-draggable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.draggable.js"), array( 'jquery' ) );
|
363 |
wp_enqueue_script( "ui-droppable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.droppable.js"), array( 'jquery' ) );
|
364 |
|
|
|
365 |
wp_enqueue_script( "bgiframe", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/jquery.bgiframe.js"), array( 'jquery' ) );
|
|
|
366 |
wp_enqueue_script( "humanMsg", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/humanmsg.js"), array( 'jquery' ) );
|
367 |
+
wp_enqueue_script( "jquery-timepicker", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/jquery.timepicker.js"), array( 'jquery' ) );
|
368 |
+
|
369 |
wp_enqueue_script( "scrollable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/tools.scrollable-1.1.2.js"), array( 'jquery' ) );
|
370 |
wp_enqueue_script( "mouse-wheel", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/tools.scrollable.mousewheel-1.0.1.js"), array( 'jquery' ) );
|
371 |
|
378 |
*/
|
379 |
function edcal_posts() {
|
380 |
header("Content-Type: application/json");
|
381 |
+
edcal_addNoCacheHeaders();
|
382 |
if (!edcal_checknonce()) {
|
383 |
die();
|
384 |
}
|
402 |
<?php
|
403 |
$size = sizeof($myposts);
|
404 |
|
405 |
+
for($i = 0; $i < $size; $i++) {
|
406 |
/*
|
407 |
* Sticky posts are ones that stick to the front page.
|
408 |
* They do technically have a date, but it doesn't
|
424 |
die();
|
425 |
}
|
426 |
|
427 |
+
/*
|
428 |
+
* This is for an AJAX call that returns a post with the specified ID
|
429 |
+
*/
|
430 |
+
function edcal_getpost() {
|
431 |
+
|
432 |
+
header("Content-Type: application/json");
|
433 |
+
edcal_addNoCacheHeaders();
|
434 |
+
|
435 |
+
// If nonce fails, return
|
436 |
+
if (!edcal_checknonce()) die();
|
437 |
+
|
438 |
+
$post_id = intval($_GET['postid']);
|
439 |
+
|
440 |
+
// If a proper post_id wasn't passed, return
|
441 |
+
if(!$post_id) die();
|
442 |
+
|
443 |
+
$post = query_posts( array('p' => $post_id) );
|
444 |
+
|
445 |
+
// get_post and setup_postdata don't get along, so we're doing a mini-loop
|
446 |
+
if(have_posts()) :
|
447 |
+
while(have_posts()) : the_post();
|
448 |
+
?>
|
449 |
+
{
|
450 |
+
"post" :
|
451 |
+
<?php
|
452 |
+
edcal_postJSON($post[0], false, true);
|
453 |
+
?>
|
454 |
+
}
|
455 |
+
<?php
|
456 |
+
endwhile;
|
457 |
+
endif;
|
458 |
+
die();
|
459 |
+
}
|
460 |
+
|
461 |
function edcal_json_encode($string) {
|
462 |
/*
|
463 |
* WordPress escapes apostrophe's when they show up in post titles as '
|
472 |
/*
|
473 |
* This function sets up the post data and prints out the values we
|
474 |
* care about in a JSON data structure. This prints out just the
|
475 |
+
* value part. If $fullPost is set to true, post_content is also returned.
|
476 |
*/
|
477 |
+
function edcal_postJSON($post, $addComma = true, $fullPost = false) {
|
478 |
+
$timeFormat = get_option("time_format");
|
479 |
+
if ($timeFormat == "g:i a") {
|
480 |
+
$timeFormat = "ga";
|
481 |
+
} else if ($timeFormat == "g:i A") {
|
482 |
+
$timeFormat = "gA";
|
483 |
+
} else if ($timeFormat == "H:i") {
|
484 |
+
$timeFormat = "H";
|
485 |
+
}
|
486 |
+
|
487 |
setup_postdata($post);
|
488 |
?>
|
489 |
{
|
490 |
"date" : "<?php the_time('d') ?><?php the_time('m') ?><?php the_time('Y') ?>",
|
491 |
"time" : "<?php the_time() ?>",
|
492 |
+
"formattedtime" : "<?php edcal_json_encode(the_time($timeFormat)); ?>",
|
493 |
"url" : "<?php edcal_json_encode(the_permalink()); ?>",
|
494 |
"status" : "<?php echo(get_post_status()); ?>",
|
495 |
"title" : <?php echo(edcal_json_encode(get_the_title())); ?>,
|
504 |
|
505 |
"permalink" : "<?php echo(get_permalink($id)); ?>",
|
506 |
"id" : "<?php the_ID(); ?>"
|
507 |
+
|
508 |
+
<?php if($fullPost) : ?>
|
509 |
+
, "content" : <?php echo edcal_json_encode(get_the_content()) ?>
|
510 |
+
|
511 |
+
<?php endif; ?>
|
512 |
}
|
513 |
<?php
|
514 |
if ($addComma) {
|
529 |
}
|
530 |
|
531 |
header("Content-Type: application/json");
|
532 |
+
edcal_addNoCacheHeaders();
|
533 |
+
|
534 |
$edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
|
535 |
$post = get_post($edcal_postid, ARRAY_A);
|
536 |
$title = $post['post_title'];
|
576 |
}
|
577 |
|
578 |
header("Content-Type: application/json");
|
579 |
+
edcal_addNoCacheHeaders();
|
580 |
+
|
581 |
$edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
|
582 |
$edcal_newTitle = isset($_GET['title'])?$_GET['title']:null;
|
583 |
|
625 |
}
|
626 |
|
627 |
header("Content-Type: application/json");
|
628 |
+
edcal_addNoCacheHeaders();
|
629 |
+
|
630 |
+
$edcal_date = isset($_POST["date"])?$_POST["date"]:null;
|
631 |
|
632 |
$my_post = array();
|
633 |
+
$my_post['post_title'] = isset($_POST["title"])?$_POST["title"]:null;
|
634 |
+
$my_post['post_content'] = isset($_POST["content"])?$_POST["content"]:null;
|
635 |
$my_post['post_status'] = 'draft';
|
636 |
|
637 |
$my_post['post_date'] = $edcal_date;
|
642 |
// Insert the post into the database
|
643 |
$my_post_id = wp_insert_post( $my_post );
|
644 |
|
|
|
645 |
/*
|
646 |
* We finish by returning the latest data for the post in the JSON
|
647 |
*/
|
648 |
global $post;
|
649 |
$post = get_post($my_post_id);
|
650 |
+
|
651 |
?>{
|
652 |
"post" :
|
653 |
<?php
|
654 |
|
655 |
+
edcal_postJSON($post, false);
|
656 |
|
657 |
?>
|
658 |
}
|
661 |
die();
|
662 |
}
|
663 |
|
664 |
+
/*
|
665 |
+
* This is a helper function to create a new draft post on a specified date
|
666 |
+
* or update an existing post
|
667 |
+
*/
|
668 |
+
function edcal_savepost() {
|
669 |
+
|
670 |
+
if (!edcal_checknonce()) {
|
671 |
+
die();
|
672 |
+
}
|
673 |
+
|
674 |
+
header("Content-Type: application/json");
|
675 |
+
edcal_addNoCacheHeaders();
|
676 |
+
|
677 |
+
$edcal_date = isset($_POST["date"])?$_POST["date"]:null;
|
678 |
+
|
679 |
+
$my_post = array();
|
680 |
+
|
681 |
+
// If the post id is not specified, we're creating a new post
|
682 |
+
if($_POST['id']) {
|
683 |
+
$my_post['ID'] = intval($_POST['id']);
|
684 |
+
} else {
|
685 |
+
$my_post['post_status'] = 'draft'; // if new post, set the status to draft
|
686 |
+
}
|
687 |
+
|
688 |
+
$my_post['post_title'] = isset($_POST["title"])?$_POST["title"]:null;
|
689 |
+
$my_post['post_content'] = isset($_POST["content"])?$_POST["content"]:null;
|
690 |
+
|
691 |
+
$my_post['post_date'] = $edcal_date;
|
692 |
+
$my_post['post_date_gmt'] = get_gmt_from_date($edcal_date);
|
693 |
+
$my_post['post_modified'] = $edcal_date;
|
694 |
+
$my_post['post_modified_gmt'] = get_gmt_from_date($edcal_date);
|
695 |
+
|
696 |
+
if($_POST['status']) {
|
697 |
+
wp_transition_post_status($_POST['status'], $my_post['post_status'], $my_post);
|
698 |
+
$my_post['post_status'] = $_POST['status'];
|
699 |
+
}
|
700 |
+
|
701 |
+
|
702 |
+
// Insert the post into the database
|
703 |
+
if($my_post['ID'])
|
704 |
+
$my_post_id = wp_update_post( $my_post );
|
705 |
+
else
|
706 |
+
$my_post_id = wp_insert_post( $my_post );
|
707 |
+
|
708 |
+
// TODO: throw error if update/insert or getsinglepost fails
|
709 |
+
/*
|
710 |
+
* We finish by returning the latest data for the post in the JSON
|
711 |
+
*/
|
712 |
+
$post = query_posts( array('p' => $my_post_id) );
|
713 |
+
|
714 |
+
// get_post and setup_postdata don't get along, so we're doing a mini-loop
|
715 |
+
if(have_posts()) :
|
716 |
+
while(have_posts()) : the_post();
|
717 |
+
?>
|
718 |
+
{
|
719 |
+
"post" :
|
720 |
+
<?php
|
721 |
+
edcal_postJSON($post[0], false);
|
722 |
+
?>
|
723 |
+
}
|
724 |
+
<?php
|
725 |
+
endwhile;
|
726 |
+
endif;
|
727 |
+
die();
|
728 |
+
}
|
729 |
+
|
730 |
/*
|
731 |
* This function checks the nonce for the URL. It returns
|
732 |
* true if the nonce checks out and outputs a JSON error
|
734 |
*/
|
735 |
function edcal_checknonce() {
|
736 |
header("Content-Type: application/json");
|
737 |
+
edcal_addNoCacheHeaders();
|
738 |
+
|
739 |
global $EDCAL_NONCE_ERROR;
|
740 |
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'edit-calendar')) {
|
741 |
/*
|
767 |
die();
|
768 |
}
|
769 |
header("Content-Type: application/json");
|
770 |
+
edcal_addNoCacheHeaders();
|
771 |
+
|
772 |
global $edcal_startDate, $edcal_endDate;
|
773 |
$edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
|
774 |
$edcal_newDate = isset($_GET['newdate'])?$_GET['newdate']:null;
|
775 |
$edcal_oldDate = isset($_GET['olddate'])?$_GET['olddate']:null;
|
776 |
$edcal_postStatus = isset($_GET['postStatus'])?$_GET['postStatus']:null;
|
777 |
+
|
778 |
+
if (!current_user_can('edit_post', $edcal_postid)) {
|
779 |
global $EDCAL_PERMISSION_ERROR;
|
780 |
/*
|
781 |
* This is just a sanity check to make sure that the current
|
920 |
}
|
921 |
|
922 |
header("Content-Type: application/json");
|
923 |
+
edcal_addNoCacheHeaders();
|
924 |
+
|
925 |
$edcal_weeks = isset($_GET['weeks'])?$_GET['weeks']:null;
|
926 |
|
927 |
add_option("edcal_weeks_pref", $edcal_weeks, "", "yes");
|
938 |
|
939 |
die();
|
940 |
}
|
941 |
+
|
942 |
+
/*
|
943 |
+
* Add the no cache headers to make sure that our responses aren't
|
944 |
+
* cached by the browser.
|
945 |
+
*/
|
946 |
+
function edcal_addNoCacheHeaders() {
|
947 |
+
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
948 |
+
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
949 |
+
}
|
images/loading.gif
DELETED
Binary file
|
images/loading_post.gif
DELETED
Binary file
|
images/loading_post_hover.gif
DELETED
Binary file
|
images/tip_close.gif
CHANGED
Binary file
|
languages/editorial-calendar-cs_CZ.mo
ADDED
Binary file
|
languages/editorial-calendar-cs_CZ.po
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Translation of the WordPress plugin by .
|
2 |
+
# Copyright (C) 2010
|
3 |
+
# This file is distributed under the same license as the package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: Editorial-Calendar-cs_CZ\n"
|
9 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/editorial-calendar\n"
|
10 |
+
"POT-Creation-Date: 2010-01-02 21:49+0000\n"
|
11 |
+
"PO-Revision-Date: 2010-02-26 18:26+0100\n"
|
12 |
+
"Last-Translator: Road runner <roadrunner@ufoni.cz>\n"
|
13 |
+
"Language-Team: Lakva <lakva@volny.cz>\n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"Plural-Forms: Y\n"
|
18 |
+
"X-Poedit-Language: Czech\n"
|
19 |
+
"X-Poedit-Country: CZECH REPUBLIC\n"
|
20 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
21 |
+
|
22 |
+
#: edcal.php:53
|
23 |
+
msgid "Calendar"
|
24 |
+
msgstr "Kalendář"
|
25 |
+
|
26 |
+
#: edcal.php:116
|
27 |
+
msgid "en-US"
|
28 |
+
msgstr "cs-CZ"
|
29 |
+
|
30 |
+
#: edcal.php:124
|
31 |
+
msgid "on"
|
32 |
+
msgstr "na"
|
33 |
+
|
34 |
+
#: edcal.php:125
|
35 |
+
msgid "by"
|
36 |
+
msgstr "do"
|
37 |
+
|
38 |
+
#: edcal.php:126
|
39 |
+
msgid "at"
|
40 |
+
msgstr "v"
|
41 |
+
|
42 |
+
#: edcal.php:128
|
43 |
+
msgid "Sunday"
|
44 |
+
msgstr "Pondělí"
|
45 |
+
|
46 |
+
#: edcal.php:129
|
47 |
+
msgid "Monday"
|
48 |
+
msgstr "Úterý"
|
49 |
+
|
50 |
+
#: edcal.php:130
|
51 |
+
msgid "Tuesday"
|
52 |
+
msgstr "Středa"
|
53 |
+
|
54 |
+
#: edcal.php:131
|
55 |
+
msgid "Wednesday"
|
56 |
+
msgstr "Čtvrtek"
|
57 |
+
|
58 |
+
#: edcal.php:132
|
59 |
+
msgid "Thursday"
|
60 |
+
msgstr "Pátek"
|
61 |
+
|
62 |
+
#: edcal.php:133
|
63 |
+
msgid "Friday"
|
64 |
+
msgstr "Sobota"
|
65 |
+
|
66 |
+
#: edcal.php:134
|
67 |
+
msgid "Saturday"
|
68 |
+
msgstr "Neděle"
|
69 |
+
|
70 |
+
#: edcal.php:153
|
71 |
+
msgid " [DRAFT]"
|
72 |
+
msgstr "[KONCEPT]"
|
73 |
+
|
74 |
+
#: edcal.php:136
|
75 |
+
msgid "Edit"
|
76 |
+
msgstr "Upravit"
|
77 |
+
|
78 |
+
#: edcal.php:137
|
79 |
+
msgid "Delete"
|
80 |
+
msgstr "Smazat"
|
81 |
+
|
82 |
+
#: edcal.php:138
|
83 |
+
msgid "View"
|
84 |
+
msgstr "Zobrazit"
|
85 |
+
|
86 |
+
#: edcal.php:139
|
87 |
+
msgid "Status:"
|
88 |
+
msgstr "Stav:"
|
89 |
+
|
90 |
+
#: edcal.php:140
|
91 |
+
msgid "Cancel"
|
92 |
+
msgstr "Storno"
|
93 |
+
|
94 |
+
#: edcal.php:141
|
95 |
+
msgid "Post Title:"
|
96 |
+
msgstr "Název příspěvku:"
|
97 |
+
|
98 |
+
#: edcal.php:161
|
99 |
+
msgid "Post Content:"
|
100 |
+
msgstr "Příspěvek obashuje:"
|
101 |
+
|
102 |
+
#: edcal.php:142
|
103 |
+
msgid "Save Draft"
|
104 |
+
msgstr "Uložit koncept"
|
105 |
+
|
106 |
+
#: edcal.php:143
|
107 |
+
msgid "Save and Edit Draft"
|
108 |
+
msgstr "Uložit a upravit koncept"
|
109 |
+
|
110 |
+
#: edcal.php:144
|
111 |
+
msgid "Add a new post on "
|
112 |
+
msgstr "Přidat nový příspěvek na "
|
113 |
+
|
114 |
+
#: edcal.php:146
|
115 |
+
msgid "You are about to delete this post "
|
116 |
+
msgstr "Chystáte se SMAZAT tento příspěvek "
|
117 |
+
|
118 |
+
#: edcal.php:147
|
119 |
+
msgid "Press cancel to stop, OK to delete."
|
120 |
+
msgstr "Stisknutím \"Storno\" akci zrušíte, \"Ok\" příspěvek smaže."
|
121 |
+
|
122 |
+
#: edcal.php:149
|
123 |
+
msgid "Looks like someone else already moved this post."
|
124 |
+
msgstr "Zdá se že příspěvek už někdo přesunul."
|
125 |
+
|
126 |
+
#: edcal.php:150
|
127 |
+
msgid "You do not have permission to edit posts."
|
128 |
+
msgstr "Nemáte oprávnění změnit příspěvek."
|
129 |
+
|
130 |
+
#: edcal.php:151
|
131 |
+
msgid "Invalid checksum for post. This is commonly a cross-site scripting error."
|
132 |
+
msgstr "Neplatný kontrolní součet příspěvku. To je obvykle chyba při mezi-sitové scriptování."
|
133 |
+
|
134 |
+
#: edcal.php:152
|
135 |
+
msgid "There was an error contacting your blog."
|
136 |
+
msgstr "Došlo k chybě při spojení s vaším blogem."
|
137 |
+
|
138 |
+
#: edcal.php:174
|
139 |
+
msgid "Screen Options"
|
140 |
+
msgstr "Možnosti zobrazení"
|
141 |
+
|
142 |
+
#: edcal.php:175
|
143 |
+
msgid "Calendar Options"
|
144 |
+
msgstr "Možnosti kalendáře"
|
145 |
+
|
146 |
+
#: edcal.php:176
|
147 |
+
msgid "Apply"
|
148 |
+
msgstr "Použít"
|
149 |
+
|
150 |
+
#: edcal.php:177
|
151 |
+
msgid "Show "
|
152 |
+
msgstr "Zobrazit"
|
153 |
+
|
154 |
+
#: edcal.php:178
|
155 |
+
msgid "weeks at a time"
|
156 |
+
msgstr "týdnů naráz"
|
157 |
+
|
158 |
+
#: edcal.php:179
|
159 |
+
msgid "The calendar can only show between 1 and 5 weeks at a time."
|
160 |
+
msgstr "Kalendář může zobrazit 1 až 5 týdnů nazáz."
|
161 |
+
|
162 |
+
#: edcal.php:180
|
163 |
+
msgid "Enter the number of weeks, between 1 and 5, for the calendar to show."
|
164 |
+
msgstr "Vložte počet týdnů, které má kalendář zobrazit, od 1 do 5."
|
165 |
+
|
166 |
+
#: edcal.php:184
|
167 |
+
msgid "Posts Calendar"
|
168 |
+
msgstr "Kalendář článků."
|
169 |
+
|
170 |
+
#: edcal.php:193
|
171 |
+
msgid "Go back four weeks."
|
172 |
+
msgstr "Zpět o čtyři týdny."
|
173 |
+
|
174 |
+
#: edcal.php:195
|
175 |
+
msgid "Skip ahead four weeks."
|
176 |
+
msgstr "Vpřed o čtyři týdny."
|
177 |
+
|
178 |
+
#: edcal.php:250
|
179 |
+
msgid "Jump to today"
|
180 |
+
msgstr "Přejít na dnešek"
|
181 |
+
|
182 |
+
#: edcal.php:200
|
183 |
+
msgid "Today"
|
184 |
+
msgstr "Dnes"
|
185 |
+
|
186 |
+
#: edcal.php:457
|
187 |
+
#: edcal.php:460
|
188 |
+
msgid "Error in deleting..."
|
189 |
+
msgstr "Chyba při mazání..."
|
190 |
+
|
lib/date.extras.js
ADDED
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @version: 1.0 Alpha-1
|
3 |
+
* @author: Coolite Inc. http://www.coolite.com/
|
4 |
+
* @date: 2008-04-13
|
5 |
+
* @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved.
|
6 |
+
* @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
|
7 |
+
* @website: http://www.datejs.com/
|
8 |
+
*/
|
9 |
+
|
10 |
+
(function () {
|
11 |
+
var $D = Date,
|
12 |
+
$P = $D.prototype,
|
13 |
+
$C = $D.CultureInfo,
|
14 |
+
$f = [],
|
15 |
+
p = function (s, l) {
|
16 |
+
if (!l) {
|
17 |
+
l = 2;
|
18 |
+
}
|
19 |
+
return ("000" + s).slice(l * -1);
|
20 |
+
};
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Converts a PHP format string to Java/.NET format string.
|
24 |
+
* A PHP format string can be used with .$format or .format.
|
25 |
+
* A Java/.NET format string can be used with .toString().
|
26 |
+
* The .parseExact function will only accept a Java/.NET format string
|
27 |
+
*
|
28 |
+
* Example
|
29 |
+
<pre>
|
30 |
+
var f1 = "%m/%d/%y"
|
31 |
+
var f2 = Date.normalizeFormat(f1); // "MM/dd/yy"
|
32 |
+
|
33 |
+
new Date().format(f1); // "04/13/08"
|
34 |
+
new Date().$format(f1); // "04/13/08"
|
35 |
+
new Date().toString(f2); // "04/13/08"
|
36 |
+
|
37 |
+
var date = Date.parseExact("04/13/08", f2); // Sun Apr 13 2008
|
38 |
+
</pre>
|
39 |
+
* @param {String} A PHP format string consisting of one or more format spcifiers.
|
40 |
+
* @return {String} The PHP format converted to a Java/.NET format string.
|
41 |
+
*/
|
42 |
+
$D.normalizeFormat = function (format) {
|
43 |
+
$f = [];
|
44 |
+
var t = new Date().$format(format);
|
45 |
+
return $f.join("");
|
46 |
+
};
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Format a local Unix timestamp according to locale settings
|
50 |
+
*
|
51 |
+
* Example
|
52 |
+
<pre>
|
53 |
+
Date.strftime("%m/%d/%y", new Date()); // "04/13/08"
|
54 |
+
Date.strftime("c", "2008-04-13T17:52:03Z"); // "04/13/08"
|
55 |
+
</pre>
|
56 |
+
* @param {String} A format string consisting of one or more format spcifiers [Optional].
|
57 |
+
* @param {Number} The number representing the number of seconds that have elapsed since January 1, 1970 (local time).
|
58 |
+
* @return {String} A string representation of the current Date object.
|
59 |
+
*/
|
60 |
+
$D.strftime = function (format, time) {
|
61 |
+
return new Date(time * 1000).$format(format);
|
62 |
+
};
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Parse any textual datetime description into a Unix timestamp.
|
66 |
+
* A Unix timestamp is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT).
|
67 |
+
*
|
68 |
+
* Example
|
69 |
+
<pre>
|
70 |
+
Date.strtotime("04/13/08"); // 1208044800
|
71 |
+
Date.strtotime("1970-01-01T00:00:00Z"); // 0
|
72 |
+
</pre>
|
73 |
+
* @param {String} A format string consisting of one or more format spcifiers [Optional].
|
74 |
+
* @param {Object} A string or date object.
|
75 |
+
* @return {String} A string representation of the current Date object.
|
76 |
+
*/
|
77 |
+
$D.strtotime = function (time) {
|
78 |
+
var d = $D.parse(time);
|
79 |
+
d.addMinutes(d.getTimezoneOffset() * -1);
|
80 |
+
return Math.round($D.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()) / 1000);
|
81 |
+
};
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Converts the value of the current Date object to its equivalent string representation using a PHP/Unix style of date format specifiers.
|
85 |
+
*
|
86 |
+
* The following descriptions are from http://www.php.net/strftime and http://www.php.net/manual/en/function.date.php.
|
87 |
+
* Copyright © 2001-2008 The PHP Group
|
88 |
+
*
|
89 |
+
* Format Specifiers
|
90 |
+
<pre>
|
91 |
+
Format Description Example
|
92 |
+
------ --------------------------------------------------------------------------- -----------------------
|
93 |
+
%a abbreviated weekday name according to the current localed "Mon" through "Sun"
|
94 |
+
%A full weekday name according to the current locale "Sunday" through "Saturday"
|
95 |
+
%b abbreviated month name according to the current locale "Jan" through "Dec"
|
96 |
+
%B full month name according to the current locale "January" through "December"
|
97 |
+
%c preferred date and time representation for the current locale "4/13/2008 12:33 PM"
|
98 |
+
%C century number (the year divided by 100 and truncated to an integer) "00" to "99"
|
99 |
+
%d day of the month as a decimal number "01" to "31"
|
100 |
+
%D same as %m/%d/%y "04/13/08"
|
101 |
+
%e day of the month as a decimal number, a single digit is preceded by a space "1" to "31"
|
102 |
+
%g like %G, but without the century "08"
|
103 |
+
%G The 4-digit year corresponding to the ISO week number (see %V). "2008"
|
104 |
+
This has the same format and value as %Y, except that if the ISO week number
|
105 |
+
belongs to the previous or next year, that year is used instead.
|
106 |
+
%h same as %b "Jan" through "Dec"
|
107 |
+
%H hour as a decimal number using a 24-hour clock "00" to "23"
|
108 |
+
%I hour as a decimal number using a 12-hour clock "01" to "12"
|
109 |
+
%j day of the year as a decimal number "001" to "366"
|
110 |
+
%m month as a decimal number "01" to "12"
|
111 |
+
%M minute as a decimal number "00" to "59"
|
112 |
+
%n newline character "\n"
|
113 |
+
%p either "am" or "pm" according to the given time value, or the "am" or "pm"
|
114 |
+
corresponding strings for the current locale
|
115 |
+
%r time in a.m. and p.m. notation "8:44 PM"
|
116 |
+
%R time in 24 hour notation "20:44"
|
117 |
+
%S second as a decimal number "00" to "59"
|
118 |
+
%t tab character "\t"
|
119 |
+
%T current time, equal to %H:%M:%S "12:49:11"
|
120 |
+
%u weekday as a decimal number ["1", "7"], with "1" representing Monday "1" to "7"
|
121 |
+
%U week number of the current year as a decimal number, starting with the "0" to ("52" or "53")
|
122 |
+
first Sunday as the first day of the first week
|
123 |
+
%V The ISO 8601:1988 week number of the current year as a decimal number, "00" to ("52" or "53")
|
124 |
+
range 01 to 53, where week 1 is the first week that has at least 4 days
|
125 |
+
in the current year, and with Monday as the first day of the week.
|
126 |
+
(Use %G or %g for the year component that corresponds to the week number
|
127 |
+
for the specified timestamp.)
|
128 |
+
%W week number of the current year as a decimal number, starting with the "00" to ("52" or "53")
|
129 |
+
first Monday as the first day of the first week
|
130 |
+
%w day of the week as a decimal, Sunday being "0" "0" to "6"
|
131 |
+
%x preferred date representation for the current locale without the time "4/13/2008"
|
132 |
+
%X preferred time representation for the current locale without the date "12:53:05"
|
133 |
+
%y year as a decimal number without a century "00" "99"
|
134 |
+
%Y year as a decimal number including the century "2008"
|
135 |
+
%Z time zone or name or abbreviation "UTC", "EST", "PST"
|
136 |
+
%z same as %Z
|
137 |
+
%% a literal "%" character "%"
|
138 |
+
|
139 |
+
d Day of the month, 2 digits with leading zeros "01" to "31"
|
140 |
+
D A textual representation of a day, three letters "Mon" through "Sun"
|
141 |
+
j Day of the month without leading zeros "1" to "31"
|
142 |
+
l A full textual representation of the day of the week (lowercase "L") "Sunday" through "Saturday"
|
143 |
+
N ISO-8601 numeric representation of the day of the week (added in PHP 5.1.0) "1" (for Monday) through "7" (for Sunday)
|
144 |
+
S English ordinal suffix for the day of the month, 2 characters "st", "nd", "rd" or "th". Works well with j
|
145 |
+
w Numeric representation of the day of the week "0" (for Sunday) through "6" (for Saturday)
|
146 |
+
z The day of the year (starting from "0") "0" through "365"
|
147 |
+
W ISO-8601 week number of year, weeks starting on Monday "00" to ("52" or "53")
|
148 |
+
F A full textual representation of a month, such as January or March "January" through "December"
|
149 |
+
m Numeric representation of a month, with leading zeros "01" through "12"
|
150 |
+
M A short textual representation of a month, three letters "Jan" through "Dec"
|
151 |
+
n Numeric representation of a month, without leading zeros "1" through "12"
|
152 |
+
t Number of days in the given month "28" through "31"
|
153 |
+
L Whether it's a leap year "1" if it is a leap year, "0" otherwise
|
154 |
+
o ISO-8601 year number. This has the same value as Y, except that if the "2008"
|
155 |
+
ISO week number (W) belongs to the previous or next year, that year
|
156 |
+
is used instead.
|
157 |
+
Y A full numeric representation of a year, 4 digits "2008"
|
158 |
+
y A two digit representation of a year "08"
|
159 |
+
a Lowercase Ante meridiem and Post meridiem "am" or "pm"
|
160 |
+
A Uppercase Ante meridiem and Post meridiem "AM" or "PM"
|
161 |
+
B Swatch Internet time "000" through "999"
|
162 |
+
g 12-hour format of an hour without leading zeros "1" through "12"
|
163 |
+
G 24-hour format of an hour without leading zeros "0" through "23"
|
164 |
+
h 12-hour format of an hour with leading zeros "01" through "12"
|
165 |
+
H 24-hour format of an hour with leading zeros "00" through "23"
|
166 |
+
i Minutes with leading zeros "00" to "59"
|
167 |
+
s Seconds, with leading zeros "00" through "59"
|
168 |
+
u Milliseconds "54321"
|
169 |
+
e Timezone identifier "UTC", "EST", "PST"
|
170 |
+
I Whether or not the date is in daylight saving time (uppercase i) "1" if Daylight Saving Time, "0" otherwise
|
171 |
+
O Difference to Greenwich time (GMT) in hours "+0200", "-0600"
|
172 |
+
P Difference to Greenwich time (GMT) with colon between hours and minutes "+02:00", "-06:00"
|
173 |
+
T Timezone abbreviation "UTC", "EST", "PST"
|
174 |
+
Z Timezone offset in seconds. The offset for timezones west of UTC is "-43200" through "50400"
|
175 |
+
always negative, and for those east of UTC is always positive.
|
176 |
+
c ISO 8601 date "2004-02-12T15:19:21+00:00"
|
177 |
+
r RFC 2822 formatted date "Thu, 21 Dec 2000 16:01:07 +0200"
|
178 |
+
U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) "0"
|
179 |
+
</pre>
|
180 |
+
* @param {String} A format string consisting of one or more format spcifiers [Optional].
|
181 |
+
* @return {String} A string representation of the current Date object.
|
182 |
+
*/
|
183 |
+
$P.$format = function (format) {
|
184 |
+
var x = this,
|
185 |
+
y,
|
186 |
+
t = function (v) {
|
187 |
+
$f.push(v);
|
188 |
+
return x.toString(v);
|
189 |
+
};
|
190 |
+
|
191 |
+
return format ? format.replace(/(%|\\)?.|%%/g,
|
192 |
+
function (m) {
|
193 |
+
if (m.charAt(0) === "\\" || m.substring(0, 2) === "%%") {
|
194 |
+
return m.replace("\\", "").replace("%%", "%");
|
195 |
+
}
|
196 |
+
switch (m) {
|
197 |
+
case "d":
|
198 |
+
case "%d":
|
199 |
+
return t("dd");
|
200 |
+
case "D":
|
201 |
+
case "%a":
|
202 |
+
return t("ddd");
|
203 |
+
case "j":
|
204 |
+
case "%e":
|
205 |
+
return t("d");
|
206 |
+
case "l":
|
207 |
+
case "%A":
|
208 |
+
return t("dddd");
|
209 |
+
case "N":
|
210 |
+
case "%u":
|
211 |
+
return x.getDay() + 1;
|
212 |
+
case "S":
|
213 |
+
return t("S");
|
214 |
+
case "w":
|
215 |
+
case "%w":
|
216 |
+
return x.getDay();
|
217 |
+
case "z":
|
218 |
+
return x.getOrdinalNumber();
|
219 |
+
case "%j":
|
220 |
+
return p(x.getOrdinalNumber(), 3);
|
221 |
+
case "%U":
|
222 |
+
var d1 = x.clone().set({month: 0, day: 1}).addDays(-1).moveToDayOfWeek(0),
|
223 |
+
d2 = x.clone().addDays(1).moveToDayOfWeek(0, -1);
|
224 |
+
return (d2 < d1) ? "00" : p((d2.getOrdinalNumber() - d1.getOrdinalNumber()) / 7 + 1);
|
225 |
+
case "W":
|
226 |
+
case "%V":
|
227 |
+
return x.getISOWeek();
|
228 |
+
case "%W":
|
229 |
+
return p(x.getWeek());
|
230 |
+
case "F":
|
231 |
+
case "%B":
|
232 |
+
return t("MMMM");
|
233 |
+
case "m":
|
234 |
+
case "%m":
|
235 |
+
return t("MM");
|
236 |
+
case "M":
|
237 |
+
case "%b":
|
238 |
+
case "%h":
|
239 |
+
return t("MMM");
|
240 |
+
case "n":
|
241 |
+
return t("M");
|
242 |
+
case "t":
|
243 |
+
return $D.getDaysInMonth(x.getFullYear(), x.getMonth());
|
244 |
+
case "L":
|
245 |
+
return ($D.isLeapYear(x.getFullYear())) ? 1 : 0;
|
246 |
+
case "o":
|
247 |
+
case "%G":
|
248 |
+
return x.setWeek(x.getISOWeek()).toString("yyyy");
|
249 |
+
case "%g":
|
250 |
+
return x.$format("%G").slice(-2);
|
251 |
+
case "Y":
|
252 |
+
case "%Y":
|
253 |
+
return t("yyyy");
|
254 |
+
case "y":
|
255 |
+
case "%y":
|
256 |
+
return t("yy");
|
257 |
+
case "a":
|
258 |
+
case "%p":
|
259 |
+
return t("tt").toLowerCase();
|
260 |
+
case "A":
|
261 |
+
return t("tt").toUpperCase();
|
262 |
+
case "g":
|
263 |
+
case "%I":
|
264 |
+
return t("h");
|
265 |
+
case "G":
|
266 |
+
return t("H");
|
267 |
+
case "h":
|
268 |
+
return t("hh");
|
269 |
+
case "H":
|
270 |
+
case "%H":
|
271 |
+
return t("HH");
|
272 |
+
case "i":
|
273 |
+
case "%M":
|
274 |
+
return t("mm");
|
275 |
+
case "s":
|
276 |
+
case "%S":
|
277 |
+
return t("ss");
|
278 |
+
case "u":
|
279 |
+
return p(x.getMilliseconds(), 3);
|
280 |
+
case "I":
|
281 |
+
return (x.isDaylightSavingTime()) ? 1 : 0;
|
282 |
+
case "O":
|
283 |
+
return x.getUTCOffset();
|
284 |
+
case "P":
|
285 |
+
y = x.getUTCOffset();
|
286 |
+
return y.substring(0, y.length - 2) + ":" + y.substring(y.length - 2);
|
287 |
+
case "e":
|
288 |
+
case "T":
|
289 |
+
case "%z":
|
290 |
+
case "%Z":
|
291 |
+
return x.getTimezone();
|
292 |
+
case "Z":
|
293 |
+
return x.getTimezoneOffset() * -60;
|
294 |
+
case "B":
|
295 |
+
var now = new Date();
|
296 |
+
return Math.floor(((now.getHours() * 3600) + (now.getMinutes() * 60) + now.getSeconds() + (now.getTimezoneOffset() + 60) * 60) / 86.4);
|
297 |
+
case "c":
|
298 |
+
return x.toISOString().replace(/\"/g, "");
|
299 |
+
case "U":
|
300 |
+
return $D.strtotime("now");
|
301 |
+
case "%c":
|
302 |
+
return t("d") + " " + t("t");
|
303 |
+
case "%C":
|
304 |
+
return Math.floor(x.getFullYear() / 100 + 1);
|
305 |
+
case "%D":
|
306 |
+
return t("MM/dd/yy");
|
307 |
+
case "%n":
|
308 |
+
return "\\n";
|
309 |
+
case "%t":
|
310 |
+
return "\\t";
|
311 |
+
case "%r":
|
312 |
+
return t("hh:mm tt");
|
313 |
+
case "%R":
|
314 |
+
return t("H:mm");
|
315 |
+
case "%T":
|
316 |
+
return t("H:mm:ss");
|
317 |
+
case "%x":
|
318 |
+
return t("d");
|
319 |
+
case "%X":
|
320 |
+
return t("t");
|
321 |
+
default:
|
322 |
+
$f.push(m);
|
323 |
+
return m;
|
324 |
+
}
|
325 |
+
}
|
326 |
+
) : this._toString();
|
327 |
+
};
|
328 |
+
|
329 |
+
if (!$P.format) {
|
330 |
+
$P.format = $P.$format;
|
331 |
+
}
|
332 |
+
}());
|
lib/edcallib.min.js
CHANGED
@@ -1,99 +1,108 @@
|
|
1 |
var humanMsg={setup:function(a,b){humanMsg.msgID="humanMsg";humanMsg.logID="humanMsgLog";if(a==undefined)a="body";humanMsg.msgOpacity=0.8;if(b!=undefined)humanMsg.msgOpacity=parseFloat(b);jQuery(a).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><p></p><div class="round"></div></div>');jQuery("#"+humanMsg.logID+" p").click(function(){jQuery(this).siblings("ul").slideToggle()})},displayMsg:function(a){if(a!=""){clearTimeout(humanMsg.t2);jQuery("#"+humanMsg.msgID+" p").html(a);
|
2 |
jQuery("#"+humanMsg.msgID+"").show().animate({opacity:humanMsg.msgOpacity},200,function(){jQuery("#"+humanMsg.logID).show().children("ul").prepend("<li>"+a+"</li>").children("li:first").slideDown(200);jQuery("#"+humanMsg.logID+" ul").css("display")=="none"&&jQuery("#"+humanMsg.logID+" p").animate({bottom:40},200,"linear",function(){jQuery(this).animate({bottom:0},300,"easeOutBounce",function(){jQuery(this).css({bottom:0})})})});humanMsg.t1=setTimeout("humanMsg.bindEvents()",700);humanMsg.t2=setTimeout("humanMsg.removeMsg()",
|
3 |
-
5000)}},bindEvents:function(){jQuery(window).mousemove(humanMsg.removeMsg).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},removeMsg:function(){jQuery(window).unbind("mousemove",humanMsg.removeMsg).unbind("click",humanMsg.removeMsg).unbind("keypress",humanMsg.removeMsg);jQuery("#"+humanMsg.msgID).css("opacity")==humanMsg.msgOpacity&&jQuery("#"+humanMsg.msgID).animate({opacity:0},500,function(){jQuery(this).hide()})}};jQuery(document).ready(function(){humanMsg.setup()});(function(a){a.fn.bgIframe=a.fn.bgiframe=function(b){if(a.browser.msie&&parseInt(a.browser.version)<=6){b=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},b||{});var
|
4 |
-
|
5 |
-
if(
|
6 |
-
1)
|
7 |
-
getRoot:function(){return
|
8 |
-
h);
|
9 |
-
|
10 |
-
u=
|
11 |
-
function(h,j){
|
12 |
-
function(j){if(!a(j.target).is("a"))return
|
13 |
-
if(
|
14 |
-
(function(a){var b=a.tools.scrollable;b.plugins=b.plugins||{};b.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};a.fn.autoscroll=function(
|
15 |
-
|
16 |
-
(function(a){var b=a.tools.scrollable;b.plugins=b.plugins||{};b.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};a.fn.navigator=function(
|
17 |
-
|
18 |
-
|
19 |
-
(function(a){a.fn.wheel=function(
|
20 |
-
|
21 |
-
"
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
(
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
function(j){
|
39 |
-
if(
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
a[
|
49 |
-
i)
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
this.
|
54 |
-
this.widgetName,this.
|
|
|
55 |
_mouseStop:function(){},_mouseCapture:function(){return true}};a.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(jQuery);(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");
|
56 |
-
this._mouseDestroy()}},_mouseCapture:function(b){var
|
57 |
-
this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;
|
58 |
-
!
|
59 |
-
"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return false},_mouseStop:function(b){var
|
60 |
-
b);
|
61 |
-
this.element[0].parentNode:
|
62 |
_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),
|
63 |
10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),
|
64 |
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-
|
65 |
-
this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)jQuery/.test(b.containment)&&b.containment.constructor!=Array){var
|
66 |
-
10)||0)+(parseInt(a(
|
67 |
-
Array)this.containment=b.containment},_convertPositionTo:function(b,
|
68 |
-
b),left:
|
69 |
-
document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var
|
70 |
-
this.containment[3]+this.offset.click.top}if(
|
71 |
-
|
72 |
-
this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c
|
73 |
eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,
|
74 |
-
|
75 |
-
false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(b);this.instance.options.helper=this.instance.options._helper;
|
76 |
-
this.instance.offset.click=
|
77 |
-
|
78 |
-
this.instance.options.revert=false;this.instance._trigger("out",b,this.instance._uiHash(this.instance));this.instance._mouseStop(b,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();
|
79 |
-
|
80 |
-
stop:function(){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(b,
|
81 |
-
document&&b.scrollParent[0].tagName!="HTML")b.overflowOffset=b.scrollParent.offset()},drag:function(b){var
|
82 |
-
|
83 |
-
(b.pageY-a(document).scrollTop())<
|
84 |
-
"snap",{start:function(){var b=a(this).data("draggable"),
|
85 |
-
|
86 |
-
{top:q,left:0}).top-
|
87 |
-
left:0}).top-
|
88 |
-
b,a.extend(
|
89 |
-
a(
|
90 |
-
this.element.addClass("ui-droppable")},destroy:function(){for(var b=a.ui.ddmanager.droppables[this.options.scope],
|
91 |
-
this.element.addClass(this.options.activeClass);
|
92 |
-
this._trigger("over",b,this.ui(
|
93 |
-
a.data(this,"droppable");if(
|
94 |
-
b.element,helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(b,c
|
95 |
-
|
96 |
-
case "touch":return(
|
97 |
-
0;continue a}
|
98 |
-
this.options.accept.call(this.element[0],b.currentItem||b.element)){this.isout=1;this.isover=0;this._deactivate.call(this,
|
99 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
var humanMsg={setup:function(a,b){humanMsg.msgID="humanMsg";humanMsg.logID="humanMsgLog";if(a==undefined)a="body";humanMsg.msgOpacity=0.8;if(b!=undefined)humanMsg.msgOpacity=parseFloat(b);jQuery(a).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><p></p><div class="round"></div></div>');jQuery("#"+humanMsg.logID+" p").click(function(){jQuery(this).siblings("ul").slideToggle()})},displayMsg:function(a){if(a!=""){clearTimeout(humanMsg.t2);jQuery("#"+humanMsg.msgID+" p").html(a);
|
2 |
jQuery("#"+humanMsg.msgID+"").show().animate({opacity:humanMsg.msgOpacity},200,function(){jQuery("#"+humanMsg.logID).show().children("ul").prepend("<li>"+a+"</li>").children("li:first").slideDown(200);jQuery("#"+humanMsg.logID+" ul").css("display")=="none"&&jQuery("#"+humanMsg.logID+" p").animate({bottom:40},200,"linear",function(){jQuery(this).animate({bottom:0},300,"easeOutBounce",function(){jQuery(this).css({bottom:0})})})});humanMsg.t1=setTimeout("humanMsg.bindEvents()",700);humanMsg.t2=setTimeout("humanMsg.removeMsg()",
|
3 |
+
5000)}},bindEvents:function(){jQuery(window).mousemove(humanMsg.removeMsg).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},removeMsg:function(){jQuery(window).unbind("mousemove",humanMsg.removeMsg).unbind("click",humanMsg.removeMsg).unbind("keypress",humanMsg.removeMsg);jQuery("#"+humanMsg.msgID).css("opacity")==humanMsg.msgOpacity&&jQuery("#"+humanMsg.msgID).animate({opacity:0},500,function(){jQuery(this).hide()})}};jQuery(document).ready(function(){humanMsg.setup()});(function(a){a.fn.bgIframe=a.fn.bgiframe=function(b){if(a.browser.msie&&parseInt(a.browser.version)<=6){b=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},b||{});var g=function(d){return d&&d.constructor==Number?d+"px":d},c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+b.src+'"style="display:block;position:absolute;z-index:-1;'+(b.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(b.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":
|
4 |
+
g(b.top))+";left:"+(b.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":g(b.left))+";width:"+(b.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":g(b.width))+";height:"+(b.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":g(b.height))+';"/>';return this.each(function(){a("> iframe.bgiframe",this).length==0&&this.insertBefore(document.createElement(c),this.firstChild)})}return this};if(!a.browser.version)a.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1]})(jQuery);(function(a){a.each({focus:"focusin",blur:"focusout"},function(b,g){a.event.special[g]={setup:function(){if(a.browser.msie)return false;this.addEventListener(b,a.event.special[g].handler,true)},teardown:function(){if(a.browser.msie)return false;this.removeEventListener(b,a.event.special[g].handler,true)},handler:function(c){arguments[0]=a.event.fix(c);arguments[0].type=g;return a.event.handle.apply(this,arguments)}}});a.extend(a.fn,{delegate:function(b,g,c){return this.bind(b,function(d){var f=a(d.target);
|
5 |
+
if(f.is(g))return c.apply(f,arguments)})},triggerEvent:function(b,g){return this.triggerHandler(b,[a.event.fix({type:b,target:g})])}})})(jQuery);(function(a){a.tools=a.tools||{};a.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var b;function g(c,d){var f=this,m=a(this),n=!d.vertical,k=c.children(),e=0,i;b||(b=f);a.each(d,function(h,j){a.isFunction(j)&&m.bind(h,j)});if(k.length>
|
6 |
+
1)k=a(d.items,c);function l(h){var j=a(h);return d.globalNav?j:c.parent().find(h)}c.data("finder",l);var o=l(d.prev),r=l(d.next),q=l(d.prevPage),p=l(d.nextPage);a.extend(f,{getIndex:function(){return e},getClickIndex:function(){var h=f.getItems();return h.index(h.filter("."+d.activeClass))},getConf:function(){return d},getSize:function(){return f.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/d.size)},getPageIndex:function(){return Math.ceil(e/d.size)},getNaviButtons:function(){return o.add(r).add(q).add(p)},
|
7 |
+
getRoot:function(){return c},getItemWrap:function(){return k},getItems:function(){return k.children(d.item)},getVisibleItems:function(){return f.getItems().slice(e,e+d.size)},seekTo:function(h,j,s){if(h<0)h=0;if(e===h)return f;if(a.isFunction(j))s=j;if(h>f.getSize()-d.size)return d.loop?f.begin():this.end();var u=f.getItems().eq(h);if(!u.length)return f;var w=a.Event("onBeforeSeek");m.trigger(w,[h]);if(w.isDefaultPrevented())return f;if(j===undefined||a.isFunction(j))j=d.speed;function x(){s&&s.call(f,
|
8 |
+
h);m.trigger("onSeek",[h])}n?k.animate({left:-u.position().left},j,d.easing,x):k.animate({top:-u.position().top},j,d.easing,x);b=f;e=h;w=a.Event("onStart");m.trigger(w,[h]);if(w.isDefaultPrevented())return f;o.add(q).toggleClass(d.disabledClass,h===0);r.add(p).toggleClass(d.disabledClass,h>=f.getSize()-d.size);return f},move:function(h,j,s){i=h>0;return this.seekTo(e+h,j,s)},next:function(h,j){return this.move(1,h,j)},prev:function(h,j){return this.move(-1,h,j)},movePage:function(h,j,s){i=h>0;var u=
|
9 |
+
d.size*h,w=e%d.size;if(w>0)u+=h>0?-w:d.size-w;return this.move(u,j,s)},prevPage:function(h,j){return this.movePage(-1,h,j)},nextPage:function(h,j){return this.movePage(1,h,j)},setPage:function(h,j,s){return this.seekTo(h*d.size,j,s)},begin:function(h,j){i=false;return this.seekTo(0,h,j)},end:function(h,j){i=true;var s=this.getSize()-d.size;return s>0?this.seekTo(s,h,j):f},reload:function(){m.trigger("onReload");return f},focus:function(){return b=f},click:function(h){var j=f.getItems().eq(h),s=d.activeClass,
|
10 |
+
u=d.size;if(h<0||h>=f.getSize())return f;if(u==1){if(d.loop)return f.next();if(h===0||h==f.getSize()-1)i=i===undefined?true:!i;return i===false?f.prev():f.next()}if(u==2){h==e&&h--;f.getItems().removeClass(s);j.addClass(s);return f.seekTo(h,time,fn)}if(!j.hasClass(s)){f.getItems().removeClass(s);j.addClass(s);j=Math.floor(u/2);j=h-j;if(j>f.getSize()-u)j=f.getSize()-u;if(j!==h)return f.seekTo(j)}return f},bind:function(h,j){m.bind(h,j);return f},unbind:function(h){m.unbind(h);return f}});a.each("onBeforeSeek,onStart,onSeek,onReload".split(","),
|
11 |
+
function(h,j){f[j]=function(s){return f.bind(j,s)}});o.addClass(d.disabledClass).click(function(){f.prev()});r.click(function(){f.next()});p.click(function(){f.nextPage()});f.getSize()<d.size&&r.add(p).addClass(d.disabledClass);q.addClass(d.disabledClass).click(function(){f.prevPage()});var t=d.hoverClass,v="keydown."+Math.random().toString().substring(10);f.onReload(function(){t&&f.getItems().hover(function(){a(this).addClass(t)},function(){a(this).removeClass(t)});d.clickable&&f.getItems().each(function(h){a(this).unbind("click.scrollable").bind("click.scrollable",
|
12 |
+
function(j){if(!a(j.target).is("a"))return f.click(h)})});d.keyboard?a(document).unbind(v).bind(v,function(h){if(!(h.altKey||h.ctrlKey))if(!(d.keyboard!="static"&&b!=f)){var j=d.keyboardSteps;if(n&&(h.keyCode==37||h.keyCode==39)){f.move(h.keyCode==37?-j:j);return h.preventDefault()}if(!n&&(h.keyCode==38||h.keyCode==40)){f.move(h.keyCode==38?-j:j);return h.preventDefault()}return true}}):a(document).unbind(v)});f.reload()}a.fn.scrollable=function(c){var d=this.eq(typeof c=="number"?c:0).data("scrollable");
|
13 |
+
if(d)return d;var f=a.extend({},a.tools.scrollable.conf);c=a.extend(f,c);c.keyboardSteps=c.keyboardSteps||c.size;this.each(function(){d=new g(a(this),c);a(this).data("scrollable",d)});return c.api?d:this}})(jQuery);
|
14 |
+
(function(a){var b=a.tools.scrollable;b.plugins=b.plugins||{};b.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};a.fn.autoscroll=function(g){if(typeof g=="number")g={interval:g};var c=a.extend({},b.plugins.autoscroll.conf),d;a.extend(c,g);this.each(function(){var f=a(this).scrollable();if(f)d=f;var m,n,k=true;f.play=function(){if(!m){k=false;m=setInterval(function(){f.move(c.steps)},c.interval);f.move(c.steps)}};f.pause=function(){m=clearInterval(m)};
|
15 |
+
f.stop=function(){f.pause();k=true};c.autopause&&f.getRoot().add(f.getNaviButtons()).hover(function(){f.pause();clearInterval(n)},function(){k||(n=setTimeout(f.play,c.interval))});c.autoplay&&setTimeout(f.play,c.interval)});return c.api?d:this}})(jQuery);
|
16 |
+
(function(a){var b=a.tools.scrollable;b.plugins=b.plugins||{};b.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};a.fn.navigator=function(g){var c=a.extend({},b.plugins.navigator.conf),d;if(typeof g=="string")g={navi:g};g=a.extend(c,g);this.each(function(){var f=a(this).scrollable(),m=f.getRoot(),n=m.data("finder").call(null,g.navi),k=null,e=f.getNaviButtons();if(f)d=f;f.getNaviButtons=function(){return e.add(n)};function i(){if(!n.children().length||
|
17 |
+
n.data("navi")==f){n.empty();n.data("navi",f);for(var l=0;l<f.getPageAmount();l++)n.append(a("<"+(g.naviItem||"a")+"/>"));k=n.children().each(function(o){var r=a(this);r.click(function(q){f.setPage(o);return q.preventDefault()});g.indexed&&r.text(o);g.idPrefix&&r.attr("id",g.idPrefix+o)})}else{k=g.naviItem?n.find(g.naviItem):n.children();k.each(function(o){var r=a(this);r.click(function(q){f.setPage(o);return q.preventDefault()})})}k.eq(0).addClass(g.activeClass)}f.onStart(function(){var l=g.activeClass;
|
18 |
+
k.removeClass(l).eq(f.getPageIndex()).addClass(l)});f.onReload(function(){i()});i();m=k.filter("[href="+location.hash+"]");m.length&&f.move(k.index(m))});return g.api?d:this}})(jQuery);
|
19 |
+
(function(a){a.fn.wheel=function(d){return this[d?"bind":"trigger"]("wheel",d)};a.event.special.wheel={setup:function(){a.event.add(this,b,g,{})},teardown:function(){a.event.remove(this,b,g)}};var b=!a.browser.mozilla?"mousewheel":"DOMMouseScroll"+(a.browser.version<"1.9"?" mousemove":"");function g(d){switch(d.type){case "mousemove":return a.extend(d.data,{clientX:d.clientX,clientY:d.clientY,pageX:d.pageX,pageY:d.pageY});case "DOMMouseScroll":a.extend(d,d.data);d.delta=-d.detail/3;break;case "mousewheel":d.delta=
|
20 |
+
d.wheelDelta/120;break}d.type="wheel";return a.event.handle.call(this,d,d.delta)}var c=a.tools.scrollable;c.plugins=c.plugins||{};c.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};a.fn.mousewheel=function(d){var f=a.extend({},c.plugins.mousewheel.conf),m;if(typeof d=="number")d={speed:d};d=a.extend(f,d);this.each(function(){var n=a(this).scrollable();if(n)m=n;n.getRoot().wheel(function(k,e){n.move(e<0?1:-1,d.speed||50);return false})});return d.api?m:this}})(jQuery);(function(a){a.fn.timePicker=function(k){var e=a.extend({},a.fn.timePicker.defaults,k);return this.each(function(){a.timePicker(this,e)})};a.timePicker=function(k,e){k=a(k)[0];return k.timePicker||(k.timePicker=new jQuery._timePicker(k,e))};a._timePicker=function(k,e){var i=false,l=false,o=f(e.startTime,e),r=f(e.endTime,e);a(k).attr("autocomplete","OFF");for(var q=[],p=new Date(o);p<=r;){q[q.length]=g(p,e);p=new Date(p.setMinutes(p.getMinutes()+e.step))}var t=a("<div "+(e.tpDivId?'id="'+e.tpDivId+
|
21 |
+
'" ':"")+'class="time-picker'+(e.show24Hours?"":" time-picker-12hours")+'"></div>'),v=a("<ul></ul>");for(p=0;p<q.length;p++)v.append("<li>"+q[p]+"</li>");t.append(v);q=a(k).offset();t.appendTo("body").css({top:q.top-48+"px",left:q.left,width:a(k).width()+5+"px"}).hide();t.mouseover(function(){i=true}).mouseout(function(){i=false});a("li",v).mouseover(function(){if(!l){a("li.selected",t).removeClass("selected");a(this).addClass("selected")}}).mousedown(function(){i=true}).click(function(){b(k,this,
|
22 |
+
t,e);i=false});function h(){if(t.is(":visible"))return false;a("li",t).removeClass("selected");var j=a(k).offset();t.css({top:j.top-48+"px",left:j.left,width:a(k).width()+5+"px"});t.show();var s=k.value?m(k.value,e):o;j=o.getHours()*60+o.getMinutes();s=s.getHours()*60+s.getMinutes()-j;s=Math.round(s/e.step);j=n(new Date(0,0,0,0,s*e.step+j,0));j=o<j&&j<=r?j:o;j=a("li:contains("+g(j,e)+")",t);if(j.length){j.addClass("selected");t[0].scrollTop=j[0].offsetTop}return true}a(k).focus(h).click(h);a(k).blur(function(){i||
|
23 |
+
t.hide()});q=a.browser.opera||a.browser.mozilla?"keypress":"keydown";a(k)[q](function(j){l=true;var s=t[0].scrollTop;switch(j.keyCode){case 38:if(h())return false;j=a("li.selected",v);var u=j.prev().addClass("selected")[0];if(u){j.removeClass("selected");if(u.offsetTop<s)t[0].scrollTop=s-u.offsetHeight}else{j.removeClass("selected");u=a("li:last",v).addClass("selected")[0];t[0].scrollTop=u.offsetTop-u.offsetHeight}return false;case 40:if(h())return false;j=a("li.selected",v);if(u=j.next().addClass("selected")[0]){j.removeClass("selected");
|
24 |
+
if(u.offsetTop+u.offsetHeight>s+t[0].offsetHeight)t[0].scrollTop=s+u.offsetHeight}else{j.removeClass("selected");a("li:first",v).addClass("selected");t[0].scrollTop=0}return false;case 13:if(t.is(":visible")){s=a("li.selected",v)[0];b(k,s,t,e)}return false;case 27:t.hide();return false}return true});a(k).keyup(function(){l=false});this.getTime=function(){return m(k.value,e)};this.setTime=function(j){k.value=g(n(j),e);a(k).change()}};a.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),
|
25 |
+
endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:true};function b(k,e,i){k.value=a(e).text();a(k).change();a.browser.msie||k.focus();i.hide()}function g(k,e){var i=k.getHours(),l=e.show24Hours?i:(i+11)%12+1;l=d(l,e);k=k.getMinutes();return l+e.separator+c(k)+(e.show24Hours?"":i<12?" AM":" PM")}function c(k){return(k<10?"0":"")+k}function d(k,e){return e.show24Hours?(k<10?"0":"")+k:k}function f(k,e){return typeof k=="object"?n(k):m(k,e)}function m(k,e){if(k){var i=k.split(e.separator),l=parseFloat(i[0]);
|
26 |
+
i=parseFloat(i[1]);if(!e.show24Hours)if(l===12&&k.substr("AM")!==-1)l=0;else if(l!==12&&k.indexOf("PM")!==-1)l+=12;k=new Date(0,0,0,l,i,0);return n(k)}return null}function n(k){k.setFullYear(2001);k.setMonth(0);k.setDate(0);return k}})(jQuery);if(!this.JSON)this.JSON={};
|
27 |
+
(function(){function a(e){return e<10?"0"+e:e}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g=
|
28 |
+
/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c,d,f={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},m;function n(e){g.lastIndex=0;return g.test(e)?'"'+e.replace(g,function(i){var l=f[i];return typeof l==="string"?l:"\\u"+("0000"+i.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function k(e,i){var l,o,r=c,q,p=i[e];if(p&&typeof p==="object"&&typeof p.toJSON==="function")p=p.toJSON(e);
|
29 |
+
if(typeof m==="function")p=m.call(i,e,p);switch(typeof p){case "string":return n(p);case "number":return isFinite(p)?String(p):"null";case "boolean":case "null":return String(p);case "object":if(!p)return"null";c+=d;q=[];if(Object.prototype.toString.apply(p)==="[object Array]"){o=p.length;for(e=0;e<o;e+=1)q[e]=k(e,p)||"null";i=q.length===0?"[]":c?"[\n"+c+q.join(",\n"+c)+"\n"+r+"]":"["+q.join(",")+"]";c=r;return i}if(m&&typeof m==="object"){o=m.length;for(e=0;e<o;e+=1){l=m[e];if(typeof l==="string")if(i=
|
30 |
+
k(l,p))q.push(n(l)+(c?": ":":")+i)}}else for(l in p)if(Object.hasOwnProperty.call(p,l))if(i=k(l,p))q.push(n(l)+(c?": ":":")+i);i=q.length===0?"{}":c?"{\n"+c+q.join(",\n"+c)+"\n"+r+"}":"{"+q.join(",")+"}";c=r;return i}}if(typeof JSON.stringify!=="function")JSON.stringify=function(e,i,l){var o;d=c="";if(typeof l==="number")for(o=0;o<l;o+=1)d+=" ";else if(typeof l==="string")d=l;if((m=i)&&typeof i!=="function"&&(typeof i!=="object"||typeof i.length!=="number"))throw new Error("JSON.stringify");return k("",
|
31 |
+
{"":e})};if(typeof JSON.parseIt!=="function")JSON.parseIt=function(e,i){function l(o,r){var q,p,t=o[r];if(t&&typeof t==="object")for(q in t)if(Object.hasOwnProperty.call(t,q)){p=l(t,q);if(p!==undefined)t[q]=p;else delete t[q]}return i.call(o,r,t)}b.lastIndex=0;if(b.test(e))e=e.replace(b,function(o){return"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
32 |
+
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){e=eval("("+e+")");return typeof i==="function"?l({"":e},""):e}throw new SyntaxError("JSON.parseIt");}})();(function(a){a.tools=a.tools||{};a.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var b;function g(c,d){var f=this,m=a(this),n=!d.vertical,k=c.children(),e=0,i;b||(b=f);a.each(d,function(h,j){a.isFunction(j)&&m.bind(h,j)});if(k.length>
|
33 |
+
1)k=a(d.items,c);function l(h){var j=a(h);return d.globalNav?j:c.parent().find(h)}c.data("finder",l);var o=l(d.prev),r=l(d.next),q=l(d.prevPage),p=l(d.nextPage);a.extend(f,{getIndex:function(){return e},getClickIndex:function(){var h=f.getItems();return h.index(h.filter("."+d.activeClass))},getConf:function(){return d},getSize:function(){return f.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/d.size)},getPageIndex:function(){return Math.ceil(e/d.size)},getNaviButtons:function(){return o.add(r).add(q).add(p)},
|
34 |
+
getRoot:function(){return c},getItemWrap:function(){return k},getItems:function(){return k.children(d.item)},getVisibleItems:function(){return f.getItems().slice(e,e+d.size)},seekTo:function(h,j,s){if(h<0)h=0;if(e===h)return f;if(a.isFunction(j))s=j;if(h>f.getSize()-d.size)return d.loop?f.begin():this.end();var u=f.getItems().eq(h);if(!u.length)return f;var w=a.Event("onBeforeSeek");m.trigger(w,h>e);if(w.isDefaultPrevented())return f;if(j===undefined||a.isFunction(j))j=d.speed;function x(){s&&s.call(f,
|
35 |
+
h);m.trigger("onSeek",[h])}n?k.animate({left:-u.position().left},j,d.easing,x):k.animate({top:-u.position().top},j,d.easing,x);b=f;e=h;w=a.Event("onStart");m.trigger(w,[h]);if(w.isDefaultPrevented())return f;o.add(q).toggleClass(d.disabledClass,h===0);r.add(p).toggleClass(d.disabledClass,h>=f.getSize()-d.size);return f},move:function(h,j,s){i=h>0;return this.seekTo(e+h,j,s)},next:function(h,j){return this.move(1,h,j)},prev:function(h,j){return this.move(-1,h,j)},movePage:function(h,j,s){i=h>0;var u=
|
36 |
+
d.size*h,w=e%d.size;if(w>0)u+=h>0?-w:d.size-w;return this.move(u,j,s)},prevPage:function(h,j){return this.movePage(-1,h,j)},nextPage:function(h,j){return this.movePage(1,h,j)},setPage:function(h,j,s){return this.seekTo(h*d.size,j,s)},begin:function(h,j){i=false;return this.seekTo(0,h,j)},end:function(h,j){i=true;var s=this.getSize()-d.size;return s>0?this.seekTo(s,h,j):f},reload:function(){m.trigger("onReload");return f},focus:function(){return b=f},click:function(h){var j=f.getItems().eq(h),s=d.activeClass,
|
37 |
+
u=d.size;if(h<0||h>=f.getSize())return f;if(u==1){if(d.loop)return f.next();if(h===0||h==f.getSize()-1)i=i===undefined?true:!i;return i===false?f.prev():f.next()}if(u==2){h==e&&h--;f.getItems().removeClass(s);j.addClass(s);return f.seekTo(h,time,fn)}if(!j.hasClass(s)){f.getItems().removeClass(s);j.addClass(s);j=Math.floor(u/2);j=h-j;if(j>f.getSize()-u)j=f.getSize()-u;if(j!==h)return f.seekTo(j)}return f},bind:function(h,j){m.bind(h,j);return f},unbind:function(h){m.unbind(h);return f}});a.each("onBeforeSeek,onStart,onSeek,onReload".split(","),
|
38 |
+
function(h,j){f[j]=function(s){return f.bind(j,s)}});o.addClass(d.disabledClass).click(function(){f.prev()});r.click(function(){f.next()});p.click(function(){f.nextPage()});f.getSize()<d.size&&r.add(p).addClass(d.disabledClass);q.addClass(d.disabledClass).click(function(){f.prevPage()});var t=d.hoverClass,v="keydown."+Math.random().toString().substring(10);f.onReload(function(){t&&f.getItems().hover(function(){a(this).addClass(t)},function(){a(this).removeClass(t)});d.clickable&&f.getItems().each(function(h){a(this).unbind("click.scrollable").bind("click.scrollable",
|
39 |
+
function(j){if(!a(j.target).is("a"))return f.click(h)})});d.keyboard?a(document).unbind(v).bind(v,function(h){if(!(h.altKey||h.ctrlKey))if(!(d.keyboard!="static"&&b!=f)){var j=d.keyboardSteps;if(n&&(h.keyCode==37||h.keyCode==39)){f.move(h.keyCode==37?-j:j);return h.preventDefault()}if(!n&&(h.keyCode==38||h.keyCode==40)){f.move(h.keyCode==38?-j:j);return h.preventDefault()}return true}}):a(document).unbind(v)});f.reload()}a.fn.scrollable=function(c){var d=this.eq(typeof c=="number"?c:0).data("scrollable");
|
40 |
+
if(d)return d;var f=a.extend({},a.tools.scrollable.conf);c=a.extend(f,c);c.keyboardSteps=c.keyboardSteps||c.size;this.each(function(){d=new g(a(this),c);a(this).data("scrollable",d)});return c.api?d:this}})(jQuery);(function(a){a.fn.wheel=function(d){return this[d?"bind":"trigger"]("wheel",d)};a.event.special.wheel={setup:function(){a.event.add(this,b,g,{})},teardown:function(){a.event.remove(this,b,g)}};var b=!a.browser.mozilla?"mousewheel":"DOMMouseScroll"+(a.browser.version<"1.9"?" mousemove":"");function g(d){switch(d.type){case "mousemove":return a.extend(d.data,{clientX:d.clientX,clientY:d.clientY,pageX:d.pageX,pageY:d.pageY});case "DOMMouseScroll":a.extend(d,d.data);d.delta=-d.detail/3;break;case "mousewheel":d.delta=
|
41 |
+
d.wheelDelta/120;break}d.type="wheel";return a.event.handle.call(this,d,d.delta)}var c=a.tools.scrollable;c.plugins=c.plugins||{};c.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};a.fn.mousewheel=function(d){var f=a.extend({},c.plugins.mousewheel.conf),m;if(typeof d=="number")d={speed:d};d=a.extend(f,d);this.each(function(){var n=a(this).scrollable();if(n)m=n;n.getRoot().wheel(function(k,e){n.move(e<0?1:-1,d.speed||50);return false})});return d.api?m:this}})(jQuery);jQuery.ui||function(a){var b=a.fn.remove,g=a.browser.mozilla&&parseFloat(a.browser.version)<1.9;a.ui={version:"1.7.2",plugin:{add:function(e,i,l){e=a.ui[e].prototype;for(var o in l){e.plugins[o]=e.plugins[o]||[];e.plugins[o].push([i,l[o]])}},call:function(e,i,l){if((i=e.plugins[i])&&e.element[0].parentNode)for(var o=0;o<i.length;o++)e.options[i[o][0]]&&i[o][1].apply(e.element,l)}},contains:function(e,i){return document.compareDocumentPosition?e.compareDocumentPosition(i)&16:e!==i&&e.contains(i)},
|
42 |
+
hasScroll:function(e,i){if(a(e).css("overflow")=="hidden")return false;i=i&&i=="left"?"scrollLeft":"scrollTop";var l=false;if(e[i]>0)return true;e[i]=1;l=e[i]>0;e[i]=0;return l},isOverAxis:function(e,i,l){return e>i&&e<i+l},isOver:function(e,i,l,o,r,q){return a.ui.isOverAxis(e,l,r)&&a.ui.isOverAxis(i,o,q)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,
|
43 |
+
NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(g){var c=a.attr,d=a.fn.removeAttr,f="http://www.w3.org/2005/07/aaa",m=/^aria-/,n=/^wairole:/;a.attr=function(e,i,l){var o=l!==undefined;return i=="role"?o?c.call(this,e,i,"wairole:"+l):(c.apply(this,arguments)||"").replace(n,""):m.test(i)?o?e.setAttributeNS(f,i.replace(m,"aaa:"),l):c.call(this,e,i.replace(m,"aaa:")):c.apply(this,arguments)};a.fn.removeAttr=function(e){return m.test(e)?
|
44 |
+
this.each(function(){this.removeAttributeNS(f,e.replace(m,""))}):d.call(this,e)}}a.fn.extend({remove:function(){a("*",this).add(this).each(function(){a(this).triggerHandler("remove")});return b.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var e;
|
45 |
+
e=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||
|
46 |
+
!e.length?a(document):e}});a.extend(a.expr[":"],{data:function(e,i,l){return!!a.data(e,l[3])},focusable:function(e){var i=e.nodeName.toLowerCase(),l=a.attr(e,"tabindex");return(/input|select|textarea|button|object/.test(i)?!e.disabled:"a"==i||"area"==i?e.href||!isNaN(l):!isNaN(l))&&!a(e)["area"==i?"parents":"closest"](":hidden").length},tabbable:function(e){var i=a.attr(e,"tabindex");return(isNaN(i)||i>=0)&&a(e).is(":focusable")}});function k(e,i,l,o){function r(p){p=a[e][i][p]||[];return typeof p==
|
47 |
+
"string"?p.split(/,?\s+/):p}var q=r("getter");if(o.length==1&&typeof o[0]=="string")q=q.concat(r("getterSetter"));return a.inArray(l,q)!=-1}a.widget=function(e,i){var l=e.split(".")[0];e=e.split(".")[1];a.fn[e]=function(o){var r=typeof o=="string",q=Array.prototype.slice.call(arguments,1);if(r&&o.substring(0,1)=="_")return this;if(r&&k(l,e,o,q)){var p=a.data(this[0],e);return p?p[o].apply(p,q):undefined}return this.each(function(){var t=a.data(this,e);!t&&!r&&a.data(this,e,new a[l][e](this,o))._init();
|
48 |
+
t&&r&&a.isFunction(t[o])&&t[o].apply(t,q)})};a[l]=a[l]||{};a[l][e]=function(o,r){var q=this;this.namespace=l;this.widgetName=e;this.widgetEventPrefix=a[l][e].eventPrefix||e;this.widgetBaseClass=l+"-"+e;this.options=a.extend({},a.widget.defaults,a[l][e].defaults,a.metadata&&a.metadata.get(o)[e],r);this.element=a(o).bind("setData."+e,function(p,t,v){if(p.target==o)return q._setData(t,v)}).bind("getData."+e,function(p,t){if(p.target==o)return q._getData(t)}).bind("remove",function(){return q.destroy()})};
|
49 |
+
a[l][e].prototype=a.extend({},a.widget.prototype,i);a[l][e].getterSetter="option"};a.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(e,i){var l=e,o=this;if(typeof e=="string"){if(i===undefined)return this._getData(e);l={};l[e]=i}a.each(l,function(r,q){o._setData(r,q)})},_getData:function(e){return this.options[e]},_setData:function(e,
|
50 |
+
i){this.options[e]=i;if(e=="disabled")this.element[i?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",i)},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(e,i,l){var o=this.options[e];e=e==this.widgetEventPrefix?e:this.widgetEventPrefix+e;i=a.Event(i);i.type=e;if(i.originalEvent){e=a.event.props.length;for(var r;e;){r=a.event.props[--e];i[r]=i.originalEvent[r]}}this.element.trigger(i,
|
51 |
+
l);return!(a.isFunction(o)&&o.call(this.element[0],i,l)===false||i.isDefaultPrevented())}};a.widget.defaults={disabled:false};a.ui.mouse={_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(i){return e._mouseDown(i)}).bind("click."+this.widgetName,function(i){if(e._preventClickEvent){e._preventClickEvent=false;i.stopImmediatePropagation();return false}});if(a.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable",
|
52 |
+
"on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);a.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},_mouseDown:function(e){e.originalEvent=e.originalEvent||{};if(!e.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(e);this._mouseDownEvent=e;var i=this,l=e.which==1,o=typeof this.options.cancel=="string"?a(e.target).parents().add(e.target).filter(this.options.cancel).length:false;if(!l||o||!this._mouseCapture(e))return true;
|
53 |
+
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(e)!==false;if(!this._mouseStarted){e.preventDefault();return true}}this._mouseMoveDelegate=function(r){return i._mouseMove(r)};this._mouseUpDelegate=function(r){return i._mouseUp(r)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+
|
54 |
+
this.widgetName,this._mouseUpDelegate);a.browser.safari||e.preventDefault();return e.originalEvent.mouseHandled=true}},_mouseMove:function(e){if(a.browser.msie&&!e.button)return this._mouseUp(e);if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==false)?this._mouseDrag(e):this._mouseUp(e);return!this._mouseStarted},_mouseUp:function(e){a(document).unbind("mousemove."+
|
55 |
+
this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=e.target==this._mouseDownEvent.target;this._mouseStop(e)}return false},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},
|
56 |
_mouseStop:function(){},_mouseCapture:function(){return true}};a.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(jQuery);(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");
|
57 |
+
this._mouseDestroy()}},_mouseCapture:function(b){var g=this.options;if(this.helper||g.disabled||a(b.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(b);if(!this.handle)return false;return true},_mouseStart:function(b){var g=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();
|
58 |
+
this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;g.cursorAt&&this._adjustOffsetFromHelper(g.cursorAt);g.containment&&this._setContainment();this._trigger("start",b);this._cacheHelperProportions();a.ui.ddmanager&&
|
59 |
+
!g.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,g){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!g){g=this._uiHash();this._trigger("drag",b,g);this.position=g.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+
|
60 |
+
"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return false},_mouseStop:function(b){var g=false;if(a.ui.ddmanager&&!this.options.dropBehaviour)g=a.ui.ddmanager.drop(this,b);if(this.dropped){g=this.dropped;this.dropped=false}if(this.options.revert=="invalid"&&!g||this.options.revert=="valid"&&g||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,g)){var c=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",
|
61 |
+
b);c._clear()})}else{this._trigger("stop",b);this._clear()}return false},_getHandle:function(b){var g=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target)g=true});return g},_createHelper:function(b){var g=this.options;b=a.isFunction(g.helper)?a(g.helper.apply(this.element[0],[b])):g.helper=="clone"?this.element.clone():this.element;b.parents("body").length||b.appendTo(g.appendTo=="parent"?
|
62 |
+
this.element[0].parentNode:g.appendTo);b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&&b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined)this.offset.click.left=b.left+this.margins.left;if(b.right!=undefined)this.offset.click.left=this.helperProportions.width-b.right+this.margins.left;if(b.top!=undefined)this.offset.click.top=b.top+this.margins.top;if(b.bottom!=undefined)this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top},
|
63 |
_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),
|
64 |
10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),
|
65 |
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-
|
66 |
+
this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)jQuery/.test(b.containment)&&b.containment.constructor!=Array){var g=a(b.containment)[0];if(g){b=a(b.containment).offset();var c=a(g).css("overflow")!="hidden";this.containment=[b.left+(parseInt(a(g).css("borderLeftWidth"),10)||0)+(parseInt(a(g).css("paddingLeft"),10)||0)-this.margins.left,b.top+(parseInt(a(g).css("borderTopWidth"),
|
67 |
+
10)||0)+(parseInt(a(g).css("paddingTop"),10)||0)-this.margins.top,b.left+(c?Math.max(g.scrollWidth,g.offsetWidth):g.offsetWidth)-(parseInt(a(g).css("borderLeftWidth"),10)||0)-(parseInt(a(g).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,b.top+(c?Math.max(g.scrollHeight,g.offsetHeight):g.offsetHeight)-(parseInt(a(g).css("borderTopWidth"),10)||0)-(parseInt(a(g).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(b.containment.constructor==
|
68 |
+
Array)this.containment=b.containment},_convertPositionTo:function(b,g){if(!g)g=this.position;b=b=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,d=/(html|body)/i.test(c[0].tagName);return{top:g.top+this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():d?0:c.scrollTop())*
|
69 |
+
b),left:g.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():d?0:c.scrollLeft())*b)}},_generatePosition:function(b){var g=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,d=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=
|
70 |
+
document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=b.pageX,m=b.pageY;if(this.originalPosition){if(this.containment){if(b.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(b.pageY-this.offset.click.top<this.containment[1])m=this.containment[1]+this.offset.click.top;if(b.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>this.containment[3])m=
|
71 |
+
this.containment[3]+this.offset.click.top}if(g.grid){m=this.originalPageY+Math.round((m-this.originalPageY)/g.grid[1])*g.grid[1];m=this.containment?!(m-this.offset.click.top<this.containment[1]||m-this.offset.click.top>this.containment[3])?m:!(m-this.offset.click.top<this.containment[1])?m-g.grid[1]:m+g.grid[1]:m;f=this.originalPageX+Math.round((f-this.originalPageX)/g.grid[0])*g.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?
|
72 |
+
f:!(f-this.offset.click.left<this.containment[0])?f-g.grid[0]:f+g.grid[0]:f}}return{top:m-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():d?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():d?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");
|
73 |
+
this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,g,c){c=c||this._uiHash();a.ui.plugin.call(this,b,[g,c]);if(b=="drag")this.positionAbs=this._convertPositionTo("absolute");return a.widget.prototype._trigger.call(this,b,g,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",
|
74 |
eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,
|
75 |
+
g){var c=a(this).data("draggable"),d=c.options,f=a.extend({},g,{item:c.element});c.sortables=[];a(d.connectToSortable).each(function(){var m=a.data(this,"sortable");if(m&&!m.options.disabled){c.sortables.push({instance:m,shouldRevert:m.options.revert});m._refreshItems();m._trigger("activate",b,f)}})},stop:function(b,g){var c=a(this).data("draggable"),d=a.extend({},g,{item:c.element});a.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=
|
76 |
+
false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(b);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",b,d)}})},drag:function(b,g){var c=a(this).data("draggable"),d=this;a.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;
|
77 |
+
this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(d).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return g.helper[0]};b.target=this.instance.currentItem[0];this.instance._mouseCapture(b,true);this.instance._mouseStart(b,true,true);this.instance.offset.click.top=
|
78 |
+
c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",b);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(b)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;
|
79 |
+
this.instance.options.revert=false;this.instance._trigger("out",b,this.instance._uiHash(this.instance));this.instance._mouseStop(b,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",b);c.dropped=false}})}});a.ui.plugin.add("draggable","cursor",{start:function(){var b=a("body"),g=a(this).data("draggable").options;if(b.css("cursor"))g._cursor=b.css("cursor");b.css("cursor",
|
80 |
+
g.cursor)},stop:function(){if(a(this).data("draggable")){var b=a(this).data("draggable").options;b._cursor&&a("body").css("cursor",b._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(){var b=a(this).data("draggable").options;a(b.iframeFix===true?"iframe":b.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},
|
81 |
+
stop:function(){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(b,g){b=a(g.helper);g=a(this).data("draggable").options;if(b.css("opacity"))g._opacity=b.css("opacity");b.css("opacity",g.opacity)},stop:function(b,g){b=a(this).data("draggable").options;b._opacity&&a(g.helper).css("opacity",b._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("draggable");if(b.scrollParent[0]!=
|
82 |
+
document&&b.scrollParent[0].tagName!="HTML")b.overflowOffset=b.scrollParent.offset()},drag:function(b){var g=a(this).data("draggable"),c=g.options,d=false;if(g.scrollParent[0]!=document&&g.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(g.overflowOffset.top+g.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity)g.scrollParent[0].scrollTop=d=g.scrollParent[0].scrollTop+c.scrollSpeed;else if(b.pageY-g.overflowOffset.top<c.scrollSensitivity)g.scrollParent[0].scrollTop=d=g.scrollParent[0].scrollTop-
|
83 |
+
c.scrollSpeed;if(!c.axis||c.axis!="y")if(g.overflowOffset.left+g.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity)g.scrollParent[0].scrollLeft=d=g.scrollParent[0].scrollLeft+c.scrollSpeed;else if(b.pageX-g.overflowOffset.left<c.scrollSensitivity)g.scrollParent[0].scrollLeft=d=g.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(b.pageY-a(document).scrollTop()<c.scrollSensitivity)d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed);else if(a(window).height()-
|
84 |
+
(b.pageY-a(document).scrollTop())<c.scrollSensitivity)d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(b.pageX-a(document).scrollLeft()<c.scrollSensitivity)d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed);else if(a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity)d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed)}d!==false&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(g,b)}});a.ui.plugin.add("draggable",
|
85 |
+
"snap",{start:function(){var b=a(this).data("draggable"),g=b.options;b.snapElements=[];a(g.snap.constructor!=String?g.snap.items||":data(draggable)":g.snap).each(function(){var c=a(this),d=c.offset();this!=b.element[0]&&b.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:d.top,left:d.left})})},drag:function(b,g){for(var c=a(this).data("draggable"),d=c.options,f=d.snapTolerance,m=g.offset.left,n=m+c.helperProportions.width,k=g.offset.top,e=k+c.helperProportions.height,i=
|
86 |
+
c.snapElements.length-1;i>=0;i--){var l=c.snapElements[i].left,o=l+c.snapElements[i].width,r=c.snapElements[i].top,q=r+c.snapElements[i].height;if(l-f<m&&m<o+f&&r-f<k&&k<q+f||l-f<m&&m<o+f&&r-f<e&&e<q+f||l-f<n&&n<o+f&&r-f<k&&k<q+f||l-f<n&&n<o+f&&r-f<e&&e<q+f){if(d.snapMode!="inner"){var p=Math.abs(r-e)<=f,t=Math.abs(q-k)<=f,v=Math.abs(l-n)<=f,h=Math.abs(o-m)<=f;if(p)g.position.top=c._convertPositionTo("relative",{top:r-c.helperProportions.height,left:0}).top-c.margins.top;if(t)g.position.top=c._convertPositionTo("relative",
|
87 |
+
{top:q,left:0}).top-c.margins.top;if(v)g.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left;if(h)g.position.left=c._convertPositionTo("relative",{top:0,left:o}).left-c.margins.left}var j=p||t||v||h;if(d.snapMode!="outer"){p=Math.abs(r-k)<=f;t=Math.abs(q-e)<=f;v=Math.abs(l-m)<=f;h=Math.abs(o-n)<=f;if(p)g.position.top=c._convertPositionTo("relative",{top:r,left:0}).top-c.margins.top;if(t)g.position.top=c._convertPositionTo("relative",{top:q-c.helperProportions.height,
|
88 |
+
left:0}).top-c.margins.top;if(v)g.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left;if(h)g.position.left=c._convertPositionTo("relative",{top:0,left:o-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&&(p||t||v||h||j))c.options.snap.snap&&c.options.snap.snap.call(c.element,b,a.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||t||v||h||j}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,
|
89 |
+
b,a.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});a.ui.plugin.add("draggable","stack",{start:function(){var b=a(this).data("draggable").options,g=a.makeArray(a(b.stack.group)).sort(function(c,d){return(parseInt(a(c).css("zIndex"),10)||b.stack.min)-(parseInt(a(d).css("zIndex"),10)||b.stack.min)});a(g).each(function(c){this.style.zIndex=b.stack.min+c});this[0].style.zIndex=b.stack.min+g.length}});a.ui.plugin.add("draggable","zIndex",{start:function(b,g){b=
|
90 |
+
a(g.helper);g=a(this).data("draggable").options;if(b.css("zIndex"))g._zIndex=b.css("zIndex");b.css("zIndex",g.zIndex)},stop:function(b,g){b=a(this).data("draggable").options;b._zIndex&&a(g.helper).css("zIndex",b._zIndex)}})})(jQuery);(function(a){a.widget("ui.droppable",{_init:function(){var b=this.options,g=b.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(c){return c.is(g)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);this.options.addClasses&&
|
91 |
+
this.element.addClass("ui-droppable")},destroy:function(){for(var b=a.ui.ddmanager.droppables[this.options.scope],g=0;g<b.length;g++)b[g]==this&&b.splice(g,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,g){if(b=="accept")this.options.accept=g&&a.isFunction(g)?g:function(c){return c.is(g)};else a.widget.prototype._setData.apply(this,arguments)},_activate:function(b){var g=a.ui.ddmanager.current;this.options.activeClass&&
|
92 |
+
this.element.addClass(this.options.activeClass);g&&this._trigger("activate",b,this.ui(g))},_deactivate:function(b){var g=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);g&&this._trigger("deactivate",b,this.ui(g))},_over:function(b){var g=a.ui.ddmanager.current;if(!(!g||(g.currentItem||g.element)[0]==this.element[0]))if(this.options.accept.call(this.element[0],g.currentItem||g.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
|
93 |
+
this._trigger("over",b,this.ui(g))}},_out:function(b){var g=a.ui.ddmanager.current;if(!(!g||(g.currentItem||g.element)[0]==this.element[0]))if(this.options.accept.call(this.element[0],g.currentItem||g.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",b,this.ui(g))}},_drop:function(b,g){var c=g||a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var d=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=
|
94 |
+
a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(c,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){d=true;return false}});if(d)return false;if(this.options.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",b,this.ui(c));return this.element}return false},ui:function(b){return{draggable:b.currentItem||
|
95 |
+
b.element,helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(b,g,c){if(!g.offset)return false;var d=(b.positionAbs||b.position.absolute).left,f=d+b.helperProportions.width,m=(b.positionAbs||b.position.absolute).top,n=m+b.helperProportions.height,k=g.offset.left,
|
96 |
+
e=k+g.proportions.width,i=g.offset.top,l=i+g.proportions.height;switch(c){case "fit":return k<d&&f<e&&i<m&&n<l;case "intersect":return k<d+b.helperProportions.width/2&&f-b.helperProportions.width/2<e&&i<m+b.helperProportions.height/2&&n-b.helperProportions.height/2<l;case "pointer":c=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left;b=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top;return g=a.ui.isOver(b,c,i,k,g.proportions.height,g.proportions.width);
|
97 |
+
case "touch":return(m>=i&&m<=l||n>=i&&n<=l||m<i&&n>l)&&(d>=k&&d<=e||f>=k&&f<=e||d<k&&f>e);default:return false}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,g){var c=a.ui.ddmanager.droppables[b.options.scope],d=g?g.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf(),m=0;a:for(;m<c.length;m++)if(!(c[m].options.disabled||b&&!c[m].options.accept.call(c[m].element[0],b.currentItem||b.element))){for(var n=0;n<f.length;n++)if(f[n]==c[m].element[0]){c[m].proportions.height=
|
98 |
+
0;continue a}c[m].visible=c[m].element.css("display")!="none";if(c[m].visible){c[m].offset=c[m].element.offset();c[m].proportions={width:c[m].element[0].offsetWidth,height:c[m].element[0].offsetHeight};d=="mousedown"&&c[m]._activate.call(c[m],g)}}},drop:function(b,g){var c=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options){if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance))c=this._drop.call(this,g);if(!this.options.disabled&&this.visible&&
|
99 |
+
this.options.accept.call(this.element[0],b.currentItem||b.element)){this.isout=1;this.isover=0;this._deactivate.call(this,g)}}});return c},drag:function(b,g){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,g);a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=a.ui.intersect(b,this,this.options.tolerance);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var d;if(this.options.greedy){var f=this.element.parents(":data(droppable):eq(0)");
|
100 |
+
if(f.length){d=a.data(f[0],"droppable");d.greedyChild=c=="isover"?1:0}}if(d&&c=="isover"){d.isover=0;d.isout=1;d._out.call(d,g)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,g);if(d&&c=="isout"){d.isout=0;d.isover=1;d._over.call(d,g)}}}})}}})(jQuery);/*
|
101 |
+
: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
|
102 |
+
*/
|
103 |
+
(function(){var a=Date,b=a.prototype,g=[];function c(d,f){f||(f=2);return("000"+d).slice(f*-1)}a.normalizeFormat=function(d){g=[];(new Date).$format(d);return g.join("")};a.strftime=function(d,f){return(new Date(f*1000)).$format(d)};a.strtotime=function(d){d=a.parse(d);d.addMinutes(d.getTimezoneOffset()*-1);return Math.round(a.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds())/1000)};b.$format=function(d){var f=this,m;
|
104 |
+
function n(k){g.push(k);return f.toString(k)}return d?d.replace(/(%|\\)?.|%%/g,function(k){if(k.charAt(0)==="\\"||k.substring(0,2)==="%%")return k.replace("\\","").replace("%%","%");switch(k){case "d":case "%d":return n("dd");case "D":case "%a":return n("ddd");case "j":case "%e":return n("d");case "l":case "%A":return n("dddd");case "N":case "%u":return f.getDay()+1;case "S":return n("S");case "w":case "%w":return f.getDay();case "z":return f.getOrdinalNumber();case "%j":return c(f.getOrdinalNumber(),
|
105 |
+
3);case "%U":k=f.clone().set({month:0,day:1}).addDays(-1).moveToDayOfWeek(0);var e=f.clone().addDays(1).moveToDayOfWeek(0,-1);return e<k?"00":c((e.getOrdinalNumber()-k.getOrdinalNumber())/7+1);case "W":case "%V":return f.getISOWeek();case "%W":return c(f.getWeek());case "F":case "%B":return n("MMMM");case "m":case "%m":return n("MM");case "M":case "%b":case "%h":return n("MMM");case "n":return n("M");case "t":return a.getDaysInMonth(f.getFullYear(),f.getMonth());case "L":return a.isLeapYear(f.getFullYear())?
|
106 |
+
1:0;case "o":case "%G":return f.setWeek(f.getISOWeek()).toString("yyyy");case "%g":return f.$format("%G").slice(-2);case "Y":case "%Y":return n("yyyy");case "y":case "%y":return n("yy");case "a":case "%p":return n("tt").toLowerCase();case "A":return n("tt").toUpperCase();case "g":case "%I":return n("h");case "G":return n("H");case "h":return n("hh");case "H":case "%H":return n("HH");case "i":case "%M":return n("mm");case "s":case "%S":return n("ss");case "u":return c(f.getMilliseconds(),3);case "I":return f.isDaylightSavingTime()?
|
107 |
+
1:0;case "O":return f.getUTCOffset();case "P":m=f.getUTCOffset();return m.substring(0,m.length-2)+":"+m.substring(m.length-2);case "e":case "T":case "%z":case "%Z":return f.getTimezone();case "Z":return f.getTimezoneOffset()*-60;case "B":k=new Date;return Math.floor((k.getHours()*3600+k.getMinutes()*60+k.getSeconds()+(k.getTimezoneOffset()+60)*60)/86.4);case "c":return f.toISOString().replace(/\"/g,"");case "U":return a.strtotime("now");case "%c":return n("d")+" "+n("t");case "%C":return Math.floor(f.getFullYear()/
|
108 |
+
100+1);case "%D":return n("MM/dd/yy");case "%n":return"\\n";case "%t":return"\\t";case "%r":return n("hh:mm tt");case "%R":return n("H:mm");case "%T":return n("H:mm:ss");case "%x":return n("d");case "%X":return n("t");default:g.push(k);return k}}):this._toString()};if(!b.format)b.format=b.$format})();
|
lib/jquery.timepicker.js
ADDED
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* A time picker for jQuery
|
3 |
+
* Based on original timePicker by Sam Collet (http://www.texotela.co.uk) -
|
4 |
+
* copyright (c) 2006 Sam Collett (http://www.texotela.co.uk)
|
5 |
+
*
|
6 |
+
* Dual licensed under the MIT and GPL licenses.
|
7 |
+
* Copyright (c) 2009 Anders Fajerson
|
8 |
+
* @name timePicker
|
9 |
+
* @version 0.2
|
10 |
+
* @author Anders Fajerson (http://perifer.se)
|
11 |
+
* @example $("#mytime").timePicker();
|
12 |
+
* @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"});
|
13 |
+
*/
|
14 |
+
|
15 |
+
(function($){
|
16 |
+
$.fn.timePicker = function(options) {
|
17 |
+
// Build main options before element iteration
|
18 |
+
var settings = $.extend({}, $.fn.timePicker.defaults, options);
|
19 |
+
|
20 |
+
return this.each(function() {
|
21 |
+
$.timePicker(this, settings);
|
22 |
+
});
|
23 |
+
};
|
24 |
+
|
25 |
+
$.timePicker = function (elm, settings) {
|
26 |
+
var e = $(elm)[0];
|
27 |
+
return e.timePicker || (e.timePicker = new jQuery._timePicker(e, settings));
|
28 |
+
};
|
29 |
+
|
30 |
+
$._timePicker = function(elm, settings) {
|
31 |
+
|
32 |
+
var tpOver = false;
|
33 |
+
var keyDown = false;
|
34 |
+
var startTime = timeToDate(settings.startTime, settings);
|
35 |
+
var endTime = timeToDate(settings.endTime, settings);
|
36 |
+
|
37 |
+
$(elm).attr('autocomplete', 'OFF'); // Disable browser autocomplete
|
38 |
+
|
39 |
+
var times = [];
|
40 |
+
var time = new Date(startTime); // Create a new date object.
|
41 |
+
while(time <= endTime) {
|
42 |
+
times[times.length] = formatTime(time, settings);
|
43 |
+
time = new Date(time.setMinutes(time.getMinutes() + settings.step));
|
44 |
+
}
|
45 |
+
|
46 |
+
//A tpDiv is generated for every timepicker, so give it a unique id based settings.id
|
47 |
+
//so the GWT TimePickerTextBox can be fully functional.
|
48 |
+
//If there is no settings.id then do not bother with an id because it is not being used
|
49 |
+
//with GWT TimePickerTextBox.
|
50 |
+
var $tpDiv = $('<div ' + (settings.tpDivId ? 'id="' + settings.tpDivId + '" ' : '') + 'class="time-picker'+ (settings.show24Hours ? '' : ' time-picker-12hours') +'"></div>');
|
51 |
+
var $tpList = $('<ul></ul>');
|
52 |
+
|
53 |
+
// Build the list.
|
54 |
+
for(var i = 0; i < times.length; i++) {
|
55 |
+
$tpList.append("<li>" + times[i] + "</li>");
|
56 |
+
}
|
57 |
+
$tpDiv.append($tpList);
|
58 |
+
// Append the timPicker to the body and position it.
|
59 |
+
var elmOffset = $(elm).offset();
|
60 |
+
$tpDiv.appendTo('body').css({
|
61 |
+
'top':(elmOffset.top - 48) + "px",
|
62 |
+
'left':elmOffset.left,
|
63 |
+
'width': ($(elm).width() + 5) + "px"
|
64 |
+
}).hide();
|
65 |
+
|
66 |
+
// Store the mouse state, used by the blur event. Use mouseover instead of
|
67 |
+
// mousedown since Opera fires blur before mousedown.
|
68 |
+
$tpDiv.mouseover(function() {
|
69 |
+
tpOver = true;
|
70 |
+
}).mouseout(function() {
|
71 |
+
tpOver = false;
|
72 |
+
});
|
73 |
+
|
74 |
+
$("li", $tpList).mouseover(function() {
|
75 |
+
if (!keyDown) {
|
76 |
+
$("li.selected", $tpDiv).removeClass("selected");
|
77 |
+
$(this).addClass("selected");
|
78 |
+
}
|
79 |
+
}).mousedown(function() {
|
80 |
+
tpOver = true;
|
81 |
+
}).click(function() {
|
82 |
+
setTimeVal(elm, this, $tpDiv, settings);
|
83 |
+
tpOver = false;
|
84 |
+
});
|
85 |
+
|
86 |
+
var showPicker = function() {
|
87 |
+
if ($tpDiv.is(":visible")) {
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
$("li", $tpDiv).removeClass("selected");
|
91 |
+
|
92 |
+
//Reposition the picker in case the page has changed (other things hidden or shown)
|
93 |
+
//and the textbox element is no longer where it was when the tpDiv was first appended to the DOM body.
|
94 |
+
var elmOffset = $(elm).offset();
|
95 |
+
$tpDiv.css({
|
96 |
+
'top':(elmOffset.top - 48) + "px",
|
97 |
+
'left':elmOffset.left,
|
98 |
+
'width': ($(elm).width() + 5) + "px"
|
99 |
+
});
|
100 |
+
|
101 |
+
// Show picker. This has to be done before scrollTop is set since that
|
102 |
+
// can't be done on hidden elements.
|
103 |
+
$tpDiv.show();
|
104 |
+
|
105 |
+
// Try to find a time in the list that matches the entered time.
|
106 |
+
var time = elm.value ? timeStringToDate(elm.value, settings) : startTime;
|
107 |
+
var startMin = startTime.getHours() * 60 + startTime.getMinutes();
|
108 |
+
var min = (time.getHours() * 60 + time.getMinutes()) - startMin;
|
109 |
+
var steps = Math.round(min / settings.step);
|
110 |
+
var roundTime = normaliseTime(new Date(0, 0, 0, 0, (steps * settings.step + startMin), 0));
|
111 |
+
roundTime = (startTime < roundTime && roundTime <= endTime) ? roundTime : startTime;
|
112 |
+
var $matchedTime = $("li:contains(" + formatTime(roundTime, settings) + ")", $tpDiv);
|
113 |
+
|
114 |
+
if ($matchedTime.length) {
|
115 |
+
$matchedTime.addClass("selected");
|
116 |
+
// Scroll to matched time.
|
117 |
+
$tpDiv[0].scrollTop = $matchedTime[0].offsetTop;
|
118 |
+
}
|
119 |
+
return true;
|
120 |
+
};
|
121 |
+
// Attach to click as well as focus so timePicker can be shown again when
|
122 |
+
// clicking on the input when it already has focus.
|
123 |
+
$(elm).focus(showPicker).click(showPicker);
|
124 |
+
// Hide timepicker on blur
|
125 |
+
$(elm).blur(function() {
|
126 |
+
if (!tpOver) {
|
127 |
+
$tpDiv.hide();
|
128 |
+
}
|
129 |
+
});
|
130 |
+
// Keypress doesn't repeat on Safari for non-text keys.
|
131 |
+
// Keydown doesn't repeat on Firefox and Opera on Mac.
|
132 |
+
// Using kepress for Opera and Firefox and keydown for the rest seems to
|
133 |
+
// work with up/down/enter/esc.
|
134 |
+
var event = ($.browser.opera || $.browser.mozilla) ? 'keypress' : 'keydown';
|
135 |
+
$(elm)[event](function(e) {
|
136 |
+
var $selected;
|
137 |
+
keyDown = true;
|
138 |
+
var top = $tpDiv[0].scrollTop;
|
139 |
+
switch (e.keyCode) {
|
140 |
+
case 38: // Up arrow.
|
141 |
+
// Just show picker if it's hidden.
|
142 |
+
if (showPicker()) {
|
143 |
+
return false;
|
144 |
+
};
|
145 |
+
$selected = $("li.selected", $tpList);
|
146 |
+
var prev = $selected.prev().addClass("selected")[0];
|
147 |
+
if (prev) {
|
148 |
+
$selected.removeClass("selected");
|
149 |
+
// Scroll item into view.
|
150 |
+
if (prev.offsetTop < top) {
|
151 |
+
$tpDiv[0].scrollTop = top - prev.offsetHeight;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
else {
|
155 |
+
// Loop to next item.
|
156 |
+
$selected.removeClass("selected");
|
157 |
+
prev = $("li:last", $tpList).addClass("selected")[0];
|
158 |
+
$tpDiv[0].scrollTop = prev.offsetTop - prev.offsetHeight;
|
159 |
+
}
|
160 |
+
return false;
|
161 |
+
break;
|
162 |
+
case 40: // Down arrow, similar in behaviour to up arrow.
|
163 |
+
if (showPicker()) {
|
164 |
+
return false;
|
165 |
+
};
|
166 |
+
$selected = $("li.selected", $tpList);
|
167 |
+
var next = $selected.next().addClass("selected")[0];
|
168 |
+
if (next) {
|
169 |
+
$selected.removeClass("selected");
|
170 |
+
if (next.offsetTop + next.offsetHeight > top + $tpDiv[0].offsetHeight) {
|
171 |
+
$tpDiv[0].scrollTop = top + next.offsetHeight;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
else {
|
175 |
+
$selected.removeClass("selected");
|
176 |
+
next = $("li:first", $tpList).addClass("selected")[0];
|
177 |
+
$tpDiv[0].scrollTop = 0;
|
178 |
+
}
|
179 |
+
return false;
|
180 |
+
break;
|
181 |
+
case 13: // Enter
|
182 |
+
if ($tpDiv.is(":visible")) {
|
183 |
+
var sel = $("li.selected", $tpList)[0];
|
184 |
+
setTimeVal(elm, sel, $tpDiv, settings);
|
185 |
+
}
|
186 |
+
return false;
|
187 |
+
break;
|
188 |
+
case 27: // Esc
|
189 |
+
$tpDiv.hide();
|
190 |
+
return false;
|
191 |
+
break;
|
192 |
+
}
|
193 |
+
return true;
|
194 |
+
});
|
195 |
+
$(elm).keyup(function(e) {
|
196 |
+
keyDown = false;
|
197 |
+
});
|
198 |
+
// Helper function to get an inputs current time as Date object.
|
199 |
+
// Returns a Date object.
|
200 |
+
this.getTime = function() {
|
201 |
+
return timeStringToDate(elm.value, settings);
|
202 |
+
};
|
203 |
+
// Helper function to set a time input.
|
204 |
+
// Takes a Date object.
|
205 |
+
this.setTime = function(time) {
|
206 |
+
elm.value = formatTime(normaliseTime(time), settings);
|
207 |
+
// Trigger element's change events.
|
208 |
+
$(elm).change();
|
209 |
+
};
|
210 |
+
|
211 |
+
}; // End fn;
|
212 |
+
|
213 |
+
// Plugin defaults.
|
214 |
+
$.fn.timePicker.defaults = {
|
215 |
+
step:30,
|
216 |
+
startTime: new Date(0, 0, 0, 0, 0, 0),
|
217 |
+
endTime: new Date(0, 0, 0, 23, 30, 0),
|
218 |
+
separator: ':',
|
219 |
+
show24Hours: true
|
220 |
+
};
|
221 |
+
|
222 |
+
// Private functions.
|
223 |
+
|
224 |
+
function setTimeVal(elm, sel, $tpDiv, settings) {
|
225 |
+
// Update input field
|
226 |
+
elm.value = $(sel).text();
|
227 |
+
// Trigger element's change events.
|
228 |
+
$(elm).change();
|
229 |
+
// Keep focus for all but IE (which doesn't like it)
|
230 |
+
if (!$.browser.msie) {
|
231 |
+
elm.focus();
|
232 |
+
}
|
233 |
+
// Hide picker
|
234 |
+
$tpDiv.hide();
|
235 |
+
}
|
236 |
+
|
237 |
+
function formatTime(time, settings) {
|
238 |
+
var h = time.getHours();
|
239 |
+
var hours = settings.show24Hours ? h : (((h + 11) % 12) + 1);
|
240 |
+
hours = formatHour(hours, settings);
|
241 |
+
var minutes = time.getMinutes();
|
242 |
+
return hours + settings.separator + formatNumber(minutes) + (settings.show24Hours ? '' : ((h < 12) ? ' AM' : ' PM'));
|
243 |
+
}
|
244 |
+
|
245 |
+
function formatNumber(value) {
|
246 |
+
return (value < 10 ? '0' : '') + value;
|
247 |
+
}
|
248 |
+
|
249 |
+
function formatHour(value, settings) {
|
250 |
+
if (settings.show24Hours) {
|
251 |
+
return (value < 10 ? '0' : '') + value;
|
252 |
+
} else {
|
253 |
+
return value;
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
function timeToDate(input, settings) {
|
258 |
+
return (typeof input == 'object') ? normaliseTime(input) : timeStringToDate(input, settings);
|
259 |
+
}
|
260 |
+
|
261 |
+
function timeStringToDate(input, settings) {
|
262 |
+
if (input) {
|
263 |
+
var array = input.split(settings.separator);
|
264 |
+
var hours = parseFloat(array[0]);
|
265 |
+
var minutes = parseFloat(array[1]);
|
266 |
+
|
267 |
+
// Convert AM/PM hour to 24-hour format.
|
268 |
+
if (!settings.show24Hours) {
|
269 |
+
if (hours === 12 && input.substr('AM') !== -1) {
|
270 |
+
hours = 0;
|
271 |
+
}
|
272 |
+
else if (hours !== 12 && input.indexOf('PM') !== -1) {
|
273 |
+
hours += 12;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
var time = new Date(0, 0, 0, hours, minutes, 0);
|
277 |
+
return normaliseTime(time);
|
278 |
+
}
|
279 |
+
return null;
|
280 |
+
}
|
281 |
+
|
282 |
+
/* Normalise time object to a common date. */
|
283 |
+
function normaliseTime(time) {
|
284 |
+
time.setFullYear(2001);
|
285 |
+
time.setMonth(0);
|
286 |
+
time.setDate(0);
|
287 |
+
return time;
|
288 |
+
}
|
289 |
+
|
290 |
+
})(jQuery);
|
291 |
+
|
lib/jquery.tooltip.css
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
#tooltip {
|
2 |
-
position: absolute;
|
3 |
-
z-index: 3000;
|
4 |
-
border: 1px solid #111;
|
5 |
-
background-color: #eee;
|
6 |
-
padding: 5px;
|
7 |
-
opacity: 0.85;
|
8 |
-
}
|
9 |
-
#tooltip h3, #tooltip div { margin: 0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/jquery.tooltip.js
DELETED
@@ -1,302 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery Tooltip plugin 1.3
|
3 |
-
*
|
4 |
-
* http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
|
5 |
-
* http://docs.jquery.com/Plugins/Tooltip
|
6 |
-
*
|
7 |
-
* Copyright (c) 2006 - 2008 Jörn Zaefferer
|
8 |
-
*
|
9 |
-
* jQueryId: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer jQuery
|
10 |
-
*
|
11 |
-
* Dual licensed under the MIT and GPL licenses:
|
12 |
-
* http://www.opensource.org/licenses/mit-license.php
|
13 |
-
* http://www.gnu.org/licenses/gpl.html
|
14 |
-
*/
|
15 |
-
|
16 |
-
;(function(jQuery) {
|
17 |
-
|
18 |
-
// the tooltip element
|
19 |
-
var helper = {},
|
20 |
-
// the current tooltipped element
|
21 |
-
current,
|
22 |
-
_top,
|
23 |
-
_left,
|
24 |
-
_right = "auto",
|
25 |
-
// IE 5.5 or 6
|
26 |
-
IE = jQuery.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
|
27 |
-
// flag for mouse tracking
|
28 |
-
track = false;
|
29 |
-
|
30 |
-
jQuery.tooltip = {
|
31 |
-
blocked: false,
|
32 |
-
defaults: {
|
33 |
-
delay: 200,
|
34 |
-
fade: false,
|
35 |
-
showURL: true,
|
36 |
-
extraClass: "",
|
37 |
-
top: 15,
|
38 |
-
left: 15,
|
39 |
-
id: "tooltip"
|
40 |
-
},
|
41 |
-
block: function() {
|
42 |
-
jQuery.tooltip.blocked = !jQuery.tooltip.blocked;
|
43 |
-
}
|
44 |
-
};
|
45 |
-
|
46 |
-
jQuery.fn.extend({
|
47 |
-
tooltip: function(settings) {
|
48 |
-
settings = jQuery.extend({}, jQuery.tooltip.defaults, settings);
|
49 |
-
createHelper(settings);
|
50 |
-
return this.each(function() {
|
51 |
-
jQuery.data(this, "tooltip", settings);
|
52 |
-
this.tOpacity = helper.parent.css("opacity");
|
53 |
-
})
|
54 |
-
.mouseover(save)
|
55 |
-
.mouseup(function() {
|
56 |
-
show();
|
57 |
-
});
|
58 |
-
},
|
59 |
-
hideWhenEmpty: function() {
|
60 |
-
return this.each(function() {
|
61 |
-
jQuery(this)[ jQuery(this).html() ? "show" : "hide" ]();
|
62 |
-
});
|
63 |
-
},
|
64 |
-
url: function() {
|
65 |
-
return this.attr('href') || this.attr('src');
|
66 |
-
}
|
67 |
-
});
|
68 |
-
|
69 |
-
function createHelper(settings) {
|
70 |
-
// there can be only one tooltip helper
|
71 |
-
if( helper.parent )
|
72 |
-
return;
|
73 |
-
// create the helper, h3 for title, div for url
|
74 |
-
helper.parent = jQuery('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
|
75 |
-
// add to document
|
76 |
-
.appendTo(document.body)
|
77 |
-
// hide it at first
|
78 |
-
.hide();
|
79 |
-
|
80 |
-
// apply bgiframe if available
|
81 |
-
if ( jQuery.fn.bgiframe )
|
82 |
-
helper.parent.bgiframe();
|
83 |
-
|
84 |
-
// save references to title and url elements
|
85 |
-
helper.body = jQuery('div.body', helper.parent);
|
86 |
-
}
|
87 |
-
|
88 |
-
function tooltipsettings(element) {
|
89 |
-
if (element) {
|
90 |
-
return jQuery.data(element, "tooltip");
|
91 |
-
} else {
|
92 |
-
jQuery("#tooltip").hide();
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
// main event handler to start showing tooltips
|
97 |
-
function handle(event) {
|
98 |
-
// if selected, update the helper position when the mouse moves
|
99 |
-
track = !!tooltipsettings(this).track;
|
100 |
-
jQuery(document.body).bind('mousemove', update);
|
101 |
-
|
102 |
-
// update at least once
|
103 |
-
update(event);
|
104 |
-
}
|
105 |
-
|
106 |
-
// save elements title before the tooltip is displayed
|
107 |
-
function save() {
|
108 |
-
// if this is the current source, or it has no title (occurs with click event), stop
|
109 |
-
if ( jQuery.tooltip.blocked || this == current || (!this.tooltipText && !tooltipsettings(this).bodyHandler))
|
110 |
-
return;
|
111 |
-
|
112 |
-
// save current
|
113 |
-
current = this;
|
114 |
-
handle.apply(current, arguments);
|
115 |
-
}
|
116 |
-
|
117 |
-
/*
|
118 |
-
* This function is a little strange. The issue is that our tooltips work
|
119 |
-
* more like modeless dialogs than like tooltips. We make this work by
|
120 |
-
* storing the information of where the tooltip should go when the mouse
|
121 |
-
* moves over an item and then showing it when the mouse is clicked on that
|
122 |
-
* item.
|
123 |
-
*/
|
124 |
-
function show() {
|
125 |
-
if (!tooltipsettings(current)) {
|
126 |
-
return;
|
127 |
-
}
|
128 |
-
helper.parent.css({
|
129 |
-
left: _left,
|
130 |
-
right: _right,
|
131 |
-
top: _top
|
132 |
-
});
|
133 |
-
|
134 |
-
var v = viewport(),
|
135 |
-
h = helper.parent[0];
|
136 |
-
|
137 |
-
/*
|
138 |
-
* We don't want the tooltip to cause scroll bars to appear.
|
139 |
-
* First we check the left.
|
140 |
-
*/
|
141 |
-
if (_left + 200 > v.x + v.cx) {
|
142 |
-
_left -= h.offsetWidth + tooltipsettings(current).left + ((_left + 225) - (v.x + v.cx));
|
143 |
-
helper.parent.css({left: _left + 'px'}).addClass("viewport-right");
|
144 |
-
}
|
145 |
-
|
146 |
-
/*
|
147 |
-
* Now we check the top
|
148 |
-
*/
|
149 |
-
if (_top + 100 > v.y + v.cy) {
|
150 |
-
_top -= h.offsetHeight + 100 + tooltipsettings(current).top;
|
151 |
-
helper.parent.css({top: _top + 'px'}).addClass("viewport-bottom");
|
152 |
-
}
|
153 |
-
|
154 |
-
// check horizontal position
|
155 |
-
if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
|
156 |
-
_left -= h.offsetWidth + 20 + tooltipsettings(current).left + 150;
|
157 |
-
helper.parent.css({left: _left + 'px'}).addClass("viewport-right");
|
158 |
-
}
|
159 |
-
// check vertical position
|
160 |
-
if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
|
161 |
-
_top -= h.offsetHeight + 20 + tooltipsettings(current).top;
|
162 |
-
helper.parent.css({top: _top + 'px'}).addClass("viewport-bottom");
|
163 |
-
}
|
164 |
-
|
165 |
-
if ( tooltipsettings(current).bodyHandler ) {
|
166 |
-
var bodyContent = tooltipsettings(current).bodyHandler.call(current);
|
167 |
-
if (bodyContent.nodeType || bodyContent.jquery) {
|
168 |
-
helper.body.empty().append(bodyContent)
|
169 |
-
} else {
|
170 |
-
helper.body.html( bodyContent );
|
171 |
-
}
|
172 |
-
helper.body.show();
|
173 |
-
} else if ( tooltipsettings(current).showBody ) {
|
174 |
-
var parts = tooltipsettings(current).showBody;
|
175 |
-
helper.body.empty();
|
176 |
-
for(var i = 0, part; (part = parts[i]); i++) {
|
177 |
-
if(i > 0)
|
178 |
-
helper.body.append("<br/>");
|
179 |
-
helper.body.append(part);
|
180 |
-
}
|
181 |
-
helper.body.hideWhenEmpty();
|
182 |
-
} else {
|
183 |
-
helper.body.hide();
|
184 |
-
}
|
185 |
-
|
186 |
-
// add an optional class for this tip
|
187 |
-
helper.parent.addClass(tooltipsettings(current).extraClass);
|
188 |
-
|
189 |
-
// fix PNG background for IE
|
190 |
-
if (tooltipsettings(current).fixPNG )
|
191 |
-
helper.parent.fixPNG();
|
192 |
-
|
193 |
-
if (!tooltipsettings(current)) {
|
194 |
-
return;
|
195 |
-
}
|
196 |
-
if ((!IE || !jQuery.fn.bgiframe) && tooltipsettings(current).fade) {
|
197 |
-
if (helper.parent.is(":animated"))
|
198 |
-
helper.parent.stop().show().fadeTo(tooltipsettings(current).fade, current.tOpacity);
|
199 |
-
else
|
200 |
-
helper.parent.is(':visible') ? helper.parent.fadeTo(tooltipsettings(current).fade, current.tOpacity) : helper.parent.fadeIn(tooltipsettings(current).fade);
|
201 |
-
} else {
|
202 |
-
helper.parent.show();
|
203 |
-
}
|
204 |
-
|
205 |
-
if (tooltipsettings(current).showHandler) {
|
206 |
-
tooltipsettings(current).showHandler.call(current);
|
207 |
-
}
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* callback for mousemove
|
212 |
-
* updates the helper position
|
213 |
-
* removes itself when no current element
|
214 |
-
*/
|
215 |
-
function update(event) {
|
216 |
-
if(jQuery.tooltip.blocked)
|
217 |
-
return;
|
218 |
-
if (!tooltipsettings(current)) {
|
219 |
-
return;
|
220 |
-
}
|
221 |
-
|
222 |
-
if (event && event.target.tagName == "OPTION") {
|
223 |
-
return;
|
224 |
-
}
|
225 |
-
|
226 |
-
// stop updating when tracking is disabled and the tooltip is visible
|
227 |
-
if ( !track && helper.parent.is(":visible")) {
|
228 |
-
jQuery(document.body).unbind('mousemove', update)
|
229 |
-
}
|
230 |
-
|
231 |
-
// if no current element is available, remove this listener
|
232 |
-
if( current == null ) {
|
233 |
-
jQuery(document.body).unbind('mousemove', update);
|
234 |
-
return;
|
235 |
-
}
|
236 |
-
|
237 |
-
// remove position helper classes
|
238 |
-
helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
|
239 |
-
|
240 |
-
_left = helper.parent[0].offsetLeft;
|
241 |
-
_top = helper.parent[0].offsetTop;
|
242 |
-
|
243 |
-
if (event) {
|
244 |
-
// position the helper 15 pixel to bottom right, starting from mouse position
|
245 |
-
_left = event.pageX + tooltipsettings(current).left;
|
246 |
-
_top = event.pageY + tooltipsettings(current).top;
|
247 |
-
_right = 'auto';
|
248 |
-
if (tooltipsettings(current).positionLeft) {
|
249 |
-
_right = jQuery(window).width() - left;
|
250 |
-
_left = 'auto';
|
251 |
-
}
|
252 |
-
}
|
253 |
-
}
|
254 |
-
|
255 |
-
function viewport() {
|
256 |
-
return {
|
257 |
-
x: jQuery(window).scrollLeft(),
|
258 |
-
y: jQuery(window).scrollTop(),
|
259 |
-
cx: jQuery(window).width(),
|
260 |
-
cy: jQuery(window).height()
|
261 |
-
};
|
262 |
-
}
|
263 |
-
|
264 |
-
// hide helper and restore added classes and the title
|
265 |
-
function hide(event) {
|
266 |
-
if(jQuery.tooltip.blocked)
|
267 |
-
return;
|
268 |
-
|
269 |
-
if (!event) {
|
270 |
-
jQuery("#tooltip").hide();
|
271 |
-
return;
|
272 |
-
}
|
273 |
-
|
274 |
-
var offset = jQuery("#tooltip").offset();
|
275 |
-
/*
|
276 |
-
* We want to give the user a chance to get their mouse over the tooltip
|
277 |
-
* before we hide it.
|
278 |
-
*/
|
279 |
-
if (event.pageX >= offset.left - 15 &&
|
280 |
-
event.pageY >= offset.top - 15 &&
|
281 |
-
event.pageX <= jQuery("#tooltip").width() + offset.left + 15 &&
|
282 |
-
event.pageY <= jQuery("#tooltip").height() + offset.top + 15) {
|
283 |
-
return;
|
284 |
-
}
|
285 |
-
|
286 |
-
// no more current element
|
287 |
-
current = null;
|
288 |
-
|
289 |
-
var tsettings = tooltipsettings(this);
|
290 |
-
function complete() {
|
291 |
-
helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
|
292 |
-
}
|
293 |
-
if ((!IE || !jQuery.fn.bgiframe) && tsettings.fade) {
|
294 |
-
if (helper.parent.is(':animated'))
|
295 |
-
helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
|
296 |
-
else
|
297 |
-
helper.parent.stop().fadeOut(tsettings.fade, complete);
|
298 |
-
} else
|
299 |
-
complete();
|
300 |
-
}
|
301 |
-
|
302 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/languages/date-cs-CZ.js
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Version: 1.0 Alpha-1
|
3 |
+
* Build Date: 13-Nov-2007
|
4 |
+
* Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved.
|
5 |
+
* License: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
|
6 |
+
* Website: http://www.datejs.com/ or http://www.coolite.com/datejs/
|
7 |
+
*/
|
8 |
+
Date.CultureInfo={name:"cs-CZ",englishName:"Czech (Czech Republic)",nativeName:"čeština (Česká republika)",dayNames:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],abbreviatedDayNames:["ne","po","út","st","čt","pá","so"],shortestDayNames:["ne","po","út","st","čt","pá","so"],firstLetterDayNames:["n","p","ú","s","č","p","s"],monthNames:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],abbreviatedMonthNames:["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"],amDesignator:"dop.",pmDesignator:"odp.",firstDayOfWeek:1,twoDigitYearMax:2029,dateElementOrder:"dmy",formatPatterns:{shortDate:"d.M.yyyy",longDate:"d. MMMM yyyy",shortTime:"H:mm",longTime:"H:mm:ss",fullDateTime:"d. MMMM yyyy H:mm:ss",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"dd MMMM",yearMonth:"MMMM yyyy"},regexPatterns:{jan:/^leden/i,feb:/^únor/i,mar:/^březen/i,apr:/^duben/i,may:/^květen/i,jun:/^červen/i,jul:/^červenec/i,aug:/^srpen/i,sep:/^září/i,oct:/^říjen/i,nov:/^listopad/i,dec:/^prosinec/i,sun:/^neděle/i,mon:/^pondělí/i,tue:/^úterý/i,wed:/^středa/i,thu:/^čtvrtek/i,fri:/^pátek/i,sat:/^sobota/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};
|
9 |
+
Date.getMonthNumberFromName=function(name){var n=Date.CultureInfo.monthNames,m=Date.CultureInfo.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
|
10 |
+
return-1;};Date.getDayNumberFromName=function(name){var n=Date.CultureInfo.dayNames,m=Date.CultureInfo.abbreviatedDayNames,o=Date.CultureInfo.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
|
11 |
+
return-1;};Date.isLeapYear=function(year){return(((year%4===0)&&(year%100!==0))||(year%400===0));};Date.getDaysInMonth=function(year,month){return[31,(Date.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};Date.getTimezoneOffset=function(s,dst){return(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST[s.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[s.toUpperCase()];};Date.getTimezoneAbbreviation=function(offset,dst){var n=(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,p;for(p in n){if(n[p]===offset){return p;}}
|
12 |
+
return null;};Date.prototype.clone=function(){return new Date(this.getTime());};Date.prototype.compareTo=function(date){if(isNaN(this)){throw new Error(this);}
|
13 |
+
if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
|
14 |
+
var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
|
15 |
+
if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
|
16 |
+
if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
|
17 |
+
if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
|
18 |
+
if(x.month||x.months){this.addMonths(x.month||x.months);}
|
19 |
+
if(x.year||x.years){this.addYears(x.year||x.years);}
|
20 |
+
if(x.day||x.days){this.addDays(x.day||x.days);}
|
21 |
+
return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(value<min||value>max){throw new RangeError(value+" is not a valid value for "+name+".");}
|
22 |
+
return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;}
|
23 |
+
if(!x.second&&x.second!==0){x.second=-1;}
|
24 |
+
if(!x.minute&&x.minute!==0){x.minute=-1;}
|
25 |
+
if(!x.hour&&x.hour!==0){x.hour=-1;}
|
26 |
+
if(!x.day&&x.day!==0){x.day=-1;}
|
27 |
+
if(!x.month&&x.month!==0){x.month=-1;}
|
28 |
+
if(!x.year&&x.year!==0){x.year=-1;}
|
29 |
+
if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());}
|
30 |
+
if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());}
|
31 |
+
if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());}
|
32 |
+
if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());}
|
33 |
+
if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());}
|
34 |
+
if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());}
|
35 |
+
if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());}
|
36 |
+
if(x.timezone){this.setTimezone(x.timezone);}
|
37 |
+
if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);}
|
38 |
+
return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;}
|
39 |
+
var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}}
|
40 |
+
return w;};Date.prototype.isDST=function(){console.log('isDST');return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();};
|
41 |
+
Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
|
42 |
+
return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i<dx.length;i++){$D[dx[i]]=$D[dx[i].substring(0,3)]=df(i);}
|
43 |
+
var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
|
44 |
+
return this.moveToMonth(n,this._orient);};};for(var j=0;j<mx.length;j++){$D[mx[j]]=$D[mx[j].substring(0,3)]=mf(j);}
|
45 |
+
var ef=function(j){return function(){if(j.substring(j.length-1)!="s"){j+="s";}
|
46 |
+
return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k<px.length;k++){de=px[k].toLowerCase();$D[de]=$D[de+"s"]=ef(px[k]);$N[de]=$N[de+"s"]=nf(de);}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ");};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern);};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern);};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern);};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern);};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};
|
47 |
+
(function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
|
48 |
+
break;}
|
49 |
+
return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
|
50 |
+
rx.push(r[0]);s=r[1];}
|
51 |
+
return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
|
52 |
+
return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
|
53 |
+
throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
|
54 |
+
return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
|
55 |
+
if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
|
56 |
+
try{r=(px[i].call(this,s));}catch(e){r=null;}
|
57 |
+
if(r){return r;}}
|
58 |
+
throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
|
59 |
+
try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
|
60 |
+
rx.push(r[0]);s=r[1];}
|
61 |
+
return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
|
62 |
+
return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
|
63 |
+
rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
|
64 |
+
s=q[1];}
|
65 |
+
if(!r){throw new $P.Exception(s);}
|
66 |
+
if(q){throw new $P.Exception(q[1]);}
|
67 |
+
if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
|
68 |
+
return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
|
69 |
+
rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
|
70 |
+
if(!last&&q[1].length===0){last=true;}
|
71 |
+
if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
|
72 |
+
p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
|
73 |
+
if(rx[1].length<best[1].length){best=rx;}
|
74 |
+
if(best[1].length===0){break;}}
|
75 |
+
if(best[0].length===0){return best;}
|
76 |
+
if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
|
77 |
+
best[1]=q[1];}
|
78 |
+
return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
|
79 |
+
return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
|
80 |
+
if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
|
81 |
+
var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
|
82 |
+
return rx;};Date.Grammar={};Date.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=((s.length==3)?Date.getMonthNumberFromName(s):(Number(s)-1));};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];var now=new Date();this.year=now.getFullYear();this.month=now.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
|
83 |
+
this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
|
84 |
+
var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
|
85 |
+
return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
|
86 |
+
for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
|
87 |
+
if(this.now){return new Date();}
|
88 |
+
var today=Date.today();var method=null;var expression=!!(this.days!=null||this.orient||this.operator);if(expression){var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";gap=(Date.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
|
89 |
+
if(this.month){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
|
90 |
+
if(!this.unit){this.unit="day";}
|
91 |
+
if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
|
92 |
+
if(this.unit=="week"){this.unit="day";this.value=this.value*7;}
|
93 |
+
this[this.unit+"s"]=this.value*orient;}
|
94 |
+
return today.add(this);}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour;}
|
95 |
+
if(this.weekday&&!this.day){this.day=(today.addDays((Date.getDayNumberFromName(this.weekday)-today.getDay()))).getDate();}
|
96 |
+
if(this.month&&!this.day){this.day=1;}
|
97 |
+
return today.set(this);}}};var _=Date.Parsing.Operators,g=Date.Grammar,t=Date.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=Date.CultureInfo.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
|
98 |
+
fn=_C[keys]=_.any.apply(null,px);}
|
99 |
+
return fn;};g.ctoken2=function(key){return _.rtoken(Date.CultureInfo.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.mm,g.ss],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^(\+|\-)\s*\d\d\d\d/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[Date.CultureInfo.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw Date.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
|
100 |
+
return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
|
101 |
+
return g._start.call({},s);};}());Date._parse=Date.parse;Date.parse=function(s){var r=null;if(!s){return null;}
|
102 |
+
try{r=Date.Grammar.start.call({},s);}catch(e){return null;}
|
103 |
+
return((r[1].length===0)?r[0]:null);};Date.getParseFunction=function(fx){var fn=Date.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
|
104 |
+
return((r[1].length===0)?r[0]:null);};};Date.parseExact=function(s,fx){return Date.getParseFunction(fx)(s);};
|
lib/lib.txt
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
This file lists all of the third-party JavaScript libraries we are using and where they came from. All of these files are compressed and combined into the edcallib.min.js file. This compressed file was made with the Google Closure JavaScript compiler. I haven't checked in that compiler because it is over 4MB and you don't need it for runtime. I haven't been able to figure out a way to make WordPress's Subversion exclude a file when building a plugin.
|
2 |
|
3 |
languages/date-*.js
|
|
|
4 |
This is an open source JavaScript date library that we use to provide and manipulate dates for the calendar.
|
5 |
http://www.datejs.com/
|
6 |
MIT License
|
@@ -18,10 +19,10 @@ JQuery tools supports the scrolling.
|
|
18 |
http://flowplayer.org/tools/index.html
|
19 |
MIT license
|
20 |
|
21 |
-
|
22 |
-
jquery.
|
23 |
-
The JQuery
|
24 |
-
http://
|
25 |
MIT License
|
26 |
|
27 |
json2.js
|
1 |
This file lists all of the third-party JavaScript libraries we are using and where they came from. All of these files are compressed and combined into the edcallib.min.js file. This compressed file was made with the Google Closure JavaScript compiler. I haven't checked in that compiler because it is over 4MB and you don't need it for runtime. I haven't been able to figure out a way to make WordPress's Subversion exclude a file when building a plugin.
|
2 |
|
3 |
languages/date-*.js
|
4 |
+
date.extras.js
|
5 |
This is an open source JavaScript date library that we use to provide and manipulate dates for the calendar.
|
6 |
http://www.datejs.com/
|
7 |
MIT License
|
19 |
http://flowplayer.org/tools/index.html
|
20 |
MIT license
|
21 |
|
22 |
+
timePicker.css
|
23 |
+
jquery.timepicker.js
|
24 |
+
The JQuery time picker shows a nice time picker when you edit the post time.
|
25 |
+
http://labs.perifer.se/timedatepicker
|
26 |
MIT License
|
27 |
|
28 |
json2.js
|
lib/timePicker.css
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div.time-picker {
|
2 |
+
position: absolute;
|
3 |
+
height: 200px;
|
4 |
+
width:6em; /* needed for IE */
|
5 |
+
overflow: auto;
|
6 |
+
background: #fff;
|
7 |
+
border: 1px solid #000;
|
8 |
+
z-index: 99;
|
9 |
+
}
|
10 |
+
div.time-picker-12hours {
|
11 |
+
width:8em; /* needed for IE */
|
12 |
+
}
|
13 |
+
|
14 |
+
div.time-picker ul {
|
15 |
+
list-style-type: none;
|
16 |
+
margin: 0;
|
17 |
+
padding: 0;
|
18 |
+
}
|
19 |
+
div.time-picker li {
|
20 |
+
padding: 1px;
|
21 |
+
cursor: pointer;
|
22 |
+
}
|
23 |
+
div.time-picker li.selected {
|
24 |
+
background: #316AC5;
|
25 |
+
color: #fff;
|
26 |
+
}
|
readme.txt
CHANGED
@@ -1,25 +1,30 @@
|
|
1 |
=== Editorial Calendar ===
|
2 |
-
Contributors: MaryVogt, zgrossbart
|
3 |
Tags: posts, post, calendar, AJAX, admin, administration
|
4 |
Requires at least: 2.8.5
|
5 |
-
Tested up to: 2.9.
|
6 |
-
Stable tag: 0.
|
7 |
|
8 |
-
Editorial
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
-
|
13 |
|
14 |
<a href="http://chrisg.org/drag-and-drop-post-scheduling-with-the-editorial-calendar-wordpress-plugin/">Chris Garret</a> liked the calendar so much he made a <a href="http://www.youtube.com/watch?v=F4BnQZsgtZc&feature=player_embedded" style="font-size: 1.25em">video</a> showing you how to use it. Thanks Chris!
|
15 |
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
1. See all of your posts and when they'll be posted.
|
19 |
1. Drag and drop to change your post dates.
|
20 |
-
1.
|
21 |
1. Easily see the status of your posts.
|
22 |
|
|
|
|
|
23 |
The editorial calendar is getting closer and closer to version 1.0. We have a few more features to go. Thank you to everyone who has helped us improve this plugin with their feedback. If you have questions, problems, or idea for new features please let us know at <a href="mailto:wp-edcal@googlegroups.com">wp-edcal@googlegroups.com</a>.
|
24 |
|
25 |
== Installation ==
|
@@ -33,9 +38,9 @@ The editorial calendar is getting closer and closer to version 1.0. We have a f
|
|
33 |
|
34 |
= Can I see a demo of the calendar? =
|
35 |
|
36 |
-
Check out our demo installation at <a href="http://www.zackgrossbart.com/extras/sandbox/wp-admin/edit.php?page=
|
37 |
|
38 |
-
= How do I navigate the calendar? =
|
39 |
|
40 |
You can move around in the calendar using the arrows next to the months at the top or your mouse wheel, You can also move using your keyboard:
|
41 |
|
@@ -48,25 +53,35 @@ You can move around in the calendar using the arrows next to the months at the t
|
|
48 |
|
49 |
= What languages does the calendar support? =
|
50 |
|
51 |
-
The calendar is available in English, French, and Croatian.
|
52 |
|
53 |
= Can I add new languages? =
|
54 |
|
55 |
Yes please! We are looking for translators. It only takes about 20 minutes. If you're interested please <a href="mailto:wp-edcal@googlegroups.com">contact us</a>.
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
= Can I use the editorial calendar with pages? =
|
58 |
|
59 |
Right now the calendar only supports posts. We're considering adding pages. If you would like to see support for pages let us know.
|
60 |
|
61 |
-
=
|
62 |
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
= Why can't I move published posts? =
|
66 |
|
67 |
Moving published posts can cause problems with some RSS feeds and is generally not a very popular thing to do. The calendar only allows you to move scheduled and draft posts.
|
68 |
|
69 |
-
= Why doesn't the calendar work with Live Countdown Timer =
|
70 |
|
71 |
If you use the plugin <a href="http://wordpress.org/extend/plugins/live-countdown-timer/">Live Countdown Timer</a> the editorial calendar will not work. There is a conflict in some JavaScript libraries. They're working on it. For now you must disable Live Countdown Timer if you want to use the WordPress Editorial Calendar.
|
72 |
|
@@ -75,10 +90,23 @@ If you use the plugin <a href="http://wordpress.org/extend/plugins/live-countdow
|
|
75 |
1. The calendar integrates seamlessly into the WordPress administration console
|
76 |
2. See the big picture with a view of all your posts and when they'll be published.
|
77 |
3. Drag and drop posts to easily change dates and take control of your blog.
|
78 |
-
4. Create and schedule
|
|
|
79 |
|
80 |
== Changelog ==
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
= 0.6 =
|
83 |
* The new look and feel of the calendar makes it easier to scan over your posts while showing you more information.
|
84 |
* You can customize the number of weeks you work with in the calendar using the screen options pull down in the upper right.
|
1 |
=== Editorial Calendar ===
|
2 |
+
Contributors: cvernon, justinstresslimit, MaryVogt, zgrossbart
|
3 |
Tags: posts, post, calendar, AJAX, admin, administration
|
4 |
Requires at least: 2.8.5
|
5 |
+
Tested up to: 2.9.2
|
6 |
+
Stable tag: 0.7
|
7 |
|
8 |
+
The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
+
Did you remember to write a post for next Tuesday? What about the Tuesday after that? WordPress doesn't make it easy to see what posts happen on what days. The editorial calendar gives you an overview of your blog and when each post will be available. You can drag and drop to move posts, quickly edit posts right in the calendar, and manage your entire blog.
|
13 |
|
14 |
<a href="http://chrisg.org/drag-and-drop-post-scheduling-with-the-editorial-calendar-wordpress-plugin/">Chris Garret</a> liked the calendar so much he made a <a href="http://www.youtube.com/watch?v=F4BnQZsgtZc&feature=player_embedded" style="font-size: 1.25em">video</a> showing you how to use it. Thanks Chris!
|
15 |
|
16 |
+
<h4>Try it out</h4>
|
17 |
+
You don't have to install the calendar to give it a try. Just check out the demo installation at <a href="http://www.zackgrossbart.com/extras/sandbox/wp-admin/edit.php?page=cal">Zack's WordPress Sandbox</a>.
|
18 |
+
|
19 |
+
<h4>Features</h4>
|
20 |
|
21 |
1. See all of your posts and when they'll be posted.
|
22 |
1. Drag and drop to change your post dates.
|
23 |
+
1. Quickedit post titles, contents, and times.
|
24 |
1. Easily see the status of your posts.
|
25 |
|
26 |
+
<h4>Make it better</h4>
|
27 |
+
|
28 |
The editorial calendar is getting closer and closer to version 1.0. We have a few more features to go. Thank you to everyone who has helped us improve this plugin with their feedback. If you have questions, problems, or idea for new features please let us know at <a href="mailto:wp-edcal@googlegroups.com">wp-edcal@googlegroups.com</a>.
|
29 |
|
30 |
== Installation ==
|
38 |
|
39 |
= Can I see a demo of the calendar? =
|
40 |
|
41 |
+
Check out our demo installation at <a href="http://www.zackgrossbart.com/extras/sandbox/wp-admin/edit.php?page=cal">Zack's WordPress Sandbox</a>.
|
42 |
|
43 |
+
= How do I navigate in the calendar? =
|
44 |
|
45 |
You can move around in the calendar using the arrows next to the months at the top or your mouse wheel, You can also move using your keyboard:
|
46 |
|
53 |
|
54 |
= What languages does the calendar support? =
|
55 |
|
56 |
+
The calendar is available in English, French, Czechoslovakian, and Croatian.
|
57 |
|
58 |
= Can I add new languages? =
|
59 |
|
60 |
Yes please! We are looking for translators. It only takes about 20 minutes. If you're interested please <a href="mailto:wp-edcal@googlegroups.com">contact us</a>.
|
61 |
|
62 |
+
= What users can use the calendar? =
|
63 |
+
|
64 |
+
The editorial calendar appears differently based on your permissions. Administrators and Editors can use every feature available in the calendar. Authors can use the calendar to edit and move their own posts, but other people's posts are read-only. Contributors and Subscribers can't see the calendar.
|
65 |
+
|
66 |
+
|
67 |
= Can I use the editorial calendar with pages? =
|
68 |
|
69 |
Right now the calendar only supports posts. We're considering adding pages. If you would like to see support for pages let us know.
|
70 |
|
71 |
+
= Does the calendar support group blogs? =
|
72 |
|
73 |
+
If your blog has multiple authors the calendar will work just fine. We are currently working on new features to add for multi-author blogs. If you have any ideas please <a href="mailto:wp-edcal@googlegroups.com">contact us</a>.
|
74 |
+
|
75 |
+
|
76 |
+
= Can my readers tell I'm using the editorial calendar? =
|
77 |
+
|
78 |
+
No. The calendar is only an administration tool. None of your readers will know you're running it unless you tell them.
|
79 |
|
80 |
= Why can't I move published posts? =
|
81 |
|
82 |
Moving published posts can cause problems with some RSS feeds and is generally not a very popular thing to do. The calendar only allows you to move scheduled and draft posts.
|
83 |
|
84 |
+
= Why doesn't the calendar work with Live Countdown Timer? =
|
85 |
|
86 |
If you use the plugin <a href="http://wordpress.org/extend/plugins/live-countdown-timer/">Live Countdown Timer</a> the editorial calendar will not work. There is a conflict in some JavaScript libraries. They're working on it. For now you must disable Live Countdown Timer if you want to use the WordPress Editorial Calendar.
|
87 |
|
90 |
1. The calendar integrates seamlessly into the WordPress administration console
|
91 |
2. See the big picture with a view of all your posts and when they'll be published.
|
92 |
3. Drag and drop posts to easily change dates and take control of your blog.
|
93 |
+
4. Create, edit, and schedule posts in one simple quickedit dialog.
|
94 |
+
5. Show as much or as little of your blog as you like.
|
95 |
|
96 |
== Changelog ==
|
97 |
|
98 |
+
= 0.7 =
|
99 |
+
* You can now edit post contents, title, and time directly in the calendar. You can also schedule a post for publication.
|
100 |
+
* The layout of posts in the calendar has been optimized to you can see the maximum number of posts in a single day without scrolling.
|
101 |
+
* The calendar is now available for Authors and grays out the posts the current user doesn't have permission to edit.
|
102 |
+
* The calendar has been translated into Czech. Thanks to Lukáš Adamec, who uses the Calendar on his blog <a href="http://hornihrad.cz/">Horni Hrad</a>.
|
103 |
+
* Added a link to view published posts directly from the calendar.
|
104 |
+
* The calendar will now use the WordPress preference for the first day of the week and fall back on the server locale if it isn't set.
|
105 |
+
* The calendar is also using the WordPress preferences for time format.
|
106 |
+
* The calendar is now loading JavaScript libraries for just the calendar page. That makes other pages load faster and avoids potential JavaScript conflicts with other plugins.
|
107 |
+
* The visible weeks preference in the screen options is now a dropdown instead of a text box.
|
108 |
+
|
109 |
+
|
110 |
= 0.6 =
|
111 |
* The new look and feel of the calendar makes it easier to scan over your posts while showing you more information.
|
112 |
* You can customize the number of weeks you work with in the calendar using the screen options pull down in the upper right.
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|
screenshot-5.png
ADDED
Binary file
|