Editorial Calendar - Version 0.2

Version Description

  • This version fixes a large number of bugs, makes many usability improvements, and has some significant performance increases.

<?php code(); // goes in backticks ?>

Download this release

Release Info

Developer MaryVogt
Plugin Icon wp plugin Editorial Calendar
Version 0.2
Comparing to
See all releases

Code changes from version 0.1 to 0.2

edcal.css CHANGED
@@ -1,4 +1,20 @@
1
- #edcal_scrollable {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  width: 98%;
3
  /* required settings */
4
  position:relative;
@@ -13,6 +29,7 @@
13
 
14
  /* this time we have very large space for the height */
15
  height:100%;
 
16
  }
17
 
18
  .day {
@@ -52,16 +69,22 @@
52
  right: 5px;
53
  }
54
 
55
- .saturday .daylabel {
56
- right: 20px;
57
- }
58
-
59
  .post {
60
  display: block;
61
  list-style-type: none;
62
  background: #FFFFE0;
63
  z-index: 10;
64
  cursor: move;
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
  .day-active {
@@ -71,6 +94,7 @@
71
  .dayhead {
72
  font-weight: bold;
73
  text-align: center;
 
74
  }
75
 
76
  #rowhead {
@@ -89,20 +113,22 @@
89
 
90
  #topleft {
91
  position: absolute;
92
- left: 75px;
93
- top: 5px;
 
94
  }
95
 
96
  #topright {
97
  position: absolute;
98
- left: 15%;
99
  top: 0px;
100
- width: 85%;
101
  text-align: right;
102
  }
103
 
104
  #moveToToday {
105
  margin-left: 2em;
 
106
  }
107
 
108
  .future {
@@ -118,18 +144,22 @@
118
  background-color: #dde4fb;
119
  }
120
 
 
 
 
 
121
  #loading {
122
  background-image: url('images/loading.gif');
123
  background-repeat: no-repeat;
 
124
  width: 43px;
125
  height: 11px;
126
  display: block;
127
- position: absolute;
128
- top: 5px;
129
- right: 5px;
130
  }
131
 
132
- .loadingclass {
133
  background-image: url('images/loading_post.gif');
134
  background-position: top right;
135
  background-repeat: no-repeat;
@@ -154,8 +184,9 @@
154
  }
155
 
156
  #tooltip h3 {
157
- max-width: 15em;
158
  margin-bottom: -10px;
 
159
  }
160
 
161
  #tooltip {
@@ -165,8 +196,31 @@
165
  padding-bottom: 0em;
166
  border: thin solid lightgray;
167
  -moz-border-radius:11px;
 
 
168
  }
169
 
170
  .ui-draggable-dragging {
171
  width: 8em;
172
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*******************************************************************************
2
+ *
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ *
15
+ ******************************************************************************/
16
+
17
+ #edcal_scrollable {
18
  width: 98%;
19
  /* required settings */
20
  position:relative;
29
 
30
  /* this time we have very large space for the height */
31
  height:100%;
32
+ margin-right: 10px;
33
  }
34
 
35
  .day {
69
  right: 5px;
70
  }
71
 
 
 
 
 
72
  .post {
73
  display: block;
74
  list-style-type: none;
75
  background: #FFFFE0;
76
  z-index: 10;
77
  cursor: move;
78
+ -moz-border-radius:6px;
79
+ -webkit-border-radius:6px;
80
+ margin-left: 2px;
81
+ margin-right: 2px;
82
+ padding: 5px;
83
+ }
84
+
85
+ .post:hover {
86
+ color: white;
87
+ background: black;
88
  }
89
 
90
  .day-active {
94
  .dayhead {
95
  font-weight: bold;
96
  text-align: center;
97
+ color: gray;
98
  }
99
 
100
  #rowhead {
113
 
114
  #topleft {
115
  position: absolute;
116
+ left: 10px;
117
+ top: -14px;
118
+ width: auto;
119
  }
120
 
121
  #topright {
122
  position: absolute;
123
+ right: 2em;
124
  top: 0px;
125
+ width: auto;
126
  text-align: right;
127
  }
128
 
129
  #moveToToday {
130
  margin-left: 2em;
131
+ text-decoration: none;
132
  }
133
 
134
  .future {
144
  background-color: #dde4fb;
145
  }
146
 
147
+ #loadingcont {
148
+ position: relative;
149
+ }
150
+
151
  #loading {
152
  background-image: url('images/loading.gif');
153
  background-repeat: no-repeat;
154
+ position: absolute;
155
  width: 43px;
156
  height: 11px;
157
  display: block;
158
+ left: 20em;
159
+ top: -1.5em;
 
160
  }
161
 
162
+ .loadingclass, .loadingclass:hover {
163
  background-image: url('images/loading_post.gif');
164
  background-position: top right;
165
  background-repeat: no-repeat;
184
  }
185
 
186
  #tooltip h3 {
187
+ max-width: 20em;
188
  margin-bottom: -10px;
189
+ padding-right: 15px;
190
  }
191
 
192
  #tooltip {
196
  padding-bottom: 0em;
197
  border: thin solid lightgray;
198
  -moz-border-radius:11px;
199
+ -webkit-border-radius:11px;
200
+ -moz-box-shadow:0 4px 18px #C8C8C8;
201
  }
202
 
203
  .ui-draggable-dragging {
204
  width: 8em;
205
  }
206
+
207
+ #tipclose {
208
+ width: 24px;
209
+ height: 23px;
210
+ position: absolute;
211
+ top: 0px;
212
+ right: -10px;
213
+ }
214
+
215
+ .tooltip {
216
+ position: relative;
217
+ }
218
+
219
+ #edcal-title-box {
220
+ display: none;
221
+ padding-right: 15px;
222
+ }
223
+
224
+ #edcal-title-edit {
225
+ font-size: 11px;
226
+ }
edcal.js CHANGED
@@ -13,6 +13,16 @@
13
  * limitations under the License.
14
  *
15
  ******************************************************************************/
 
 
 
 
 
 
 
 
 
 
16
 
17
  /*
18
  This is the WordPress editorial calendar. It is a continuous
@@ -69,15 +79,16 @@ var edcal = {
69
 
70
  /*
71
  This is the base URL we use to make AJAX calls back
72
- to the server. This values is set in code generated
73
- from edcal.php.
 
74
  */
75
  ajax_url: '',
76
 
77
  /*
78
  * The cache of dates we have already loaded posts for.
79
  */
80
- cacheDates : new Array(),
81
 
82
  /*
83
  * The ID of the timer we use to batch new post requests
@@ -145,27 +156,27 @@ var edcal = {
145
  var count = 1;
146
 
147
  jQuery(gridid).each(function(){
148
- jQuery(this).css("position", "relative");
149
-
150
- jQuery(this).children("div").each(function(){
151
- jQuery(this).css({
152
- width: cellWidth + "%",
153
- height: cellHeight + "%",
154
- position: "absolute",
155
- left: x + "%",
156
- top: y + "%"
157
- });
158
-
159
- if ((count % cols) === 0){
160
- x = 0;
161
- y += cellHeight + padding;
162
- }else{
163
- x += cellWidth + padding;
164
- }
165
-
166
- count++;
167
- });
168
- });
169
  },
170
 
171
  /*
@@ -207,8 +218,9 @@ var edcal = {
207
  var newrow = '<div class="rowcont" id="' + 'row' + edcal._wDate.toString("ddMMMyyyy") + '">' +
208
  '<div id="' + 'row' + edcal._wDate.toString("ddMMMyyyy") + 'row" class="row">';
209
  for (var i = 0; i < 7; i++) {
210
- newrow +='<div id="' + _date.toString("ddMMMyyyy") + '" class="day ' + _date.toString("dddd").toLowerCase() + ' ' +
211
- _date.toString("MMM").toLowerCase() + '">';
 
212
 
213
  newrow += '<div class="dayobj">';
214
 
@@ -254,56 +266,77 @@ var edcal = {
254
  greedy: true,
255
  tolerance: 'pointer',
256
  drop: function(event, ui) {
257
- //output('dropped ui.draggable.attr("id"): ' + ui.draggable.attr("id"));
258
- //output('dropped on jQuery(this).attr("id"): ' + jQuery(this).attr("id"));
259
- //output('ui.draggable.html(): ' + ui.draggable.html());
260
-
261
- var dayId = ui.draggable.parent().parent().parent().attr("id");
262
-
263
- // Step 0. Get the post object from the map
264
- var post = edcal.findPostForId(ui.draggable.parent().parent().parent().attr("id"), ui.draggable.attr("id"));
265
- output("post: " + post);
266
-
267
- // Step 1. Remove the post from the posts map
268
- edcal.removePostFromMap(ui.draggable.parent().parent().attr("id"),
269
- ui.draggable.attr("id"));
270
-
271
- // Step 2. Remove the old element from the old parent.
272
- jQuery('#' + ui.draggable.attr("id")).remove();
273
-
274
- // Step 3. Add the item to the new DOM parent
275
- jQuery('#' + jQuery(this).attr("id") + ' .postlist').append(edcal.createPostItem(post,
276
- jQuery(this).attr("id")));
277
-
278
- // Step 4. Don't forget to make the new item draggable
279
- //jQuery('#' + jQuery(this).attr("id") + ' .post').draggable({ revert: 'invalid'});
280
-
281
- // Step 5. And add the tooltip
282
- edcal.addTooltip(jQuery(this).attr("id"));
283
-
284
- if (dayId == jQuery(this).attr("id")) {
285
- /*
286
- * If they dropped back on to the day they started with we
287
- * don't want to go back to the server.
288
- */
289
- edcal.draggablePost('#' + jQuery(this).attr("id") + ' .post');
290
- } else {
291
- // Step6. Update the date on the server
292
- edcal.changeDate(jQuery(this).attr("id"), post);
293
  }
294
- }
295
- });
296
-
297
  return jQuery('row' + edcal._wDate.toString("ddMMMyyyy"));
298
  },
299
 
 
 
 
300
  draggablePost: function(/*post selector*/ post) {
301
- jQuery(post).draggable({
302
- revert: 'invalid',
303
- appendTo: 'body',
304
- helper: "clone",
305
- addClasses: false
306
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  },
308
 
309
  /*
@@ -311,17 +344,17 @@ var edcal = {
311
  from the cache map.
312
  */
313
  removePostFromMap: function(/*string*/ dayobjId, /*string*/ postId) {
314
- if (edcal.posts[dayobjId]) {
315
- for (var i = 0; i < edcal.posts[dayobjId].length; i++) {
316
- if (edcal.posts[dayobjId][i] &&
317
- "post-" + edcal.posts[dayobjId][i].POST_ID === postId) {
318
- edcal.posts[dayobjId][i] = null;
319
- return true;
320
- }
321
- }
322
- }
323
-
324
- return false;
325
  },
326
 
327
  /*
@@ -331,11 +364,18 @@ var edcal = {
331
  jQuery('#' + dayobjId + ' .postlist').append(edcal.createPostItem(post, dayobjId));
332
  },
333
 
 
 
 
 
334
  addPostItemDragAndToolltip: function(/*string*/ dayobjId) {
335
  edcal.draggablePost('#' + dayobjId + ' .post');
336
  edcal.addTooltip(dayobjId);
337
  },
338
 
 
 
 
339
  confirmDelete: function(/*string*/ posttitle) {
340
  if (confirm('You are about to delete this post ' + posttitle + '.\n\n Press cancel to stop, OK to delete.')) {
341
  return true;
@@ -343,6 +383,70 @@ var edcal = {
343
  return false;
344
  }
345
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
 
347
  /*
348
  * Adds a tooltip to every post in the specified day.
@@ -352,10 +456,17 @@ var edcal = {
352
  delay: 1500,
353
  bodyHandler: function() {
354
  var post = edcal.findPostForId(dayobjId, jQuery(this).attr("id"));
355
- edcal.findPostForId(jQuery(this).parent().parent().attr("id"),
356
- jQuery(this).attr("id"));
357
  var tooltip = '<div class="tooltip">' +
358
- '<h3>' + post.title + '</h3>' +
 
 
 
 
 
 
 
 
 
359
  '<p>' +
360
  '<i>by</i> ' + post.author + ' <i>on</i> ' +
361
  edcal.getDayFromDayId(post.date).toString("MMMM d, yyyy") +
@@ -437,11 +548,6 @@ var edcal = {
437
  /*
438
  Gets all the post items for the specified day from
439
  the post cache.
440
-
441
- TODO - This function adds all of the posts to a
442
- specific day in the calendar. If there are too
443
- many posts they'll overrun the calendar day. We
444
- need a better UI solution.
445
  */
446
  getPostItems: function(/*string*/ dayobjId) {
447
  var postsString = "";
@@ -521,16 +627,18 @@ var edcal = {
521
 
522
  edcal.currentDirection = direction;
523
 
 
 
524
 
525
  if (direction) {
526
- for (var i = 0; i < steps; i++) {
527
  jQuery("#cal > div:first").remove();
528
  edcal.createRow(jQuery("#cal"), true);
529
  edcal._wDate.add(7).days();
530
  }
531
  edcal.alignCal();
532
  } else {
533
- for (var i = 0; i < steps; i++) {
534
  jQuery("#cal > div:last").remove();
535
  edcal.createRow(jQuery("#cal"), false);
536
  edcal._wDate.add(-7).days();
@@ -562,9 +670,9 @@ var edcal = {
562
  */
563
  if (!direction) {
564
  edcal.getPosts(edcal._wDate.clone(),
565
- edcal._wDate.clone().add(7 * (edcal.steps + 2)).days());
566
  } else {
567
- edcal.getPosts(edcal._wDate.clone().add(-7 * (edcal.steps + 2)).days(),
568
  edcal._wDate.clone());
569
  }
570
 
@@ -663,7 +771,7 @@ var edcal = {
663
  // initialize scrollable
664
  jQuery(".edcal_scrollable").scrollable({
665
  vertical:true,
666
- size: 6,
667
  keyboardSteps: 1,
668
  speed: 100
669
  // use mousewheel plugin
@@ -673,8 +781,6 @@ var edcal = {
673
 
674
  edcal.moveTo(Date.today());
675
 
676
- var steps = 1;
677
-
678
  /*
679
  * The scrollable handles some basic binding. This gets us
680
  * up arrow, down arrow and the mouse wheel.
@@ -705,11 +811,14 @@ var edcal = {
705
  evt.keyCode === 38 && evt.ctrlKey){ // Ctrl+up up arrow
706
  edcal.move(4, false);
707
  return false;
 
 
 
708
  }
709
  });
710
 
711
- edcal.getPosts(Date.today().next().sunday().add(-61).days(),
712
- Date.today().next().sunday().add(61).days());
713
 
714
  /*
715
  Now we bind the listeners for all of our links and the window
@@ -744,8 +853,6 @@ var edcal = {
744
  the specified post on the server.
745
  */
746
  changeDate: function(/*string*/ newdate, /*Post*/ post) {
747
- output("changeDate(" + newdate + ", " + post + ")");
748
-
749
  newdate = edcal.getDayFromDayId(newdate).toString("yyyy-MM-dd");
750
 
751
  var postStatus = "";
@@ -786,7 +893,7 @@ var edcal = {
786
  url: url,
787
  type: "POST",
788
  processData: false,
789
- timeout: 10000,
790
  dataType: "json",
791
  success: function(res) {
792
  edcal.removePostItem(res.post.date, "post-" + res.post.id);
@@ -802,7 +909,7 @@ var edcal = {
802
  }
803
  },
804
  error: function(xhr) {
805
- showError("There was an error contacting your blog.")
806
  if (xhr.responseText) {
807
  output("xhr.responseText: " + xhr.responseText);
808
  }
@@ -823,7 +930,7 @@ var edcal = {
823
  specified dates.
824
  */
825
  getPosts: function(/*Date*/ from, /*Date*/ to) {
826
- output("getPosts(" + from.toString("dd-MMM-yyyy") + ", " + to.toString("dd-MMM-yyyy") + ")");
827
 
828
  var shouldGet = edcal.cacheDates[from];
829
 
@@ -849,7 +956,7 @@ var edcal = {
849
  url: url,
850
  type: "GET",
851
  processData: false,
852
- timeout: 10000,
853
  dataType: "text",
854
  success: function(res) {
855
  jQuery("#loading").hide();
@@ -860,7 +967,7 @@ var edcal = {
860
  * one used by JQuery.
861
  */
862
  var parsedRes = JSON.parseIt(res);
863
- var postDates = new Array();
864
  jQuery.each(parsedRes, function(i, post) {
865
  if (post) {
866
  edcal.removePostItem(post.date, "post-" + post.id);
@@ -887,7 +994,7 @@ var edcal = {
887
  }, 300);
888
  },
889
  error: function(xhr) {
890
- showError("There was an error contacting your blog.")
891
  if (xhr.responseText) {
892
  output("xhr.responseText: " + xhr.responseText);
893
  }
@@ -900,12 +1007,16 @@ jQuery(document).ready(function(){
900
  edcal.init();
901
  });
902
 
903
- /**
904
- * This is a helper function to output messages on the HTML page. It
905
- * write them out to a text area.
906
- *
907
- * @param msg the message to write
908
  */
909
- function output(msg) {
910
- //console.info(msg);
911
- }
 
 
 
 
 
 
 
13
  * limitations under the License.
14
  *
15
  ******************************************************************************/
16
+
17
+ /**
18
+ * This is a helper function to output messages on the HTML page. It
19
+ * write them out to a text area.
20
+ *
21
+ * @param msg the message to write
22
+ */
23
+ function output(msg) {
24
+ //console.info(msg);
25
+ }
26
 
27
  /*
28
  This is the WordPress editorial calendar. It is a continuous
79
 
80
  /*
81
  This is the base URL we use to make AJAX calls back
82
+ to the server. This value is set in code generated
83
+ from edcal.php that run in a script tag in the main
84
+ page.
85
  */
86
  ajax_url: '',
87
 
88
  /*
89
  * The cache of dates we have already loaded posts for.
90
  */
91
+ cacheDates : [],
92
 
93
  /*
94
  * The ID of the timer we use to batch new post requests
156
  var count = 1;
157
 
158
  jQuery(gridid).each(function(){
159
+ jQuery(this).css("position", "relative");
160
+
161
+ jQuery(this).children("div").each(function(){
162
+ jQuery(this).css({
163
+ width: cellWidth + "%",
164
+ height: cellHeight + "%",
165
+ position: "absolute",
166
+ left: x + "%",
167
+ top: y + "%"
168
+ });
169
+
170
+ if ((count % cols) === 0) {
171
+ x = 0;
172
+ y += cellHeight + padding;
173
+ } else {
174
+ x += cellWidth + padding;
175
+ }
176
+
177
+ count++;
178
+ });
179
+ });
180
  },
181
 
182
  /*
218
  var newrow = '<div class="rowcont" id="' + 'row' + edcal._wDate.toString("ddMMMyyyy") + '">' +
219
  '<div id="' + 'row' + edcal._wDate.toString("ddMMMyyyy") + 'row" class="row">';
220
  for (var i = 0; i < 7; i++) {
221
+ newrow += '<div id="' + _date.toString("ddMMMyyyy") + '" class="day ' +
222
+ _date.toString("dddd").toLowerCase() + ' ' +
223
+ _date.toString("MMM").toLowerCase() + '">';
224
 
225
  newrow += '<div class="dayobj">';
226
 
266
  greedy: true,
267
  tolerance: 'pointer',
268
  drop: function(event, ui) {
269
+ //output('dropped ui.draggable.attr("id"): ' + ui.draggable.attr("id"));
270
+ //output('dropped on jQuery(this).attr("id"): ' + jQuery(this).attr("id"));
271
+ //output('ui.draggable.html(): ' + ui.draggable.html());
272
+
273
+ var dayId = ui.draggable.parent().parent().parent().attr("id");
274
+
275
+ // Step 0. Get the post object from the map
276
+ var post = edcal.findPostForId(ui.draggable.parent().parent().parent().attr("id"),
277
+ ui.draggable.attr("id"));
278
+
279
+ // Step 1. Remove the post from the posts map
280
+ edcal.removePostFromMap(ui.draggable.parent().parent().parent().attr("id"),
281
+ ui.draggable.attr("id"));
282
+
283
+ // Step 2. Remove the old element from the old parent.
284
+ jQuery('#' + ui.draggable.attr("id")).remove();
285
+
286
+ // Step 3. Add the item to the new DOM parent
287
+ jQuery('#' + jQuery(this).attr("id") + ' .postlist').append(edcal.createPostItem(post,
288
+ jQuery(this).attr("id")));
289
+
290
+ // Step 4. And add the tooltip
291
+ edcal.addTooltip(jQuery(this).attr("id"));
292
+
293
+ if (dayId == jQuery(this).attr("id")) {
294
+ /*
295
+ If they dropped back on to the day they started with we
296
+ don't want to go back to the server.
297
+ */
298
+ edcal.draggablePost('#' + jQuery(this).attr("id") + ' .post');
299
+ } else {
300
+ // Step6. Update the date on the server
301
+ edcal.changeDate(jQuery(this).attr("id"), post);
302
+ }
 
 
303
  }
304
+ });
305
+
 
306
  return jQuery('row' + edcal._wDate.toString("ddMMMyyyy"));
307
  },
308
 
309
+ /*
310
+ * This is a helper method to make an individual post item draggable.
311
+ */
312
  draggablePost: function(/*post selector*/ post) {
313
+ /*
314
+ * Click is a different operation than drag in our UI. The problem is if
315
+ * the user is moving their mouse just a little bit we can think it is a
316
+ * drag instead of a click. We stop this by delaying the drag event until
317
+ * the user has dragged at least 10 pixels. This works fine on IE and
318
+ * Firefox, but on Chrome it causes text selection so we don't delay on
319
+ * Chrome.
320
+ */
321
+ var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
322
+ var is_safari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
323
+
324
+ if (is_chrome || is_safari) {
325
+ jQuery(post).draggable({
326
+ revert: 'invalid',
327
+ appendTo: 'body',
328
+ helper: "clone",
329
+ addClasses: false
330
+ });
331
+ } else {
332
+ jQuery(post).draggable({
333
+ revert: 'invalid',
334
+ appendTo: 'body',
335
+ distance: 10,
336
+ helper: "clone",
337
+ addClasses: false
338
+ });
339
+ }
340
  },
341
 
342
  /*
344
  from the cache map.
345
  */
346
  removePostFromMap: function(/*string*/ dayobjId, /*string*/ postId) {
347
+ if (edcal.posts[dayobjId]) {
348
+ for (var i = 0; i < edcal.posts[dayobjId].length; i++) {
349
+ if (edcal.posts[dayobjId][i] &&
350
+ "post-" + edcal.posts[dayobjId][i].id === postId) {
351
+ edcal.posts[dayobjId][i] = null;
352
+ return true;
353
+ }
354
+ }
355
+ }
356
+
357
+ return false;
358
  },
359
 
360
  /*
364
  jQuery('#' + dayobjId + ' .postlist').append(edcal.createPostItem(post, dayobjId));
365
  },
366
 
367
+ /*
368
+ Makes all the posts in the specified day draggable
369
+ and adds the tooltip.
370
+ */
371
  addPostItemDragAndToolltip: function(/*string*/ dayobjId) {
372
  edcal.draggablePost('#' + dayobjId + ' .post');
373
  edcal.addTooltip(dayobjId);
374
  },
375
 
376
+ /*
377
+ * Confirms if you want to delete the specified post
378
+ */
379
  confirmDelete: function(/*string*/ posttitle) {
380
  if (confirm('You are about to delete this post ' + posttitle + '.\n\n Press cancel to stop, OK to delete.')) {
381
  return true;
383
  return false;
384
  }
385
  },
386
+
387
+ /*
388
+ This is an AJAX function to save the past title when
389
+ the user presses the save button on the tooltip.
390
+ */
391
+ saveTitle: function(/*string*/ postId) {
392
+
393
+ var url = edcal.ajax_url + "?action=edcal_changetitle&postid=" + postId +
394
+ "&title=" + jQuery.URLEncode(jQuery("#edcal-title-edit-field").val());
395
+
396
+ jQuery("#post-" + postId).addClass("loadingclass");
397
+
398
+ jQuery("#tooltip").hide();
399
+
400
+ jQuery.ajax( {
401
+ url: url,
402
+ type: "POST",
403
+ processData: false,
404
+ timeout: 100000,
405
+ dataType: "json",
406
+ success: function(res) {
407
+ edcal.removePostItem(res.post.date, "post-" + res.post.id);
408
+ edcal.addPostItem(res.post, res.post.date);
409
+ edcal.addPostItemDragAndToolltip(res.post.date);
410
+ },
411
+ error: function(xhr) {
412
+ edcal.showError("There was an error contacting your blog.");
413
+ if (xhr.responseText) {
414
+ output("xhr.responseText: " + xhr.responseText);
415
+ }
416
+ }
417
+ });
418
+ },
419
+
420
+ /*
421
+ * Cancels the edit title action in the tooltip.
422
+ */
423
+ cancelEditTitle: function(/*string*/ postTitle) {
424
+ jQuery("#edcal-title-edit-field").val(postTitle);
425
+
426
+ jQuery("#edcal-title-box").hide();
427
+ jQuery("#edcal-title").show();
428
+
429
+ },
430
+
431
+ /*
432
+ * Shows the edit title UI in the tooltip.
433
+ */
434
+ editTitle: function() {
435
+ jQuery("#edcal-title").hide();
436
+ jQuery("#edcal-title-box").show();
437
+
438
+ jQuery("#edcal-title-edit-field").focus();
439
+ jQuery("#edcal-title-edit-field").select();
440
+ },
441
+
442
+ /*
443
+ Switches back to the normal tooltip title view
444
+ and closes the tooltip.
445
+ */
446
+ closeTooltip: function() {
447
+ edcal.cancelEditTitle();
448
+ jQuery("#tooltip").hide();
449
+ },
450
 
451
  /*
452
  * Adds a tooltip to every post in the specified day.
456
  delay: 1500,
457
  bodyHandler: function() {
458
  var post = edcal.findPostForId(dayobjId, jQuery(this).attr("id"));
 
 
459
  var tooltip = '<div class="tooltip">' +
460
+ '<a href="#" id="tipclose" onclick="edcal.closeTooltip(); return false;" title="close"> </a>' +
461
+ '<h3 id="edcal-title">' + post.title +
462
+ ' <a href="#" onclick="edcal.editTitle(); return false;" class="edit-post-status" id="edcal-title-edit">Edit</a>' +
463
+ '</h3>' +
464
+ '<div id="edcal-title-box">' +
465
+ '<input type="text" value="' + post.title + '" id="edcal-title-edit-field"/> &nbsp;&nbsp;' +
466
+ '<span id="edit-slug-buttons">' +
467
+ '<a class="save button" href="#" onclick="edcal.saveTitle(\'' + post.id + '\'); return false;">Save</a> ' +
468
+ '<a href="#" onclick="edcal.cancelEditTitle(\'' + post.title + '\'); return false;" class="cancel">Cancel</a></span>' +
469
+ '</div>' +
470
  '<p>' +
471
  '<i>by</i> ' + post.author + ' <i>on</i> ' +
472
  edcal.getDayFromDayId(post.date).toString("MMMM d, yyyy") +
548
  /*
549
  Gets all the post items for the specified day from
550
  the post cache.
 
 
 
 
 
551
  */
552
  getPostItems: function(/*string*/ dayobjId) {
553
  var postsString = "";
627
 
628
  edcal.currentDirection = direction;
629
 
630
+ var i;
631
+
632
 
633
  if (direction) {
634
+ for (i = 0; i < steps; i++) {
635
  jQuery("#cal > div:first").remove();
636
  edcal.createRow(jQuery("#cal"), true);
637
  edcal._wDate.add(7).days();
638
  }
639
  edcal.alignCal();
640
  } else {
641
+ for (i = 0; i < steps; i++) {
642
  jQuery("#cal > div:last").remove();
643
  edcal.createRow(jQuery("#cal"), false);
644
  edcal._wDate.add(-7).days();
670
  */
671
  if (!direction) {
672
  edcal.getPosts(edcal._wDate.clone(),
673
+ edcal._wDate.clone().add(7 * (edcal.steps + 1)).days());
674
  } else {
675
+ edcal.getPosts(edcal._wDate.clone().add(-7 * (edcal.steps + 1)).days(),
676
  edcal._wDate.clone());
677
  }
678
 
771
  // initialize scrollable
772
  jQuery(".edcal_scrollable").scrollable({
773
  vertical:true,
774
+ size: 5,
775
  keyboardSteps: 1,
776
  speed: 100
777
  // use mousewheel plugin
781
 
782
  edcal.moveTo(Date.today());
783
 
 
 
784
  /*
785
  * The scrollable handles some basic binding. This gets us
786
  * up arrow, down arrow and the mouse wheel.
811
  evt.keyCode === 38 && evt.ctrlKey){ // Ctrl+up up arrow
812
  edcal.move(4, false);
813
  return false;
814
+ } else if (evt.keyCode === 27) { //escape key
815
+ edcal.closeTooltip();
816
+ return false;
817
  }
818
  });
819
 
820
+ edcal.getPosts(Date.today().next().sunday().add(-28).days(),
821
+ Date.today().next().sunday().add(35).days());
822
 
823
  /*
824
  Now we bind the listeners for all of our links and the window
853
  the specified post on the server.
854
  */
855
  changeDate: function(/*string*/ newdate, /*Post*/ post) {
 
 
856
  newdate = edcal.getDayFromDayId(newdate).toString("yyyy-MM-dd");
857
 
858
  var postStatus = "";
893
  url: url,
894
  type: "POST",
895
  processData: false,
896
+ timeout: 100000,
897
  dataType: "json",
898
  success: function(res) {
899
  edcal.removePostItem(res.post.date, "post-" + res.post.id);
909
  }
910
  },
911
  error: function(xhr) {
912
+ showError("There was an error contacting your blog.");
913
  if (xhr.responseText) {
914
  output("xhr.responseText: " + xhr.responseText);
915
  }
930
  specified dates.
931
  */
932
  getPosts: function(/*Date*/ from, /*Date*/ to) {
933
+ //output("getPosts(" + from.toString("dd-MMM-yyyy") + ", " + to.toString("dd-MMM-yyyy") + ")");
934
 
935
  var shouldGet = edcal.cacheDates[from];
936
 
956
  url: url,
957
  type: "GET",
958
  processData: false,
959
+ timeout: 100000,
960
  dataType: "text",
961
  success: function(res) {
962
  jQuery("#loading").hide();
967
  * one used by JQuery.
968
  */
969
  var parsedRes = JSON.parseIt(res);
970
+ var postDates = [];
971
  jQuery.each(parsedRes, function(i, post) {
972
  if (post) {
973
  edcal.removePostItem(post.date, "post-" + post.id);
994
  }, 300);
995
  },
996
  error: function(xhr) {
997
+ edcal.showError("There was an error contacting your blog.");
998
  if (xhr.responseText) {
999
  output("xhr.responseText: " + xhr.responseText);
1000
  }
1007
  edcal.init();
1008
  });
1009
 
1010
+ /*
1011
+ * This code is from the JQuery URL Encode plugin (http://plugins.jquery.com/project/URLEncode);
 
 
 
1012
  */
1013
+ jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
1014
+ while(x<c.length){var m=r.exec(c.substr(x));
1015
+ if(m!==null && m.length>1 && m[1]!=''){o+=m[1];x+=m[1].length;
1016
+ }else{if(c[x]===' '){o+='+';}else{var d=c.charCodeAt(x);var h=d.toString(16);
1017
+ o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;},
1018
+ URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/;
1019
+ while((m=r.exec(o))!==null && m.length>1 && m[1]!==''){b=parseInt(m[1].substr(1),16);
1020
+ t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;}
1021
+ });
1022
+
edcal.php CHANGED
@@ -17,12 +17,14 @@
17
 
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
- Description: An editorial calendar for setting the dates of your WordPress posts
21
- Author: EdCal Project
22
- Author URI: TBD
 
23
  */
24
 
25
  add_action('wp_ajax_edcal_changedate', 'edcal_changedate' );
 
26
  add_action('admin_menu', 'edcal_list_add_management_page');
27
  add_action('wp_ajax_edcal_posts', 'edcal_posts' );
28
  add_action("admin_print_scripts", 'edcal_scripts');
@@ -92,9 +94,17 @@ function edcal_list_admin() {
92
  background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading_post.gif")); ?>');
93
  }
94
 
 
 
 
 
95
  #loading {
96
  background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading.gif")); ?>');
97
  }
 
 
 
 
98
  </style>
99
  <?php
100
 
@@ -108,12 +118,20 @@ function edcal_list_admin() {
108
  <div class="icon32" id="icon-edit"><br/></div>
109
  <h2>Posts Calendar</h2>
110
 
 
 
 
 
111
  <div id="topbar">
112
  <div id="topleft">
113
- <div id="loading"> </div>
 
 
 
 
114
  </div>
115
  <div id="topright">
116
- <a href="#" class="prev page-numbers" id="prevmonth" style="border: none";>&laquo;</a><span id="currentRange"></span><a href="#" class="next page-numbers" id="nextmonth" style="border: none";>&raquo;</a> <a href="#" id="moveToToday">Jump to Today</a>
117
  </div>
118
  </div>
119
 
@@ -151,11 +169,16 @@ function edcal_filter_where($where = '') {
151
  /*
152
  * This function adds all of the JavaScript files we need.
153
  *
154
- * TODO: This list is way too long. We need to minimize and
155
- * combine most of these files. I'm still on the fence if we
156
- * should include these files inline.
157
  */
158
  function edcal_scripts( ) {
 
 
 
 
 
 
 
 
159
  wp_enqueue_script( "ui-core", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.core.js"), array( 'jquery' ) );
160
  wp_enqueue_script( "ui-draggable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.draggable.js"), array( 'jquery' ) );
161
  wp_enqueue_script( "ui-droppable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.droppable.js"), array( 'jquery' ) );
@@ -177,7 +200,7 @@ function edcal_scripts( ) {
177
  * This is an AJAX call that gets the posts between the from date
178
  * and the to date.
179
  */
180
- function edcal_posts( ) {
181
  header("Content-Type: application/json");
182
  global $edcal_startDate, $edcal_endDate;
183
  $edcal_startDate = isset($_GET['from'])?$_GET['from']:null;
@@ -197,7 +220,9 @@ function edcal_posts( ) {
197
  ?>[
198
  <?php
199
  foreach($myposts as $post) {
200
- edcal_postJSON($post);
 
 
201
  }
202
 
203
  ?> ]
@@ -233,6 +258,47 @@ function edcal_postJSON($post) {
233
  <?php
234
  }
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  /*
237
  * This function changes the date on a post. It does optimistic
238
  * concurrency checking by comparing the original post date from
@@ -321,9 +387,23 @@ function edcal_changedate() {
321
  * the date in the local time zone, the modified date in GMT and the
322
  * modified date in the local time zone. We update all of them.
323
  */
 
 
 
 
 
 
 
 
 
 
 
324
  $updated_post = array();
325
  $updated_post['ID'] = $edcal_postid;
326
  $updated_post['post_date'] = $edcal_newDate . substr($post['post_date'], strlen($edcal_newDate));
 
 
 
327
  $updated_post['post_date_gmt'] = $edcal_newDate . substr($post['post_date_gmt'], strlen($edcal_newDate));
328
  $updated_post['post_modified'] = $edcal_newDate . substr($post['post_modified'], strlen($edcal_newDate));
329
  $updated_post['post_modified_gmt'] = $edcal_newDate . substr($post['post_modified_gmt'], strlen($edcal_newDate));
17
 
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
+ Description: An editorial calendar for managing the dates of your WordPress posts
21
+ Author: Mary Vogt and Zack Grossbart
22
+ Version: 0.2
23
+ Author URI: http://www.zackgrossbart.com
24
  */
25
 
26
  add_action('wp_ajax_edcal_changedate', 'edcal_changedate' );
27
+ add_action('wp_ajax_edcal_changetitle', 'edcal_changetitle' );
28
  add_action('admin_menu', 'edcal_list_add_management_page');
29
  add_action('wp_ajax_edcal_posts', 'edcal_posts' );
30
  add_action("admin_print_scripts", 'edcal_scripts');
94
  background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading_post.gif")); ?>');
95
  }
96
 
97
+ .loadingclass:hover {
98
+ background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading_post_hover.gif")); ?>');
99
+ }
100
+
101
  #loading {
102
  background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading.gif")); ?>');
103
  }
104
+
105
+ #tipclose {
106
+ background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/tip_close.gif")); ?>');
107
+ }
108
  </style>
109
  <?php
110
 
118
  <div class="icon32" id="icon-edit"><br/></div>
119
  <h2>Posts Calendar</h2>
120
 
121
+ <div id="loadingcont">
122
+ <div id="loading"> </div>
123
+ </div>
124
+
125
  <div id="topbar">
126
  <div id="topleft">
127
+ <h3>
128
+ <a href="#" title="Go back four weeks." class="prev page-numbers" id="prevmonth" style="border: none;">&laquo;</a>
129
+ <span id="currentRange"></span>
130
+ <a href="#" title="Skip ahead four weeks." class="next page-numbers" id="nextmonth" style="border: none;">&raquo;</a>
131
+ </h2>
132
  </div>
133
  <div id="topright">
134
+ <a href="#" id="moveToToday">Today</a>
135
  </div>
136
  </div>
137
 
169
  /*
170
  * This function adds all of the JavaScript files we need.
171
  *
 
 
 
172
  */
173
  function edcal_scripts( ) {
174
+ wp_enqueue_script( "edcal-lib", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/edcallib.min.js"), array( 'jquery' ) );
175
+ return;
176
+
177
+ /*
178
+ * If you're using one of the specific libraries you should comment out the two lines
179
+ * above this comment.
180
+ */
181
+
182
  wp_enqueue_script( "ui-core", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.core.js"), array( 'jquery' ) );
183
  wp_enqueue_script( "ui-draggable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.draggable.js"), array( 'jquery' ) );
184
  wp_enqueue_script( "ui-droppable", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/lib/ui.droppable.js"), array( 'jquery' ) );
200
  * This is an AJAX call that gets the posts between the from date
201
  * and the to date.
202
  */
203
+ function edcal_posts() {
204
  header("Content-Type: application/json");
205
  global $edcal_startDate, $edcal_endDate;
206
  $edcal_startDate = isset($_GET['from'])?$_GET['from']:null;
220
  ?>[
221
  <?php
222
  foreach($myposts as $post) {
223
+ if (!is_sticky($id)) {
224
+ edcal_postJSON($post);
225
+ }
226
  }
227
 
228
  ?> ]
258
  <?php
259
  }
260
 
261
+ /*
262
+ * This is a helper AJAX function to change the title of a post. It
263
+ * gets called from the save button in the tooltip when you change a
264
+ * post title in a calendar.
265
+ */
266
+ function edcal_changetitle() {
267
+ header("Content-Type: application/json");
268
+ $edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
269
+ $edcal_newTitle = isset($_GET['title'])?$_GET['title']:null;
270
+
271
+ $post = get_post($edcal_postid, ARRAY_A);
272
+ setup_postdata($post);
273
+
274
+ $post['post_title'] = $edcal_newTitle;
275
+
276
+ /*
277
+ * Now we finally update the post into the database
278
+ */
279
+ wp_update_post( $post );
280
+
281
+ /*
282
+ * We finish by returning the latest data for the post in the JSON
283
+ */
284
+ global $post;
285
+ $args = array(
286
+ 'posts_id' => $edcal_postid,
287
+ );
288
+
289
+ $post = get_post($edcal_postid);
290
+ ?>{
291
+ "post" :
292
+ <?php
293
+ edcal_postJSON($post);
294
+ ?>
295
+ }
296
+ <?php
297
+
298
+
299
+ die;
300
+ }
301
+
302
  /*
303
  * This function changes the date on a post. It does optimistic
304
  * concurrency checking by comparing the original post date from
387
  * the date in the local time zone, the modified date in GMT and the
388
  * modified date in the local time zone. We update all of them.
389
  */
390
+ $post['post_date_gmt'] = $post['post_date'];
391
+
392
+ /*
393
+ * When a user creates a draft and never sets a date or publishes it
394
+ * then the GMT date will have a timestamp of 00:00:00 to indicate
395
+ * that the date hasn't been set. In that case we need to specify
396
+ * an edit date or the wp_update_post function will strip our new
397
+ * date out and leave the post as publish immediately.
398
+ */
399
+ $needsEditDate = strpos($post['post_date_gmt'], "00:00:00") === 0;
400
+
401
  $updated_post = array();
402
  $updated_post['ID'] = $edcal_postid;
403
  $updated_post['post_date'] = $edcal_newDate . substr($post['post_date'], strlen($edcal_newDate));
404
+ if ($needsEditDate != -1) {
405
+ $updated_post['edit_date'] = $edcal_newDate . substr($post['post_date'], strlen($edcal_newDate));
406
+ }
407
  $updated_post['post_date_gmt'] = $edcal_newDate . substr($post['post_date_gmt'], strlen($edcal_newDate));
408
  $updated_post['post_modified'] = $edcal_newDate . substr($post['post_modified'], strlen($edcal_newDate));
409
  $updated_post['post_modified_gmt'] = $edcal_newDate . substr($post['post_modified_gmt'], strlen($edcal_newDate));
images/loading_post_hover.gif ADDED
Binary file
images/tip_close.gif ADDED
Binary file
lib/edcallib.min.js ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var a;
2
+ Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb",
3
+ "Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,
4
+ feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,
5
+ tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",
6
+ PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};Date.getMonthNumberFromName=function(b){var c=Date.CultureInfo.monthNames,d=Date.CultureInfo.abbreviatedMonthNames;b=b.toLowerCase();for(var e=0;e<c.length;e++)if(c[e].toLowerCase()==b||d[e].toLowerCase()==b)return e;return-1};
7
+ Date.getDayNumberFromName=function(b){var c=Date.CultureInfo.dayNames,d=Date.CultureInfo.abbreviatedDayNames;b=b.toLowerCase();for(var e=0;e<c.length;e++)if(c[e].toLowerCase()==b||d[e].toLowerCase()==b)return e;return-1};Date.isLeapYear=function(b){return b%4===0&&b%100!==0||b%400===0};Date.getDaysInMonth=function(b,c){return[31,Date.isLeapYear(b)?29:28,31,30,31,30,31,31,30,31,30,31][c]};Date.getTimezoneOffset=function(b,c){return c?Date.CultureInfo.abbreviatedTimeZoneDST[b.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[b.toUpperCase()]};
8
+ Date.getTimezoneAbbreviation=function(b,c){c=c?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard;var d;for(d in c)if(c[d]===b)return d;return null};a=Date.prototype;a.clone=function(){return new Date(this.getTime())};a.compareTo=function(b){if(isNaN(this))throw new Error(this);if(b instanceof Date&&!isNaN(b))return this>b?1:this<b?-1:0;else throw new TypeError(b);};a.equals=function(b){return this.compareTo(b)===0};
9
+ a.between=function(b,c){var d=this.getTime();return d>=b.getTime()&&d<=c.getTime()};a.addMilliseconds=function(b){this.setMilliseconds(this.getMilliseconds()+b);return this};a.addSeconds=function(b){return this.addMilliseconds(b*1000)};a.addMinutes=function(b){return this.addMilliseconds(b*60000)};a.addHours=function(b){return this.addMilliseconds(b*3600000)};a.addDays=function(b){return this.addMilliseconds(b*86400000)};a.addWeeks=function(b){return this.addMilliseconds(b*604800000)};
10
+ a.addMonths=function(b){var c=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+b);this.setDate(Math.min(c,this.getDaysInMonth()));return this};a.addYears=function(b){return this.addMonths(b*12)};
11
+ a.add=function(b){if(typeof b=="number"){this._orient=b;return this}b=b;if(b.millisecond||b.milliseconds)this.addMilliseconds(b.millisecond||b.milliseconds);if(b.second||b.seconds)this.addSeconds(b.second||b.seconds);if(b.minute||b.minutes)this.addMinutes(b.minute||b.minutes);if(b.hour||b.hours)this.addHours(b.hour||b.hours);if(b.month||b.months)this.addMonths(b.month||b.months);if(b.year||b.years)this.addYears(b.year||b.years);if(b.day||b.days)this.addDays(b.day||b.days);return this};
12
+ Date._validate=function(b,c,d,e){if(typeof b!="number")throw new TypeError(b+" is not a Number.");else if(b<c||b>d)throw new RangeError(b+" is not a valid value for "+e+".");return true};Date.validateMillisecond=function(b){return Date._validate(b,0,999,"milliseconds")};Date.validateSecond=function(b){return Date._validate(b,0,59,"seconds")};Date.validateMinute=function(b){return Date._validate(b,0,59,"minutes")};Date.validateHour=function(b){return Date._validate(b,0,23,"hours")};
13
+ Date.validateDay=function(b,c,d){return Date._validate(b,1,Date.getDaysInMonth(c,d),"days")};Date.validateMonth=function(b){return Date._validate(b,0,11,"months")};Date.validateYear=function(b){return Date._validate(b,1,9999,"seconds")};a=Date.prototype;
14
+ a.set=function(b){b=b;if(!b.millisecond&&b.millisecond!==0)b.millisecond=-1;if(!b.second&&b.second!==0)b.second=-1;if(!b.minute&&b.minute!==0)b.minute=-1;if(!b.hour&&b.hour!==0)b.hour=-1;if(!b.day&&b.day!==0)b.day=-1;if(!b.month&&b.month!==0)b.month=-1;if(!b.year&&b.year!==0)b.year=-1;b.millisecond!=-1&&Date.validateMillisecond(b.millisecond)&&this.addMilliseconds(b.millisecond-this.getMilliseconds());b.second!=-1&&Date.validateSecond(b.second)&&this.addSeconds(b.second-this.getSeconds());b.minute!=
15
+ -1&&Date.validateMinute(b.minute)&&this.addMinutes(b.minute-this.getMinutes());b.hour!=-1&&Date.validateHour(b.hour)&&this.addHours(b.hour-this.getHours());b.month!==-1&&Date.validateMonth(b.month)&&this.addMonths(b.month-this.getMonth());b.year!=-1&&Date.validateYear(b.year)&&this.addYears(b.year-this.getFullYear());b.day!=-1&&Date.validateDay(b.day,this.getFullYear(),this.getMonth())&&this.addDays(b.day-this.getDate());b.timezone&&this.setTimezone(b.timezone);b.timezoneOffset&&this.setTimezoneOffset(b.timezoneOffset);
16
+ return this};a.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};a.isLeapYear=function(){var b=this.getFullYear();return b%4===0&&b%100!==0||b%400===0};a.isWeekday=function(){return!(this.is().sat()||this.is().sun())};a.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};a.moveToFirstDayOfMonth=function(){return this.set({day:1})};a.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};
17
+ a.moveToDayOfWeek=function(b,c){b=(b-this.getDay()+7*(c||+1))%7;return this.addDays(b===0?(b+=7*(c||+1)):b)};a.moveToMonth=function(b,c){b=(b-this.getMonth()+12*(c||+1))%12;return this.addMonths(b===0?(b+=12*(c||+1)):b)};a.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000)};
18
+ a.getWeekOfYear=function(b){var c=this.getFullYear(),d=this.getMonth(),e=this.getDate();b=b||Date.CultureInfo.firstDayOfWeek;var g=8-(new Date(c,0,1)).getDay();if(g==8)g=1;d=(Date.UTC(c,d,e,0,0,0)-Date.UTC(c,0,1,0,0,0))/86400000+1;d=Math.floor((d-g+7)/7);if(d===b){c--;c=8-(new Date(c,0,1)).getDay();d=c==2||c==8?53:52}return d};a.isDST=function(){console.log("isDST");return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};
19
+ a.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};a.setTimezoneOffset=function(b){var c=this.getTimezoneOffset();b=Number(b)*-6/10;this.addMinutes(b-c);return this};a.setTimezone=function(b){return this.setTimezoneOffset(Date.getTimezoneOffset(b))};a.getUTCOffset=function(){var b=this.getTimezoneOffset()*-10/6;if(b<0){b=(b-10000).toString();return b[0]+b.substr(2)}else{b=(b+10000).toString();return"+"+b.substr(1)}};
20
+ a.getDayName=function(b){return b?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};a.getMonthName=function(b){return b?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};a._toString=Date.prototype.toString;
21
+ a.toString=function(b){var c=this;function d(e){return e.toString().length==1?"0"+e:e}return b?b.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(e){switch(e){case "hh":return d(c.getHours()<13?c.getHours():c.getHours()-12);case "h":return c.getHours()<13?c.getHours():c.getHours()-12;case "HH":return d(c.getHours());case "H":return c.getHours();case "mm":return d(c.getMinutes());case "m":return c.getMinutes();case "ss":return d(c.getSeconds());case "s":return c.getSeconds();case "yyyy":return c.getFullYear();
22
+ case "yy":return c.getFullYear().toString().substring(2,4);case "dddd":return c.getDayName();case "ddd":return c.getDayName(true);case "dd":return d(c.getDate());case "d":return c.getDate().toString();case "MMMM":return c.getMonthName();case "MMM":return c.getMonthName(true);case "MM":return d(c.getMonth()+1);case "M":return c.getMonth()+1;case "t":return c.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case "tt":return c.getHours()<12?Date.CultureInfo.amDesignator:
23
+ Date.CultureInfo.pmDesignator;case "zzz":case "zz":case "z":return""}}):this._toString()};Date.now=function(){return new Date};Date.today=function(){return Date.now().clearTime()};a=Date.prototype;a._orient=+1;a.next=function(){this._orient=+1;return this};a.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this};a._is=false;a.is=function(){this._is=true;return this};Number.prototype._dateElement="day";
24
+ Number.prototype.fromNow=function(){var b={};b[this._dateElement]=this;return Date.now().add(b)};Number.prototype.ago=function(){var b={};b[this._dateElement]=this*-1;return Date.now().add(b)};
25
+ (function(){var b=Date.prototype,c=Number.prototype,d="sunday monday tuesday wednesday thursday friday saturday".split(/\s/),e="january february march april may june july august september october november december".split(/\s/),g="Millisecond Second Minute Hour Day Week Month Year".split(/\s/);function i(j){return function(){if(this._is){this._is=false;return this.getDay()==j}return this.moveToDayOfWeek(j,this._orient)}}for(var k=0;k<d.length;k++)b[d[k]]=b[d[k].substring(0,3)]=i(k);function m(j){return function(){if(this._is){this._is=
26
+ false;return this.getMonth()===j}return this.moveToMonth(j,this._orient)}}for(d=0;d<e.length;d++)b[e[d]]=b[e[d].substring(0,3)]=m(d);function h(j){return function(){if(j.substring(j.length-1)!="s")j+="s";return this["add"+j](this._orient)}}function f(j){return function(){this._dateElement=j;return this}}for(d=0;d<g.length;d++){e=g[d].toLowerCase();b[e]=b[e+"s"]=h(g[d]);c[e]=c[e+"s"]=f(e)}})();a=Date.prototype;a.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ")};
27
+ a.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern)};a.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern)};a.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern)};a.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern)};
28
+ a.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};
29
+ (function(){Date.Parsing={Exception:function(k){this.message="Parse error at '"+k.substring(0,10)+" ...'"}};var b=Date.Parsing,c=b.Operators={rtoken:function(k){return function(m){var h=m.match(k);if(h)return[h[0],m.substring(h[0].length)];else throw new b.Exception(m);}},token:function(){return function(k){return c.rtoken(new RegExp("^s*"+k+"s*"))(k)}},stoken:function(k){return c.rtoken(new RegExp("^"+k))},until:function(k){return function(m){for(var h=[],f=null;m.length;){try{f=k.call(this,m)}catch(j){h.push(f[0]);
30
+ m=f[1];continue}break}return[h,m]}},many:function(k){return function(m){for(var h=[],f=null;m.length;){try{f=k.call(this,m)}catch(j){return[h,m]}h.push(f[0]);m=f[1]}return[h,m]}},optional:function(k){return function(m){var h=null;try{h=k.call(this,m)}catch(f){return[null,m]}return[h[0],h[1]]}},not:function(k){return function(m){try{k.call(this,m)}catch(h){return[null,m]}throw new b.Exception(m);}},ignore:function(k){return k?function(m){var h=null;h=k.call(this,m);return[null,h[1]]}:null},product:function(){for(var k=
31
+ arguments[0],m=Array.prototype.slice.call(arguments,1),h=[],f=0;f<k.length;f++)h.push(c.each(k[f],m));return h},cache:function(k){var m={},h=null;return function(f){try{h=m[f]=m[f]||k.call(this,f)}catch(j){h=m[f]=j}if(h instanceof b.Exception)throw h;else return h}},any:function(){var k=arguments;return function(m){for(var h=null,f=0;f<k.length;f++)if(k[f]!=null){try{h=k[f].call(this,m)}catch(j){h=null}if(h)return h}throw new b.Exception(m);}},each:function(){var k=arguments;return function(m){for(var h=
32
+ [],f=null,j=0;j<k.length;j++)if(k[j]!=null){try{f=k[j].call(this,m)}catch(n){throw new b.Exception(m);}h.push(f[0]);m=f[1]}return[h,m]}},all:function(){var k=arguments,m=m;return m.each(m.optional(k))},sequence:function(k,m,h){m=m||c.rtoken(/^\s*/);h=h||null;if(k.length==1)return k[0];return function(f){for(var j=null,n=null,p=[],s=0;s<k.length;s++){try{j=k[s].call(this,f)}catch(t){break}p.push(j[0]);try{n=m.call(this,j[1])}catch(q){n=null;break}f=n[1]}if(!j)throw new b.Exception(f);if(n)throw new b.Exception(n[1]);
33
+ if(h)try{j=h.call(this,j[1])}catch(u){throw new b.Exception(j[1]);}return[p,j?j[1]:f]}},between:function(k,m,h){h=h||k;var f=c.each(c.ignore(k),m,c.ignore(h));return function(j){j=f.call(this,j);return[[j[0][0],r[0][2]],j[1]]}},list:function(k,m,h){m=m||c.rtoken(/^\s*/);h=h||null;return k instanceof Array?c.each(c.product(k.slice(0,-1),c.ignore(m)),k.slice(-1),c.ignore(h)):c.each(c.many(c.each(k,c.ignore(m))),px,c.ignore(h))},set:function(k,m,h){m=m||c.rtoken(/^\s*/);h=h||null;return function(f){var j=
34
+ null;for(var n=j=null,p=null,s=[[],f],t=false,q=0;q<k.length;q++){j=n=null;t=k.length==1;try{j=k[q].call(this,f)}catch(u){continue}p=[[j[0]],j[1]];if(j[1].length>0&&!t)try{n=m.call(this,j[1])}catch(x){t=true}else t=true;if(!t&&n[1].length===0)t=true;if(!t){j=[];for(t=0;t<k.length;t++)q!=t&&j.push(k[t]);j=c.set(j,m).call(this,n[1]);if(j[0].length>0){p[0]=p[0].concat(j[0]);p[1]=j[1]}}if(p[1].length<s[1].length)s=p;if(s[1].length===0)break}if(s[0].length===0)return s;if(h){try{n=h.call(this,s[1])}catch(l){throw new b.Exception(s[1]);
35
+ }s[1]=n[1]}return s}},forward:function(k,m){return function(h){return k[m].call(this,h)}},replace:function(k,m){return function(h){h=k.call(this,h);return[m,h[1]]}},process:function(k,m){return function(h){h=k.call(this,h);return[m.call(this,h[0]),h[1]]}},min:function(k,m){return function(h){var f=m.call(this,h);if(f[0].length<k)throw new b.Exception(h);return f}}};function d(k){return function(){var m=null,h=[];if(arguments.length>1)m=Array.prototype.slice.call(arguments);else if(arguments[0]instanceof
36
+ Array)m=arguments[0];if(m)for(var f=0,j=m.shift();f<j.length;){m.unshift(j[f]);h.push(k.apply(null,m));m.shift();return h}else return k.apply(null,arguments)}}for(var e="optional not ignore cache".split(/\s/),g=0;g<e.length;g++)c[e[g]]=d(c[e[g]]);function i(k){return function(){return arguments[0]instanceof Array?k.apply(null,arguments[0]):k.apply(null,arguments)}}e="each any all".split(/\s/);for(g=0;g<e.length;g++)c[e[g]]=i(c[e[g]])})();
37
+ (function(){function b(h){for(var f=[],j=0;j<h.length;j++)if(h[j]instanceof Array)f=f.concat(b(h[j]));else h[j]&&f.push(h[j]);return f}Date.Grammar={};Date.Translator={hour:function(h){return function(){this.hour=Number(h)}},minute:function(h){return function(){this.minute=Number(h)}},second:function(h){return function(){this.second=Number(h)}},meridian:function(h){return function(){this.meridian=h.slice(0,1).toLowerCase()}},timezone:function(h){return function(){var f=h.replace(/[^\d\+\-]/g,"");
38
+ if(f.length)this.timezoneOffset=Number(f);else this.timezone=h.toLowerCase()}},day:function(h){var f=h[0];return function(){this.day=Number(f.match(/\d+/)[0])}},month:function(h){return function(){this.month=h.length==3?Date.getMonthNumberFromName(h):Number(h)-1}},year:function(h){return function(){var f=Number(h);this.year=h.length>2?f:f+(f+2000<Date.CultureInfo.twoDigitYearMax?2000:1900)}},rday:function(h){return function(){switch(h){case "yesterday":this.days=-1;break;case "tomorrow":this.days=
39
+ 1;break;case "today":this.days=0;break;case "now":this.days=0;this.now=true;break}}},finishExact:function(h){h=h instanceof Array?h:[h];var f=new Date;this.year=f.getFullYear();this.month=f.getMonth();this.day=1;for(f=this.second=this.minute=this.hour=0;f<h.length;f++)h[f]&&h[f].call(this);this.hour=this.meridian=="p"&&this.hour<13?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month))throw new RangeError(this.day+" is not a valid value for days.");h=new Date(this.year,this.month,
40
+ this.day,this.hour,this.minute,this.second);if(this.timezone)h.set({timezone:this.timezone});else this.timezoneOffset&&h.set({timezoneOffset:this.timezoneOffset});return h},finish:function(h){h=h instanceof Array?b(h):[h];if(h.length===0)return null;for(var f=0;f<h.length;f++)typeof h[f]=="function"&&h[f].call(this);if(this.now)return new Date;h=Date.today();if(f=!!(this.days!=null||this.orient||this.operator)){var j,n;n=this.orient=="past"||this.operator=="subtract"?-1:1;if(this.weekday){this.unit=
41
+ "day";f=Date.getDayNumberFromName(this.weekday)-h.getDay();j=7;this.days=f?(f+n*j)%j:n*j}if(this.month){this.unit="month";f=this.month-h.getMonth();j=12;this.months=f?(f+n*j)%j:n*j;this.month=null}if(!this.unit)this.unit="day";if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value)this.value=1;if(this.unit=="week"){this.unit="day";this.value*=7}this[this.unit+"s"]=this.value*n}return h.add(this)}else{if(this.meridian&&this.hour)this.hour=this.hour<13&&this.meridian=="p"?this.hour+12:this.hour;
42
+ if(this.weekday&&!this.day)this.day=h.addDays(Date.getDayNumberFromName(this.weekday)-h.getDay()).getDate();if(this.month&&!this.day)this.day=1;return h.set(this)}}};var c=Date.Parsing.Operators,d=Date.Grammar,e=Date.Translator,g;d.datePartDelimiter=c.rtoken(/^([\s\-\.\,\/\x27]+)/);d.timePartDelimiter=c.stoken(":");d.whiteSpace=c.rtoken(/^\s*/);d.generalDelimiter=c.rtoken(/^(([\s\,]|at|on)+)/);var i={};d.ctoken=function(h){var f=i[h];if(!f){f=Date.CultureInfo.regexPatterns;for(var j=h.split(/\s+/),
43
+ n=[],p=0;p<j.length;p++)n.push(c.replace(c.rtoken(f[j[p]]),j[p]));f=i[h]=c.any.apply(null,n)}return f};d.ctoken2=function(h){return c.rtoken(Date.CultureInfo.regexPatterns[h])};d.h=c.cache(c.process(c.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),e.hour));d.hh=c.cache(c.process(c.rtoken(/^(0[0-9]|1[0-2])/),e.hour));d.H=c.cache(c.process(c.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),e.hour));d.HH=c.cache(c.process(c.rtoken(/^([0-1][0-9]|2[0-3])/),e.hour));d.m=c.cache(c.process(c.rtoken(/^([0-5][0-9]|[0-9])/),e.minute));
44
+ d.mm=c.cache(c.process(c.rtoken(/^[0-5][0-9]/),e.minute));d.s=c.cache(c.process(c.rtoken(/^([0-5][0-9]|[0-9])/),e.second));d.ss=c.cache(c.process(c.rtoken(/^[0-5][0-9]/),e.second));d.hms=c.cache(c.sequence([d.H,d.mm,d.ss],d.timePartDelimiter));d.t=c.cache(c.process(d.ctoken2("shortMeridian"),e.meridian));d.tt=c.cache(c.process(d.ctoken2("longMeridian"),e.meridian));d.z=c.cache(c.process(c.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),e.timezone));d.zz=c.cache(c.process(c.rtoken(/^(\+|\-)\s*\d\d\d\d/),e.timezone));
45
+ d.zzz=c.cache(c.process(d.ctoken2("timezone"),e.timezone));d.timeSuffix=c.each(c.ignore(d.whiteSpace),c.set([d.tt,d.zzz]));d.time=c.each(c.optional(c.ignore(c.stoken("T"))),d.hms,d.timeSuffix);d.d=c.cache(c.process(c.each(c.rtoken(/^([0-2]\d|3[0-1]|\d)/),c.optional(d.ctoken2("ordinalSuffix"))),e.day));d.dd=c.cache(c.process(c.each(c.rtoken(/^([0-2]\d|3[0-1])/),c.optional(d.ctoken2("ordinalSuffix"))),e.day));d.ddd=d.dddd=c.cache(c.process(d.ctoken("sun mon tue wed thu fri sat"),function(h){return function(){this.weekday=
46
+ h}}));d.M=c.cache(c.process(c.rtoken(/^(1[0-2]|0\d|\d)/),e.month));d.MM=c.cache(c.process(c.rtoken(/^(1[0-2]|0\d)/),e.month));d.MMM=d.MMMM=c.cache(c.process(d.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),e.month));d.y=c.cache(c.process(c.rtoken(/^(\d\d?)/),e.year));d.yy=c.cache(c.process(c.rtoken(/^(\d\d)/),e.year));d.yyy=c.cache(c.process(c.rtoken(/^(\d\d?\d?\d?)/),e.year));d.yyyy=c.cache(c.process(c.rtoken(/^(\d\d\d\d)/),e.year));g=function(){return c.each(c.any.apply(null,arguments),
47
+ c.not(d.ctoken2("timeContext")))};d.day=g(d.d,d.dd);d.month=g(d.M,d.MMM);d.year=g(d.yyyy,d.yy);d.orientation=c.process(d.ctoken("past future"),function(h){return function(){this.orient=h}});d.operator=c.process(d.ctoken("add subtract"),function(h){return function(){this.operator=h}});d.rday=c.process(d.ctoken("yesterday tomorrow today now"),e.rday);d.unit=c.process(d.ctoken("minute hour day week month year"),function(h){return function(){this.unit=h}});d.value=c.process(c.rtoken(/^\d\d?(st|nd|rd|th)?/),
48
+ function(h){return function(){this.value=h.replace(/\D/g,"")}});d.expression=c.set([d.rday,d.operator,d.value,d.unit,d.orientation,d.ddd,d.MMM]);g=function(){return c.set(arguments,d.datePartDelimiter)};d.mdy=g(d.ddd,d.month,d.day,d.year);d.ymd=g(d.ddd,d.year,d.month,d.day);d.dmy=g(d.ddd,d.day,d.month,d.year);d.date=function(h){return(d[Date.CultureInfo.dateElementOrder]||d.mdy).call(this,h)};d.format=c.process(c.many(c.any(c.process(c.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),
49
+ function(h){if(d[h])return d[h];else throw Date.Parsing.Exception(h);}),c.process(c.rtoken(/^[^dMyhHmstz]+/),function(h){return c.ignore(c.stoken(h))}))),function(h){return c.process(c.each.apply(null,h),e.finishExact)});var k={};function m(h){return k[h]=k[h]||d.format(h)[0]}d.formats=function(h){if(h instanceof Array){for(var f=[],j=0;j<h.length;j++)f.push(m(h[j]));return c.any.apply(null,f)}else return m(h)};d._formats=d.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz",
50
+ "d"]);d._start=c.process(c.set([d.date,d.time,d.expression],d.generalDelimiter,d.whiteSpace),e.finish);d.start=function(h){try{var f=d._formats.call({},h);if(f[1].length===0)return f}catch(j){}return d._start.call({},h)}})();Date._parse=Date.parse;Date.parse=function(b){var c=null;if(!b)return null;try{c=Date.Grammar.start.call({},b)}catch(d){return null}return c[1].length===0?c[0]:null};
51
+ Date.getParseFunction=function(b){var c=Date.Grammar.formats(b);return function(d){var e=null;try{e=c.call({},d)}catch(g){return null}return e[1].length===0?e[0]:null}};Date.parseExact=function(b,c){return Date.getParseFunction(c)(b)};var humanMsg={setup:function(b,c){humanMsg.msgID="humanMsg";humanMsg.logID="humanMsgLog";if(b==undefined)b="body";humanMsg.msgOpacity=0.8;if(c!=undefined)humanMsg.msgOpacity=parseFloat(c);jQuery(b).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><p></p><div class="round"></div></div>');jQuery("#"+humanMsg.logID+" p").click(function(){jQuery(this).siblings("ul").slideToggle()})},displayMsg:function(b){if(b!=""){clearTimeout(humanMsg.t2);jQuery("#"+humanMsg.msgID+" p").html(b);
52
+ jQuery("#"+humanMsg.msgID+"").show().animate({opacity:humanMsg.msgOpacity},200,function(){jQuery("#"+humanMsg.logID).show().children("ul").prepend("<li>"+b+"</li>").children("li:first").slideDown(200);jQuery("#"+humanMsg.logID+" ul").css("display")=="none"&&jQuery("#"+humanMsg.logID+" p").animate({bottom:40},200,"linear",function(){jQuery(this).animate({bottom:0},300,"easeOutBounce",function(){jQuery(this).css({bottom:0})})})});humanMsg.t1=setTimeout("humanMsg.bindEvents()",700);humanMsg.t2=setTimeout("humanMsg.removeMsg()",
53
+ 5000)}},bindEvents:function(){jQuery(window).mousemove(humanMsg.removeMsg).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},removeMsg:function(){jQuery(window).unbind("mousemove",humanMsg.removeMsg).unbind("click",humanMsg.removeMsg).unbind("keypress",humanMsg.removeMsg);jQuery("#"+humanMsg.msgID).css("opacity")==humanMsg.msgOpacity&&jQuery("#"+humanMsg.msgID).animate({opacity:0},500,function(){jQuery(this).hide()})}};jQuery(document).ready(function(){humanMsg.setup()});(function(b){b.fn.bgIframe=b.fn.bgiframe=function(c){if(b.browser.msie&&parseInt(b.browser.version)<=6){c=b.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c||{});var d=function(g){return g&&g.constructor==Number?g+"px":g},e='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":
54
+ d(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":d(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":d(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":d(c.height))+';"/>';return this.each(function(){b("> iframe.bgiframe",this).length==0&&this.insertBefore(document.createElement(e),this.firstChild)})}return this};if(!b.browser.version)b.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1]})(jQuery);(function(b){b.each({focus:"focusin",blur:"focusout"},function(c,d){b.event.special[d]={setup:function(){if(b.browser.msie)return false;this.addEventListener(c,b.event.special[d].handler,true)},teardown:function(){if(b.browser.msie)return false;this.removeEventListener(c,b.event.special[d].handler,true)},handler:function(e){arguments[0]=b.event.fix(e);arguments[0].type=d;return b.event.handle.apply(this,arguments)}}});b.extend(b.fn,{delegate:function(c,d,e){return this.bind(c,function(g){var i=b(g.target);
55
+ if(i.is(d))return e.apply(i,arguments)})},triggerEvent:function(c,d){return this.triggerHandler(c,[b.event.fix({type:c,target:d})])}})})(jQuery);(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function d(e,g){var i=this,k=b(this),m=!g.vertical,h=e.children(),f=0,j;c||(c=i);b.each(g,function(l,o){b.isFunction(o)&&k.bind(l,o)});if(h.length>
56
+ 1)h=b(g.items,e);function n(l){var o=b(l);return g.globalNav?o:e.parent().find(l)}e.data("finder",n);var p=n(g.prev),s=n(g.next),t=n(g.prevPage),q=n(g.nextPage);b.extend(i,{getIndex:function(){return f},getClickIndex:function(){var l=i.getItems();return l.index(l.filter("."+g.activeClass))},getConf:function(){return g},getSize:function(){return i.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/g.size)},getPageIndex:function(){return Math.ceil(f/g.size)},getNaviButtons:function(){return p.add(s).add(t).add(q)},
57
+ getRoot:function(){return e},getItemWrap:function(){return h},getItems:function(){return h.children(g.item)},getVisibleItems:function(){return i.getItems().slice(f,f+g.size)},seekTo:function(l,o,v){if(l<0)l=0;if(f===l)return i;if(b.isFunction(o))v=o;if(l>i.getSize()-g.size)return g.loop?i.begin():this.end();var w=i.getItems().eq(l);if(!w.length)return i;var y=b.Event("onBeforeSeek");k.trigger(y,[l]);if(y.isDefaultPrevented())return i;if(o===undefined||b.isFunction(o))o=g.speed;function z(){v&&v.call(i,
58
+ l);k.trigger("onSeek",[l])}m?h.animate({left:-w.position().left},o,g.easing,z):h.animate({top:-w.position().top},o,g.easing,z);c=i;f=l;y=b.Event("onStart");k.trigger(y,[l]);if(y.isDefaultPrevented())return i;p.add(t).toggleClass(g.disabledClass,l===0);s.add(q).toggleClass(g.disabledClass,l>=i.getSize()-g.size);return i},move:function(l,o,v){j=l>0;return this.seekTo(f+l,o,v)},next:function(l,o){return this.move(1,l,o)},prev:function(l,o){return this.move(-1,l,o)},movePage:function(l,o,v){j=l>0;var w=
59
+ g.size*l,y=f%g.size;if(y>0)w+=l>0?-y:g.size-y;return this.move(w,o,v)},prevPage:function(l,o){return this.movePage(-1,l,o)},nextPage:function(l,o){return this.movePage(1,l,o)},setPage:function(l,o,v){return this.seekTo(l*g.size,o,v)},begin:function(l,o){j=false;return this.seekTo(0,l,o)},end:function(l,o){j=true;var v=this.getSize()-g.size;return v>0?this.seekTo(v,l,o):i},reload:function(){k.trigger("onReload");return i},focus:function(){return c=i},click:function(l){var o=i.getItems().eq(l),v=g.activeClass,
60
+ w=g.size;if(l<0||l>=i.getSize())return i;if(w==1){if(g.loop)return i.next();if(l===0||l==i.getSize()-1)j=j===undefined?true:!j;return j===false?i.prev():i.next()}if(w==2){l==f&&l--;i.getItems().removeClass(v);o.addClass(v);return i.seekTo(l,time,fn)}if(!o.hasClass(v)){i.getItems().removeClass(v);o.addClass(v);o=Math.floor(w/2);o=l-o;if(o>i.getSize()-w)o=i.getSize()-w;if(o!==l)return i.seekTo(o)}return i},bind:function(l,o){k.bind(l,o);return i},unbind:function(l){k.unbind(l);return i}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),
61
+ function(l,o){i[o]=function(v){return i.bind(o,v)}});p.addClass(g.disabledClass).click(function(){i.prev()});s.click(function(){i.next()});q.click(function(){i.nextPage()});i.getSize()<g.size&&s.add(q).addClass(g.disabledClass);t.addClass(g.disabledClass).click(function(){i.prevPage()});var u=g.hoverClass,x="keydown."+Math.random().toString().substring(10);i.onReload(function(){u&&i.getItems().hover(function(){b(this).addClass(u)},function(){b(this).removeClass(u)});g.clickable&&i.getItems().each(function(l){b(this).unbind("click.scrollable").bind("click.scrollable",
62
+ function(o){if(!b(o.target).is("a"))return i.click(l)})});g.keyboard?b(document).unbind(x).bind(x,function(l){if(!(l.altKey||l.ctrlKey))if(!(g.keyboard!="static"&&c!=i)){var o=g.keyboardSteps;if(m&&(l.keyCode==37||l.keyCode==39)){i.move(l.keyCode==37?-o:o);return l.preventDefault()}if(!m&&(l.keyCode==38||l.keyCode==40)){i.move(l.keyCode==38?-o:o);return l.preventDefault()}return true}}):b(document).unbind(x)});i.reload()}b.fn.scrollable=function(e){var g=this.eq(typeof e=="number"?e:0).data("scrollable");
63
+ if(g)return g;var i=b.extend({},b.tools.scrollable.conf);e=b.extend(i,e);e.keyboardSteps=e.keyboardSteps||e.size;this.each(function(){g=new d(b(this),e);b(this).data("scrollable",g)});return e.api?g:this}})(jQuery);
64
+ (function(b){var c=b.tools.scrollable;c.plugins=c.plugins||{};c.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};b.fn.autoscroll=function(d){if(typeof d=="number")d={interval:d};var e=b.extend({},c.plugins.autoscroll.conf),g;b.extend(e,d);this.each(function(){var i=b(this).scrollable();if(i)g=i;var k,m,h=true;i.play=function(){if(!k){h=false;k=setInterval(function(){i.move(e.steps)},e.interval);i.move(e.steps)}};i.pause=function(){k=clearInterval(k)};
65
+ i.stop=function(){i.pause();h=true};e.autopause&&i.getRoot().add(i.getNaviButtons()).hover(function(){i.pause();clearInterval(m)},function(){h||(m=setTimeout(i.play,e.interval))});e.autoplay&&setTimeout(i.play,e.interval)});return e.api?g:this}})(jQuery);
66
+ (function(b){var c=b.tools.scrollable;c.plugins=c.plugins||{};c.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};b.fn.navigator=function(d){var e=b.extend({},c.plugins.navigator.conf),g;if(typeof d=="string")d={navi:d};d=b.extend(e,d);this.each(function(){var i=b(this).scrollable(),k=i.getRoot(),m=k.data("finder").call(null,d.navi),h=null,f=i.getNaviButtons();if(i)g=i;i.getNaviButtons=function(){return f.add(m)};function j(){if(!m.children().length||
67
+ m.data("navi")==i){m.empty();m.data("navi",i);for(var n=0;n<i.getPageAmount();n++)m.append(b("<"+(d.naviItem||"a")+"/>"));h=m.children().each(function(p){var s=b(this);s.click(function(t){i.setPage(p);return t.preventDefault()});d.indexed&&s.text(p);d.idPrefix&&s.attr("id",d.idPrefix+p)})}else{h=d.naviItem?m.find(d.naviItem):m.children();h.each(function(p){var s=b(this);s.click(function(t){i.setPage(p);return t.preventDefault()})})}h.eq(0).addClass(d.activeClass)}i.onStart(function(){var n=d.activeClass;
68
+ h.removeClass(n).eq(i.getPageIndex()).addClass(n)});i.onReload(function(){j()});j();k=h.filter("[href="+location.hash+"]");k.length&&i.move(h.index(k))});return d.api?g:this}})(jQuery);
69
+ (function(b){b.fn.wheel=function(g){return this[g?"bind":"trigger"]("wheel",g)};b.event.special.wheel={setup:function(){b.event.add(this,c,d,{})},teardown:function(){b.event.remove(this,c,d)}};var c=!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+(b.browser.version<"1.9"?" mousemove":"");function d(g){switch(g.type){case "mousemove":return b.extend(g.data,{clientX:g.clientX,clientY:g.clientY,pageX:g.pageX,pageY:g.pageY});case "DOMMouseScroll":b.extend(g,g.data);g.delta=-g.detail/3;break;case "mousewheel":g.delta=
70
+ g.wheelDelta/120;break}g.type="wheel";return b.event.handle.call(this,g,g.delta)}var e=b.tools.scrollable;e.plugins=e.plugins||{};e.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};b.fn.mousewheel=function(g){var i=b.extend({},e.plugins.mousewheel.conf),k;if(typeof g=="number")g={speed:g};g=b.extend(i,g);this.each(function(){var m=b(this).scrollable();if(m)k=m;m.getRoot().wheel(function(h,f){m.move(f<0?1:-1,g.speed||50);return false})});return g.api?k:this}})(jQuery);(function(b){var c={},d,e,g,i="auto",k=b.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),m=false;b.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){b.tooltip.blocked=!b.tooltip.blocked}};b.fn.extend({tooltip:function(q){q=b.extend({},b.tooltip.defaults,q);h(q);return this.each(function(){b.data(this,"tooltip",q);this.tOpacity=c.parent.css("opacity")}).mouseover(n).mouseup(function(){p()})},hideWhenEmpty:function(){return this.each(function(){b(this)[b(this).html()?
71
+ "show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function h(q){if(!c.parent){c.parent=b('<div id="'+q.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();b.fn.bgiframe&&c.parent.bgiframe();c.body=b("div.body",c.parent)}}function f(q){if(q)return b.data(q,"tooltip");else b("#tooltip").hide()}function j(q){m=!!f(this).track;b(document.body).bind("mousemove",s);s(q)}function n(){if(!(b.tooltip.blocked||this==d||!this.tooltipText&&
72
+ !f(this).bodyHandler)){d=this;j.apply(d,arguments)}}function p(){if(f(d)){c.parent.css({left:g,right:i,top:e});var q=t(),u=c.parent[0];if(q.x+q.cx<u.offsetLeft+u.offsetWidth){g-=u.offsetWidth+20+f(d).left+150;c.parent.css({left:g+"px"}).addClass("viewport-right")}if(q.y+q.cy<u.offsetTop+u.offsetHeight){e-=u.offsetHeight+20+f(d).top;c.parent.css({top:e+"px"}).addClass("viewport-bottom")}if(f(d).bodyHandler){q=f(d).bodyHandler.call(d);q.nodeType||q.jquery?c.body.empty().append(q):c.body.html(q);c.body.show()}else if(f(d).showBody){q=
73
+ f(d).showBody;c.body.empty();u=0;for(var x;x=q[u];u++){u>0&&c.body.append("<br/>");c.body.append(x)}c.body.hideWhenEmpty()}else c.body.hide();c.parent.addClass(f(d).extraClass);f(d).fixPNG&&c.parent.fixPNG();if(f(d))if((!k||!b.fn.bgiframe)&&f(d).fade)if(c.parent.is(":animated"))c.parent.stop().show().fadeTo(f(d).fade,d.tOpacity);else c.parent.is(":visible")?c.parent.fadeTo(f(d).fade,d.tOpacity):c.parent.fadeIn(f(d).fade);else c.parent.show()}}function s(q){if(!b.tooltip.blocked)if(f(d))if(!(q&&q.target.tagName==
74
+ "OPTION")){!m&&c.parent.is(":visible")&&b(document.body).unbind("mousemove",s);if(d==null)b(document.body).unbind("mousemove",s);else{c.parent.removeClass("viewport-right").removeClass("viewport-bottom");g=c.parent[0].offsetLeft;e=c.parent[0].offsetTop;if(q){g=q.pageX+f(d).left;e=q.pageY+f(d).top;i="auto";if(f(d).positionLeft){i=b(window).width()-left;g="auto"}}}}}function t(){return{x:b(window).scrollLeft(),y:b(window).scrollTop(),cx:b(window).width(),cy:b(window).height()}}})(jQuery);if(!this.JSON)this.JSON={};
75
+ (function(){function b(f){return f<10?"0"+f:f}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,d=
76
+ /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,g,i={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;function m(f){d.lastIndex=0;return d.test(f)?'"'+f.replace(d,function(j){var n=i[j];return typeof n==="string"?n:"\\u"+("0000"+j.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function h(f,j){var n,p,s=e,t,q=j[f];if(q&&typeof q==="object"&&typeof q.toJSON==="function")q=q.toJSON(f);
77
+ if(typeof k==="function")q=k.call(j,f,q);switch(typeof q){case "string":return m(q);case "number":return isFinite(q)?String(q):"null";case "boolean":case "null":return String(q);case "object":if(!q)return"null";e+=g;t=[];if(Object.prototype.toString.apply(q)==="[object Array]"){p=q.length;for(f=0;f<p;f+=1)t[f]=h(f,q)||"null";j=t.length===0?"[]":e?"[\n"+e+t.join(",\n"+e)+"\n"+s+"]":"["+t.join(",")+"]";e=s;return j}if(k&&typeof k==="object"){p=k.length;for(f=0;f<p;f+=1){n=k[f];if(typeof n==="string")if(j=
78
+ h(n,q))t.push(m(n)+(e?": ":":")+j)}}else for(n in q)if(Object.hasOwnProperty.call(q,n))if(j=h(n,q))t.push(m(n)+(e?": ":":")+j);j=t.length===0?"{}":e?"{\n"+e+t.join(",\n"+e)+"\n"+s+"}":"{"+t.join(",")+"}";e=s;return j}}if(typeof JSON.stringify!=="function")JSON.stringify=function(f,j,n){var p;g=e="";if(typeof n==="number")for(p=0;p<n;p+=1)g+=" ";else if(typeof n==="string")g=n;if((k=j)&&typeof j!=="function"&&(typeof j!=="object"||typeof j.length!=="number"))throw new Error("JSON.stringify");return h("",
79
+ {"":f})};if(typeof JSON.parseIt!=="function")JSON.parseIt=function(f,j){function n(p,s){var t,q,u=p[s];if(u&&typeof u==="object")for(t in u)if(Object.hasOwnProperty.call(u,t)){q=n(u,t);if(q!==undefined)u[t]=q;else delete u[t]}return j.call(p,s,u)}c.lastIndex=0;if(c.test(f))f=f.replace(c,function(p){return"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(f.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
80
+ "]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){f=eval("("+f+")");return typeof j==="function"?n({"":f},""):f}throw new SyntaxError("JSON.parseIt");}})();(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function d(e,g){var i=this,k=b(this),m=!g.vertical,h=e.children(),f=0,j;c||(c=i);b.each(g,function(l,o){b.isFunction(o)&&k.bind(l,o)});if(h.length>
81
+ 1)h=b(g.items,e);function n(l){var o=b(l);return g.globalNav?o:e.parent().find(l)}e.data("finder",n);var p=n(g.prev),s=n(g.next),t=n(g.prevPage),q=n(g.nextPage);b.extend(i,{getIndex:function(){return f},getClickIndex:function(){var l=i.getItems();return l.index(l.filter("."+g.activeClass))},getConf:function(){return g},getSize:function(){return i.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/g.size)},getPageIndex:function(){return Math.ceil(f/g.size)},getNaviButtons:function(){return p.add(s).add(t).add(q)},
82
+ getRoot:function(){return e},getItemWrap:function(){return h},getItems:function(){return h.children(g.item)},getVisibleItems:function(){return i.getItems().slice(f,f+g.size)},seekTo:function(l,o,v){if(l<0)l=0;if(f===l)return i;if(b.isFunction(o))v=o;if(l>i.getSize()-g.size)return g.loop?i.begin():this.end();var w=i.getItems().eq(l);if(!w.length)return i;var y=b.Event("onBeforeSeek");k.trigger(y,l>f);if(y.isDefaultPrevented())return i;if(o===undefined||b.isFunction(o))o=g.speed;function z(){v&&v.call(i,
83
+ l);k.trigger("onSeek",[l])}m?h.animate({left:-w.position().left},o,g.easing,z):h.animate({top:-w.position().top},o,g.easing,z);c=i;f=l;y=b.Event("onStart");k.trigger(y,[l]);if(y.isDefaultPrevented())return i;p.add(t).toggleClass(g.disabledClass,l===0);s.add(q).toggleClass(g.disabledClass,l>=i.getSize()-g.size);return i},move:function(l,o,v){j=l>0;return this.seekTo(f+l,o,v)},next:function(l,o){return this.move(1,l,o)},prev:function(l,o){return this.move(-1,l,o)},movePage:function(l,o,v){j=l>0;var w=
84
+ g.size*l,y=f%g.size;if(y>0)w+=l>0?-y:g.size-y;return this.move(w,o,v)},prevPage:function(l,o){return this.movePage(-1,l,o)},nextPage:function(l,o){return this.movePage(1,l,o)},setPage:function(l,o,v){return this.seekTo(l*g.size,o,v)},begin:function(l,o){j=false;return this.seekTo(0,l,o)},end:function(l,o){j=true;var v=this.getSize()-g.size;return v>0?this.seekTo(v,l,o):i},reload:function(){k.trigger("onReload");return i},focus:function(){return c=i},click:function(l){var o=i.getItems().eq(l),v=g.activeClass,
85
+ w=g.size;if(l<0||l>=i.getSize())return i;if(w==1){if(g.loop)return i.next();if(l===0||l==i.getSize()-1)j=j===undefined?true:!j;return j===false?i.prev():i.next()}if(w==2){l==f&&l--;i.getItems().removeClass(v);o.addClass(v);return i.seekTo(l,time,fn)}if(!o.hasClass(v)){i.getItems().removeClass(v);o.addClass(v);o=Math.floor(w/2);o=l-o;if(o>i.getSize()-w)o=i.getSize()-w;if(o!==l)return i.seekTo(o)}return i},bind:function(l,o){k.bind(l,o);return i},unbind:function(l){k.unbind(l);return i}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),
86
+ function(l,o){i[o]=function(v){return i.bind(o,v)}});p.addClass(g.disabledClass).click(function(){i.prev()});s.click(function(){i.next()});q.click(function(){i.nextPage()});i.getSize()<g.size&&s.add(q).addClass(g.disabledClass);t.addClass(g.disabledClass).click(function(){i.prevPage()});var u=g.hoverClass,x="keydown."+Math.random().toString().substring(10);i.onReload(function(){u&&i.getItems().hover(function(){b(this).addClass(u)},function(){b(this).removeClass(u)});g.clickable&&i.getItems().each(function(l){b(this).unbind("click.scrollable").bind("click.scrollable",
87
+ function(o){if(!b(o.target).is("a"))return i.click(l)})});g.keyboard?b(document).unbind(x).bind(x,function(l){if(!(l.altKey||l.ctrlKey))if(!(g.keyboard!="static"&&c!=i)){var o=g.keyboardSteps;if(m&&(l.keyCode==37||l.keyCode==39)){i.move(l.keyCode==37?-o:o);return l.preventDefault()}if(!m&&(l.keyCode==38||l.keyCode==40)){i.move(l.keyCode==38?-o:o);return l.preventDefault()}return true}}):b(document).unbind(x)});i.reload()}b.fn.scrollable=function(e){var g=this.eq(typeof e=="number"?e:0).data("scrollable");
88
+ if(g)return g;var i=b.extend({},b.tools.scrollable.conf);e=b.extend(i,e);e.keyboardSteps=e.keyboardSteps||e.size;this.each(function(){g=new d(b(this),e);b(this).data("scrollable",g)});return e.api?g:this}})(jQuery);(function(b){b.fn.wheel=function(g){return this[g?"bind":"trigger"]("wheel",g)};b.event.special.wheel={setup:function(){b.event.add(this,c,d,{})},teardown:function(){b.event.remove(this,c,d)}};var c=!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+(b.browser.version<"1.9"?" mousemove":"");function d(g){switch(g.type){case "mousemove":return b.extend(g.data,{clientX:g.clientX,clientY:g.clientY,pageX:g.pageX,pageY:g.pageY});case "DOMMouseScroll":b.extend(g,g.data);g.delta=-g.detail/3;break;case "mousewheel":g.delta=
89
+ g.wheelDelta/120;break}g.type="wheel";return b.event.handle.call(this,g,g.delta)}var e=b.tools.scrollable;e.plugins=e.plugins||{};e.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};b.fn.mousewheel=function(g){var i=b.extend({},e.plugins.mousewheel.conf),k;if(typeof g=="number")g={speed:g};g=b.extend(i,g);this.each(function(){var m=b(this).scrollable();if(m)k=m;m.getRoot().wheel(function(h,f){m.move(f<0?1:-1,g.speed||50);return false})});return g.api?k:this}})(jQuery);jQuery.ui||function(b){var c=b.fn.remove,d=b.browser.mozilla&&parseFloat(b.browser.version)<1.9;b.ui={version:"1.7.2",plugin:{add:function(f,j,n){f=b.ui[f].prototype;for(var p in n){f.plugins[p]=f.plugins[p]||[];f.plugins[p].push([j,n[p]])}},call:function(f,j,n){if((j=f.plugins[j])&&f.element[0].parentNode)for(var p=0;p<j.length;p++)f.options[j[p][0]]&&j[p][1].apply(f.element,n)}},contains:function(f,j){return document.compareDocumentPosition?f.compareDocumentPosition(j)&16:f!==j&&f.contains(j)},
90
+ hasScroll:function(f,j){if(b(f).css("overflow")=="hidden")return false;j=j&&j=="left"?"scrollLeft":"scrollTop";var n=false;if(f[j]>0)return true;f[j]=1;n=f[j]>0;f[j]=0;return n},isOverAxis:function(f,j,n){return f>j&&f<j+n},isOver:function(f,j,n,p,s,t){return b.ui.isOverAxis(f,n,s)&&b.ui.isOverAxis(j,p,t)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,
91
+ NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var e=b.attr,g=b.fn.removeAttr,i="http://www.w3.org/2005/07/aaa",k=/^aria-/,m=/^wairole:/;b.attr=function(f,j,n){var p=n!==undefined;return j=="role"?p?e.call(this,f,j,"wairole:"+n):(e.apply(this,arguments)||"").replace(m,""):k.test(j)?p?f.setAttributeNS(i,j.replace(k,"aaa:"),n):e.call(this,f,j.replace(k,"aaa:")):e.apply(this,arguments)};b.fn.removeAttr=function(f){return k.test(f)?
92
+ this.each(function(){this.removeAttributeNS(i,f.replace(k,""))}):g.call(this,f)}}b.fn.extend({remove:function(){b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return c.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var f;
93
+ f=b.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(b.curCSS(this,"position",1))&&/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||
94
+ !f.length?b(document):f}});b.extend(b.expr[":"],{data:function(f,j,n){return!!b.data(f,n[3])},focusable:function(f){var j=f.nodeName.toLowerCase(),n=b.attr(f,"tabindex");return(/input|select|textarea|button|object/.test(j)?!f.disabled:"a"==j||"area"==j?f.href||!isNaN(n):!isNaN(n))&&!b(f)["area"==j?"parents":"closest"](":hidden").length},tabbable:function(f){var j=b.attr(f,"tabindex");return(isNaN(j)||j>=0)&&b(f).is(":focusable")}});function h(f,j,n,p){function s(q){q=b[f][j][q]||[];return typeof q==
95
+ "string"?q.split(/,?\s+/):q}var t=s("getter");if(p.length==1&&typeof p[0]=="string")t=t.concat(s("getterSetter"));return b.inArray(n,t)!=-1}b.widget=function(f,j){var n=f.split(".")[0];f=f.split(".")[1];b.fn[f]=function(p){var s=typeof p=="string",t=Array.prototype.slice.call(arguments,1);if(s&&p.substring(0,1)=="_")return this;if(s&&h(n,f,p,t)){var q=b.data(this[0],f);return q?q[p].apply(q,t):undefined}return this.each(function(){var u=b.data(this,f);!u&&!s&&b.data(this,f,new b[n][f](this,p))._init();
96
+ u&&s&&b.isFunction(u[p])&&u[p].apply(u,t)})};b[n]=b[n]||{};b[n][f]=function(p,s){var t=this;this.namespace=n;this.widgetName=f;this.widgetEventPrefix=b[n][f].eventPrefix||f;this.widgetBaseClass=n+"-"+f;this.options=b.extend({},b.widget.defaults,b[n][f].defaults,b.metadata&&b.metadata.get(p)[f],s);this.element=b(p).bind("setData."+f,function(q,u,x){if(q.target==p)return t._setData(u,x)}).bind("getData."+f,function(q,u){if(q.target==p)return t._getData(u)}).bind("remove",function(){return t.destroy()})};
97
+ b[n][f].prototype=b.extend({},b.widget.prototype,j);b[n][f].getterSetter="option"};b.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(f,j){var n=f,p=this;if(typeof f=="string"){if(j===undefined)return this._getData(f);n={};n[f]=j}b.each(n,function(s,t){p._setData(s,t)})},_getData:function(f){return this.options[f]},_setData:function(f,
98
+ j){this.options[f]=j;if(f=="disabled")this.element[j?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",j)},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(f,j,n){var p=this.options[f];f=f==this.widgetEventPrefix?f:this.widgetEventPrefix+f;j=b.Event(j);j.type=f;if(j.originalEvent){f=b.event.props.length;for(var s;f;){s=b.event.props[--f];j[s]=j.originalEvent[s]}}this.element.trigger(j,
99
+ n);return!(b.isFunction(p)&&p.call(this.element[0],j,n)===false||j.isDefaultPrevented())}};b.widget.defaults={disabled:false};b.ui.mouse={_mouseInit:function(){var f=this;this.element.bind("mousedown."+this.widgetName,function(j){return f._mouseDown(j)}).bind("click."+this.widgetName,function(j){if(f._preventClickEvent){f._preventClickEvent=false;j.stopImmediatePropagation();return false}});if(b.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable",
100
+ "on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);b.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},_mouseDown:function(f){f.originalEvent=f.originalEvent||{};if(!f.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(f);this._mouseDownEvent=f;var j=this,n=f.which==1,p=typeof this.options.cancel=="string"?b(f.target).parents().add(f.target).filter(this.options.cancel).length:false;if(!n||p||!this._mouseCapture(f))return true;
101
+ this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){j.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=this._mouseStart(f)!==false;if(!this._mouseStarted){f.preventDefault();return true}}this._mouseMoveDelegate=function(s){return j._mouseMove(s)};this._mouseUpDelegate=function(s){return j._mouseUp(s)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+
102
+ this.widgetName,this._mouseUpDelegate);b.browser.safari||f.preventDefault();return f.originalEvent.mouseHandled=true}},_mouseMove:function(f){if(b.browser.msie&&!f.button)return this._mouseUp(f);if(this._mouseStarted){this._mouseDrag(f);return f.preventDefault()}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,f)!==false)?this._mouseDrag(f):this._mouseUp(f);return!this._mouseStarted},_mouseUp:function(f){b(document).unbind("mousemove."+
103
+ this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=f.target==this._mouseDownEvent.target;this._mouseStop(f)}return false},_mouseDistanceMet:function(f){return Math.max(Math.abs(this._mouseDownEvent.pageX-f.pageX),Math.abs(this._mouseDownEvent.pageY-f.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},
104
+ _mouseStop:function(){},_mouseCapture:function(){return true}};b.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(jQuery);(function(b){b.widget("ui.draggable",b.extend({},b.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");
105
+ this._mouseDestroy()}},_mouseCapture:function(c){var d=this.options;if(this.helper||d.disabled||b(c.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(c);if(!this.handle)return false;return true},_mouseStart:function(c){var d=this.options;this.helper=this._createHelper(c);this._cacheHelperProportions();if(b.ui.ddmanager)b.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();
106
+ this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt);d.containment&&this._setContainment();this._trigger("start",c);this._cacheHelperProportions();b.ui.ddmanager&&
107
+ !d.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(c,true);return true},_mouseDrag:function(c,d){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!d){d=this._uiHash();this._trigger("drag",c,d);this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+
108
+ "px";b.ui.ddmanager&&b.ui.ddmanager.drag(this,c);return false},_mouseStop:function(c){var d=false;if(b.ui.ddmanager&&!this.options.dropBehaviour)d=b.ui.ddmanager.drop(this,c);if(this.dropped){d=this.dropped;this.dropped=false}if(this.options.revert=="invalid"&&!d||this.options.revert=="valid"&&d||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)){var e=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){e._trigger("stop",
109
+ c);e._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(c){var d=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==c.target)d=true});return d},_createHelper:function(c){var d=this.options;c=b.isFunction(d.helper)?b(d.helper.apply(this.element[0],[c])):d.helper=="clone"?this.element.clone():this.element;c.parents("body").length||c.appendTo(d.appendTo=="parent"?
110
+ this.element[0].parentNode:d.appendTo);c[0]!=this.element[0]&&!/(fixed|absolute)/.test(c.css("position"))&&c.css("position","absolute");return c},_adjustOffsetFromHelper:function(c){if(c.left!=undefined)this.offset.click.left=c.left+this.margins.left;if(c.right!=undefined)this.offset.click.left=this.helperProportions.width-c.right+this.margins.left;if(c.top!=undefined)this.offset.click.top=c.top+this.margins.top;if(c.bottom!=undefined)this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top},
111
+ _getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)c={top:0,left:0};return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),
112
+ 10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.element.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),
113
+ 10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var c=this.options;if(c.containment=="parent")c.containment=this.helper[0].parentNode;if(c.containment=="document"||c.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(c.containment=="document"?document:window).width()-this.helperProportions.width-
114
+ this.margins.left,(b(c.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)jQuery/.test(c.containment)&&c.containment.constructor!=Array){var d=b(c.containment)[0];if(d){c=b(c.containment).offset();var e=b(d).css("overflow")!="hidden";this.containment=[c.left+(parseInt(b(d).css("borderLeftWidth"),10)||0)+(parseInt(b(d).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(b(d).css("borderTopWidth"),
115
+ 10)||0)+(parseInt(b(d).css("paddingTop"),10)||0)-this.margins.top,c.left+(e?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(b(d).css("borderLeftWidth"),10)||0)-(parseInt(b(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,c.top+(e?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(b(d).css("borderTopWidth"),10)||0)-(parseInt(b(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(c.containment.constructor==
116
+ Array)this.containment=c.containment},_convertPositionTo:function(c,d){if(!d)d=this.position;c=c=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(e[0].tagName);return{top:d.top+this.offset.relative.top*c+this.offset.parent.top*c-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:e.scrollTop())*
117
+ c),left:d.left+this.offset.relative.left*c+this.offset.parent.left*c-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:e.scrollLeft())*c)}},_generatePosition:function(c){var d=this.options,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(e[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=
118
+ document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var i=c.pageX,k=c.pageY;if(this.originalPosition){if(this.containment){if(c.pageX-this.offset.click.left<this.containment[0])i=this.containment[0]+this.offset.click.left;if(c.pageY-this.offset.click.top<this.containment[1])k=this.containment[1]+this.offset.click.top;if(c.pageX-this.offset.click.left>this.containment[2])i=this.containment[2]+this.offset.click.left;if(c.pageY-this.offset.click.top>this.containment[3])k=
119
+ this.containment[3]+this.offset.click.top}if(d.grid){k=this.originalPageY+Math.round((k-this.originalPageY)/d.grid[1])*d.grid[1];k=this.containment?!(k-this.offset.click.top<this.containment[1]||k-this.offset.click.top>this.containment[3])?k:!(k-this.offset.click.top<this.containment[1])?k-d.grid[1]:k+d.grid[1]:k;i=this.originalPageX+Math.round((i-this.originalPageX)/d.grid[0])*d.grid[0];i=this.containment?!(i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2])?
120
+ i:!(i-this.offset.click.left<this.containment[0])?i-d.grid[0]:i+d.grid[0]:i}}return{top:k-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:e.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:e.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");
121
+ this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(c,d,e){e=e||this._uiHash();b.ui.plugin.call(this,c,[d,e]);if(c=="drag")this.positionAbs=this._convertPositionTo("absolute");return b.widget.prototype._trigger.call(this,c,d,e)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));b.extend(b.ui.draggable,{version:"1.7.2",
122
+ eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});b.ui.plugin.add("draggable","connectToSortable",{start:function(c,
123
+ d){var e=b(this).data("draggable"),g=e.options,i=b.extend({},d,{item:e.element});e.sortables=[];b(g.connectToSortable).each(function(){var k=b.data(this,"sortable");if(k&&!k.options.disabled){e.sortables.push({instance:k,shouldRevert:k.options.revert});k._refreshItems();k._trigger("activate",c,i)}})},stop:function(c,d){var e=b(this).data("draggable"),g=b.extend({},d,{item:e.element});b.each(e.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;e.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=
124
+ false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;e.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,g)}})},drag:function(c,d){var e=b(this).data("draggable"),g=this;b.each(e.sortables,function(){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;
125
+ this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=b(g).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return d.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=
126
+ e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}this.instance.currentItem&&this.instance._mouseDrag(c)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;
127
+ this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();e._trigger("fromSortable",c);e.dropped=false}})}});b.ui.plugin.add("draggable","cursor",{start:function(){var c=b("body"),d=b(this).data("draggable").options;if(c.css("cursor"))d._cursor=c.css("cursor");c.css("cursor",
128
+ d.cursor)},stop:function(){if(b(this).data("draggable")){var c=b(this).data("draggable").options;c._cursor&&b("body").css("cursor",c._cursor)}}});b.ui.plugin.add("draggable","iframeFix",{start:function(){var c=b(this).data("draggable").options;b(c.iframeFix===true?"iframe":c.iframeFix).each(function(){b('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(b(this).offset()).appendTo("body")})},
129
+ stop:function(){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(c,d){c=b(d.helper);d=b(this).data("draggable").options;if(c.css("opacity"))d._opacity=c.css("opacity");c.css("opacity",d.opacity)},stop:function(c,d){c=b(this).data("draggable").options;c._opacity&&b(d.helper).css("opacity",c._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var c=b(this).data("draggable");if(c.scrollParent[0]!=
130
+ document&&c.scrollParent[0].tagName!="HTML")c.overflowOffset=c.scrollParent.offset()},drag:function(c){var d=b(this).data("draggable"),e=d.options,g=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")if(d.overflowOffset.top+d.scrollParent[0].offsetHeight-c.pageY<e.scrollSensitivity)d.scrollParent[0].scrollTop=g=d.scrollParent[0].scrollTop+e.scrollSpeed;else if(c.pageY-d.overflowOffset.top<e.scrollSensitivity)d.scrollParent[0].scrollTop=g=d.scrollParent[0].scrollTop-
131
+ e.scrollSpeed;if(!e.axis||e.axis!="y")if(d.overflowOffset.left+d.scrollParent[0].offsetWidth-c.pageX<e.scrollSensitivity)d.scrollParent[0].scrollLeft=g=d.scrollParent[0].scrollLeft+e.scrollSpeed;else if(c.pageX-d.overflowOffset.left<e.scrollSensitivity)d.scrollParent[0].scrollLeft=g=d.scrollParent[0].scrollLeft-e.scrollSpeed}else{if(!e.axis||e.axis!="x")if(c.pageY-b(document).scrollTop()<e.scrollSensitivity)g=b(document).scrollTop(b(document).scrollTop()-e.scrollSpeed);else if(b(window).height()-
132
+ (c.pageY-b(document).scrollTop())<e.scrollSensitivity)g=b(document).scrollTop(b(document).scrollTop()+e.scrollSpeed);if(!e.axis||e.axis!="y")if(c.pageX-b(document).scrollLeft()<e.scrollSensitivity)g=b(document).scrollLeft(b(document).scrollLeft()-e.scrollSpeed);else if(b(window).width()-(c.pageX-b(document).scrollLeft())<e.scrollSensitivity)g=b(document).scrollLeft(b(document).scrollLeft()+e.scrollSpeed)}g!==false&&b.ui.ddmanager&&!e.dropBehaviour&&b.ui.ddmanager.prepareOffsets(d,c)}});b.ui.plugin.add("draggable",
133
+ "snap",{start:function(){var c=b(this).data("draggable"),d=c.options;c.snapElements=[];b(d.snap.constructor!=String?d.snap.items||":data(draggable)":d.snap).each(function(){var e=b(this),g=e.offset();this!=c.element[0]&&c.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:g.top,left:g.left})})},drag:function(c,d){for(var e=b(this).data("draggable"),g=e.options,i=g.snapTolerance,k=d.offset.left,m=k+e.helperProportions.width,h=d.offset.top,f=h+e.helperProportions.height,j=
134
+ e.snapElements.length-1;j>=0;j--){var n=e.snapElements[j].left,p=n+e.snapElements[j].width,s=e.snapElements[j].top,t=s+e.snapElements[j].height;if(n-i<k&&k<p+i&&s-i<h&&h<t+i||n-i<k&&k<p+i&&s-i<f&&f<t+i||n-i<m&&m<p+i&&s-i<h&&h<t+i||n-i<m&&m<p+i&&s-i<f&&f<t+i){if(g.snapMode!="inner"){var q=Math.abs(s-f)<=i,u=Math.abs(t-h)<=i,x=Math.abs(n-m)<=i,l=Math.abs(p-k)<=i;if(q)d.position.top=e._convertPositionTo("relative",{top:s-e.helperProportions.height,left:0}).top-e.margins.top;if(u)d.position.top=e._convertPositionTo("relative",
135
+ {top:t,left:0}).top-e.margins.top;if(x)d.position.left=e._convertPositionTo("relative",{top:0,left:n-e.helperProportions.width}).left-e.margins.left;if(l)d.position.left=e._convertPositionTo("relative",{top:0,left:p}).left-e.margins.left}var o=q||u||x||l;if(g.snapMode!="outer"){q=Math.abs(s-h)<=i;u=Math.abs(t-f)<=i;x=Math.abs(n-k)<=i;l=Math.abs(p-m)<=i;if(q)d.position.top=e._convertPositionTo("relative",{top:s,left:0}).top-e.margins.top;if(u)d.position.top=e._convertPositionTo("relative",{top:t-e.helperProportions.height,
136
+ left:0}).top-e.margins.top;if(x)d.position.left=e._convertPositionTo("relative",{top:0,left:n}).left-e.margins.left;if(l)d.position.left=e._convertPositionTo("relative",{top:0,left:p-e.helperProportions.width}).left-e.margins.left}if(!e.snapElements[j].snapping&&(q||u||x||l||o))e.options.snap.snap&&e.options.snap.snap.call(e.element,c,b.extend(e._uiHash(),{snapItem:e.snapElements[j].item}));e.snapElements[j].snapping=q||u||x||l||o}else{e.snapElements[j].snapping&&e.options.snap.release&&e.options.snap.release.call(e.element,
137
+ c,b.extend(e._uiHash(),{snapItem:e.snapElements[j].item}));e.snapElements[j].snapping=false}}}});b.ui.plugin.add("draggable","stack",{start:function(){var c=b(this).data("draggable").options,d=b.makeArray(b(c.stack.group)).sort(function(e,g){return(parseInt(b(e).css("zIndex"),10)||c.stack.min)-(parseInt(b(g).css("zIndex"),10)||c.stack.min)});b(d).each(function(e){this.style.zIndex=c.stack.min+e});this[0].style.zIndex=c.stack.min+d.length}});b.ui.plugin.add("draggable","zIndex",{start:function(c,d){c=
138
+ b(d.helper);d=b(this).data("draggable").options;if(c.css("zIndex"))d._zIndex=c.css("zIndex");c.css("zIndex",d.zIndex)},stop:function(c,d){c=b(this).data("draggable").options;c._zIndex&&b(d.helper).css("zIndex",c._zIndex)}})})(jQuery);(function(b){b.widget("ui.droppable",{_init:function(){var c=this.options,d=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&b.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(d)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};b.ui.ddmanager.droppables[this.options.scope]=b.ui.ddmanager.droppables[this.options.scope]||[];b.ui.ddmanager.droppables[this.options.scope].push(this);this.options.addClasses&&
139
+ this.element.addClass("ui-droppable")},destroy:function(){for(var c=b.ui.ddmanager.droppables[this.options.scope],d=0;d<c.length;d++)c[d]==this&&c.splice(d,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(c,d){if(c=="accept")this.options.accept=d&&b.isFunction(d)?d:function(e){return e.is(d)};else b.widget.prototype._setData.apply(this,arguments)},_activate:function(c){var d=b.ui.ddmanager.current;this.options.activeClass&&
140
+ this.element.addClass(this.options.activeClass);d&&this._trigger("activate",c,this.ui(d))},_deactivate:function(c){var d=b.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);d&&this._trigger("deactivate",c,this.ui(d))},_over:function(c){var d=b.ui.ddmanager.current;if(!(!d||(d.currentItem||d.element)[0]==this.element[0]))if(this.options.accept.call(this.element[0],d.currentItem||d.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
141
+ this._trigger("over",c,this.ui(d))}},_out:function(c){var d=b.ui.ddmanager.current;if(!(!d||(d.currentItem||d.element)[0]==this.element[0]))if(this.options.accept.call(this.element[0],d.currentItem||d.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",c,this.ui(d))}},_drop:function(c,d){var e=d||b.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]==this.element[0])return false;var g=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var i=
142
+ b.data(this,"droppable");if(i.options.greedy&&b.ui.intersect(e,b.extend(i,{offset:i.element.offset()}),i.options.tolerance)){g=true;return false}});if(g)return false;if(this.options.accept.call(this.element[0],e.currentItem||e.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",c,this.ui(e));return this.element}return false},ui:function(c){return{draggable:c.currentItem||
143
+ c.element,helper:c.helper,position:c.position,absolutePosition:c.positionAbs,offset:c.positionAbs}}});b.extend(b.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});b.ui.intersect=function(c,d,e){if(!d.offset)return false;var g=(c.positionAbs||c.position.absolute).left,i=g+c.helperProportions.width,k=(c.positionAbs||c.position.absolute).top,m=k+c.helperProportions.height,h=d.offset.left,
144
+ f=h+d.proportions.width,j=d.offset.top,n=j+d.proportions.height;switch(e){case "fit":return h<g&&i<f&&j<k&&m<n;case "intersect":return h<g+c.helperProportions.width/2&&i-c.helperProportions.width/2<f&&j<k+c.helperProportions.height/2&&m-c.helperProportions.height/2<n;case "pointer":e=(c.positionAbs||c.position.absolute).left+(c.clickOffset||c.offset.click).left;c=(c.positionAbs||c.position.absolute).top+(c.clickOffset||c.offset.click).top;return d=b.ui.isOver(c,e,j,h,d.proportions.height,d.proportions.width);
145
+ case "touch":return(k>=j&&k<=n||m>=j&&m<=n||k<j&&m>n)&&(g>=h&&g<=f||i>=h&&i<=f||g<h&&i>f);default:return false}};b.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(c,d){var e=b.ui.ddmanager.droppables[c.options.scope],g=d?d.type:null,i=(c.currentItem||c.element).find(":data(droppable)").andSelf(),k=0;a:for(;k<e.length;k++)if(!(e[k].options.disabled||c&&!e[k].options.accept.call(e[k].element[0],c.currentItem||c.element))){for(var m=0;m<i.length;m++)if(i[m]==e[k].element[0]){e[k].proportions.height=
146
+ 0;continue a}e[k].visible=e[k].element.css("display")!="none";if(e[k].visible){e[k].offset=e[k].element.offset();e[k].proportions={width:e[k].element[0].offsetWidth,height:e[k].element[0].offsetHeight};g=="mousedown"&&e[k]._activate.call(e[k],d)}}},drop:function(c,d){var e=false;b.each(b.ui.ddmanager.droppables[c.options.scope],function(){if(this.options){if(!this.options.disabled&&this.visible&&b.ui.intersect(c,this,this.options.tolerance))e=this._drop.call(this,d);if(!this.options.disabled&&this.visible&&
147
+ this.options.accept.call(this.element[0],c.currentItem||c.element)){this.isout=1;this.isover=0;this._deactivate.call(this,d)}}});return e},drag:function(c,d){c.options.refreshPositions&&b.ui.ddmanager.prepareOffsets(c,d);b.each(b.ui.ddmanager.droppables[c.options.scope],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var e=b.ui.intersect(c,this,this.options.tolerance);if(e=!e&&this.isover==1?"isout":e&&this.isover==0?"isover":null){var g;if(this.options.greedy){var i=this.element.parents(":data(droppable):eq(0)");
148
+ if(i.length){g=b.data(i[0],"droppable");g.greedyChild=e=="isover"?1:0}}if(g&&e=="isover"){g.isover=0;g.isout=1;g._out.call(g,d)}this[e]=1;this[e=="isout"?"isover":"isout"]=0;this[e=="isover"?"_over":"_out"].call(this,d);if(g&&e=="isout"){g.isout=0;g.isover=1;g._over.call(g,d)}}}})}}})(jQuery);
lib/jquery.bgiframe.js CHANGED
@@ -65,8 +65,7 @@
65
  * Default: "javascript:false;"
66
  *
67
  * @name bgiframe
68
- * @type jQuery
69
- * @cat Plugins/bgiframe
70
  * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
71
  */
72
  jQuery.fn.bgIframe = jQuery.fn.bgiframe = function(s) {
65
  * Default: "javascript:false;"
66
  *
67
  * @name bgiframe
68
+ @cat Plugins/bgiframe
 
69
  * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
70
  */
71
  jQuery.fn.bgIframe = jQuery.fn.bgiframe = function(s) {
lib/jquery.tooltip.js CHANGED
@@ -19,12 +19,9 @@
19
  var helper = {},
20
  // the current tooltipped element
21
  current,
22
- // the title of the current element, used for restoring
23
- title,
24
- // timeout id for delayed tooltips
25
- tID,
26
- //timout for hiding delayed tooltips
27
- htID,
28
  // IE 5.5 or 6
29
  IE = jQuery.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
30
  // flag for mouse tracking
@@ -53,38 +50,13 @@
53
  return this.each(function() {
54
  jQuery.data(this, "tooltip", settings);
55
  this.tOpacity = helper.parent.css("opacity");
56
- // copy tooltip into its own expando and remove the title
57
- this.tooltipText = this.title;
58
- jQuery(this).removeAttr("title");
59
- // also remove alt attribute to prevent default tooltip in IE
60
- this.alt = "";
61
  })
62
  .mouseover(save)
63
- .mouseout(hide)
64
- .click(hide);
 
65
  },
66
- fixPNG: IE ? function() {
67
- return this.each(function () {
68
- var image = jQuery(this).css('backgroundImage');
69
- if (image.match(/^url\(["']?(.*\.png)["']?\)jQuery/i)) {
70
- image = RegExp.jQuery1;
71
- jQuery(this).css({
72
- 'backgroundImage': 'none',
73
- 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
74
- }).each(function () {
75
- var position = jQuery(this).css('position');
76
- if (position != 'absolute' && position != 'relative')
77
- jQuery(this).css('position', 'relative');
78
- });
79
- }
80
- });
81
- } : function() { return this; },
82
- unfixPNG: IE ? function() {
83
- return this.each(function () {
84
- jQuery(this).css({'filter': '', backgroundImage: ''});
85
- });
86
- } : function() { return this; },
87
- hideWhenEmpty: function() {
88
  return this.each(function() {
89
  jQuery(this)[ jQuery(this).html() ? "show" : "hide" ]();
90
  });
@@ -110,12 +82,7 @@
110
  helper.parent.bgiframe();
111
 
112
  // save references to title and url elements
113
- helper.title = jQuery('h3', helper.parent);
114
- helper.body = jQuery('div.body', helper.parent);
115
- helper.url = jQuery('div.url', helper.parent);
116
- jQuery("#" + settings.id).click(function() {
117
- hide();
118
- });
119
  }
120
 
121
  function tooltipsettings(element) {
@@ -128,43 +95,66 @@
128
 
129
  // main event handler to start showing tooltips
130
  function handle(event) {
131
- // show helper, either with timeout or on instant
132
- if( tooltipsettings(this).delay )
133
- tID = setTimeout(show, tooltipsettings(this).delay);
134
- else
135
- show();
136
-
137
- // if selected, update the helper position when the mouse moves
138
  track = !!tooltipsettings(this).track;
139
  jQuery(document.body).bind('mousemove', update);
140
 
141
  // update at least once
142
- update(event);
143
  }
144
 
145
  // save elements title before the tooltip is displayed
146
  function save() {
147
- // if this is the current source, or it has no title (occurs with click event), stop
148
- if ( jQuery.tooltip.blocked || this == current || (!this.tooltipText && !tooltipsettings(this).bodyHandler) )
149
  return;
150
 
151
  // save current
152
  current = this;
153
- title = this.tooltipText;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
- if ( tooltipsettings(this).bodyHandler ) {
156
- helper.title.hide();
157
- var bodyContent = tooltipsettings(this).bodyHandler.call(this);
 
 
 
 
 
 
 
 
 
 
 
 
158
  if (bodyContent.nodeType || bodyContent.jquery) {
159
  helper.body.empty().append(bodyContent)
160
  } else {
161
  helper.body.html( bodyContent );
162
  }
163
  helper.body.show();
164
- } else if ( tooltipsettings(this).showBody ) {
165
- var parts = title.split(tooltipsettings(this).showBody);
166
- helper.title.html(parts.shift()).show();
167
- helper.body.empty();
168
  for(var i = 0, part; (part = parts[i]); i++) {
169
  if(i > 0)
170
  helper.body.append("<br/>");
@@ -172,33 +162,20 @@
172
  }
173
  helper.body.hideWhenEmpty();
174
  } else {
175
- helper.title.html(title).show();
176
- helper.body.hide();
177
  }
178
-
179
- // if element has href or src, add and show it, otherwise hide it
180
- if( tooltipsettings(this).showURL && jQuery(this).url() )
181
- helper.url.html( jQuery(this).url().replace('http://', '') ).show();
182
- else
183
- helper.url.hide();
184
-
185
  // add an optional class for this tip
186
- helper.parent.addClass(tooltipsettings(this).extraClass);
187
 
188
  // fix PNG background for IE
189
- if (tooltipsettings(this).fixPNG )
190
  helper.parent.fixPNG();
191
 
192
- handle.apply(this, arguments);
193
- }
194
-
195
- // delete timeout and show helper
196
- function show() {
197
  if (!tooltipsettings(current)) {
198
  return;
199
  }
200
- tID = null;
201
- if ((!IE || !jQuery.fn.bgiframe) && tooltipsettings(current).fade) {
202
  if (helper.parent.is(":animated"))
203
  helper.parent.stop().show().fadeTo(tooltipsettings(current).fade, current.tOpacity);
204
  else
@@ -206,10 +183,9 @@
206
  } else {
207
  helper.parent.show();
208
  }
209
- update();
210
  }
211
-
212
- /**
213
  * callback for mousemove
214
  * updates the helper position
215
  * removes itself when no current element
@@ -224,8 +200,8 @@
224
  if (event && event.target.tagName == "OPTION") {
225
  return;
226
  }
227
-
228
- // stop updating when tracking is disabled and the tooltip is visible
229
  if ( !track && helper.parent.is(":visible")) {
230
  jQuery(document.body).unbind('mousemove', update)
231
  }
@@ -239,35 +215,18 @@
239
  // remove position helper classes
240
  helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
241
 
242
- var left = helper.parent[0].offsetLeft;
243
- var top = helper.parent[0].offsetTop;
244
- if (event) {
 
245
  // position the helper 15 pixel to bottom right, starting from mouse position
246
- left = event.pageX + tooltipsettings(current).left;
247
- top = event.pageY + tooltipsettings(current).top;
248
- var right='auto';
249
  if (tooltipsettings(current).positionLeft) {
250
- right = jQuery(window).width() - left;
251
- left = 'auto';
252
  }
253
- helper.parent.css({
254
- left: left,
255
- right: right,
256
- top: top
257
- });
258
- }
259
-
260
- var v = viewport(),
261
- h = helper.parent[0];
262
- // check horizontal position
263
- if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
264
- left -= h.offsetWidth + 20 + tooltipsettings(current).left + 75;
265
- helper.parent.css({left: left + 'px'}).addClass("viewport-right");
266
- }
267
- // check vertical position
268
- if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
269
- top -= h.offsetHeight + 20 + tooltipsettings(current).top;
270
- helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
271
  }
272
  }
273
 
@@ -279,8 +238,8 @@
279
  cy: jQuery(window).height()
280
  };
281
  }
282
-
283
- // hide helper and restore added classes and the title
284
  function hide(event) {
285
  if(jQuery.tooltip.blocked)
286
  return;
@@ -302,10 +261,7 @@
302
  return;
303
  }
304
 
305
- // clear timeout if possible
306
- if(tID)
307
- clearTimeout(tID);
308
- // no more current element
309
  current = null;
310
 
311
  var tsettings = tooltipsettings(this);
@@ -319,11 +275,6 @@
319
  helper.parent.stop().fadeOut(tsettings.fade, complete);
320
  } else
321
  complete();
322
-
323
- if( tooltipsettings(this).fixPNG )
324
- helper.parent.unfixPNG();
325
-
326
- htID = null;
327
  }
328
 
329
  })(jQuery);
19
  var helper = {},
20
  // the current tooltipped element
21
  current,
22
+ _top,
23
+ _left,
24
+ _right = "auto",
 
 
 
25
  // IE 5.5 or 6
26
  IE = jQuery.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
27
  // flag for mouse tracking
50
  return this.each(function() {
51
  jQuery.data(this, "tooltip", settings);
52
  this.tOpacity = helper.parent.css("opacity");
 
 
 
 
 
53
  })
54
  .mouseover(save)
55
+ .mouseup(function() {
56
+ show();
57
+ });
58
  },
59
+ hideWhenEmpty: function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  return this.each(function() {
61
  jQuery(this)[ jQuery(this).html() ? "show" : "hide" ]();
62
  });
82
  helper.parent.bgiframe();
83
 
84
  // save references to title and url elements
85
+ helper.body = jQuery('div.body', helper.parent);
 
 
 
 
 
86
  }
87
 
88
  function tooltipsettings(element) {
95
 
96
  // main event handler to start showing tooltips
97
  function handle(event) {
98
+ // if selected, update the helper position when the mouse moves
 
 
 
 
 
 
99
  track = !!tooltipsettings(this).track;
100
  jQuery(document.body).bind('mousemove', update);
101
 
102
  // update at least once
103
+ update(event);
104
  }
105
 
106
  // save elements title before the tooltip is displayed
107
  function save() {
108
+ // if this is the current source, or it has no title (occurs with click event), stop
109
+ if ( jQuery.tooltip.blocked || this == current || (!this.tooltipText && !tooltipsettings(this).bodyHandler))
110
  return;
111
 
112
  // save current
113
  current = this;
114
+ handle.apply(current, arguments);
115
+ }
116
+
117
+ /*
118
+ * This function is a little strange. The issue is that our tooltips work
119
+ * more like modeless dialogs than like tooltips. We make this work by
120
+ * storing the information of where the tooltip should go when the mouse
121
+ * moves over an item and then showing it when the mouse is clicked on that
122
+ * item.
123
+ */
124
+ function show() {
125
+ if (!tooltipsettings(current)) {
126
+ return;
127
+ }
128
+ helper.parent.css({
129
+ left: _left,
130
+ right: _right,
131
+ top: _top
132
+ });
133
 
134
+ var v = viewport(),
135
+ h = helper.parent[0];
136
+ // check horizontal position
137
+ if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
138
+ _left -= h.offsetWidth + 20 + tooltipsettings(current).left + 150;
139
+ helper.parent.css({left: _left + 'px'}).addClass("viewport-right");
140
+ }
141
+ // check vertical position
142
+ if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
143
+ _top -= h.offsetHeight + 20 + tooltipsettings(current).top;
144
+ helper.parent.css({top: _top + 'px'}).addClass("viewport-bottom");
145
+ }
146
+
147
+ if ( tooltipsettings(current).bodyHandler ) {
148
+ var bodyContent = tooltipsettings(current).bodyHandler.call(current);
149
  if (bodyContent.nodeType || bodyContent.jquery) {
150
  helper.body.empty().append(bodyContent)
151
  } else {
152
  helper.body.html( bodyContent );
153
  }
154
  helper.body.show();
155
+ } else if ( tooltipsettings(current).showBody ) {
156
+ var parts = tooltipsettings(current).showBody;
157
+ helper.body.empty();
 
158
  for(var i = 0, part; (part = parts[i]); i++) {
159
  if(i > 0)
160
  helper.body.append("<br/>");
162
  }
163
  helper.body.hideWhenEmpty();
164
  } else {
165
+ helper.body.hide();
 
166
  }
167
+
 
 
 
 
 
 
168
  // add an optional class for this tip
169
+ helper.parent.addClass(tooltipsettings(current).extraClass);
170
 
171
  // fix PNG background for IE
172
+ if (tooltipsettings(current).fixPNG )
173
  helper.parent.fixPNG();
174
 
 
 
 
 
 
175
  if (!tooltipsettings(current)) {
176
  return;
177
  }
178
+ if ((!IE || !jQuery.fn.bgiframe) && tooltipsettings(current).fade) {
 
179
  if (helper.parent.is(":animated"))
180
  helper.parent.stop().show().fadeTo(tooltipsettings(current).fade, current.tOpacity);
181
  else
183
  } else {
184
  helper.parent.show();
185
  }
 
186
  }
187
+
188
+ /**
189
  * callback for mousemove
190
  * updates the helper position
191
  * removes itself when no current element
200
  if (event && event.target.tagName == "OPTION") {
201
  return;
202
  }
203
+
204
+ // stop updating when tracking is disabled and the tooltip is visible
205
  if ( !track && helper.parent.is(":visible")) {
206
  jQuery(document.body).unbind('mousemove', update)
207
  }
215
  // remove position helper classes
216
  helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
217
 
218
+ _left = helper.parent[0].offsetLeft;
219
+ _top = helper.parent[0].offsetTop;
220
+
221
+ if (event) {
222
  // position the helper 15 pixel to bottom right, starting from mouse position
223
+ _left = event.pageX + tooltipsettings(current).left;
224
+ _top = event.pageY + tooltipsettings(current).top;
225
+ _right = 'auto';
226
  if (tooltipsettings(current).positionLeft) {
227
+ _right = jQuery(window).width() - left;
228
+ _left = 'auto';
229
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  }
231
  }
232
 
238
  cy: jQuery(window).height()
239
  };
240
  }
241
+
242
+ // hide helper and restore added classes and the title
243
  function hide(event) {
244
  if(jQuery.tooltip.blocked)
245
  return;
261
  return;
262
  }
263
 
264
+ // no more current element
 
 
 
265
  current = null;
266
 
267
  var tsettings = tooltipsettings(this);
275
  helper.parent.stop().fadeOut(tsettings.fade, complete);
276
  } else
277
  complete();
 
 
 
 
 
278
  }
279
 
280
  })(jQuery);
lib/lib.txt ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This file lists all of the third-party JavaScript libraries we are using and where they came from. All of these files are compressed and combined into the edcallib.min.js file. This compressed file was made with the Google Closure JavaScript compiler. I haven't checked in that compiler because it is over 4MB and you don't need it for runtime. I haven't been able to figure out a way to make WordPress's Subversion exclude a file when building a plugin.
2
+
3
+ date.js
4
+ This is an open source JavaScript date library that we use to provide and manipulate dates for the calendar.
5
+ http://www.datejs.com/
6
+ MIT License
7
+
8
+ humanmsg.css
9
+ humanmsg.js
10
+ We use Humanized style error messages when we show concurrency errors and other issues the user might run into when dragging posts.
11
+ http://code.google.com/p/humanmsg/
12
+ Apache License 2.0
13
+
14
+ jquery.bgiframe.js
15
+ jquery.delegate.js
16
+ jquery.tools.min.js
17
+ JQuery tools supports the scrolling.
18
+ http://flowplayer.org/tools/index.html
19
+ MIT license
20
+
21
+ jquery.tooltip.css
22
+ jquery.tooltip.js
23
+ The JQuery tooltip plugin manages the tooltips we show when you click on a post. This plugin has many customizations from the origional and shouldn't be upgraded.
24
+ http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
25
+ MIT License
26
+
27
+ json2.js
28
+ We use this library for faster JSON parsing.
29
+ http://www.json.org/js.html
30
+ It is available under the public domain.
31
+
32
+ tools.scrollable-1.1.2.js
33
+ tools.scrollable.mousewheel-1.0.1.js
34
+ The scrollable library supports the mouse wheel scrolling and manages the calendar's vertical scrolling.
35
+ http://flowplayer.org/tools/scrollable.html
36
+ MIT License
37
+
38
+ ui.core.js
39
+ ui.draggable.js
40
+ ui.droppable.js
41
+ The draggable, droppable, and UI core support drag and drop.
42
+ http://jqueryui.com/demos/draggable/
43
+ MIT License
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Editorial Calendar ===
2
  Contributors: MaryVogt, zgrossbart
3
- Tags: posts
4
  Requires at least: 2.8.5
5
  Tested up to: 2.8.6
6
- Stable tag: 0.1
7
 
8
  THIS PLUGIN IS NOT READY FOR DOWNLOAD. Editorial calendar lets you see all your posts and drag and drop them to change the date.
9
 
@@ -11,23 +11,45 @@ THIS PLUGIN IS NOT READY FOR DOWNLOAD. Editorial calendar lets you see all your
11
 
12
  *THIS PLUGIN IS NOT READY FOR DOWNLOAD. DO NOT RUN IT OUTSIDE OF A TEST ENVIRONMENT.*
13
 
14
- The editorial calendar lets WordPress administrators and editors manage the dates for multiple posts at once. You see all of your posts in a calendar view and can arrange them via an easy drag and drop interface. The editorial calendar great improves any blog that plans posts in advance or takes contributions from multiple users.
15
 
16
  == Installation ==
17
 
 
18
  1. Upload the plugin directory <code>editorial-calendar</code> to the <code>wp-content/plugins</code> directory.
19
  1. Activate the plugin through the 'Plugins' menu in WordPress.
20
  1. Click the new 'Calendar' option under the 'Posts' menu.
21
 
 
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  == Screenshots ==
25
 
26
- 1. We'll get some screen shots soon
 
 
27
 
28
  == Changelog ==
29
 
30
  = 0.1 =
31
  * This version is just for beta testers
32
 
 
 
 
33
  `<?php code(); // goes in backticks ?>`
1
  === Editorial Calendar ===
2
  Contributors: MaryVogt, zgrossbart
3
+ Tags: posts, post, calendar, AJAX, admin, administration
4
  Requires at least: 2.8.5
5
  Tested up to: 2.8.6
6
+ Stable tag: 0.2
7
 
8
  THIS PLUGIN IS NOT READY FOR DOWNLOAD. Editorial calendar lets you see all your posts and drag and drop them to change the date.
9
 
11
 
12
  *THIS PLUGIN IS NOT READY FOR DOWNLOAD. DO NOT RUN IT OUTSIDE OF A TEST ENVIRONMENT.*
13
 
14
+ The editorial calendar lets WordPress administrators and editors manage the dates for multiple posts at once. You see all of your posts in a calendar view and can arrange them via an easy drag and drop interface. The editorial calendar greatly improves any blog that plans posts in advance or takes contributions from multiple users.
15
 
16
  == Installation ==
17
 
18
+ 1. <b>Backup your WordPress database</b>.
19
  1. Upload the plugin directory <code>editorial-calendar</code> to the <code>wp-content/plugins</code> directory.
20
  1. Activate the plugin through the 'Plugins' menu in WordPress.
21
  1. Click the new 'Calendar' option under the 'Posts' menu.
22
 
23
+ == Frequently Asked Questions ==
24
 
25
+ = Can I use the editorial calendar with pages? =
26
+
27
+ Right now the calendar only supports posts. We are considering adding support for pages. If you would like to see support for pages let us know.
28
+
29
+ = Does the editorial calendar change the way my posts look? =
30
+
31
+ No. The calendar is only an administration tool. None of your readers will know you are running the calendar unless you tell them.
32
+
33
+ = Why are my posts different colors? =
34
+
35
+ The different color of each post indicates the status. Gray is <code>draft</code>, blue is <code>publish</code>, and yellow is <code>future</code>.
36
+
37
+ = Why does the calendar change my post status? =
38
+
39
+ The calendar works with three types of post status: <code>draft</code>, <code>publish</code>, and <code>future</code>. If you move a <code>publish</code> post to a date after the current day it becomes a <code>future</code> post. If you drag a <code>future</code> post to a day before the current day it becomes a <code>draft</code> post.
40
 
41
  == Screenshots ==
42
 
43
+ 1. See all of your posts and when they'll be posted.
44
+ 2. Get more information and edit post titles right in the calendar.
45
+ 3. Drag and drop posts to easily change dates and arrange your calendar.
46
 
47
  == Changelog ==
48
 
49
  = 0.1 =
50
  * This version is just for beta testers
51
 
52
+ = 0.2 =
53
+ * This version fixes a large number of bugs, makes many usability improvements, and has some significant performance increases.
54
+
55
  `<?php code(); // goes in backticks ?>`
screenshot-1.gif ADDED
Binary file
screenshot-2.gif ADDED
Binary file
screenshot-3.gif ADDED
Binary file