├── README.md ├── events.json ├── full_demo ├── demo.css ├── demo.js ├── images │ └── header-bg.png ├── reset.css └── weekcalendar_full_demo.html ├── jquery.weekcalendar.css ├── jquery.weekcalendar.iml ├── jquery.weekcalendar.js ├── libs ├── css │ └── smoothness │ │ ├── images │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ └── ui-icons_cd0a0a_256x240.png │ │ └── jquery-ui-1.8rc3.custom.css ├── jquery-1.4.2.min.js └── jquery-ui-1.8rc3.custom.min.js ├── release-notes.txt ├── weekcalendar.html ├── weekcalendar_demo_2.html └── weekcalendar_json.html /README.md: -------------------------------------------------------------------------------- 1 | jquery-week-calendar 2 | ==================== 3 | 4 | Now actively maintained in the following fork - https://github.com/themouette/jquery-week-calendar 5 | -------------------------------------------------------------------------------- /events.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"id":1, "start":"2009-05-10T13:15:00.000+10:00", "end":"2009-05-10T14:15:00.000+10:00", "title":"Lunch with Mike"} 3 | ] 4 | 5 | -------------------------------------------------------------------------------- /full_demo/demo.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif; 3 | font-size: 83.33%; 4 | } 5 | 6 | h1 { 7 | padding: 0.5em; 8 | font-size: 1.6em; 9 | } 10 | 11 | h2 { 12 | margin: 0.5em 0; 13 | font-size: 1.4em; 14 | } 15 | 16 | p { 17 | margin: 0.5em; 18 | } 19 | 20 | .ui-widget { 21 | font-size: 1em; 22 | } 23 | 24 | #event_edit_container, #about { 25 | display: none; 26 | } 27 | 28 | #about_button_container { 29 | position: absolute; 30 | top: 1em; 31 | right: 1em; 32 | padding: 0.5em 2em; 33 | background: #ddf; 34 | border: 1px solid #bbd; 35 | width: 10em; 36 | text-align: center; 37 | } 38 | 39 | .wc-header td { 40 | background: url(images/header-bg.png) repeat-x; 41 | } 42 | 43 | label { 44 | display: block; 45 | margin-top: 1em; 46 | margin-bottom: 0.5em; 47 | } 48 | 49 | form ul { 50 | padding: 0.3em; 51 | } 52 | 53 | select, input[type='text'], textarea { 54 | width: 250px; 55 | padding: 3px; 56 | } 57 | 58 | input[type='text'] { 59 | width: 245px; 60 | } 61 | 62 | ul.formatted,ol.formatted { 63 | display: block; 64 | margin: 1em 0.5em; 65 | } 66 | 67 | ul.formatted li,ol.formatted li { 68 | margin: 5px 30px; 69 | display: auto; 70 | } 71 | 72 | ul.formatted li { 73 | list-style-type: disc; 74 | } 75 | 76 | ol.formatted li { 77 | list-style-type: decimal; 78 | } -------------------------------------------------------------------------------- /full_demo/demo.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | 4 | var $calendar = $('#calendar'); 5 | var id = 10; 6 | 7 | $calendar.weekCalendar({ 8 | timeslotsPerHour : 4, 9 | allowCalEventOverlap : true, 10 | overlapEventsSeparate: true, 11 | firstDayOfWeek : 1, 12 | businessHours :{start: 8, end: 18, limitDisplay: true }, 13 | daysToShow : 7, 14 | height : function($calendar) { 15 | return $(window).height() - $("h1").outerHeight() - 1; 16 | }, 17 | eventRender : function(calEvent, $event) { 18 | if (calEvent.end.getTime() < new Date().getTime()) { 19 | $event.css("backgroundColor", "#aaa"); 20 | $event.find(".wc-time").css({ 21 | "backgroundColor" : "#999", 22 | "border" : "1px solid #888" 23 | }); 24 | } 25 | }, 26 | draggable : function(calEvent, $event) { 27 | return calEvent.readOnly != true; 28 | }, 29 | resizable : function(calEvent, $event) { 30 | return calEvent.readOnly != true; 31 | }, 32 | eventNew : function(calEvent, $event) { 33 | var $dialogContent = $("#event_edit_container"); 34 | resetForm($dialogContent); 35 | var startField = $dialogContent.find("select[name='start']").val(calEvent.start); 36 | var endField = $dialogContent.find("select[name='end']").val(calEvent.end); 37 | var titleField = $dialogContent.find("input[name='title']"); 38 | var bodyField = $dialogContent.find("textarea[name='body']"); 39 | 40 | 41 | $dialogContent.dialog({ 42 | modal: true, 43 | title: "New Calendar Event", 44 | close: function() { 45 | $dialogContent.dialog("destroy"); 46 | $dialogContent.hide(); 47 | $('#calendar').weekCalendar("removeUnsavedEvents"); 48 | }, 49 | buttons: { 50 | save : function() { 51 | calEvent.id = id; 52 | id++; 53 | calEvent.start = new Date(startField.val()); 54 | calEvent.end = new Date(endField.val()); 55 | calEvent.title = titleField.val(); 56 | calEvent.body = bodyField.val(); 57 | 58 | $calendar.weekCalendar("removeUnsavedEvents"); 59 | $calendar.weekCalendar("updateEvent", calEvent); 60 | $dialogContent.dialog("close"); 61 | }, 62 | cancel : function() { 63 | $dialogContent.dialog("close"); 64 | } 65 | } 66 | }).show(); 67 | 68 | $dialogContent.find(".date_holder").text($calendar.weekCalendar("formatDate", calEvent.start)); 69 | setupStartAndEndTimeFields(startField, endField, calEvent, $calendar.weekCalendar("getTimeslotTimes", calEvent.start)); 70 | 71 | }, 72 | eventDrop : function(calEvent, $event) { 73 | 74 | }, 75 | eventResize : function(calEvent, $event) { 76 | }, 77 | eventClick : function(calEvent, $event) { 78 | 79 | if (calEvent.readOnly) { 80 | return; 81 | } 82 | 83 | var $dialogContent = $("#event_edit_container"); 84 | resetForm($dialogContent); 85 | var startField = $dialogContent.find("select[name='start']").val(calEvent.start); 86 | var endField = $dialogContent.find("select[name='end']").val(calEvent.end); 87 | var titleField = $dialogContent.find("input[name='title']").val(calEvent.title); 88 | var bodyField = $dialogContent.find("textarea[name='body']"); 89 | bodyField.val(calEvent.body); 90 | 91 | $dialogContent.dialog({ 92 | modal: true, 93 | title: "Edit - " + calEvent.title, 94 | close: function() { 95 | $dialogContent.dialog("destroy"); 96 | $dialogContent.hide(); 97 | $('#calendar').weekCalendar("removeUnsavedEvents"); 98 | }, 99 | buttons: { 100 | save : function() { 101 | 102 | calEvent.start = new Date(startField.val()); 103 | calEvent.end = new Date(endField.val()); 104 | calEvent.title = titleField.val(); 105 | calEvent.body = bodyField.val(); 106 | 107 | $calendar.weekCalendar("updateEvent", calEvent); 108 | $dialogContent.dialog("close"); 109 | }, 110 | "delete" : function() { 111 | $calendar.weekCalendar("removeEvent", calEvent.id); 112 | $dialogContent.dialog("close"); 113 | }, 114 | cancel : function() { 115 | $dialogContent.dialog("close"); 116 | } 117 | } 118 | }).show(); 119 | 120 | var startField = $dialogContent.find("select[name='start']").val(calEvent.start); 121 | var endField = $dialogContent.find("select[name='end']").val(calEvent.end); 122 | $dialogContent.find(".date_holder").text($calendar.weekCalendar("formatDate", calEvent.start)); 123 | setupStartAndEndTimeFields(startField, endField, calEvent, $calendar.weekCalendar("getTimeslotTimes", calEvent.start)); 124 | $(window).resize().resize(); //fixes a bug in modal overlay size ?? 125 | 126 | }, 127 | eventMouseover : function(calEvent, $event) { 128 | }, 129 | eventMouseout : function(calEvent, $event) { 130 | }, 131 | noEvents : function() { 132 | 133 | }, 134 | data : function(start, end, callback) { 135 | callback(getEventData()); 136 | } 137 | }); 138 | 139 | function resetForm($dialogContent) { 140 | $dialogContent.find("input").val(""); 141 | $dialogContent.find("textarea").val(""); 142 | } 143 | 144 | function getEventData() { 145 | var year = new Date().getFullYear(); 146 | var month = new Date().getMonth(); 147 | var day = new Date().getDate(); 148 | 149 | return { 150 | events : [ 151 | { 152 | "id":1, 153 | "start": new Date(year, month, day, 12), 154 | "end": new Date(year, month, day, 13, 30), 155 | "title":"Lunch with Mike" 156 | }, 157 | { 158 | "id":2, 159 | "start": new Date(year, month, day, 14), 160 | "end": new Date(year, month, day, 14, 45), 161 | "title":"Dev Meeting" 162 | }, 163 | { 164 | "id":3, 165 | "start": new Date(year, month, day + 1, 17), 166 | "end": new Date(year, month, day + 1, 17, 45), 167 | "title":"Hair cut" 168 | }, 169 | { 170 | "id":4, 171 | "start": new Date(year, month, day - 1, 8), 172 | "end": new Date(year, month, day - 1, 9, 30), 173 | "title":"Team breakfast" 174 | }, 175 | { 176 | "id":5, 177 | "start": new Date(year, month, day + 1, 14), 178 | "end": new Date(year, month, day + 1, 15), 179 | "title":"Product showcase" 180 | }, 181 | { 182 | "id":6, 183 | "start": new Date(year, month, day, 10), 184 | "end": new Date(year, month, day, 11), 185 | "title":"I'm read-only", 186 | readOnly : true 187 | } 188 | 189 | ] 190 | }; 191 | } 192 | 193 | 194 | /* 195 | * Sets up the start and end time fields in the calendar event 196 | * form for editing based on the calendar event being edited 197 | */ 198 | function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) { 199 | 200 | for (var i = 0; i < timeslotTimes.length; i++) { 201 | var startTime = timeslotTimes[i].start; 202 | var endTime = timeslotTimes[i].end; 203 | var startSelected = ""; 204 | if (startTime.getTime() === calEvent.start.getTime()) { 205 | startSelected = "selected=\"selected\""; 206 | } 207 | var endSelected = ""; 208 | if (endTime.getTime() === calEvent.end.getTime()) { 209 | endSelected = "selected=\"selected\""; 210 | } 211 | $startTimeField.append(""); 212 | $endTimeField.append(""); 213 | 214 | } 215 | $endTimeOptions = $endTimeField.find("option"); 216 | $startTimeField.trigger("change"); 217 | } 218 | 219 | var $endTimeField = $("select[name='end']"); 220 | var $endTimeOptions = $endTimeField.find("option"); 221 | 222 | //reduces the end time options to be only after the start time options. 223 | $("select[name='start']").change(function() { 224 | var startTime = $(this).find(":selected").val(); 225 | var currentEndTime = $endTimeField.find("option:selected").val(); 226 | $endTimeField.html( 227 | $endTimeOptions.filter(function() { 228 | return startTime < $(this).val(); 229 | }) 230 | ); 231 | 232 | var endTimeSelected = false; 233 | $endTimeField.find("option").each(function() { 234 | if ($(this).val() === currentEndTime) { 235 | $(this).attr("selected", "selected"); 236 | endTimeSelected = true; 237 | return false; 238 | } 239 | }); 240 | 241 | if (!endTimeSelected) { 242 | //automatically select an end date 2 slots away. 243 | $endTimeField.find("option:eq(1)").attr("selected", "selected"); 244 | } 245 | 246 | }); 247 | 248 | 249 | var $about = $("#about"); 250 | 251 | $("#about_button").click(function() { 252 | $about.dialog({ 253 | title: "About this calendar demo", 254 | width: 600, 255 | close: function() { 256 | $about.dialog("destroy"); 257 | $about.hide(); 258 | }, 259 | buttons: { 260 | close : function() { 261 | $about.dialog("close"); 262 | } 263 | } 264 | }).show(); 265 | }); 266 | 267 | 268 | }); -------------------------------------------------------------------------------- /full_demo/images/header-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/full_demo/images/header-bg.png -------------------------------------------------------------------------------- /full_demo/reset.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://developer.yahoo.net/yui/license.txt 5 | version: 2.5.1 6 | */ 7 | html { 8 | color: #000; 9 | background: #FFF; 10 | } 11 | 12 | body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td { 13 | margin: 0; 14 | padding: 0; 15 | } 16 | 17 | 18 | table { 19 | border-collapse: collapse; 20 | border-spacing: 0; 21 | } 22 | 23 | fieldset, img { 24 | border: 0; 25 | } 26 | 27 | address, caption, cite, code, dfn, em, strong, th, var { 28 | font-style: normal; 29 | font-weight: normal; 30 | } 31 | 32 | li { 33 | list-style: none; 34 | } 35 | 36 | caption, th { 37 | text-align: left; 38 | } 39 | 40 | h1, h2, h3, h4, h5, h6 { 41 | font-size: 100%; 42 | font-weight: normal; 43 | } 44 | 45 | q:before, q:after { 46 | content: ''; 47 | } 48 | 49 | abbr, acronym { 50 | border: 0; 51 | font-variant: normal; 52 | } 53 | 54 | sup { 55 | vertical-align: text-top; 56 | } 57 | 58 | sub { 59 | vertical-align: text-bottom; 60 | } 61 | 62 | input, textarea, select { 63 | font-family: inherit; 64 | font-size: inherit; 65 | font-weight: inherit; 66 | } 67 | 68 | input, textarea, select { 69 | 70 | * font-size: 71 | 100%; 72 | } 73 | 74 | legend { 75 | color: #000; 76 | } -------------------------------------------------------------------------------- /full_demo/weekcalendar_full_demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

jQuery Week Calendar (full demo)

29 |
30 | 31 |
32 |
33 |
34 |
35 | 36 | 53 |
54 |
55 |
56 |

Summary

57 |

58 | This calendar implementation demonstrates further usage of the calendar with editing and deleting of events. 59 | It stops short however of implementing a server-side back-end which is out of the scope of this plugin. It 60 | should be reasonably evident by viewing the demo source code, where the points for adding ajax should be. 61 | Note also that this is **just a demo** and some of the demo code itself is rough. It could certainly be 62 | optimised. 63 |

64 |

65 | ***Note: This demo is straight out of SVN trunk so may show unreleased features from time to time. 66 |

67 |

Demonstrated Features

68 |

69 | This calendar implementation demonstrates the following features: 70 |

71 | 85 |
86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /jquery.weekcalendar.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .wc-container { 4 | font-size: 14px; 5 | font-family: arial, helvetica; 6 | } 7 | 8 | .wc-nav { 9 | padding: 1em; 10 | text-align: right; 11 | } 12 | 13 | .wc-nav button { 14 | margin: 0 0.5em; 15 | } 16 | 17 | 18 | .wc-container table { 19 | border-collapse: collapse; 20 | border-spacing: 0; 21 | } 22 | .wc-container table td { 23 | margin: 0; 24 | padding: 0; 25 | } 26 | 27 | .wc-header { 28 | background: #eee; 29 | border-top: 1px solid #aaa; 30 | border-bottom: 1px solid #aaa; 31 | width: 100%; 32 | } 33 | 34 | .wc-header .wc-time-column-header { 35 | width: 6%; 36 | } 37 | 38 | .wc-header .wc-scrollbar-shim { 39 | width: 16px; 40 | } 41 | 42 | .wc-header .wc-day-column-header { 43 | text-align: center; 44 | padding: 0.4em; 45 | } 46 | .wc-header td { 47 | background-color: #eee; 48 | } 49 | 50 | .wc-grid-timeslot-header { 51 | width: 6%; 52 | background: #eee; 53 | } 54 | 55 | 56 | 57 | .wc-scrollable-grid { 58 | overflow: auto; 59 | overflow-x: hidden !important; 60 | overflow-y: auto !important; 61 | position: relative; 62 | background-color: #fff; 63 | width: 100%; 64 | } 65 | 66 | 67 | table.wc-time-slots { 68 | width: 100%; 69 | table-layout: fixed; 70 | cursor: default; 71 | } 72 | 73 | .wc-day-column { 74 | width: 13.5%; 75 | border-left: 1px solid #ddd; 76 | overflow: visible; 77 | vertical-align: top; 78 | } 79 | 80 | .wc-day-column-inner { 81 | width: 100%; 82 | position:relative; 83 | } 84 | 85 | .wc-time-slot-wrapper { 86 | position:relative; 87 | height: 1px; 88 | top: 1px; 89 | } 90 | 91 | .wc-time-slots { 92 | position: absolute; 93 | width: 100%; 94 | } 95 | 96 | 97 | .wc-time-header-cell { 98 | padding: 5px; 99 | height: 80px; /* reference height */ 100 | } 101 | 102 | 103 | .wc-time-slot { 104 | border-bottom: 1px dotted #ddd; 105 | } 106 | 107 | .wc-hour-header { 108 | text-align: right; 109 | } 110 | 111 | .wc-hour-end, .wc-hour-header { 112 | border-bottom: 1px solid #ccc; 113 | color: #555; 114 | } 115 | 116 | .wc-business-hours { 117 | background-color: #E6EEF1; 118 | border-bottom: 1px solid #ccc; 119 | color: #333; 120 | font-size: 1.4em; 121 | } 122 | 123 | .wc-business-hours .wc-am-pm { 124 | font-size: 0.6em; 125 | } 126 | 127 | .wc-day-header-cell { 128 | text-align: center; 129 | vertical-align: middle; 130 | padding: 5px; 131 | } 132 | 133 | 134 | 135 | .wc-time-slot-header .wc-header-cell { 136 | text-align: right; 137 | padding-right: 10px; 138 | } 139 | 140 | .wc-header .wc-today { 141 | font-weight: bold; 142 | } 143 | 144 | .wc-time-slots .wc-today { 145 | background-color: #ffffcc; 146 | } 147 | 148 | 149 | .wc-cal-event { 150 | background-color: #68a1e5; 151 | filter:alpha(opacity=80); 152 | -moz-opacity:0.8; 153 | -khtml-opacity: 0.8; 154 | opacity: 0.8; 155 | position: absolute; 156 | text-align: center; 157 | overflow: hidden; 158 | cursor: pointer; 159 | color: #fff; 160 | width: 100%; 161 | display: none; 162 | } 163 | 164 | 165 | .wc-cal-event div { 166 | padding: 0 5px; 167 | 168 | } 169 | 170 | .wc-cal-event .wc-time { 171 | background-color: #2b72d0; 172 | border: 1px solid #1b62c0; 173 | color: #fff; 174 | padding: 0; 175 | font-weight: bold; 176 | } 177 | 178 | .wc-container .ui-draggable .wc-time { 179 | cursor: move; 180 | } 181 | 182 | .wc-cal-event .wc-title { 183 | position: relative; 184 | } 185 | 186 | .wc-container .ui-resizable-s { 187 | height: 10px; 188 | bottom: -8px; 189 | } 190 | 191 | 192 | .wc-container .ui-draggable-dragging { 193 | z-index: 1000; 194 | } 195 | -------------------------------------------------------------------------------- /jquery.weekcalendar.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jquery.weekcalendar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery.weekCalendar v1.2.3-pre 3 | * http://www.redredred.com.au/ 4 | * 5 | * Requires: 6 | * - jquery.weekcalendar.css 7 | * - jquery 1.3.x 8 | * - jquery-ui 1.7.x (widget, drag, drop, resize) 9 | * 10 | * Copyright (c) 2009 Rob Monie 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 | * If you're after a monthly calendar plugin, check out http://arshaw.com/fullcalendar/ 16 | */ 17 | 18 | (function($) { 19 | 20 | $.widget("ui.weekCalendar", { 21 | 22 | options : { 23 | date: new Date(), 24 | timeFormat : "h:i a", 25 | dateFormat : "M d, Y", 26 | alwaysDisplayTimeMinutes: true, 27 | use24Hour : false, 28 | daysToShow : 7, 29 | firstDayOfWeek : 0, // 0 = Sunday, 1 = Monday, 2 = Tuesday, ... , 6 = Saturday 30 | useShortDayNames: false, 31 | timeSeparator : " to ", 32 | startParam : "start", 33 | endParam : "end", 34 | businessHours : {start: 8, end: 18, limitDisplay : false}, 35 | newEventText : "New Event", 36 | timeslotHeight: 20, 37 | defaultEventLength : 2, 38 | timeslotsPerHour : 4, 39 | buttons : true, 40 | buttonText : { 41 | today : "today", 42 | lastWeek : " < ", 43 | nextWeek : " > " 44 | }, 45 | scrollToHourMillis : 500, 46 | allowCalEventOverlap : false, 47 | overlapEventsSeparate: false, 48 | readonly: false, 49 | draggable : function(calEvent, element) { 50 | return true; 51 | }, 52 | resizable : function(calEvent, element) { 53 | return true; 54 | }, 55 | eventClick : function() { 56 | }, 57 | eventRender : function(calEvent, element) { 58 | return element; 59 | }, 60 | eventAfterRender : function(calEvent, element) { 61 | return element; 62 | }, 63 | eventDrag : function(calEvent, element) { 64 | }, 65 | eventDrop : function(calEvent, element) { 66 | }, 67 | eventResize : function(calEvent, element) { 68 | }, 69 | eventNew : function(calEvent, element) { 70 | }, 71 | eventMouseover : function(calEvent, $event) { 72 | }, 73 | eventMouseout : function(calEvent, $event) { 74 | }, 75 | calendarBeforeLoad : function(calendar) { 76 | }, 77 | calendarAfterLoad : function(calendar) { 78 | }, 79 | noEvents : function() { 80 | }, 81 | shortMonths : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 82 | longMonths : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 83 | shortDays : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 84 | longDays : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] 85 | }, 86 | 87 | /*********************** 88 | * Initialise calendar * 89 | ***********************/ 90 | _create : function() { 91 | 92 | var self = this; 93 | self._computeOptions(); 94 | self._setupEventDelegation(); 95 | 96 | self._renderCalendar(); 97 | 98 | self._loadCalEvents(); 99 | 100 | self._resizeCalendar(); 101 | self._scrollToHour(self.options.date.getHours()); 102 | 103 | $(window).unbind("resize.weekcalendar"); 104 | $(window).bind("resize.weekcalendar", function() { 105 | self._resizeCalendar(); 106 | }); 107 | 108 | }, 109 | 110 | 111 | /******************** 112 | * public functions * 113 | ********************/ 114 | /* 115 | * Refresh the events for the currently displayed week. 116 | */ 117 | refresh : function() { 118 | this._loadCalEvents(this.element.data("startDate")); //reload with existing week 119 | }, 120 | 121 | /* 122 | * Clear all events currently loaded into the calendar 123 | */ 124 | clear : function() { 125 | this._clearCalendar(); 126 | }, 127 | 128 | /* 129 | * Go to this week 130 | */ 131 | today : function() { 132 | this._clearCalendar(); 133 | this._loadCalEvents(new Date()); 134 | }, 135 | 136 | /* 137 | * Go to the previous week relative to the currently displayed week 138 | */ 139 | prevWeek : function() { 140 | //minus more than 1 day to be sure we're in previous week - account for daylight savings or other anomolies 141 | var newDate = new Date(this.element.data("startDate").getTime() - (MILLIS_IN_WEEK / 6)); 142 | this._clearCalendar(); 143 | this._loadCalEvents(newDate); 144 | }, 145 | 146 | /* 147 | * Go to the next week relative to the currently displayed week 148 | */ 149 | nextWeek : function() { 150 | //add 8 days to be sure of being in prev week - allows for daylight savings or other anomolies 151 | var newDate = new Date(this.element.data("startDate").getTime() + MILLIS_IN_WEEK + (MILLIS_IN_WEEK / 7)); 152 | this._clearCalendar(); 153 | this._loadCalEvents(newDate); 154 | }, 155 | 156 | /* 157 | * Reload the calendar to whatever week the date passed in falls on. 158 | */ 159 | gotoWeek : function(date) { 160 | this._clearCalendar(); 161 | this._loadCalEvents(date); 162 | }, 163 | 164 | /* 165 | * Remove an event based on it's id 166 | */ 167 | removeEvent : function(eventId) { 168 | 169 | var self = this; 170 | 171 | self.element.find(".wc-cal-event").each(function() { 172 | if ($(this).data("calEvent").id === eventId) { 173 | $(this).remove(); 174 | return false; 175 | } 176 | }); 177 | 178 | //this could be more efficient rather than running on all days regardless... 179 | self.element.find(".wc-day-column-inner").each(function() { 180 | self._adjustOverlappingEvents($(this)); 181 | }); 182 | }, 183 | 184 | /* 185 | * Removes any events that have been added but not yet saved (have no id). 186 | * This is useful to call after adding a freshly saved new event. 187 | */ 188 | removeUnsavedEvents : function() { 189 | 190 | var self = this; 191 | 192 | self.element.find(".wc-new-cal-event").each(function() { 193 | $(this).remove(); 194 | }); 195 | 196 | //this could be more efficient rather than running on all days regardless... 197 | self.element.find(".wc-day-column-inner").each(function() { 198 | self._adjustOverlappingEvents($(this)); 199 | }); 200 | }, 201 | 202 | /* 203 | * update an event in the calendar. If the event exists it refreshes 204 | * it's rendering. If it's a new event that does not exist in the calendar 205 | * it will be added. 206 | */ 207 | updateEvent : function (calEvent) { 208 | this._updateEventInCalendar(calEvent); 209 | }, 210 | 211 | /* 212 | * Returns an array of timeslot start and end times based on 213 | * the configured grid of the calendar. Returns in both date and 214 | * formatted time based on the 'timeFormat' config option. 215 | */ 216 | getTimeslotTimes : function(date) { 217 | var options = this.options; 218 | var firstHourDisplayed = options.businessHours.limitDisplay ? options.businessHours.start : 0; 219 | var startDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), firstHourDisplayed); 220 | 221 | var times = [] 222 | var startMillis = startDate.getTime(); 223 | for (var i = 0; i < options.timeslotsPerDay; i++) { 224 | var endMillis = startMillis + options.millisPerTimeslot; 225 | times[i] = { 226 | start: new Date(startMillis), 227 | startFormatted: this._formatDate(new Date(startMillis), options.timeFormat), 228 | end: new Date(endMillis), 229 | endFormatted: this._formatDate(new Date(endMillis), options.timeFormat) 230 | }; 231 | startMillis = endMillis; 232 | } 233 | return times; 234 | }, 235 | 236 | formatDate : function(date, format) { 237 | if (format) { 238 | return this._formatDate(date, format); 239 | } else { 240 | return this._formatDate(date, this.options.dateFormat); 241 | } 242 | }, 243 | 244 | formatTime : function(date, format) { 245 | if (format) { 246 | return this._formatDate(date, format); 247 | } else { 248 | return this._formatDate(date, this.options.timeFormat); 249 | } 250 | }, 251 | 252 | 253 | 254 | 255 | 256 | /* 257 | getData : function(key) { 258 | return this._getData(key); 259 | }, 260 | */ 261 | 262 | /********************* 263 | * private functions * 264 | *********************/ 265 | 266 | 267 | _setOption: function(key, value) { 268 | var self = this; 269 | if(self.options[key] != value) { 270 | 271 | // this could be made more efficient at some stage by caching the 272 | // events array locally in a store but this should be done in conjunction 273 | // with a proper binding model. 274 | 275 | var currentEvents = $.map(self.element.find(".wc-cal-event"), function() { 276 | return $(this).data("calEvent"); 277 | }); 278 | 279 | var newOptions = {}; 280 | newOptions[key] = value; 281 | self._renderEvents({events:currentEvents, options: newOptions}, self.element.find(".wc-day-column-inner")) 282 | } 283 | 284 | }, 285 | 286 | 287 | // compute dynamic options based on other config values 288 | _computeOptions : function() { 289 | 290 | var options = this.options; 291 | 292 | if (options.businessHours.limitDisplay) { 293 | options.timeslotsPerDay = options.timeslotsPerHour * (options.businessHours.end - options.businessHours.start); 294 | options.millisToDisplay = (options.businessHours.end - options.businessHours.start) * 60 * 60 * 1000; 295 | options.millisPerTimeslot = options.millisToDisplay / options.timeslotsPerDay; 296 | } else { 297 | options.timeslotsPerDay = options.timeslotsPerHour * 24; 298 | options.millisToDisplay = MILLIS_IN_DAY; 299 | options.millisPerTimeslot = MILLIS_IN_DAY / options.timeslotsPerDay; 300 | } 301 | }, 302 | 303 | /* 304 | * Resize the calendar scrollable height based on the provided function in options. 305 | */ 306 | _resizeCalendar : function () { 307 | 308 | var options = this.options; 309 | if (options && $.isFunction(options.height)) { 310 | var calendarHeight = options.height(this.element); 311 | var headerHeight = this.element.find(".wc-header").outerHeight(); 312 | var navHeight = this.element.find(".wc-nav").outerHeight(); 313 | this.element.find(".wc-scrollable-grid").height(calendarHeight - navHeight - headerHeight); 314 | } 315 | }, 316 | 317 | /* 318 | * configure calendar interaction events that are able to use event 319 | * delegation for greater efficiency 320 | */ 321 | _setupEventDelegation : function() { 322 | var self = this; 323 | var options = this.options; 324 | this.element.click(function(event) { 325 | var $target = $(event.target); 326 | if ($target.data("preventClick")) { 327 | return; 328 | } 329 | if ($target.hasClass("wc-cal-event")) { 330 | options.eventClick($target.data("calEvent"), $target, event); 331 | } else if ($target.parent().hasClass("wc-cal-event")) { 332 | options.eventClick($target.parent().data("calEvent"), $target.parent(), event); 333 | } 334 | }).mouseover(function(event) { 335 | var $target = $(event.target); 336 | 337 | if (self._isDraggingOrResizing($target)) { 338 | return; 339 | } 340 | 341 | if ($target.hasClass("wc-cal-event")) { 342 | options.eventMouseover($target.data("calEvent"), $target, event); 343 | } 344 | }).mouseout(function(event) { 345 | var $target = $(event.target); 346 | if (self._isDraggingOrResizing($target)) { 347 | return; 348 | } 349 | if ($target.hasClass("wc-cal-event")) { 350 | if ($target.data("sizing")) return; 351 | options.eventMouseout($target.data("calEvent"), $target, event); 352 | 353 | } 354 | }); 355 | }, 356 | 357 | /* 358 | * check if a ui draggable or resizable is currently being dragged or resized 359 | */ 360 | _isDraggingOrResizing : function ($target) { 361 | return $target.hasClass("ui-draggable-dragging") || $target.hasClass("ui-resizable-resizing"); 362 | }, 363 | 364 | /* 365 | * Render the main calendar layout 366 | */ 367 | _renderCalendar : function() { 368 | 369 | var $calendarContainer, calendarNavHtml, calendarHeaderHtml, calendarBodyHtml, $weekDayColumns; 370 | var self = this; 371 | var options = this.options; 372 | 373 | $calendarContainer = $("
").appendTo(self.element); 374 | 375 | if (options.buttons) { 376 | calendarNavHtml = "
\ 377 | \ 378 | \ 379 | \ 380 |
"; 381 | 382 | $(calendarNavHtml).appendTo($calendarContainer); 383 | 384 | $calendarContainer.find(".wc-nav .wc-today").click(function() { 385 | self.element.weekCalendar("today"); 386 | return false; 387 | }); 388 | 389 | $calendarContainer.find(".wc-nav .wc-prev").click(function() { 390 | self.element.weekCalendar("prevWeek"); 391 | return false; 392 | }); 393 | 394 | $calendarContainer.find(".wc-nav .wc-next").click(function() { 395 | self.element.weekCalendar("nextWeek"); 396 | return false; 397 | }); 398 | 399 | } 400 | 401 | //render calendar header 402 | calendarHeaderHtml = ""; 403 | for (var i = 1; i <= options.daysToShow; i++) { 404 | calendarHeaderHtml += ""; 405 | } 406 | calendarHeaderHtml += "
"; 407 | 408 | //render calendar body 409 | calendarBodyHtml = "
\ 410 | \ 411 | \ 412 | \ 413 | \ 414 | "; 443 | 444 | for (var i = 1; i <= options.daysToShow; i++) { 445 | calendarBodyHtml += "" 446 | } 447 | 448 | calendarBodyHtml += "
\ 415 |
\ 416 |
"; 417 | 418 | var start = options.businessHours.limitDisplay ? options.businessHours.start : 0; 419 | var end = options.businessHours.limitDisplay ? options.businessHours.end : 24; 420 | 421 | for (var i = start; i < end; i++) { 422 | for (var j = 0; j < options.timeslotsPerHour - 1; j++) { 423 | calendarBodyHtml += "
"; 424 | } 425 | calendarBodyHtml += "
"; 426 | } 427 | 428 | calendarBodyHtml += "
"; 429 | 430 | for (var i = start; i < end; i++) { 431 | 432 | var bhClass = (options.businessHours.start <= i && options.businessHours.end > i) ? "wc-business-hours" : ""; 433 | calendarBodyHtml += "
" 434 | if (options.use24Hour) { 435 | calendarBodyHtml += "
" + self._24HourForIndex(i) + "
"; 436 | } else { 437 | calendarBodyHtml += "
" + self._hourForIndex(i) + "" + self._amOrPm(i) + "
"; 438 | } 439 | calendarBodyHtml += "
"; 440 | } 441 | 442 | calendarBodyHtml += "
"; 449 | 450 | //append all calendar parts to container 451 | $(calendarHeaderHtml + calendarBodyHtml).appendTo($calendarContainer); 452 | 453 | $weekDayColumns = $calendarContainer.find(".wc-day-column-inner"); 454 | $weekDayColumns.each(function(i, val) { 455 | $(this).height(options.timeslotHeight * options.timeslotsPerDay); 456 | if (!options.readonly) { 457 | self._addDroppableToWeekDay($(this)); 458 | self._setupEventCreationForWeekDay($(this)); 459 | } 460 | }); 461 | 462 | $calendarContainer.find(".wc-time-slot").height(options.timeslotHeight - 1); //account for border 463 | 464 | $calendarContainer.find(".wc-time-header-cell").css({ 465 | height : (options.timeslotHeight * options.timeslotsPerHour) - 11, 466 | padding: 5 467 | }); 468 | 469 | 470 | }, 471 | 472 | /* 473 | * setup mouse events for capturing new events 474 | */ 475 | _setupEventCreationForWeekDay : function($weekDay) { 476 | var self = this; 477 | var options = this.options; 478 | $weekDay.mousedown(function(event) { 479 | var $target = $(event.target); 480 | if ($target.hasClass("wc-day-column-inner")) { 481 | 482 | var $newEvent = $("
"); 483 | 484 | $newEvent.css({lineHeight: (options.timeslotHeight - 2) + "px", fontSize: (options.timeslotHeight / 2) + "px"}); 485 | $target.append($newEvent); 486 | 487 | var columnOffset = $target.offset().top; 488 | var clickY = event.pageY - columnOffset; 489 | var clickYRounded = (clickY - (clickY % options.timeslotHeight)) / options.timeslotHeight; 490 | var topPosition = clickYRounded * options.timeslotHeight; 491 | $newEvent.css({top: topPosition}); 492 | 493 | $target.bind("mousemove.newevent", function(event) { 494 | $newEvent.show(); 495 | $newEvent.addClass("ui-resizable-resizing"); 496 | var height = Math.round(event.pageY - columnOffset - topPosition); 497 | var remainder = height % options.timeslotHeight; 498 | //snap to closest timeslot 499 | if (remainder < (height / 2)) { 500 | var useHeight = height - remainder; 501 | $newEvent.css("height", useHeight < options.timeslotHeight ? options.timeslotHeight : useHeight); 502 | } else { 503 | $newEvent.css("height", height + (options.timeslotHeight - remainder)); 504 | } 505 | }).mouseup(function() { 506 | $target.unbind("mousemove.newevent"); 507 | $newEvent.addClass("ui-corner-all"); 508 | }); 509 | } 510 | 511 | }).mouseup(function(event) { 512 | var $target = $(event.target); 513 | 514 | var $weekDay = $target.closest(".wc-day-column-inner"); 515 | var $newEvent = $weekDay.find(".wc-new-cal-event-creating"); 516 | 517 | if ($newEvent.length) { 518 | //if even created from a single click only, default height 519 | if (!$newEvent.hasClass("ui-resizable-resizing")) { 520 | $newEvent.css({height: options.timeslotHeight * options.defaultEventLength}).show(); 521 | } 522 | var top = parseInt($newEvent.css("top")); 523 | var eventDuration = self._getEventDurationFromPositionedEventElement($weekDay, $newEvent, top); 524 | 525 | $newEvent.remove(); 526 | var newCalEvent = {start: eventDuration.start, end: eventDuration.end, title: options.newEventText}; 527 | var $renderedCalEvent = self._renderEvent(newCalEvent, $weekDay); 528 | 529 | if (!options.allowCalEventOverlap) { 530 | self._adjustForEventCollisions($weekDay, $renderedCalEvent, newCalEvent, newCalEvent); 531 | self._positionEvent($weekDay, $renderedCalEvent); 532 | } else { 533 | self._adjustOverlappingEvents($weekDay); 534 | } 535 | 536 | options.eventNew(eventDuration, $renderedCalEvent); 537 | } 538 | }); 539 | }, 540 | 541 | /* 542 | * load calendar events for the week based on the date provided 543 | */ 544 | _loadCalEvents : function(dateWithinWeek) { 545 | 546 | var date, weekStartDate, endDate, $weekDayColumns; 547 | var self = this; 548 | 549 | 550 | 551 | var options = this.options; 552 | date = dateWithinWeek || options.date; 553 | weekStartDate = self._dateFirstDayOfWeek(date); 554 | 555 | weekEndDate = self._dateLastMilliOfWeek(date); 556 | 557 | options.calendarBeforeLoad(self.element); 558 | 559 | self.element.data("startDate", weekStartDate); 560 | self.element.data("endDate", weekEndDate); 561 | 562 | $weekDayColumns = self.element.find(".wc-day-column-inner"); 563 | 564 | self._updateDayColumnHeader($weekDayColumns); 565 | 566 | //load events by chosen means 567 | if (typeof options.data == 'string') { 568 | if (options.loading) options.loading(true); 569 | var jsonOptions = {}; 570 | jsonOptions[options.startParam || 'start'] = Math.round(weekStartDate.getTime() / 1000); 571 | jsonOptions[options.endParam || 'end'] = Math.round(weekEndDate.getTime() / 1000); 572 | $.getJSON(options.data, jsonOptions, function(data) { 573 | self._renderEvents(data, $weekDayColumns); 574 | if (options.loading) options.loading(false); 575 | }); 576 | } 577 | else if ($.isFunction(options.data)) { 578 | options.data(weekStartDate, weekEndDate, 579 | function(data) { 580 | self._renderEvents(data, $weekDayColumns); 581 | }); 582 | } 583 | else if (options.data) { 584 | self._renderEvents(options.data, $weekDayColumns); 585 | } 586 | 587 | self._disableTextSelect($weekDayColumns); 588 | 589 | 590 | }, 591 | 592 | /* 593 | * update the display of each day column header based on the calendar week 594 | */ 595 | _updateDayColumnHeader : function ($weekDayColumns) { 596 | var self = this; 597 | var options = this.options; 598 | var currentDay = self._cloneDate(self.element.data("startDate")); 599 | 600 | self.element.find(".wc-header td.wc-day-column-header").each(function(i, val) { 601 | 602 | var dayName = options.useShortDayNames ? options.shortDays[currentDay.getDay()] : options.longDays[currentDay.getDay()]; 603 | 604 | $(this).html(dayName + "
" + self._formatDate(currentDay, options.dateFormat)); 605 | if (self._isToday(currentDay)) { 606 | $(this).addClass("wc-today"); 607 | } else { 608 | $(this).removeClass("wc-today"); 609 | } 610 | currentDay = self._addDays(currentDay, 1); 611 | 612 | }); 613 | 614 | currentDay = self._dateFirstDayOfWeek(self._cloneDate(self.element.data("startDate"))); 615 | 616 | $weekDayColumns.each(function(i, val) { 617 | 618 | $(this).data("startDate", self._cloneDate(currentDay)); 619 | $(this).data("endDate", new Date(currentDay.getTime() + (MILLIS_IN_DAY))); 620 | if (self._isToday(currentDay)) { 621 | $(this).parent().addClass("wc-today"); 622 | } else { 623 | $(this).parent().removeClass("wc-today"); 624 | } 625 | 626 | currentDay = self._addDays(currentDay, 1); 627 | }); 628 | 629 | }, 630 | 631 | /* 632 | * Render the events into the calendar 633 | */ 634 | _renderEvents : function (data, $weekDayColumns) { 635 | 636 | this._clearCalendar(); 637 | 638 | var self = this; 639 | var options = this.options; 640 | var eventsToRender; 641 | 642 | if ($.isArray(data)) { 643 | eventsToRender = self._cleanEvents(data); 644 | } else if (data.events) { 645 | eventsToRender = self._cleanEvents(data.events); 646 | } 647 | 648 | if (data.options) { 649 | 650 | var updateLayout = false; 651 | //update options 652 | $.each(data.options, function(key, value) { 653 | if (value !== options[key]) { 654 | options[key] = value; 655 | updateLayout = true; 656 | } 657 | }); 658 | 659 | self._computeOptions(); 660 | 661 | if (updateLayout) { 662 | self.element.empty(); 663 | self._renderCalendar(); 664 | $weekDayColumns = self.element.find(".wc-time-slots .wc-day-column-inner"); 665 | self._updateDayColumnHeader($weekDayColumns); 666 | self._resizeCalendar(); 667 | } 668 | 669 | } 670 | 671 | 672 | $.each(eventsToRender, function(i, calEvent) { 673 | 674 | var $weekDay = self._findWeekDayForEvent(calEvent, $weekDayColumns); 675 | 676 | if ($weekDay) { 677 | self._renderEvent(calEvent, $weekDay); 678 | } 679 | }); 680 | 681 | $weekDayColumns.each(function() { 682 | self._adjustOverlappingEvents($(this)); 683 | }); 684 | 685 | options.calendarAfterLoad(self.element); 686 | 687 | if (!eventsToRender.length) { 688 | options.noEvents(); 689 | } 690 | 691 | }, 692 | 693 | /* 694 | * Render a specific event into the day provided. Assumes correct 695 | * day for calEvent date 696 | */ 697 | _renderEvent: function (calEvent, $weekDay) { 698 | var self = this; 699 | var options = this.options; 700 | if (calEvent.start.getTime() > calEvent.end.getTime()) { 701 | return; // can't render a negative height 702 | } 703 | 704 | var eventClass, eventHtml, $calEvent, $modifiedEvent; 705 | 706 | eventClass = calEvent.id ? "wc-cal-event" : "wc-cal-event wc-new-cal-event"; 707 | eventHtml = "
\ 708 |
\ 709 |
"; 710 | 711 | $calEvent = $(eventHtml); 712 | $modifiedEvent = options.eventRender(calEvent, $calEvent); 713 | $calEvent = $modifiedEvent ? $modifiedEvent.appendTo($weekDay) : $calEvent.appendTo($weekDay); 714 | $calEvent.css({lineHeight: (options.timeslotHeight - 2) + "px", fontSize: (options.timeslotHeight / 2) + "px"}); 715 | 716 | self._refreshEventDetails(calEvent, $calEvent); 717 | self._positionEvent($weekDay, $calEvent); 718 | $calEvent.show(); 719 | 720 | if (!options.readonly && options.resizable(calEvent, $calEvent)) { 721 | self._addResizableToCalEvent(calEvent, $calEvent, $weekDay) 722 | } 723 | if (!options.readonly && options.draggable(calEvent, $calEvent)) { 724 | self._addDraggableToCalEvent(calEvent, $calEvent); 725 | } 726 | 727 | options.eventAfterRender(calEvent, $calEvent); 728 | 729 | return $calEvent; 730 | 731 | }, 732 | 733 | _adjustOverlappingEvents : function($weekDay) { 734 | var self = this; 735 | if (self.options.allowCalEventOverlap) { 736 | var groupsList = self._groupOverlappingEventElements($weekDay); 737 | $.each(groupsList, function() { 738 | var curGroups = this; 739 | $.each(curGroups, function(groupIndex) { 740 | var curGroup = this; 741 | 742 | // do we want events to be displayed as overlapping 743 | if (self.options.overlapEventsSeparate) { 744 | var newWidth = 100 / curGroups.length; 745 | var newLeft = groupIndex * newWidth; 746 | } else { 747 | // TODO what happens when the group has more than 10 elements 748 | var newWidth = 100 - ( (curGroups.length - 1) * 10 ); 749 | var newLeft = groupIndex * 10; 750 | } 751 | $.each(curGroup, function() { 752 | // bring mouseovered event to the front 753 | if (!self.options.overlapEventsSeparate) { 754 | $(this).bind("mouseover.z-index", function() { 755 | var $elem = $(this); 756 | $.each(curGroup, function() { 757 | $(this).css({"z-index": "1"}); 758 | }); 759 | $elem.css({"z-index": "3"}); 760 | }); 761 | } 762 | $(this).css({width: newWidth + "%", left:newLeft + "%", right: 0}); 763 | }); 764 | }); 765 | }); 766 | } 767 | }, 768 | 769 | 770 | /* 771 | * Find groups of overlapping events 772 | */ 773 | _groupOverlappingEventElements : function($weekDay) { 774 | var $events = $weekDay.find(".wc-cal-event:visible"); 775 | var sortedEvents = $events.sort(function(a, b) { 776 | return $(a).data("calEvent").start.getTime() - $(b).data("calEvent").start.getTime(); 777 | }); 778 | 779 | var lastEndTime = new Date(0, 0, 0); 780 | var groups = []; 781 | var curGroups = []; 782 | var $curEvent; 783 | $.each(sortedEvents, function() { 784 | $curEvent = $(this); 785 | //checks, if the current group list is not empty, if the overlapping is finished 786 | if (curGroups.length > 0) { 787 | if (lastEndTime.getTime() <= $curEvent.data("calEvent").start.getTime()) { 788 | //finishes the current group list by adding it to the resulting list of groups and cleans it 789 | 790 | groups.push(curGroups); 791 | curGroups = []; 792 | } 793 | } 794 | 795 | //finds the first group to fill with the event 796 | for (var groupIndex = 0; groupIndex < curGroups.length; groupIndex++) { 797 | if (curGroups[groupIndex].length > 0) { 798 | //checks if the event starts after the end of the last event of the group 799 | if (curGroups[groupIndex][curGroups [groupIndex].length - 1].data("calEvent").end.getTime() <= $curEvent.data("calEvent").start.getTime()) { 800 | curGroups[groupIndex].push($curEvent); 801 | if (lastEndTime.getTime() < $curEvent.data("calEvent").end.getTime()) { 802 | lastEndTime = $curEvent.data("calEvent").end; 803 | } 804 | return; 805 | } 806 | } 807 | } 808 | //if not found, creates a new group 809 | curGroups.push([$curEvent]); 810 | if (lastEndTime.getTime() < $curEvent.data("calEvent").end.getTime()) { 811 | lastEndTime = $curEvent.data("calEvent").end; 812 | } 813 | }); 814 | //adds the last groups in result 815 | if (curGroups.length > 0) { 816 | groups.push(curGroups); 817 | } 818 | return groups; 819 | }, 820 | 821 | 822 | /* 823 | * find the weekday in the current calendar that the calEvent falls within 824 | */ 825 | _findWeekDayForEvent : function(calEvent, $weekDayColumns) { 826 | 827 | var $weekDay; 828 | $weekDayColumns.each(function() { 829 | if ($(this).data("startDate").getTime() <= calEvent.start.getTime() && $(this).data("endDate").getTime() >= calEvent.end.getTime()) { 830 | $weekDay = $(this); 831 | return false; 832 | } 833 | }); 834 | return $weekDay; 835 | }, 836 | 837 | /* 838 | * update the events rendering in the calendar. Add if does not yet exist. 839 | */ 840 | _updateEventInCalendar : function (calEvent) { 841 | var self = this; 842 | var options = this.options; 843 | self._cleanEvent(calEvent); 844 | 845 | if (calEvent.id) { 846 | self.element.find(".wc-cal-event").each(function() { 847 | if ($(this).data("calEvent").id === calEvent.id || $(this).hasClass("wc-new-cal-event")) { 848 | $(this).remove(); 849 | return false; 850 | } 851 | }); 852 | } 853 | 854 | var $weekDay = self._findWeekDayForEvent(calEvent, self.element.find(".wc-time-slots .wc-day-column-inner")); 855 | if ($weekDay) { 856 | var $calEvent = self._renderEvent(calEvent, $weekDay); 857 | self._adjustForEventCollisions($weekDay, $calEvent, calEvent, calEvent); 858 | self._refreshEventDetails(calEvent, $calEvent); 859 | self._positionEvent($weekDay, $calEvent); 860 | self._adjustOverlappingEvents($weekDay); 861 | } 862 | }, 863 | 864 | /* 865 | * Position the event element within the weekday based on it's start / end dates. 866 | */ 867 | _positionEvent : function($weekDay, $calEvent) { 868 | var options = this.options; 869 | var calEvent = $calEvent.data("calEvent"); 870 | var pxPerMillis = $weekDay.height() / options.millisToDisplay; 871 | var firstHourDisplayed = options.businessHours.limitDisplay ? options.businessHours.start : 0; 872 | var startMillis = calEvent.start.getTime() - new Date(calEvent.start.getFullYear(), calEvent.start.getMonth(), calEvent.start.getDate(), firstHourDisplayed).getTime(); 873 | var eventMillis = calEvent.end.getTime() - calEvent.start.getTime(); 874 | var pxTop = pxPerMillis * startMillis; 875 | var pxHeight = pxPerMillis * eventMillis; 876 | $calEvent.css({top: pxTop, height: pxHeight}); 877 | }, 878 | 879 | /* 880 | * Determine the actual start and end times of a calevent based on it's 881 | * relative position within the weekday column and the starting hour of the 882 | * displayed calendar. 883 | */ 884 | _getEventDurationFromPositionedEventElement : function($weekDay, $calEvent, top) { 885 | var options = this.options; 886 | var startOffsetMillis = options.businessHours.limitDisplay ? options.businessHours.start * 60 * 60 * 1000 : 0; 887 | var start = new Date($weekDay.data("startDate").getTime() + startOffsetMillis + Math.round(top / options.timeslotHeight) * options.millisPerTimeslot); 888 | var end = new Date(start.getTime() + ($calEvent.height() / options.timeslotHeight) * options.millisPerTimeslot); 889 | return {start: start, end: end}; 890 | }, 891 | 892 | /* 893 | * If the calendar does not allow event overlap, adjust the start or end date if necessary to 894 | * avoid overlapping of events. Typically, shortens the resized / dropped event to it's max possible 895 | * duration based on the overlap. If no satisfactory adjustment can be made, the event is reverted to 896 | * it's original location. 897 | */ 898 | _adjustForEventCollisions : function($weekDay, $calEvent, newCalEvent, oldCalEvent, maintainEventDuration) { 899 | var options = this.options; 900 | 901 | if (options.allowCalEventOverlap) { 902 | return; 903 | } 904 | var adjustedStart, adjustedEnd; 905 | var self = this; 906 | 907 | $weekDay.find(".wc-cal-event").not($calEvent).each(function() { 908 | var currentCalEvent = $(this).data("calEvent"); 909 | 910 | //has been dropped onto existing event overlapping the end time 911 | if (newCalEvent.start.getTime() < currentCalEvent.end.getTime() 912 | && newCalEvent.end.getTime() >= currentCalEvent.end.getTime()) { 913 | 914 | adjustedStart = currentCalEvent.end; 915 | } 916 | 917 | 918 | //has been dropped onto existing event overlapping the start time 919 | if (newCalEvent.end.getTime() > currentCalEvent.start.getTime() 920 | && newCalEvent.start.getTime() <= currentCalEvent.start.getTime()) { 921 | 922 | adjustedEnd = currentCalEvent.start; 923 | } 924 | //has been dropped inside existing event with same or larger duration 925 | if (oldCalEvent.resizable == false || (newCalEvent.end.getTime() <= currentCalEvent.end.getTime() 926 | && newCalEvent.start.getTime() >= currentCalEvent.start.getTime())) { 927 | 928 | adjustedStart = oldCalEvent.start; 929 | adjustedEnd = oldCalEvent.end; 930 | return false; 931 | } 932 | 933 | }); 934 | 935 | 936 | newCalEvent.start = adjustedStart || newCalEvent.start; 937 | 938 | if (adjustedStart && maintainEventDuration) { 939 | newCalEvent.end = new Date(adjustedStart.getTime() + (oldCalEvent.end.getTime() - oldCalEvent.start.getTime())); 940 | self._adjustForEventCollisions($weekDay, $calEvent, newCalEvent, oldCalEvent); 941 | } else { 942 | newCalEvent.end = adjustedEnd || newCalEvent.end; 943 | } 944 | 945 | 946 | //reset if new cal event has been forced to zero size 947 | if (newCalEvent.start.getTime() >= newCalEvent.end.getTime()) { 948 | newCalEvent.start = oldCalEvent.start; 949 | newCalEvent.end = oldCalEvent.end; 950 | } 951 | 952 | $calEvent.data("calEvent", newCalEvent); 953 | }, 954 | 955 | /* 956 | * Add draggable capabilities to an event 957 | */ 958 | _addDraggableToCalEvent : function(calEvent, $calEvent) { 959 | var self = this; 960 | var options = this.options; 961 | var $weekDay = self._findWeekDayForEvent(calEvent, self.element.find(".wc-time-slots .wc-day-column-inner")); 962 | $calEvent.draggable({ 963 | handle : ".wc-time", 964 | containment: ".wc-scrollable-grid", 965 | revert: 'valid', 966 | opacity: 0.5, 967 | grid : [$calEvent.outerWidth() + 1, options.timeslotHeight ], 968 | start : function(event, ui) { 969 | var $calEvent = ui.draggable; 970 | options.eventDrag(calEvent, $calEvent); 971 | } 972 | }); 973 | 974 | }, 975 | 976 | /* 977 | * Add droppable capabilites to weekdays to allow dropping of calEvents only 978 | */ 979 | _addDroppableToWeekDay : function($weekDay) { 980 | var self = this; 981 | var options = this.options; 982 | $weekDay.droppable({ 983 | accept: ".wc-cal-event", 984 | drop: function(event, ui) { 985 | var $calEvent = ui.draggable; 986 | var top = Math.round(parseInt(ui.position.top)); 987 | var eventDuration = self._getEventDurationFromPositionedEventElement($weekDay, $calEvent, top); 988 | var calEvent = $calEvent.data("calEvent"); 989 | 990 | 991 | 992 | var newCalEvent = $.extend(true, {}, calEvent, {start: eventDuration.start, end: eventDuration.end}); 993 | self._adjustForEventCollisions($weekDay, $calEvent, newCalEvent, calEvent, true); 994 | var $weekDayColumns = self.element.find(".wc-day-column-inner"); 995 | 996 | //trigger drop callback 997 | options.eventDrop(newCalEvent, calEvent, $newEvent); 998 | 999 | var $newEvent = self._renderEvent(newCalEvent, self._findWeekDayForEvent(newCalEvent, $weekDayColumns)); 1000 | $calEvent.hide(); 1001 | 1002 | $calEvent.data("preventClick", true); 1003 | 1004 | var $weekDayOld = self._findWeekDayForEvent($calEvent.data("calEvent"), self.element.find(".wc-time-slots .wc-day-column-inner")); 1005 | 1006 | if ($weekDayOld.data("startDate") != $weekDay.data("startDate")) { 1007 | self._adjustOverlappingEvents($weekDayOld); 1008 | } 1009 | self._adjustOverlappingEvents($weekDay); 1010 | 1011 | setTimeout(function() { 1012 | $calEvent.remove(); 1013 | }, 1000); 1014 | 1015 | } 1016 | }); 1017 | }, 1018 | 1019 | /* 1020 | * Add resizable capabilities to a calEvent 1021 | */ 1022 | _addResizableToCalEvent : function(calEvent, $calEvent, $weekDay) { 1023 | var self = this; 1024 | var options = this.options; 1025 | $calEvent.resizable({ 1026 | grid: options.timeslotHeight, 1027 | containment : $weekDay, 1028 | handles: "s", 1029 | minHeight: options.timeslotHeight, 1030 | stop :function(event, ui) { 1031 | var $calEvent = ui.element; 1032 | var newEnd = new Date($calEvent.data("calEvent").start.getTime() + ($calEvent.height() / options.timeslotHeight) * options.millisPerTimeslot); 1033 | var newCalEvent = $.extend(true, {}, calEvent, {start: calEvent.start, end: newEnd}); 1034 | self._adjustForEventCollisions($weekDay, $calEvent, newCalEvent, calEvent); 1035 | 1036 | self._refreshEventDetails(newCalEvent, $calEvent); 1037 | self._positionEvent($weekDay, $calEvent); 1038 | self._adjustOverlappingEvents($weekDay); 1039 | //trigger resize callback 1040 | options.eventResize(newCalEvent, calEvent, $calEvent); 1041 | $calEvent.data("preventClick", true); 1042 | setTimeout(function() { 1043 | $calEvent.removeData("preventClick"); 1044 | }, 500); 1045 | } 1046 | }); 1047 | }, 1048 | 1049 | /* 1050 | * Refresh the displayed details of a calEvent in the calendar 1051 | */ 1052 | _refreshEventDetails : function(calEvent, $calEvent) { 1053 | var self = this; 1054 | var options = this.options; 1055 | var one_hour = 3600000; 1056 | var displayTitleWithTime = calEvent.end.getTime()-calEvent.start.getTime() <= (one_hour/options.timeslotsPerHour); 1057 | if (displayTitleWithTime){ 1058 | $calEvent.find(".wc-time").html(self._formatDate(calEvent.start, options.timeFormat) + ": " + calEvent.title); 1059 | } 1060 | else { 1061 | $calEvent.find(".wc-time").html(self._formatDate(calEvent.start, options.timeFormat) + options.timeSeparator + self._formatDate(calEvent.end, options.timeFormat)); 1062 | } 1063 | $calEvent.find(".wc-title").html(calEvent.title); 1064 | $calEvent.data("calEvent", calEvent); 1065 | }, 1066 | 1067 | /* 1068 | * Clear all cal events from the calendar 1069 | */ 1070 | _clearCalendar : function() { 1071 | this.element.find(".wc-day-column-inner div").remove(); 1072 | }, 1073 | 1074 | /* 1075 | * Scroll the calendar to a specific hour 1076 | */ 1077 | _scrollToHour : function(hour) { 1078 | var self = this; 1079 | var options = this.options; 1080 | var $scrollable = this.element.find(".wc-scrollable-grid"); 1081 | var slot = hour; 1082 | if (self.options.businessHours.limitDisplay) { 1083 | if (hour <= self.options.businessHours.start) { 1084 | slot = 0; 1085 | } else if (hour > self.options.businessHours.end) { 1086 | slot = self.options.businessHours.end - 1087 | self.options.businessHours.start - 1; 1088 | } else { 1089 | slot = hour - self.options.businessHours.start; 1090 | } 1091 | 1092 | } 1093 | 1094 | var $target = this.element.find(".wc-grid-timeslot-header .wc-hour-header:eq(" + slot + ")"); 1095 | 1096 | $scrollable.animate({scrollTop: 0}, 0, function() { 1097 | var targetOffset = $target.offset().top; 1098 | var scroll = targetOffset - $scrollable.offset().top - $target.outerHeight(); 1099 | $scrollable.animate({scrollTop: scroll}, options.scrollToHourMillis); 1100 | }); 1101 | }, 1102 | 1103 | /* 1104 | * find the hour (12 hour day) for a given hour index 1105 | */ 1106 | _hourForIndex : function(index) { 1107 | if (index === 0) { //midnight 1108 | return 12; 1109 | } else if (index < 13) { //am 1110 | return index; 1111 | } else { //pm 1112 | return index - 12; 1113 | } 1114 | }, 1115 | 1116 | _24HourForIndex : function(index) { 1117 | if (index === 0) { //midnight 1118 | return "00:00"; 1119 | } else if (index < 10) { 1120 | return "0" + index + ":00"; 1121 | } else { 1122 | return index + ":00"; 1123 | } 1124 | }, 1125 | 1126 | _amOrPm : function (hourOfDay) { 1127 | return hourOfDay < 12 ? "AM" : "PM"; 1128 | }, 1129 | 1130 | _isToday : function(date) { 1131 | var clonedDate = this._cloneDate(date); 1132 | this._clearTime(clonedDate); 1133 | var today = new Date(); 1134 | this._clearTime(today); 1135 | return today.getTime() === clonedDate.getTime(); 1136 | }, 1137 | 1138 | /* 1139 | * Clean events to ensure correct format 1140 | */ 1141 | _cleanEvents : function(events) { 1142 | var self = this; 1143 | $.each(events, function(i, event) { 1144 | self._cleanEvent(event); 1145 | }); 1146 | return events; 1147 | }, 1148 | 1149 | /* 1150 | * Clean specific event 1151 | */ 1152 | _cleanEvent : function (event) { 1153 | if (event.date) { 1154 | event.start = event.date; 1155 | } 1156 | event.start = this._cleanDate(event.start); 1157 | event.end = this._cleanDate(event.end); 1158 | if (!event.end) { 1159 | event.end = this._addDays(this._cloneDate(event.start), 1); 1160 | } 1161 | }, 1162 | 1163 | /* 1164 | * Disable text selection of the elements in different browsers 1165 | */ 1166 | _disableTextSelect : function($elements) { 1167 | $elements.each(function() { 1168 | if ($.browser.mozilla) {//Firefox 1169 | $(this).css('MozUserSelect', 'none'); 1170 | } else if ($.browser.msie) {//IE 1171 | $(this).bind('selectstart', function() { 1172 | return false; 1173 | }); 1174 | } else {//Opera, etc. 1175 | $(this).mousedown(function() { 1176 | return false; 1177 | }); 1178 | } 1179 | }); 1180 | }, 1181 | 1182 | /* 1183 | * returns the date on the first millisecond of the week 1184 | */ 1185 | 1186 | _dateFirstDayOfWeek : function(date) { 1187 | var self = this; 1188 | var midnightCurrentDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); 1189 | var adjustedDate = new Date(midnightCurrentDate); 1190 | adjustedDate.setDate(adjustedDate.getDate() - self._getAdjustedDayIndex(midnightCurrentDate)); 1191 | 1192 | return adjustedDate; 1193 | 1194 | }, 1195 | 1196 | /* 1197 | * returns the date on the first millisecond of the last day of the week 1198 | */ 1199 | _dateLastDayOfWeek : function(date) { 1200 | 1201 | 1202 | var self = this; 1203 | var midnightCurrentDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); 1204 | var adjustedDate = new Date(midnightCurrentDate); 1205 | adjustedDate.setDate(adjustedDate.getDate() + (6 - this._getAdjustedDayIndex(midnightCurrentDate))); 1206 | 1207 | return adjustedDate; 1208 | 1209 | }, 1210 | 1211 | /* 1212 | * gets the index of the current day adjusted based on options 1213 | */ 1214 | _getAdjustedDayIndex : function(date) { 1215 | 1216 | var midnightCurrentDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); 1217 | var currentDayOfStandardWeek = midnightCurrentDate.getDay(); 1218 | var days = [0,1,2,3,4,5,6]; 1219 | this._rotate(days, this.options.firstDayOfWeek); 1220 | return days[currentDayOfStandardWeek]; 1221 | }, 1222 | 1223 | /* 1224 | * returns the date on the last millisecond of the week 1225 | */ 1226 | _dateLastMilliOfWeek : function(date) { 1227 | var lastDayOfWeek = this._dateLastDayOfWeek(date); 1228 | return new Date(lastDayOfWeek.getTime() + (MILLIS_IN_DAY)); 1229 | 1230 | }, 1231 | 1232 | /* 1233 | * Clear the time components of a date leaving the date 1234 | * of the first milli of day 1235 | */ 1236 | _clearTime : function(d) { 1237 | d.setHours(0); 1238 | d.setMinutes(0); 1239 | d.setSeconds(0); 1240 | d.setMilliseconds(0); 1241 | return d; 1242 | }, 1243 | 1244 | /* 1245 | * add specific number of days to date 1246 | */ 1247 | _addDays : function(d, n, keepTime) { 1248 | d.setDate(d.getDate() + n); 1249 | if (keepTime) { 1250 | return d; 1251 | } 1252 | return this._clearTime(d); 1253 | }, 1254 | 1255 | /* 1256 | * Rotate an array by specified number of places. 1257 | */ 1258 | _rotate : function(a /*array*/, p /* integer, positive integer rotate to the right, negative to the left... */) { 1259 | for (var l = a.length, p = (Math.abs(p) >= l && (p %= l),p < 0 && (p += l),p), i, x; p; p = (Math.ceil(l / p) - 1) * p - l + (l = p)) { 1260 | for (i = l; i > p; x = a[--i],a[i] = a[i - p],a[i - p] = x); 1261 | } 1262 | return a; 1263 | }, 1264 | 1265 | _cloneDate : function(d) { 1266 | return new Date(d.getTime()); 1267 | }, 1268 | 1269 | /* 1270 | * return a date for different representations 1271 | */ 1272 | _cleanDate : function(d) { 1273 | if (typeof d == 'string') { 1274 | return $.weekCalendar.parseISO8601(d, true) || Date.parse(d) || new Date(parseInt(d)); 1275 | } 1276 | if (typeof d == 'number') { 1277 | return new Date(d); 1278 | } 1279 | return d; 1280 | }, 1281 | 1282 | /* 1283 | * date formatting is adapted from 1284 | * http://jacwright.com/projects/javascript/date_format 1285 | */ 1286 | _formatDate : function(date, format) { 1287 | var options = this.options; 1288 | var returnStr = ''; 1289 | for (var i = 0; i < format.length; i++) { 1290 | var curChar = format.charAt(i); 1291 | if ($.isFunction(this._replaceChars[curChar])) { 1292 | var res = this._replaceChars[curChar](date, options); 1293 | 1294 | if (res === '00' && options.alwaysDisplayTimeMinutes === false) { 1295 | //remove previous character 1296 | returnStr = returnStr.slice(0, -1); 1297 | } else { 1298 | 1299 | returnStr += res; 1300 | } 1301 | } else { 1302 | returnStr += curChar; 1303 | } 1304 | } 1305 | 1306 | return returnStr; 1307 | }, 1308 | 1309 | _replaceChars : { 1310 | 1311 | // Day 1312 | d: function(date) { 1313 | return (date.getDate() < 10 ? '0' : '') + date.getDate(); 1314 | }, 1315 | D: function(date, options) { 1316 | return options.shortDays[date.getDay()]; 1317 | }, 1318 | j: function(date) { 1319 | return date.getDate(); 1320 | }, 1321 | l: function(date, options) { 1322 | return options.longDays[date.getDay()]; 1323 | }, 1324 | N: function(date) { 1325 | return date.getDay() + 1; 1326 | }, 1327 | S: function(date) { 1328 | return (date.getDate() % 10 == 1 && date.getDate() != 11 ? 'st' : (date.getDate() % 10 == 2 && date.getDate() != 12 ? 'nd' : (date.getDate() % 10 == 3 && date.getDate() != 13 ? 'rd' : 'th'))); 1329 | }, 1330 | w: function(date) { 1331 | return date.getDay(); 1332 | }, 1333 | z: function(date) { 1334 | return "Not Yet Supported"; 1335 | }, 1336 | // Week 1337 | W: function(date) { 1338 | return "Not Yet Supported"; 1339 | }, 1340 | // Month 1341 | F: function(date, options) { 1342 | return options.longMonths[date.getMonth()]; 1343 | }, 1344 | m: function(date) { 1345 | return (date.getMonth() < 9 ? '0' : '') + (date.getMonth() + 1); 1346 | }, 1347 | M: function(date, options) { 1348 | return options.shortMonths[date.getMonth()]; 1349 | }, 1350 | n: function(date) { 1351 | return date.getMonth() + 1; 1352 | }, 1353 | t: function(date) { 1354 | return "Not Yet Supported"; 1355 | }, 1356 | // Year 1357 | L: function(date) { 1358 | return "Not Yet Supported"; 1359 | }, 1360 | o: function(date) { 1361 | return "Not Supported"; 1362 | }, 1363 | Y: function(date) { 1364 | return date.getFullYear(); 1365 | }, 1366 | y: function(date) { 1367 | return ('' + date.getFullYear()).substr(2); 1368 | }, 1369 | // Time 1370 | a: function(date) { 1371 | return date.getHours() < 12 ? 'am' : 'pm'; 1372 | }, 1373 | A: function(date) { 1374 | return date.getHours() < 12 ? 'AM' : 'PM'; 1375 | }, 1376 | B: function(date) { 1377 | return "Not Yet Supported"; 1378 | }, 1379 | g: function(date) { 1380 | return date.getHours() % 12 || 12; 1381 | }, 1382 | G: function(date) { 1383 | return date.getHours(); 1384 | }, 1385 | h: function(date) { 1386 | return ((date.getHours() % 12 || 12) < 10 ? '0' : '') + (date.getHours() % 12 || 12); 1387 | }, 1388 | H: function(date) { 1389 | return (date.getHours() < 10 ? '0' : '') + date.getHours(); 1390 | }, 1391 | i: function(date) { 1392 | return (date.getMinutes() < 10 ? '0' : '') + date.getMinutes(); 1393 | }, 1394 | s: function(date) { 1395 | return (date.getSeconds() < 10 ? '0' : '') + date.getSeconds(); 1396 | }, 1397 | // Timezone 1398 | e: function(date) { 1399 | return "Not Yet Supported"; 1400 | }, 1401 | I: function(date) { 1402 | return "Not Supported"; 1403 | }, 1404 | O: function(date) { 1405 | return (date.getTimezoneOffset() < 0 ? '-' : '+') + (date.getTimezoneOffset() / 60 < 10 ? '0' : '') + (date.getTimezoneOffset() / 60) + '00'; 1406 | }, 1407 | T: function(date) { 1408 | return "Not Yet Supported"; 1409 | }, 1410 | Z: function(date) { 1411 | return date.getTimezoneOffset() * 60; 1412 | }, 1413 | // Full Date/Time 1414 | c: function(date) { 1415 | return "Not Yet Supported"; 1416 | }, 1417 | r: function(date) { 1418 | return date.toString(); 1419 | }, 1420 | U: function(date) { 1421 | return date.getTime() / 1000; 1422 | } 1423 | } 1424 | 1425 | }); 1426 | 1427 | $.extend($.ui.weekCalendar, { 1428 | version: '1.2.2-pre', 1429 | 1430 | }); 1431 | 1432 | var MILLIS_IN_DAY = 86400000; 1433 | var MILLIS_IN_WEEK = MILLIS_IN_DAY * 7; 1434 | 1435 | $.weekCalendar = function() { 1436 | return { 1437 | parseISO8601 : function(s, ignoreTimezone) { 1438 | 1439 | // derived from http://delete.me.uk/2005/03/iso8601.html 1440 | var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + 1441 | "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" + 1442 | "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?"; 1443 | var d = s.match(new RegExp(regexp)); 1444 | if (!d) return null; 1445 | var offset = 0; 1446 | var date = new Date(d[1], 0, 1); 1447 | if (d[3]) { 1448 | date.setMonth(d[3] - 1); 1449 | } 1450 | if (d[5]) { 1451 | date.setDate(d[5]); 1452 | } 1453 | if (d[7]) { 1454 | date.setHours(d[7]); 1455 | } 1456 | if (d[8]) { 1457 | date.setMinutes(d[8]); 1458 | } 1459 | if (d[10]) { 1460 | date.setSeconds(d[10]); 1461 | } 1462 | if (d[12]) { 1463 | date.setMilliseconds(Number("0." + d[12]) * 1000); 1464 | } 1465 | if (!ignoreTimezone) { 1466 | if (d[14]) { 1467 | offset = (Number(d[16]) * 60) + Number(d[17]); 1468 | offset *= ((d[15] == '-') ? 1 : -1); 1469 | } 1470 | offset -= date.getTimezoneOffset(); 1471 | } 1472 | return new Date(Number(date) + (offset * 60 * 1000)); 1473 | } 1474 | }; 1475 | }(); 1476 | 1477 | 1478 | })(jQuery); 1479 | -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /libs/css/smoothness/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robmonie/jquery-week-calendar/f2c9a94317740444c945de6b97f929cc58f08d46/libs/css/smoothness/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /libs/css/smoothness/jquery-ui-1.8rc3.custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 3 | * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 4 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 5 | */ 6 | 7 | /* Layout helpers 8 | ----------------------------------*/ 9 | .ui-helper-hidden { display: none; } 10 | .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } 11 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 12 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 13 | .ui-helper-clearfix { display: inline-block; } 14 | /* required comment for clearfix to work in Opera \*/ 15 | * html .ui-helper-clearfix { height:1%; } 16 | .ui-helper-clearfix { display:block; } 17 | /* end clearfix */ 18 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 19 | 20 | 21 | /* Interaction Cues 22 | ----------------------------------*/ 23 | .ui-state-disabled { cursor: default !important; } 24 | 25 | 26 | /* Icons 27 | ----------------------------------*/ 28 | 29 | /* states and images */ 30 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 31 | 32 | 33 | /* Misc visuals 34 | ----------------------------------*/ 35 | 36 | /* Overlays */ 37 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 38 | 39 | 40 | /* 41 | * jQuery UI CSS Framework 42 | * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 43 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 44 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px 45 | */ 46 | 47 | 48 | /* Component containers 49 | ----------------------------------*/ 50 | .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } 51 | .ui-widget .ui-widget { font-size: 1em; } 52 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } 53 | .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } 54 | .ui-widget-content a { color: #222222; } 55 | .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } 56 | .ui-widget-header a { color: #222222; } 57 | 58 | /* Interaction states 59 | ----------------------------------*/ 60 | .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } 61 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } 62 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } 63 | .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } 64 | .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } 65 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } 66 | .ui-widget :active { outline: none; } 67 | 68 | /* Interaction Cues 69 | ----------------------------------*/ 70 | .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } 71 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } 72 | .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } 73 | .ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } 74 | .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } 75 | .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } 76 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } 77 | .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } 78 | 79 | /* Icons 80 | ----------------------------------*/ 81 | 82 | /* states and images */ 83 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } 84 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } 85 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } 86 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } 87 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } 88 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } 89 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } 90 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } 91 | 92 | /* positioning */ 93 | .ui-icon-carat-1-n { background-position: 0 0; } 94 | .ui-icon-carat-1-ne { background-position: -16px 0; } 95 | .ui-icon-carat-1-e { background-position: -32px 0; } 96 | .ui-icon-carat-1-se { background-position: -48px 0; } 97 | .ui-icon-carat-1-s { background-position: -64px 0; } 98 | .ui-icon-carat-1-sw { background-position: -80px 0; } 99 | .ui-icon-carat-1-w { background-position: -96px 0; } 100 | .ui-icon-carat-1-nw { background-position: -112px 0; } 101 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 102 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 103 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 104 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 105 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 106 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 107 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 108 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 109 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 110 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 111 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 112 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 113 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 114 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 115 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 116 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 117 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 118 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 119 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 120 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 121 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 122 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 123 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 124 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 125 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 126 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 127 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 128 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 129 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 130 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 131 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 132 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 133 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 134 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 135 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 136 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 137 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 138 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 139 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 140 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 141 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 142 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 143 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 144 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 145 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 146 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 147 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 148 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 149 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 150 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 151 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 152 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 153 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 154 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 155 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 156 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 157 | .ui-icon-arrow-4 { background-position: 0 -80px; } 158 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 159 | .ui-icon-extlink { background-position: -32px -80px; } 160 | .ui-icon-newwin { background-position: -48px -80px; } 161 | .ui-icon-refresh { background-position: -64px -80px; } 162 | .ui-icon-shuffle { background-position: -80px -80px; } 163 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 164 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 165 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 166 | .ui-icon-folder-open { background-position: -16px -96px; } 167 | .ui-icon-document { background-position: -32px -96px; } 168 | .ui-icon-document-b { background-position: -48px -96px; } 169 | .ui-icon-note { background-position: -64px -96px; } 170 | .ui-icon-mail-closed { background-position: -80px -96px; } 171 | .ui-icon-mail-open { background-position: -96px -96px; } 172 | .ui-icon-suitcase { background-position: -112px -96px; } 173 | .ui-icon-comment { background-position: -128px -96px; } 174 | .ui-icon-person { background-position: -144px -96px; } 175 | .ui-icon-print { background-position: -160px -96px; } 176 | .ui-icon-trash { background-position: -176px -96px; } 177 | .ui-icon-locked { background-position: -192px -96px; } 178 | .ui-icon-unlocked { background-position: -208px -96px; } 179 | .ui-icon-bookmark { background-position: -224px -96px; } 180 | .ui-icon-tag { background-position: -240px -96px; } 181 | .ui-icon-home { background-position: 0 -112px; } 182 | .ui-icon-flag { background-position: -16px -112px; } 183 | .ui-icon-calendar { background-position: -32px -112px; } 184 | .ui-icon-cart { background-position: -48px -112px; } 185 | .ui-icon-pencil { background-position: -64px -112px; } 186 | .ui-icon-clock { background-position: -80px -112px; } 187 | .ui-icon-disk { background-position: -96px -112px; } 188 | .ui-icon-calculator { background-position: -112px -112px; } 189 | .ui-icon-zoomin { background-position: -128px -112px; } 190 | .ui-icon-zoomout { background-position: -144px -112px; } 191 | .ui-icon-search { background-position: -160px -112px; } 192 | .ui-icon-wrench { background-position: -176px -112px; } 193 | .ui-icon-gear { background-position: -192px -112px; } 194 | .ui-icon-heart { background-position: -208px -112px; } 195 | .ui-icon-star { background-position: -224px -112px; } 196 | .ui-icon-link { background-position: -240px -112px; } 197 | .ui-icon-cancel { background-position: 0 -128px; } 198 | .ui-icon-plus { background-position: -16px -128px; } 199 | .ui-icon-plusthick { background-position: -32px -128px; } 200 | .ui-icon-minus { background-position: -48px -128px; } 201 | .ui-icon-minusthick { background-position: -64px -128px; } 202 | .ui-icon-close { background-position: -80px -128px; } 203 | .ui-icon-closethick { background-position: -96px -128px; } 204 | .ui-icon-key { background-position: -112px -128px; } 205 | .ui-icon-lightbulb { background-position: -128px -128px; } 206 | .ui-icon-scissors { background-position: -144px -128px; } 207 | .ui-icon-clipboard { background-position: -160px -128px; } 208 | .ui-icon-copy { background-position: -176px -128px; } 209 | .ui-icon-contact { background-position: -192px -128px; } 210 | .ui-icon-image { background-position: -208px -128px; } 211 | .ui-icon-video { background-position: -224px -128px; } 212 | .ui-icon-script { background-position: -240px -128px; } 213 | .ui-icon-alert { background-position: 0 -144px; } 214 | .ui-icon-info { background-position: -16px -144px; } 215 | .ui-icon-notice { background-position: -32px -144px; } 216 | .ui-icon-help { background-position: -48px -144px; } 217 | .ui-icon-check { background-position: -64px -144px; } 218 | .ui-icon-bullet { background-position: -80px -144px; } 219 | .ui-icon-radio-off { background-position: -96px -144px; } 220 | .ui-icon-radio-on { background-position: -112px -144px; } 221 | .ui-icon-pin-w { background-position: -128px -144px; } 222 | .ui-icon-pin-s { background-position: -144px -144px; } 223 | .ui-icon-play { background-position: 0 -160px; } 224 | .ui-icon-pause { background-position: -16px -160px; } 225 | .ui-icon-seek-next { background-position: -32px -160px; } 226 | .ui-icon-seek-prev { background-position: -48px -160px; } 227 | .ui-icon-seek-end { background-position: -64px -160px; } 228 | .ui-icon-seek-start { background-position: -80px -160px; } 229 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 230 | .ui-icon-seek-first { background-position: -80px -160px; } 231 | .ui-icon-stop { background-position: -96px -160px; } 232 | .ui-icon-eject { background-position: -112px -160px; } 233 | .ui-icon-volume-off { background-position: -128px -160px; } 234 | .ui-icon-volume-on { background-position: -144px -160px; } 235 | .ui-icon-power { background-position: 0 -176px; } 236 | .ui-icon-signal-diag { background-position: -16px -176px; } 237 | .ui-icon-signal { background-position: -32px -176px; } 238 | .ui-icon-battery-0 { background-position: -48px -176px; } 239 | .ui-icon-battery-1 { background-position: -64px -176px; } 240 | .ui-icon-battery-2 { background-position: -80px -176px; } 241 | .ui-icon-battery-3 { background-position: -96px -176px; } 242 | .ui-icon-circle-plus { background-position: 0 -192px; } 243 | .ui-icon-circle-minus { background-position: -16px -192px; } 244 | .ui-icon-circle-close { background-position: -32px -192px; } 245 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 246 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 247 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 248 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 249 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 250 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 251 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 252 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 253 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 254 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 255 | .ui-icon-circle-check { background-position: -208px -192px; } 256 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 257 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 258 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 259 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 260 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 261 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 262 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 263 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 264 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 265 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 266 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 267 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 268 | 269 | 270 | /* Misc visuals 271 | ----------------------------------*/ 272 | 273 | /* Corner radius */ 274 | .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } 275 | .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } 276 | .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } 277 | .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } 278 | .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } 279 | .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } 280 | .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } 281 | .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } 282 | .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } 283 | 284 | /* Overlays */ 285 | .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } 286 | .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* Resizable 287 | ----------------------------------*/ 288 | .ui-resizable { position: relative;} 289 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 290 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 291 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } 292 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } 293 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } 294 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } 295 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 296 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 297 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 298 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Accordion 299 | ----------------------------------*/ 300 | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } 301 | .ui-accordion .ui-accordion-li-fix { display: inline; } 302 | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } 303 | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } 304 | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } 305 | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } 306 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } 307 | .ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete 308 | ----------------------------------*/ 309 | .ui-autocomplete { position: absolute; cursor: default; } 310 | .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } 311 | 312 | /* workarounds */ 313 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ 314 | 315 | /* Menu 316 | ----------------------------------*/ 317 | .ui-menu { 318 | list-style:none; 319 | padding: 2px; 320 | margin: 0; 321 | display:block; 322 | } 323 | .ui-menu .ui-menu { 324 | margin-top: -3px; 325 | } 326 | .ui-menu .ui-menu-item { 327 | margin:0; 328 | padding: 0; 329 | width: 100%; 330 | } 331 | .ui-menu .ui-menu-item a { 332 | text-decoration:none; 333 | display:block; 334 | padding:.2em .4em; 335 | line-height:1.5; 336 | } 337 | .ui-menu .ui-menu-item a.ui-state-hover, 338 | .ui-menu .ui-menu-item a.ui-state-active { 339 | margin: -1px; 340 | } 341 | /* Button 342 | ----------------------------------*/ 343 | 344 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ 345 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ 346 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ 347 | .ui-button-icons-only { width: 3em; } 348 | button.ui-button-icons-only { width: 3.2em; } 349 | 350 | /*button text element */ 351 | .ui-button .ui-button-text { display: block; line-height: 1.4; } 352 | .ui-button-text-only .ui-button-text { padding: .4em 1em; } 353 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } 354 | .ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 1.8em; } 355 | .ui-button-text-icons .ui-button-text { padding-right: 1.8em; } 356 | /* no icon support for input elements, provide padding by default */ 357 | input.ui-button { padding: .4em 1em; } 358 | 359 | /*button icon element(s) */ 360 | .ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } 361 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } 362 | .ui-button-text-icon .ui-icon-primary, .ui-button-text-icons .ui-icon-primary, .ui-button-icons-only .ui-icon-primary { left: .5em; } 363 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 364 | 365 | /*button sets*/ 366 | .ui-button-set { margin-right: 7px; } 367 | .ui-button-set .ui-button { margin-left: 0; margin-right: -.3em; } 368 | 369 | /* workarounds */ 370 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ 371 | 372 | 373 | 374 | 375 | 376 | /* Dialog 377 | ----------------------------------*/ 378 | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } 379 | .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } 380 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } 381 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } 382 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 383 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } 384 | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } 385 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } 386 | .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } 387 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } 388 | .ui-draggable .ui-dialog-titlebar { cursor: move; } 389 | /* Slider 390 | ----------------------------------*/ 391 | .ui-slider { position: relative; text-align: left; } 392 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } 393 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } 394 | 395 | .ui-slider-horizontal { height: .8em; } 396 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } 397 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } 398 | .ui-slider-horizontal .ui-slider-range-min { left: 0; } 399 | .ui-slider-horizontal .ui-slider-range-max { right: 0; } 400 | 401 | .ui-slider-vertical { width: .8em; height: 100px; } 402 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } 403 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } 404 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } 405 | .ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs 406 | ----------------------------------*/ 407 | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 408 | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } 409 | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } 410 | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } 411 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } 412 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } 413 | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ 414 | .ui-tabs .ui-tabs-panel { display: block; border: 0; padding: 1em 1.4em; background: none; } 415 | .ui-tabs .ui-tabs-hide { display: none !important; } 416 | /* Datepicker 417 | ----------------------------------*/ 418 | .ui-datepicker { width: 17em; padding: .2em .2em 0; } 419 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 420 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 421 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 422 | .ui-datepicker .ui-datepicker-prev { left:2px; } 423 | .ui-datepicker .ui-datepicker-next { right:2px; } 424 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 425 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 426 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 427 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 428 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 429 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 430 | .ui-datepicker select.ui-datepicker-month, 431 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 432 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 433 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 434 | .ui-datepicker td { border: 0; padding: 1px; } 435 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 436 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 437 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 438 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 439 | 440 | /* with multiple calendars */ 441 | .ui-datepicker.ui-datepicker-multi { width:auto; } 442 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 443 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 444 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 445 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 446 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 447 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 448 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 449 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 450 | .ui-datepicker-row-break { clear:both; width:100%; } 451 | 452 | /* RTL support */ 453 | .ui-datepicker-rtl { direction: rtl; } 454 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 455 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 456 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 457 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 458 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 459 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 460 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 461 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 462 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 463 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 464 | 465 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 466 | .ui-datepicker-cover { 467 | display: none; /*sorry for IE5*/ 468 | display/**/: block; /*sorry for IE5*/ 469 | position: absolute; /*must have*/ 470 | z-index: -1; /*must have*/ 471 | filter: mask(); /*must have*/ 472 | top: -4px; /*must have*/ 473 | left: -4px; /*must have*/ 474 | width: 200px; /*must have*/ 475 | height: 200px; /*must have*/ 476 | }/* Progressbar 477 | ----------------------------------*/ 478 | .ui-progressbar { height:2em; text-align: left; } 479 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } -------------------------------------------------------------------------------- /libs/jquery-1.4.2.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery JavaScript Library v1.4.2 3 | * http://jquery.com/ 4 | * 5 | * Copyright 2010, John Resig 6 | * Dual licensed under the MIT or GPL Version 2 licenses. 7 | * http://jquery.org/license 8 | * 9 | * Includes Sizzle.js 10 | * http://sizzlejs.com/ 11 | * Copyright 2010, The Dojo Foundation 12 | * Released under the MIT, BSD, and GPL Licenses. 13 | * 14 | * Date: Sat Feb 13 22:33:48 2010 -0500 15 | */ 16 | (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, 21 | Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& 22 | (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, 23 | a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== 24 | "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, 25 | function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; 34 | var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, 35 | parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= 36 | false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= 37 | s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, 38 | applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; 39 | else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, 40 | a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== 41 | w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, 42 | cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= 47 | c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); 48 | a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, 49 | function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); 50 | k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), 51 | C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= 53 | e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& 54 | f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; 55 | if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", 63 | e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, 64 | "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, 65 | d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, 71 | e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); 72 | t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| 73 | g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, 80 | CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, 81 | g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, 82 | text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, 83 | setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= 84 | h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== 86 | "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, 87 | h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& 90 | q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; 91 | if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); 92 | (function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: 93 | function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= 96 | {},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== 97 | "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", 98 | d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? 99 | a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 100 | 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= 102 | c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, 103 | wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, 104 | prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, 105 | this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); 106 | return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, 107 | ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); 111 | return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", 112 | ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= 113 | c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? 114 | c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= 115 | function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= 116 | Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, 117 | "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= 118 | a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= 119 | a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== 120 | "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, 121 | serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), 122 | function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, 123 | global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& 124 | e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? 125 | "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== 126 | false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= 127 | false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", 128 | c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| 129 | d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); 130 | g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 131 | 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== 132 | "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; 133 | if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== 139 | "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| 140 | c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; 141 | this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= 142 | this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, 143 | e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; 149 | a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); 150 | c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, 151 | d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- 152 | f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": 153 | "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in 154 | e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); 155 | -------------------------------------------------------------------------------- /release-notes.txt: -------------------------------------------------------------------------------- 1 | 1.2.3 (Development) 2 | - Modifed the order of execution of eventDrop and eventRender so that drop callback occurs before rendering. 3 | - Migrated to jquery-ui-1.8 and jquery 1.4 (no longer supports previous versions) 4 | - Fixed daylight savings problem 5 | - Added support for modifying calendar options on the fly. 6 | 7 | 1.2.2 (2009-10-30) 8 | - Fixed inconsistent bug with dropping events in IE7/8 causing a js error 9 | - Updated the way that events that overlap are organised if using the overlapEventsSeperate option (thanks Yann) 10 | - Fixed bug where when resizing and overlapping events is enabled, the layout of overlapping of events wasn't being recalculated 11 | - Fixed bug where deleting existing or unsaved events that were overlapping was not recalcuating the layout of remaining events 12 | - Fixed bug where calendar was not honouring the allowCalEventOverlap = false option when creating new or updating events from dialog (Issue 84) 13 | - Added 'daysToShow' config option to optionally only display a limited number of days in a week. (thanks jura khrapunov) 14 | - Made change that prevents dragged events from being resized when the event has resizing disabled and overlapping is switched off. (Issue 70) 15 | - Added proper scoping of css to the calendar using 'wc' prefix for all class names. 16 | - Fixed problem with scrolling to hour if business hours are restricted 17 | 18 | 19 | Once again, thanks for all contributions, suggestions and help in the google group! 20 | 21 | 22 | 1.2.1 23 | - Added public method 'getData' that returns the value of a named config option. 24 | - Added public method 'clear' that clears all calendar events from the calendar. 25 | - Added eventDrag callback 26 | - Added support for 24 hour timeslot display as an alternative to AM / PM 12 hour day. (thanks dozebox) 27 | - Added eventAfterRender callback 28 | - Added support for weeks starting on any day of the week (thanks Bramus!) 29 | - Added better overlapping event support with the ability to have staggered or parallel layout of overlapping events. (thanks Roderik) 30 | - Hovering over overlapping events brings them into focus (thanks Roderik) 31 | - Added methods for formatting dates and times using the calendar config or by passing in date / time formats. 32 | - Modified logic for 'scrollToTime' to scroll to the time of the reference date of the week. 33 | 34 | 35 | 36 | 37 | **Thanks to everyone who logged issues and made suggestions in this release. 38 | 39 | 40 | 2009-06-19 - 1.2 41 | - Added better layout support for overlapping of events 42 | - Added ability to supply formatters for date and time 43 | - Added improved demo with creation / editing of events using jquery ui. 44 | - Added option to only display hours defined in the 'businessHours' config option. 45 | - Migrated code base to extend jquery-ui widget. 46 | - Improved inline method documentation. 47 | - Added 'readonly' config option to flag the entire calendar as readonly, preventing creation, dragging, dropping and resizing of events. 48 | - Added ability to configure day, month names for better i18n support 49 | - Fixed bug with IE7 resizing once an event gets to 2 timeslots or smaller 50 | 51 | 52 | 2009-06-08 - 1.1.3 53 | - Removed console.log that was causing issues in IE. 54 | - Fixed an issue with nav buttons in certain environments 55 | 56 | 57 | 2009-05-21 - 1.1.2 58 | - Fixed problem in safari and chrome where new events where not being created due to lack of event bubbling of mousedown and mouseup events. 59 | 60 | 2009-05-17- 1.1.1 61 | - Fixed problem with calculation of end date passed to data functions / url 62 | - Updating scrolling to hour to only occur on first render 63 | - Added code to check for changed options after loading data before actually re-rendering the calendar. 64 | 65 | 66 | 2009-05-16 - 1.1 67 | - Extended the events data structure to allow options to be passed back to the calendar with event data. This has 68 | resulted in a config option name change. The events option is now called 'data'. The data option can be either an array 69 | of calendar events or an object containing a property called 'events' which is the events data array. The data option 70 | can also contain an additional property called 'options'. Any options passed with the data will replace the current options 71 | in the calendar and force a re-render of the calendar. This is very useful in cases where the calendar layout needs to change for 72 | different data sets. For example, a calendar that is delegated but each owner has their own preference for timeslots per hour. 73 | - Fixed problem where errors were raised due to missing mouseover / mouseout events on calEvents. 74 | 75 | 2009-05-12 - 1.0 76 | - Added support for preventing overlapping calendar events 77 | - Internal refactoring and cleanup including moving standard events to use delegation 78 | 79 | 2009-05-10 - 1.0-alpha-4 80 | - Fixed problem caused by window resize event binding hanging around after calendar is removed from the DOM. 81 | - Wasn't returning a reference to the original jquery plugin object so chaining wasn't possible 82 | - Added calendarPreLoad and calendarPostLoad events that are called before and after events get loaded into the calendar. 83 | - Removed calendarRendered event as it was superseded by the calendarPostLoad event 84 | - Fixed bug in calendar scrolling to hour of day. 85 | - Added scrollToHourMillis config option for setting the duration of the scroll to hour of day animation. 86 | - Fixed problem where the newEvent event was triggered multiple times after navigating through weeks. 87 | - Fixed problem where dragging an event caused an event click to be triggered on drop instead of a dropped event. 88 | - Fixed issue in IE7 where width of calendar was not taking into account the width of the vertical scrollbar, causing a horizontal scrollbar to appear 89 | 90 | 2009-05-07 - 1.0-alpha-3 91 | 92 | - Tightened up some of the rendering to cater to different configuration. 93 | - Added timeslotHeight config property so you can can specify the height of calendar time slots. 94 | - Fixed problem where resizing an event causes a new event to be created 95 | - Fixed problem with click event for calendar events firing twice. 96 | 97 | 98 | 2009-05-06 - 1.0-alpha-2 99 | - Removed jQuery UI Theme from source in favour of google hosted theme 100 | - Fixed bug with parsing dates in events supplied as milliseconds 101 | - Added minified and yui compressed versions of javascript 102 | - Fixed bug where current day remained highlighted after navigating to next / prev weeks 103 | 104 | 105 | 2009-05-05 - 1.0-alpha-1 106 | - Initial Release -------------------------------------------------------------------------------- /weekcalendar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 53 | 54 | 55 | 56 | 122 | 123 | 124 |

Week Calendar Demo

125 |

This calendar demonstrates a basic calendar. Events triggered are displayed in the message area. Appointments in the past are shaded grey.

126 |
127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /weekcalendar_demo_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 49 | 50 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 65 | 66 | 67 | 68 | 158 | 159 | 160 |

Week Calendar Demo (Data supplied config overrides)

161 |

This calendar demonstrates the ability to return calendar configuration options with an event dataset.

162 |
163 |
164 | Event Data Source: 165 | 170 |
171 |
172 | 173 | 174 | -------------------------------------------------------------------------------- /weekcalendar_json.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 53 | 54 | 55 | 56 | 111 | 112 | 113 |

Week Calendar Demo (JSON data source)

114 |

Please Note ***. This demo uses static json data. For this reason, in order to see any event data, please edit events.json to use current dates.

115 |
116 | 117 | 118 | --------------------------------------------------------------------------------