right-rails 1.0.10 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README.rdoc +4 -4
  2. data/Rakefile +4 -4
  3. data/lib/right_rails.rb +1 -1
  4. data/public/javascripts/right/autocompleter-src.js +115 -106
  5. data/public/javascripts/right/autocompleter.js +3 -14
  6. data/public/javascripts/right/billboard-src.js +58 -38
  7. data/public/javascripts/right/billboard.js +3 -13
  8. data/public/javascripts/right/calendar-src.js +136 -133
  9. data/public/javascripts/right/calendar.js +4 -33
  10. data/public/javascripts/right/colorpicker-src.js +128 -125
  11. data/public/javascripts/right/colorpicker.js +4 -23
  12. data/public/javascripts/right/dialog-src.js +67 -37
  13. data/public/javascripts/right/dialog.js +3 -17
  14. data/public/javascripts/right/dnd-src.js +44 -43
  15. data/public/javascripts/right/dnd.js +3 -16
  16. data/public/javascripts/right/effects-src.js +125 -98
  17. data/public/javascripts/right/effects.js +3 -13
  18. data/public/javascripts/right/in-edit-src.js +54 -38
  19. data/public/javascripts/right/in-edit.js +4 -10
  20. data/public/javascripts/right/jquerysh-src.js +344 -20
  21. data/public/javascripts/right/jquerysh.js +3 -3
  22. data/public/javascripts/right/json-src.js +22 -35
  23. data/public/javascripts/right/json.js +4 -7
  24. data/public/javascripts/right/keys-src.js +87 -0
  25. data/public/javascripts/right/keys.js +7 -0
  26. data/public/javascripts/right/lightbox-src.js +76 -58
  27. data/public/javascripts/right/lightbox.js +3 -20
  28. data/public/javascripts/right/rails-src.js +108 -107
  29. data/public/javascripts/right/rails.js +4 -11
  30. data/public/javascripts/right/rater-src.js +47 -31
  31. data/public/javascripts/right/rater.js +3 -9
  32. data/public/javascripts/right/resizable-src.js +60 -33
  33. data/public/javascripts/right/resizable.js +3 -11
  34. data/public/javascripts/right/selectable-src.js +87 -51
  35. data/public/javascripts/right/selectable.js +3 -18
  36. data/public/javascripts/right/sizzle-src.js +15 -10
  37. data/public/javascripts/right/sizzle.js +4 -27
  38. data/public/javascripts/right/slider-src.js +49 -33
  39. data/public/javascripts/right/slider.js +3 -10
  40. data/public/javascripts/right/sortable-src.js +46 -32
  41. data/public/javascripts/right/sortable.js +4 -13
  42. data/public/javascripts/right/table-src.js +19 -10
  43. data/public/javascripts/right/table.js +4 -6
  44. data/public/javascripts/right/tabs-src.js +69 -47
  45. data/public/javascripts/right/tabs.js +4 -26
  46. data/public/javascripts/right/tooltips-src.js +78 -56
  47. data/public/javascripts/right/tooltips.js +4 -9
  48. data/public/javascripts/right/uploader-src.js +50 -34
  49. data/public/javascripts/right/uploader.js +3 -9
  50. data/public/javascripts/right-olds-src.js +528 -355
  51. data/public/javascripts/right-olds.js +4 -13
  52. data/public/javascripts/right-safe-src.js +4 -99
  53. data/public/javascripts/right-safe.js +3 -4
  54. data/public/javascripts/right-src.js +1618 -1245
  55. data/public/javascripts/right.js +4 -91
  56. metadata +8 -6
@@ -1,9 +1,8 @@
1
1
  /**
2
- * The calendar widget implemented with RightJS
2
+ * RightJS-UI Calendar v2.2.0
3
+ * http://rightjs.org/ui/calendar
3
4
  *
4
- * Home page: http://rightjs.org/ui/calendar
5
- *
6
- * @copyright (C) 2009-2010 Nikolay Nemshilov
5
+ * Copyright (C) 2009-2011 Nikolay Nemshilov
7
6
  */
8
7
  var Calendar = RightJS.Calendar = (function(document, parseInt, RightJS) {
9
8
  /**
@@ -11,38 +10,9 @@ var Calendar = RightJS.Calendar = (function(document, parseInt, RightJS) {
11
10
  * it creates an abstract proxy with the common functionality
12
11
  * which then we reuse and override in the actual widgets
13
12
  *
14
- * Copyright (C) 2010 Nikolay Nemshilov
15
- */
16
-
17
- /**
18
- * The filenames to include
19
- *
20
- * Copyright (C) 2010 Nikolay Nemshilov
13
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
21
14
  */
22
15
 
23
- var R = RightJS,
24
- $ = RightJS.$,
25
- $$ = RightJS.$$,
26
- $w = RightJS.$w,
27
- $ext = RightJS.$ext,
28
- $uid = RightJS.$uid,
29
- isString = RightJS.isString,
30
- isArray = RightJS.isArray,
31
- isFunction = RightJS.isFunction,
32
- Wrapper = RightJS.Wrapper,
33
- Element = RightJS.Element,
34
- Input = RightJS.Input,
35
- RegExp = RightJS.RegExp,
36
- Browser = RightJS.Browser;
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
16
  /**
47
17
  * The widget units constructor
48
18
  *
@@ -61,7 +31,7 @@ function Widget(tag_name, methods) {
61
31
  *
62
32
  * Copyright (C) 2010 Nikolay Nemshilov
63
33
  */
64
- var AbstractWidget = new RightJS.Wrapper(RightJS.Element.Wrappers[tag_name] || RightJS.Element, {
34
+ var AbstractWidget = new RightJS.Class(RightJS.Element.Wrappers[tag_name] || RightJS.Element, {
65
35
  /**
66
36
  * The common constructor
67
37
  *
@@ -93,7 +63,8 @@ function Widget(tag_name, methods) {
93
63
  options = {};
94
64
  }
95
65
  this.setOptions(options, this);
96
- return this;
66
+
67
+ return (RightJS.Wrapper.Cache[RightJS.$uid(this._)] = this);
97
68
  },
98
69
 
99
70
  // protected
@@ -106,12 +77,16 @@ function Widget(tag_name, methods) {
106
77
  * @return void
107
78
  */
108
79
  setOptions: function(options, element) {
109
- element = element || this;
110
- RightJS.Options.setOptions.call(this,
111
- RightJS.Object.merge(options, eval("("+(
80
+ if (element) {
81
+ options = RightJS.Object.merge(options, new Function("return "+(
112
82
  element.get('data-'+ this.key) || '{}'
113
- )+")"))
114
- );
83
+ ))());
84
+ }
85
+
86
+ if (options) {
87
+ RightJS.Options.setOptions.call(this, RightJS.Object.merge(this.options, options));
88
+ }
89
+
115
90
  return this;
116
91
  }
117
92
  });
@@ -120,7 +95,7 @@ function Widget(tag_name, methods) {
120
95
  * Creating the actual widget class
121
96
  *
122
97
  */
123
- var Klass = new RightJS.Wrapper(AbstractWidget, methods);
98
+ var Klass = new RightJS.Class(AbstractWidget, methods);
124
99
 
125
100
  // creating the widget related shortcuts
126
101
  RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
@@ -135,9 +110,9 @@ function Widget(tag_name, methods) {
135
110
  * so those buttons didn't interfere with
136
111
  * the user's tab-index on his page
137
112
  *
138
- * Copyright (C) 2010 Nikolay Nemshilov
113
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
139
114
  */
140
- var Button = new RightJS.Wrapper(RightJS.Element, {
115
+ var Button = new RightJS.Class(RightJS.Element, {
141
116
  /**
142
117
  * Constructor
143
118
  *
@@ -207,30 +182,81 @@ var Button = new RightJS.Wrapper(RightJS.Element, {
207
182
  * A shared module that toggles a widget visibility status
208
183
  * in a uniformed way according to the options settings
209
184
  *
210
- * Copyright (C) 2010 Nikolay Nemshilov
185
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
211
186
  */
187
+ var Toggler = {
188
+ /**
189
+ * Shows the element
190
+ *
191
+ * @param String fx-name
192
+ * @param Object fx-options
193
+ * @return Element this
194
+ */
195
+ show: function(fx_name, fx_options) {
196
+ this.constructor.current = this;
197
+ return Toggler_toggle(this, 'show', fx_name, fx_options);
198
+ },
199
+
200
+ /**
201
+ * Hides the element
202
+ *
203
+ * @param String fx-name
204
+ * @param Object fx-options
205
+ * @return Element this
206
+ */
207
+ hide: function(fx_name, fx_options) {
208
+ this.constructor.current = null;
209
+ return Toggler_toggle(this, 'show', fx_name, fx_options);
210
+ },
211
+
212
+ /**
213
+ * Toggles the widget at the given element
214
+ *
215
+ * @param Element the related element
216
+ * @param String position right/bottom (bottom is the default)
217
+ * @param Boolean marker if the element should be resized to the element size
218
+ * @return Widget this
219
+ */
220
+ showAt: function(element, where, resize) {
221
+ this.hide(null).shownAt = element = RightJS.$(element);
222
+
223
+ // moves this element at the given one
224
+ Toggler_re_position.call(this, element, where, resize);
225
+
226
+ return this.show();
227
+ },
228
+
229
+ /**
230
+ * Toggles the widget at the given element
231
+ *
232
+ * @param Element the related element
233
+ * @param String position top/left/right/bottom (bottom is the default)
234
+ * @param Boolean marker if the element should be resized to the element size
235
+ * @return Widget this
236
+ */
237
+ toggleAt: function(element, where, resize) {
238
+ return this.hidden() ? this.showAt(element, where, resize) : this.hide();
239
+ }
240
+ };
241
+
212
242
 
213
243
  /**
214
- * The toggler's common functionality
215
- *
216
- * NOTE: this function getting called in the context
217
- * of a widget
244
+ * toggles the element's state according to the current settings
218
245
  *
219
- * @param Element the element to toggle
220
246
  * @param event String 'show' or 'hide' the event name
221
247
  * @param String an optional fx-name
222
248
  * @param Object an optional fx-options hash
223
249
  * @return void
224
250
  */
225
- function toggler(element, event, fx_name, fx_options) {
251
+ function Toggler_toggle(element, event, fx_name, fx_options) {
226
252
  if (RightJS.Fx) {
227
253
  if (fx_name === undefined) {
228
- fx_name = this.options.fxName;
254
+ fx_name = element.options.fxName;
229
255
 
230
256
  if (fx_options === undefined) {
231
257
  fx_options = {
232
- duration: this.options.fxDuration,
233
- onFinish: RightJS(this.fire).bind(this, event)
258
+ duration: element.options.fxDuration,
259
+ onFinish: RightJS(element.fire).bind(element, event)
234
260
  };
235
261
 
236
262
  // hide on double time
@@ -242,12 +268,10 @@ function toggler(element, event, fx_name, fx_options) {
242
268
  }
243
269
  }
244
270
 
245
- RightJS.Element.prototype[event].call(element, fx_name, fx_options);
246
-
247
271
  // manually trigger the event if no fx were specified
248
- if (!RightJS.Fx || !fx_name) { this.fire(event); }
272
+ if (!RightJS.Fx || !fx_name) { element.fire(event); }
249
273
 
250
- return this;
274
+ return element.$super(fx_name, fx_options);
251
275
  }
252
276
 
253
277
  /**
@@ -262,7 +286,7 @@ function toggler(element, event, fx_name, fx_options) {
262
286
  * @param Boolean if `true` then the element size will be adjusted
263
287
  * @return void
264
288
  */
265
- function re_position(element, where, resize) {
289
+ function Toggler_re_position(element, where, resize) {
266
290
  var anchor = this.reAnchor || (this.reAnchor =
267
291
  new RightJS.Element('div', {'class': 'rui-re-anchor'}))
268
292
  .insert(this),
@@ -292,7 +316,7 @@ function re_position(element, where, resize) {
292
316
  target.moveTo(left, top);
293
317
 
294
318
  if (resize) {
295
- if (['left', 'right'].include(where)) {
319
+ if (where === 'left' || where === 'right') {
296
320
  target.setHeight(height);
297
321
  } else {
298
322
  target.setWidth(width);
@@ -303,67 +327,6 @@ function re_position(element, where, resize) {
303
327
  target.setStyle('visibility:visible').hide(null);
304
328
  }
305
329
 
306
- /**
307
- * The actual shared module to be inserted in the widgets
308
- *
309
- * Copyright (C) 2010 Nikolay Nemshilov
310
- */
311
- var Toggler = {
312
- /**
313
- * Shows the element
314
- *
315
- * @param String fx-name
316
- * @param Object fx-options
317
- * @return Element this
318
- */
319
- show: function(fx_name, fx_options) {
320
- this.constructor.current = this;
321
- return toggler.call(this, this, 'show', fx_name, fx_options);
322
- },
323
-
324
- /**
325
- * Hides the element
326
- *
327
- * @param String fx-name
328
- * @param Object fx-options
329
- * @return Element this
330
- */
331
- hide: function(fx_name, fx_options) {
332
- this.constructor.current = null;
333
- return toggler.call(this, this, 'hide', fx_name, fx_options);
334
- },
335
-
336
- /**
337
- * Toggles the widget at the given element
338
- *
339
- * @param Element the related element
340
- * @param String position right/bottom (bottom is the default)
341
- * @param Boolean marker if the element should be resized to the element size
342
- * @return Widget this
343
- */
344
- showAt: function(element, where, resize) {
345
- this.hide(null).shownAt = element = RightJS.$(element);
346
-
347
- // moves this element at the given one
348
- re_position.call(this, element, where, resize);
349
-
350
- return this.show();
351
- },
352
-
353
- /**
354
- * Toggles the widget at the given element
355
- *
356
- * @param Element the related element
357
- * @param String position top/left/right/bottom (bottom is the default)
358
- * @param Boolean marker if the element should be resized to the element size
359
- * @return Widget this
360
- */
361
- toggleAt: function(element, where, resize) {
362
- return this.hidden() ? this.showAt(element, where, resize) : this.hide();
363
- }
364
- };
365
-
366
-
367
330
  /**
368
331
  * A shared module that provides for the widgets an ability
369
332
  * to be assigned to an input element and work in pair with it
@@ -429,16 +392,45 @@ function zerofy(number) {
429
392
  }
430
393
 
431
394
 
395
+ /**
396
+ * The filenames to include
397
+ *
398
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
399
+ */
400
+
401
+ var R = RightJS,
402
+ $ = RightJS.$,
403
+ $$ = RightJS.$$,
404
+ $w = RightJS.$w,
405
+ $ext = RightJS.$ext,
406
+ $uid = RightJS.$uid,
407
+ isString = RightJS.isString,
408
+ isArray = RightJS.isArray,
409
+ isFunction = RightJS.isFunction,
410
+ Class = RightJS.Class,
411
+ Element = RightJS.Element,
412
+ Input = RightJS.Input,
413
+ RegExp = RightJS.RegExp,
414
+ Browser = RightJS.Browser;
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
432
424
  /**
433
425
  * The calendar widget for RightJS
434
426
  *
435
- * Copyright (C) 2009-2010 Nikolay Nemshilov
427
+ * Copyright (C) 2009-2011 Nikolay Nemshilov
436
428
  */
437
429
  var Calendar = new Widget({
438
430
  include: [Toggler, Assignable],
439
431
 
440
432
  extend: {
441
- version: '2.0.0',
433
+ version: '2.2.0',
442
434
 
443
435
  EVENTS: $w('show hide change done'),
444
436
 
@@ -720,9 +712,9 @@ var Calendar = new Widget({
720
712
  /**
721
713
  * The calendar month/year swapping buttons block
722
714
  *
723
- * Copyright (C) 2010 Nikolay Nemshilov
715
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
724
716
  */
725
- var Swaps = new Wrapper(Element, {
717
+ var Swaps = new Class(Element, {
726
718
  /**
727
719
  * Constructor
728
720
  *
@@ -821,9 +813,9 @@ var Swaps = new Wrapper(Element, {
821
813
  /**
822
814
  * Represents a single month block
823
815
  *
824
- * Copyright (C) 2010 Nikolay Nemshilov
816
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
825
817
  */
826
- var Month = new Wrapper(Element, {
818
+ var Month = new Class(Element, {
827
819
  /**
828
820
  * Constructor
829
821
  *
@@ -953,9 +945,9 @@ var Month = new Wrapper(Element, {
953
945
  /**
954
946
  * The calendar months greed unit
955
947
  *
956
- * Copyright (C) 2010 Nikolay Nemshilov
948
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
957
949
  */
958
- var Greed = new Wrapper(Element, {
950
+ var Greed = new Class(Element, {
959
951
  /**
960
952
  * Constructor
961
953
  *
@@ -1002,9 +994,9 @@ var Greed = new Wrapper(Element, {
1002
994
  /**
1003
995
  * The time-picker block unit
1004
996
  *
1005
- * Copyright (C) 2010 Nikolay Nemshilov
997
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
1006
998
  */
1007
- var Timepicker = new Wrapper(Element, {
999
+ var Timepicker = new Class(Element, {
1008
1000
  /**
1009
1001
  * Constructor
1010
1002
  *
@@ -1105,7 +1097,7 @@ var Timepicker = new Wrapper(Element, {
1105
1097
  *
1106
1098
  * Copyright (C) 2010 Nikolay Nemshilov
1107
1099
  */
1108
- var Buttons = new Wrapper(Element, {
1100
+ var Buttons = new Class(Element, {
1109
1101
  /**
1110
1102
  * Constructor
1111
1103
  *
@@ -1455,7 +1447,18 @@ $(document).on({
1455
1447
  });
1456
1448
 
1457
1449
 
1458
- document.write("<style type=\"text/css\">.rui-panel{margin:0;padding:.5em;position:relative;background-color:#EEE;border:1px solid #BBB;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;box-shadow:.15em .3em .5em #BBB;-moz-box-shadow:.15em .3em .5em #BBB;-webkit-box-shadow:.15em .3em .5em #BBB;cursor:default} *.rui-button{display:inline-block; *display:inline; *zoom:1;height:1em;line-height:1em;margin:0;padding:.2em .5em;text-align:center;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;cursor:pointer;color:#333;background-color:#FFF;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-button:hover{color:#111;border-color:#999;background-color:#DDD;box-shadow:#888 0 0 .1em;-moz-box-shadow:#888 0 0 .1em;-webkit-box-shadow:#888 0 0 .1em} *.rui-button:active{color:#000;border-color:#777;text-indent:1px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none} *.rui-button-disabled, *.rui-button-disabled:hover, *.rui-button-disabled:active{color:#888;background:#DDD;border-color:#CCC;cursor:default;text-indent:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}div.rui-calendar .swaps,div.rui-calendar .greed,div.rui-calendar .timepicker,div.rui-calendar .buttons,div.rui-calendar table,div.rui-calendar table tr,div.rui-calendar table th,div.rui-calendar table td,div.rui-calendar table tbody,div.rui-calendar table thead,div.rui-calendar table caption{background:none;border:none;width:auto;height:auto;margin:0;padding:0}div.rui-calendar-inline{position:relative;display:inline-block; *display:inline; *zoom:1;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-calendar .swaps{position:relative}div.rui-calendar .swaps .rui-button{position:absolute;float:left;width:1em;padding:.15em .4em}div.rui-calendar .swaps .next-month{right:0em;_right:.5em}div.rui-calendar .swaps .prev-year{left:2.05em}div.rui-calendar .swaps .next-year{right:2.05em;_right:2.52em}div.rui-calendar .greed{border-spacing:0px;border-collapse:collapse;border-size:0}div.rui-calendar .greed td{vertical-align:top;padding-left:.4em}div.rui-calendar .greed>tbody>tr>td:first-child{padding:0}div.rui-calendar .month{margin-top:.2em;border-spacing:1px;border-collapse:separate}div.rui-calendar .month caption{text-align:center}div.rui-calendar .month th{color:#666;text-align:center}div.rui-calendar .month td{text-align:right;padding:.1em .3em;background-color:#FFF;border:1px solid #CCC;cursor:pointer;color:#555;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.rui-calendar .month td:hover{background-color:#CCC;border-color:#AAA;color:#000}div.rui-calendar .month td.blank{background:transparent;cursor:default;border:none}div.rui-calendar .month td.selected{background-color:#BBB;border-color:#AAA;color:#222;font-weight:bold;padding:.1em .2em}div.rui-calendar .month td.disabled{color:#888;background:#EEE;border-color:#CCC;cursor:default}div.rui-calendar .timepicker{border-top:1px solid #ccc;margin-top:.3em;padding-top:.5em;text-align:center}div.rui-calendar .timepicker select{margin:0 .4em}div.rui-calendar .buttons{position:relative;margin-top:.5em}div.rui-calendar .buttons div.rui-button{width:4em;padding:.25em .5em}div.rui-calendar .buttons .done{position:absolute;right:0em;top:0}</style>");
1450
+ var embed_style = document.createElement('style'),
1451
+ embed_rules = document.createTextNode(".rui-panel{margin:0;padding:.5em;position:relative;background-color:#EEE;border:1px solid #BBB;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;box-shadow:.15em .3em .5em #BBB;-moz-box-shadow:.15em .3em .5em #BBB;-webkit-box-shadow:.15em .3em .5em #BBB;cursor:default} *.rui-button{display:inline-block; *display:inline; *zoom:1;height:1em;line-height:1em;margin:0;padding:.2em .5em;text-align:center;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;cursor:pointer;color:#333;background-color:#FFF;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-button:hover{color:#111;border-color:#999;background-color:#DDD;box-shadow:#888 0 0 .1em;-moz-box-shadow:#888 0 0 .1em;-webkit-box-shadow:#888 0 0 .1em} *.rui-button:active{color:#000;border-color:#777;text-indent:1px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none} *.rui-button-disabled, *.rui-button-disabled:hover, *.rui-button-disabled:active{color:#888;background:#DDD;border-color:#CCC;cursor:default;text-indent:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}div.rui-calendar .swaps,div.rui-calendar .greed,div.rui-calendar .timepicker,div.rui-calendar .buttons,div.rui-calendar table,div.rui-calendar table tr,div.rui-calendar table th,div.rui-calendar table td,div.rui-calendar table tbody,div.rui-calendar table thead,div.rui-calendar table caption{background:none;border:none;width:auto;height:auto;margin:0;padding:0}div.rui-calendar-inline{position:relative;display:inline-block; *display:inline; *zoom:1;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-calendar .swaps{position:relative}div.rui-calendar .swaps .rui-button{position:absolute;float:left;width:1em;padding:.15em .4em}div.rui-calendar .swaps .next-month{right:0em;_right:.5em}div.rui-calendar .swaps .prev-year{left:2.05em}div.rui-calendar .swaps .next-year{right:2.05em;_right:2.52em}div.rui-calendar .greed{border-spacing:0px;border-collapse:collapse;border-size:0}div.rui-calendar .greed td{vertical-align:top;padding-left:.4em}div.rui-calendar .greed>tbody>tr>td:first-child{padding:0}div.rui-calendar .month{margin-top:.2em;border-spacing:1px;border-collapse:separate}div.rui-calendar .month caption{text-align:center}div.rui-calendar .month th{color:#666;text-align:center}div.rui-calendar .month td{text-align:right;padding:.1em .3em;background-color:#FFF;border:1px solid #CCC;cursor:pointer;color:#555;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.rui-calendar .month td:hover{background-color:#CCC;border-color:#AAA;color:#000}div.rui-calendar .month td.blank{background:transparent;cursor:default;border:none}div.rui-calendar .month td.selected{background-color:#BBB;border-color:#AAA;color:#222;font-weight:bold;padding:.1em .2em}div.rui-calendar .month td.disabled{color:#888;background:#EEE;border-color:#CCC;cursor:default}div.rui-calendar .timepicker{border-top:1px solid #ccc;margin-top:.3em;padding-top:.5em;text-align:center}div.rui-calendar .timepicker select{margin:0 .4em}div.rui-calendar .buttons{position:relative;margin-top:.5em}div.rui-calendar .buttons div.rui-button{width:4em;padding:.25em .5em}div.rui-calendar .buttons .done{position:absolute;right:0em;top:0}");
1452
+
1453
+ embed_style.type = 'text/css';
1454
+ document.getElementsByTagName('head')[0].appendChild(embed_style);
1455
+
1456
+ if(embed_style.styleSheet) {
1457
+ embed_style.styleSheet.cssText = embed_rules.nodeValue;
1458
+ } else {
1459
+ embed_style.appendChild(embed_rules);
1460
+ }
1461
+
1459
1462
 
1460
1463
  return Calendar;
1461
1464
  })(document, parseInt, RightJS);
@@ -1,36 +1,7 @@
1
1
  /**
2
- * The calendar widget implemented with RightJS
2
+ * RightJS-UI Calendar v2.2.0
3
+ * http://rightjs.org/ui/calendar
3
4
  *
4
- * Home page: http://rightjs.org/ui/calendar
5
- *
6
- * @copyright (C) 2009-2010 Nikolay Nemshilov
5
+ * Copyright (C) 2009-2011 Nikolay Nemshilov
7
6
  */
8
- var Calendar=RightJS.Calendar=function(u,p,f){function x(a,b,c,e){if(f.Fx)if(c===undefined){c=this.options.fxName;if(e===undefined){e={duration:this.options.fxDuration,onFinish:f(this.fire).bind(this,b)};if(b==="hide")e.duration=(f.Fx.Durations[e.duration]||e.duration)/2}}f.Element.prototype[b].call(a,c,e);if(!f.Fx||!c)this.fire(b);return this}function s(a){return(a<10?"0":"")+a}var o=f,y=f.$,D=f.$$,q=f.$w,E=f.$ext,F=f.isString,z=f.isArray,G=f.isFunction,t=f.Wrapper,l=f.Element,A=f.Input,B=f.RegExp,
9
- C=f.Browser,r=new f.Wrapper(f.Element,{initialize:function(a,b){this.$super("div",b);this._.innerHTML=a;this.addClass("rui-button");this.on("selectstart","stopEvent")},disable:function(){return this.addClass("rui-button-disabled")},enable:function(){return this.removeClass("rui-button-disabled")},disabled:function(){return this.hasClass("rui-button-disabled")},enabled:function(){return!this.disabled()},fire:function(){this.enabled()&&this.$super.apply(this,arguments);return this}}),n=new (function(a,
10
- b){if(!b){b=a;a="DIV"}var c=new f.Wrapper(f.Element.Wrappers[a]||f.Element,{initialize:function(e,d){this.key=e;var g=[{"class":"rui-"+e}];this instanceof f.Input||this instanceof f.Form||g.unshift(a);this.$super.apply(this,g);if(f.isString(d))d=f.$(d);if(d instanceof f.Element){this._=d._;if("$listeners"in d)d.$listeners=d.$listeners;d={}}this.setOptions(d,this);return this},setOptions:function(e,d){d=d||this;f.Options.setOptions.call(this,f.Object.merge(e,eval("("+(d.get("data-"+this.key)||"{}")+
11
- ")")));return this}});c=new f.Wrapper(c,b);f.Observer.createShortcuts(c.prototype,c.EVENTS||[]);return c})({include:[{show:function(a,b){this.constructor.current=this;return x.call(this,this,"show",a,b)},hide:function(a,b){this.constructor.current=null;return x.call(this,this,"hide",a,b)},showAt:function(a,b,c){var e=this.hide(null).shownAt=a=f.$(a),d=(this.reAnchor||(this.reAnchor=new f.Element("div",{"class":"rui-re-anchor"})).insert(this)).insertTo(e,"after").position();a=e.dimensions();var g=
12
- p(e.getStyle("borderTopWidth")),h=p(e.getStyle("borderLeftWidth")),j=p(e.getStyle("borderRightWidth")),i=p(e.getStyle("borderBottomWidth"));e=a.top-d.y+g;d=a.left-d.x+h;h=a.width-h-j;a=a.height-g-i;this.setStyle("visibility:hidden").show(null);if(b==="right")d+=h-this.size().x;else e+=a;this.moveTo(d,e);if(c)["left","right"].include(b)?this.setHeight(a):this.setWidth(h);this.setStyle("visibility:visible").hide(null);return this.show()},toggleAt:function(a,b,c){return this.hidden()?this.showAt(a,b,
13
- c):this.hide()}},{assignTo:function(a,b){a=f.$(a);if(b=f.$(b)){b[this.key]=this;b.assignedInput=a}else a[this.key]=this;var c=f(function(){if(this.visible()&&(!this.showAt||this.shownAt===a))this.setValue(a.value())}).bind(this);a.on({keyup:c,change:c});this.onChange(function(){if(!this.showAt||this.shownAt===a)a.setValue(this.getValue())});return this}}],extend:{version:"2.0.0",EVENTS:q("show hide change done"),Options:{format:"ISO",showTime:null,showButtons:false,minDate:false,maxDate:false,fxName:"fade",
14
- fxDuration:"short",firstDay:1,numberOfMonths:1,timePeriod:1,twentyFourHour:null,listYears:false,hideOnPick:false,update:null,trigger:null,cssRule:"*[data-calendar]"},Formats:{ISO:"%Y-%m-%d",POSIX:"%Y/%m/%d",EUR:"%d-%m-%Y",US:"%m/%d/%Y"},i18n:{Done:"Done",Now:"Now",NextMonth:"Next Month",PrevMonth:"Previous Month",NextYear:"Next Year",PrevYear:"Previous Year",dayNames:q("Sunday Monday Tuesday Wednesday Thursday Friday Saturday"),dayNamesShort:q("Sun Mon Tue Wed Thu Fri Sat"),dayNamesMin:q("Su Mo Tu We Th Fr Sa"),
15
- monthNames:q("January February March April May June July August September October November December"),monthNamesShort:q("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")},current:null,hideAll:function(a){D("div.rui-calendar").each(function(b){b instanceof n&&b!==a&&b.visible()&&!b.inlined()&&b.hide()})}},initialize:function(a){this.$super("calendar",a);this.addClass("rui-panel");a=this.options;this.insert([this.swaps=new H(a),this.greed=new I(a)]);if(a.showTime)this.insert(this.timepicker=new J(a));
16
- if(a.showButtons)this.insert(this.buttons=new K(a));this.setDate(new Date).initEvents()},setDate:function(a,b){if(a=this.parse(a)){var c=this.options;if(c.minDate&&c.minDate>a)a=new Date(c.minDate);if(c.maxDate&&c.maxDate<a){a=new Date(c.maxDate);a.setDate(a.getDate()-1)}this._date=b?new Date(this._date||this.date):null;this.greed.setDate(this._date||a,a);if(c.minDate||c.maxDate)this.swaps.setDate(a);this.timepicker&&!b&&this.timepicker.setDate(a);if(a!=this.date)this.fire("change",{date:this.date=
17
- a})}return this},getDate:function(){return this.date},setValue:function(a){return this.setDate(a)},getValue:function(a){return this.format(a)},insertTo:function(a,b){this.addClass("rui-calendar-inline");return this.$super(a,b)},done:function(){this.inlined()||this.hide();this.fire("done",{date:this.date})},inlined:function(){return this.hasClass("rui-calendar-inline")},setOptions:function(a){a=a||{};this.$super(a,y(a.trigger||a.update));var b=this.constructor,c=this.options;c.i18n={};for(var e in b.i18n)c.i18n[e]=
18
- z(b.i18n[e])?b.i18n[e].clone():b.i18n[e];E(c.i18n,a.i18n);c.dayNames=c.i18n.dayNamesMin;c.firstDay&&c.dayNames.push(c.dayNames.shift());if(!z(c.numberOfMonths))c.numberOfMonths=[c.numberOfMonths,1];if(c.minDate)c.minDate=this.parse(c.minDate);if(c.maxDate){c.maxDate=this.parse(c.maxDate);c.maxDate.setDate(c.maxDate.getDate()+1)}c.format=o(b.Formats[c.format]||c.format).trim();if(c.showTime===null)c.showTime=c.format.search(/%[HkIl]/)>-1;if(c.twentyFourHour===null)c.twentyFourHour=c.format.search(/%[Il]/)<
19
- 0;if(c.timePeriod>60&&12%Math.ceil(c.timePeriod/60))c.twentyFourHour=true;c.update&&this.assignTo(c.update,c.trigger);return this},hideOthers:function(){n.hideAll(this);return this}}),H=new t(l,{initialize:function(a){this.$super("div",{"class":"swaps"});this.options=a;var b=a.i18n;this.insert([this.prevMonth=new r("&lsaquo;",{title:b.PrevMonth,"class":"prev-month"}),this.nextMonth=new r("&rsaquo;",{title:b.NextMonth,"class":"next-month"})]);if(a.listYears)this.insert([this.prevYear=new r("&laquo;",
20
- {title:b.PrevYear,"class":"prev-year"}),this.nextYear=new r("&raquo;",{title:b.NextYear,"class":"next-year"})]);this.buttons=o([this.prevMonth,this.nextMonth,this.prevYear,this.nextYear]).compact();this.onClick(this.clicked)},setDate:function(a){var b=this.options,c=b.numberOfMonths[0]*b.numberOfMonths[1],e=true,d=true,g=true,h=true;if(b.minDate){g=new Date(a.getFullYear(),0,1,0,0,0);var j=new Date(b.minDate.getFullYear(),0,1,0,0,0);e=g>j;g.setMonth(a.getMonth()-Math.ceil(c-c/2));j.setMonth(b.minDate.getMonth());
21
- g=g>=j}if(b.maxDate){a=new Date(a);b=new Date(b.maxDate);c=o([a,b]);c.each(function(i){i.setDate(32);i.setMonth(i.getMonth()-1);i.setDate(32-i.getDate());i.setHours(0);i.setMinutes(0);i.setSeconds(0);i.setMilliseconds(0)});h=a<b;c.each("setMonth",0);d=a<b}this.nextMonth[h?"enable":"disable"]();this.prevMonth[g?"enable":"disable"]();if(this.nextYear){this.nextYear[d?"enable":"disable"]();this.prevYear[e?"enable":"disable"]()}},clicked:function(a){(a=a.target)&&this.buttons.include(a)&&a.enabled()&&
22
- this.fire(a.get("className").split(/\s+/)[0])}}),L=new t(l,{initialize:function(a){this.$super("table",{"class":"month"});this.options=a;this.insert(this.caption=new l("caption"));this.insert("<thead><tr>"+a.dayNames.map(function(d){return"<th>"+d+"</th>"}).join("")+"</tr></thead>");this.days=[];a=(new l("tbody")).insertTo(this);var b,c,e;for(c=0;c<6;c++){e=(new l("tr")).insertTo(a);for(b=0;b<7;b++)this.days.push((new l("td")).insertTo(e))}this.onClick(this.clicked)},setDate:function(a,b){a.setDate(32);
23
- var c=32-a.getDate();a.setMonth(a.getMonth()-1);for(var e=Math.ceil(b.getTime()/864E5),d=this.options,g=d.i18n,h=this.days,j=0,i=h.length-1,k,m,v;j<7;j++){k=h[j]._;m=h[i-j]._;v=h[i-j-7]._;k.innerHTML=m.innerHTML=v.innerHTML="";k.className=m.className=v.className="blank"}j=1;i=0;for(var w;j<=c;j++){a.setDate(j);m=a.getDay();if(d.firstDay===1)m=m>0?m-1:6;if(j===1||m===0){w=h.slice(i*7,i*7+7);i++}k=w[m]._;if(C.OLD){k.innerHTML="";k.appendChild(u.createTextNode(j))}else k.innerHTML=""+j;k.className=e===
24
- Math.ceil(a.getTime()/864E5)?"selected":"";if(d.minDate&&d.minDate>a||d.maxDate&&d.maxDate<a)k.className="disabled";w[m].date=new Date(a)}c=(d.listYears?g.monthNamesShort[a.getMonth()]+",":g.monthNames[a.getMonth()])+" "+a.getFullYear();e=this.caption._;if(C.OLD){e.innerHTML="";e.appendChild(u.createTextNode(c))}else e.innerHTML=c},clicked:function(a){a=a.target;var b=a.date;if(a&&b&&!a.hasClass("disabled")&&!a.hasClass("blank")){a.addClass("selected");this.fire("date-set",{date:b.getDate(),month:b.getMonth(),
25
- year:b.getFullYear()})}}}),I=new t(l,{initialize:function(a){this.$super("table",{"class":"greed"});this.months=[];for(var b=(new l("tbody")).insertTo(this),c,e=0;e<a.numberOfMonths[1];e++)for(var d=(new l("tr")).insertTo(b),g=0;g<a.numberOfMonths[0];g++){this.months.push(c=new L(a));(new l("td")).insertTo(d).insert(c)}},setDate:function(a,b){var c=this.months,e=c.length;b=b||a;for(var d=-Math.ceil(e-e/2)+1,g=0;d<Math.floor(e-e/2)+1;d++,g++){var h=new Date(a);h.setMonth(a.getMonth()+d);c[g].setDate(h,
26
- b)}}}),J=new t(l,{initialize:function(a){this.$super("div",{"class":"timepicker"});this.options=a;var b=o(this.timeChanged).bind(this);this.insert([this.hours=(new l("select")).onChange(b),this.minutes=(new l("select")).onChange(b)]);for(var c=a.timePeriod<60?a.timePeriod:60,e=a.timePeriod<60?1:Math.ceil(a.timePeriod/60),d=0;d<60;d++){var g=s(d);if(d<24&&d%e==0)if(a.twentyFourHour)this.hours.insert(new l("option",{value:d,html:g}));else if(d<12)this.hours.insert(new l("option",{value:d,html:d==0?
27
- 12:d}));d%c==0&&this.minutes.insert(new l("option",{value:d,html:g}))}if(!a.twentyFourHour){this.meridian=(new l("select")).onChange(b).insertTo(this);o(o(a.format).includes(/%P/)?["am","pm"]:["AM","PM"]).each(function(h){this.meridian.insert(new l("option",{value:h.toLowerCase(),html:h}))},this)}},setDate:function(a){var b=this.options,c=b.timePeriod<60?a.getHours():Math.round(a.getHours()/(b.timePeriod/60))*(b.timePeriod/60);a=Math.round(a.getMinutes()/(b.timePeriod%60))*b.timePeriod;if(this.meridian){this.meridian.setValue(c<
28
- 12?"am":"pm");c=c==0||c==12?12:c>12?c-12:c}this.hours.setValue(c);this.minutes.setValue(a)},timeChanged:function(a){a.stopPropagation();a=p(this.hours.value());var b=p(this.minutes.value());if(this.meridian){if(a==12)a=0;if(this.meridian.value()=="pm")a+=12}this.fire("time-set",{hours:a,minutes:b})}}),K=new t(l,{initialize:function(a){this.$super("div",{"class":"buttons"});this.insert([(new r(a.i18n.Now,{"class":"now"})).onClick("fire","now-clicked"),(new r(a.i18n.Done,{"class":"done"})).onClick("fire",
29
- "done-clicked")])}});n.include({parse:function(a){var b;if(F(a)&&a){var c=B.escape(this.options.format),e=o(c.match(/%[a-z]/ig)).map("match",/[a-z]$/i).map("first").without("%");c=new B("^"+c.replace(/%p/i,"(pm|PM|am|AM)").replace(/(%[a-z])/ig,"(.+?)")+"$");if(a=o(a).trim().match(c)){a.shift();for(var d=c=null,g=null,h=null,j=null,i;a.length;){var k=a.shift(),m=e.shift();if(m.toLowerCase()=="b")d=this.options.i18n[m=="b"?"monthNamesShort":"monthNames"].indexOf(k);else if(m.toLowerCase()=="p")i=k.toLowerCase();
30
- else{k=p(k,10);switch(m){case "d":case "e":b=k;break;case "m":d=k-1;break;case "y":case "Y":c=k;break;case "H":case "k":case "I":case "l":g=k;break;case "M":h=k;break;case "S":j=k;break}}}if(i){g=g==12?0:g;g=i=="pm"?g+12:g}b=new Date(c,d,b,g,h,j)}}else if(a instanceof Date||Date.parse(a))b=new Date(a);return!b||isNaN(b.getTime())?null:b},format:function(a){var b=this.options.i18n,c=this.date.getDay(),e=this.date.getMonth(),d=this.date.getDate(),g=this.date.getFullYear(),h=this.date.getHours(),j=this.date.getMinutes(),
31
- i=this.date.getSeconds(),k=h==0?12:h<13?h:h-12;b={a:b.dayNamesShort[c],A:b.dayNames[c],b:b.monthNamesShort[e],B:b.monthNames[e],d:s(d),e:""+d,m:(e<9?"0":"")+(e+1),y:(""+g).substring(2,4),Y:""+g,H:s(h),k:""+h,I:(h>0&&(h<10||h>12&&h<22)?"0":"")+k,l:""+k,p:h<12?"AM":"PM",P:h<12?"am":"pm",M:s(j),S:s(i),"%":"%"};a=a||this.options.format;for(var m in b)a=a.replace("%"+m,b[m]);return a}});n.include({initEvents:function(){var a=this._terminate;this.on({"prev-day":["_shiftDate",{Date:-1}],"next-day":["_shiftDate",
32
- {Date:1}],"prev-week":["_shiftDate",{Date:-7}],"next-week":["_shiftDate",{Date:7}],"prev-month":["_shiftDate",{Month:-1}],"next-month":["_shiftDate",{Month:1}],"prev-year":["_shiftDate",{FullYear:-1}],"next-year":["_shiftDate",{FullYear:1}],"date-set":this._changeDate,"time-set":this._changeTime,"now-clicked":this._setNow,"done-clicked":this.done,click:a,mousedown:a,focus:a,blur:a})},_shiftDate:function(a){var b=new Date(this.date);for(var c in a)b["set"+c](b["get"+c]()+a[c]);this.setDate(b)},_changeDate:function(a){var b=
33
- new Date(this.date);b.setDate(a.date);b.setMonth(a.month);b.setFullYear(a.year);this.setDate(b,true);this.options.hideOnPick&&this.done()},_changeTime:function(a){var b=new Date(this.date);b.setHours(a.hours);b.setMinutes(a.minutes);this.setDate(b)},_setNow:function(){this.setDate(new Date)},_terminate:function(a){a.stopPropagation();if(this._hide_delay){this._hide_delay.cancel();this._hide_delay=null}}});y(u).on({focus:function(a){a=a.target instanceof A&&a.target.get("type")=="text"?a.target:null;
34
- n.hideAll();if(a&&(a.calendar||a.match(n.Options.cssRule)))(a.calendar||new n({update:a})).setValue(a.value()).showAt(a)},blur:function(a){var b=a.target.calendar;if(b)b._hide_delay=o(function(){b.hide()}).delay(200)},click:function(a){var b=a.target instanceof l?a.target:null;if(b&&(b.calendar||b.match(n.Options.cssRule))){if(!(b instanceof A)||b.get("type")!="text"){a.stop();(b.calendar||new n({trigger:b})).hide(null).toggleAt(b.assignedInput)}}else a.find("div.rui-calendar")||n.hideAll()},keydown:function(a){var b=
35
- n.current,c={27:"hide",37:"prev-day",39:"next-day",38:"prev-week",40:"next-week",33:"prev-month",34:"next-month",13:"done"}[a.keyCode];if(c&&b&&b.visible()){a.stop();G(b[c])?b[c]():b.fire(c)}}});u.write('<style type="text/css">.rui-panel{margin:0;padding:.5em;position:relative;background-color:#EEE;border:1px solid #BBB;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;box-shadow:.15em .3em .5em #BBB;-moz-box-shadow:.15em .3em .5em #BBB;-webkit-box-shadow:.15em .3em .5em #BBB;cursor:default} *.rui-button{display:inline-block; *display:inline; *zoom:1;height:1em;line-height:1em;margin:0;padding:.2em .5em;text-align:center;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;cursor:pointer;color:#333;background-color:#FFF;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-button:hover{color:#111;border-color:#999;background-color:#DDD;box-shadow:#888 0 0 .1em;-moz-box-shadow:#888 0 0 .1em;-webkit-box-shadow:#888 0 0 .1em} *.rui-button:active{color:#000;border-color:#777;text-indent:1px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none} *.rui-button-disabled, *.rui-button-disabled:hover, *.rui-button-disabled:active{color:#888;background:#DDD;border-color:#CCC;cursor:default;text-indent:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}div.rui-calendar .swaps,div.rui-calendar .greed,div.rui-calendar .timepicker,div.rui-calendar .buttons,div.rui-calendar table,div.rui-calendar table tr,div.rui-calendar table th,div.rui-calendar table td,div.rui-calendar table tbody,div.rui-calendar table thead,div.rui-calendar table caption{background:none;border:none;width:auto;height:auto;margin:0;padding:0}div.rui-calendar-inline{position:relative;display:inline-block; *display:inline; *zoom:1;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-calendar .swaps{position:relative}div.rui-calendar .swaps .rui-button{position:absolute;float:left;width:1em;padding:.15em .4em}div.rui-calendar .swaps .next-month{right:0em;_right:.5em}div.rui-calendar .swaps .prev-year{left:2.05em}div.rui-calendar .swaps .next-year{right:2.05em;_right:2.52em}div.rui-calendar .greed{border-spacing:0px;border-collapse:collapse;border-size:0}div.rui-calendar .greed td{vertical-align:top;padding-left:.4em}div.rui-calendar .greed>tbody>tr>td:first-child{padding:0}div.rui-calendar .month{margin-top:.2em;border-spacing:1px;border-collapse:separate}div.rui-calendar .month caption{text-align:center}div.rui-calendar .month th{color:#666;text-align:center}div.rui-calendar .month td{text-align:right;padding:.1em .3em;background-color:#FFF;border:1px solid #CCC;cursor:pointer;color:#555;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.rui-calendar .month td:hover{background-color:#CCC;border-color:#AAA;color:#000}div.rui-calendar .month td.blank{background:transparent;cursor:default;border:none}div.rui-calendar .month td.selected{background-color:#BBB;border-color:#AAA;color:#222;font-weight:bold;padding:.1em .2em}div.rui-calendar .month td.disabled{color:#888;background:#EEE;border-color:#CCC;cursor:default}div.rui-calendar .timepicker{border-top:1px solid #ccc;margin-top:.3em;padding-top:.5em;text-align:center}div.rui-calendar .timepicker select{margin:0 .4em}div.rui-calendar .buttons{position:relative;margin-top:.5em}div.rui-calendar .buttons div.rui-button{width:4em;padding:.25em .5em}div.rui-calendar .buttons .done{position:absolute;right:0em;top:0}</style>');
36
- return n}(document,parseInt,RightJS);
7
+ var Calendar=RightJS.Calendar=function(a,b,c){function j(a){return(a<10?"0":"")+a}function h(a,d,e){var f=this.reAnchor||(this.reAnchor=new c.Element("div",{"class":"rui-re-anchor"})).insert(this),g=f.insertTo(a,"after").position(),h=a.dimensions(),i=this,j=b(a.getStyle("borderTopWidth")),k=b(a.getStyle("borderLeftWidth")),l=b(a.getStyle("borderRightWidth")),m=b(a.getStyle("borderBottomWidth")),n=h.top-g.y+j,o=h.left-g.x+k,p=h.width-k-l,q=h.height-j-m;i.setStyle("visibility:hidden").show(null),d==="right"?o+=p-i.size().x:n+=q,i.moveTo(o,n),e&&(d==="left"||d==="right"?i.setHeight(q):i.setWidth(p)),i.setStyle("visibility:visible").hide(null)}function g(a,b,d,e){c.Fx&&(d===undefined&&(d=a.options.fxName,e===undefined&&(e={duration:a.options.fxDuration,onFinish:c(a.fire).bind(a,b)},b==="hide"&&(e.duration=(c.Fx.Durations[e.duration]||e.duration)/2)))),(!c.Fx||!d)&&a.fire(b);return a.$super(d,e)}function d(a,b){b||(b=a,a="DIV");var d=new c.Class(c.Element.Wrappers[a]||c.Element,{initialize:function(b,d){this.key=b;var e=[{"class":"rui-"+b}];this instanceof c.Input||this instanceof c.Form||e.unshift(a),this.$super.apply(this,e),c.isString(d)&&(d=c.$(d)),d instanceof c.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return c.Wrapper.Cache[c.$uid(this._)]=this},setOptions:function(a,b){b&&(a=c.Object.merge(a,(new Function("return "+(b.get("data-"+this.key)||"{}")))())),a&&c.Options.setOptions.call(this,c.Object.merge(this.options,a));return this}}),e=new c.Class(d,b);c.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var e=new c.Class(c.Element,{initialize:function(a,b){this.$super("div",b),this._.innerHTML=a,this.addClass("rui-button"),this.on("selectstart","stopEvent")},disable:function(){return this.addClass("rui-button-disabled")},enable:function(){return this.removeClass("rui-button-disabled")},disabled:function(){return this.hasClass("rui-button-disabled")},enabled:function(){return!this.disabled()},fire:function(){this.enabled()&&this.$super.apply(this,arguments);return this}}),f={show:function(a,b){this.constructor.current=this;return g(this,"show",a,b)},hide:function(a,b){this.constructor.current=null;return g(this,"show",a,b)},showAt:function(a,b,d){this.hide(null).shownAt=a=c.$(a),h.call(this,a,b,d);return this.show()},toggleAt:function(a,b,c){return this.hidden()?this.showAt(a,b,c):this.hide()}},i={assignTo:function(a,b){a=c.$(a),b=c.$(b),b?(b[this.key]=this,b.assignedInput=a):a[this.key]=this;var d=c(function(){this.visible()&&(!this.showAt||this.shownAt===a)&&this.setValue(a.value())}).bind(this);a.on({keyup:d,change:d}),this.onChange(function(){(!this.showAt||this.shownAt===a)&&a.setValue(this.getValue())});return this}},k=c,l=c.$,m=c.$$,n=c.$w,o=c.$ext,p=c.$uid,q=c.isString,r=c.isArray,s=c.isFunction,t=c.Class,u=c.Element,v=c.Input,w=c.RegExp,x=c.Browser,y=new d({include:[f,i],extend:{version:"2.2.0",EVENTS:n("show hide change done"),Options:{format:"ISO",showTime:null,showButtons:!1,minDate:!1,maxDate:!1,fxName:"fade",fxDuration:"short",firstDay:1,numberOfMonths:1,timePeriod:1,twentyFourHour:null,listYears:!1,hideOnPick:!1,update:null,trigger:null,cssRule:"*[data-calendar]"},Formats:{ISO:"%Y-%m-%d",POSIX:"%Y/%m/%d",EUR:"%d-%m-%Y",US:"%m/%d/%Y"},i18n:{Done:"Done",Now:"Now",NextMonth:"Next Month",PrevMonth:"Previous Month",NextYear:"Next Year",PrevYear:"Previous Year",dayNames:n("Sunday Monday Tuesday Wednesday Thursday Friday Saturday"),dayNamesShort:n("Sun Mon Tue Wed Thu Fri Sat"),dayNamesMin:n("Su Mo Tu We Th Fr Sa"),monthNames:n("January February March April May June July August September October November December"),monthNamesShort:n("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")},current:null,hideAll:function(a){m("div.rui-calendar").each(function(b){b instanceof y&&b!==a&&b.visible()&&!b.inlined()&&b.hide()})}},initialize:function(a){this.$super("calendar",a),this.addClass("rui-panel"),a=this.options,this.insert([this.swaps=new z(a),this.greed=new B(a)]),a.showTime&&this.insert(this.timepicker=new C(a)),a.showButtons&&this.insert(this.buttons=new D(a)),this.setDate(new Date).initEvents()},setDate:function(a,b){if(a=this.parse(a)){var c=this.options;c.minDate&&c.minDate>a&&(a=new Date(c.minDate)),c.maxDate&&c.maxDate<a&&(a=new Date(c.maxDate),a.setDate(a.getDate()-1)),this._date=b?new Date(this._date||this.date):null,this.greed.setDate(this._date||a,a),(c.minDate||c.maxDate)&&this.swaps.setDate(a),this.timepicker&&!b&&this.timepicker.setDate(a),a!=this.date&&this.fire("change",{date:this.date=a})}return this},getDate:function(){return this.date},setValue:function(a){return this.setDate(a)},getValue:function(a){return this.format(a)},insertTo:function(a,b){this.addClass("rui-calendar-inline");return this.$super(a,b)},done:function(){this.inlined()||this.hide(),this.fire("done",{date:this.date})},inlined:function(){return this.hasClass("rui-calendar-inline")},setOptions:function(a){a=a||{},this.$super(a,l(a.trigger||a.update));var b=this.constructor,c=this.options;c.i18n={};for(var d in b.i18n)c.i18n[d]=r(b.i18n[d])?b.i18n[d].clone():b.i18n[d];o(c.i18n,a.i18n),c.dayNames=c.i18n.dayNamesMin,c.firstDay&&c.dayNames.push(c.dayNames.shift()),r(c.numberOfMonths)||(c.numberOfMonths=[c.numberOfMonths,1]),c.minDate&&(c.minDate=this.parse(c.minDate)),c.maxDate&&(c.maxDate=this.parse(c.maxDate),c.maxDate.setDate(c.maxDate.getDate()+1)),c.format=k(b.Formats[c.format]||c.format).trim(),c.showTime===null&&(c.showTime=c.format.search(/%[HkIl]/)>-1),c.twentyFourHour===null&&(c.twentyFourHour=c.format.search(/%[Il]/)<0),c.timePeriod>60&&12%Math.ceil(c.timePeriod/60)&&(c.twentyFourHour=!0),c.update&&this.assignTo(c.update,c.trigger);return this},hideOthers:function(){y.hideAll(this);return this}}),z=new t(u,{initialize:function(a){this.$super("div",{"class":"swaps"}),this.options=a;var b=a.i18n;this.insert([this.prevMonth=new e("&lsaquo;",{title:b.PrevMonth,"class":"prev-month"}),this.nextMonth=new e("&rsaquo;",{title:b.NextMonth,"class":"next-month"})]),a.listYears&&this.insert([this.prevYear=new e("&laquo;",{title:b.PrevYear,"class":"prev-year"}),this.nextYear=new e("&raquo;",{title:b.NextYear,"class":"next-year"})]),this.buttons=k([this.prevMonth,this.nextMonth,this.prevYear,this.nextYear]).compact(),this.onClick(this.clicked)},setDate:function(a){var b=this.options,c=b.numberOfMonths[0]*b.numberOfMonths[1],d=!0,e=!0,f=!0,g=!0;if(b.minDate){var h=new Date(a.getFullYear(),0,1,0,0,0),i=new Date(b.minDate.getFullYear(),0,1,0,0,0);d=h>i,h.setMonth(a.getMonth()-Math.ceil(c-c/2)),i.setMonth(b.minDate.getMonth()),f=h>=i}if(b.maxDate){var j=new Date(a),l=new Date(b.maxDate),m=k([j,l]);m.each(function(a){a.setDate(32),a.setMonth(a.getMonth()-1),a.setDate(32-a.getDate()),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}),g=j<l,m.each("setMonth",0),e=j<l}this.nextMonth[g?"enable":"disable"](),this.prevMonth[f?"enable":"disable"](),this.nextYear&&(this.nextYear[e?"enable":"disable"](),this.prevYear[d?"enable":"disable"]())},clicked:function(a){var b=a.target;b&&this.buttons.include(b)&&(b.enabled()&&this.fire(b.get("className").split(/\s+/)[0]))}}),A=new t(u,{initialize:function(a){this.$super("table",{"class":"month"}),this.options=a,this.insert(this.caption=new u("caption")),this.insert("<thead><tr>"+a.dayNames.map(function(a){return"<th>"+a+"</th>"}).join("")+"</tr></thead>"),this.days=[];var b=(new u("tbody")).insertTo(this),c,d,e;for(d=0;d<6;d++){e=(new u("tr")).insertTo(b);for(c=0;c<7;c++)this.days.push((new u("td")).insertTo(e))}this.onClick(this.clicked)},setDate:function(b,c){b.setDate(32);var d=32-b.getDate();b.setMonth(b.getMonth()-1);var e=Math.ceil(c.getTime()/864e5),f=this.options,g=f.i18n,h=this.days;for(var i=0,j=h.length-1,k,l,m;i<7;i++)k=h[i]._,l=h[j-i]._,m=h[j-i-7]._,k.innerHTML=l.innerHTML=m.innerHTML="",k.className=l.className=m.className="blank";for(var i=1,n=0,o,p;i<=d;i++){b.setDate(i);var q=b.getDay();f.firstDay===1&&(q=q>0?q-1:6);if(i===1||q===0)o=h.slice(n*7,n*7+7),n++;p=o[q]._,x.OLD?(p.innerHTML="",p.appendChild(a.createTextNode(i))):p.innerHTML=""+i,p.className=e===Math.ceil(b.getTime()/864e5)?"selected":"";if(f.minDate&&f.minDate>b||f.maxDate&&f.maxDate<b)p.className="disabled";o[q].date=new Date(b)}var r=(f.listYears?g.monthNamesShort[b.getMonth()]+",":g.monthNames[b.getMonth()])+" "+b.getFullYear(),s=this.caption._;x.OLD?(s.innerHTML="",s.appendChild(a.createTextNode(r))):s.innerHTML=r},clicked:function(a){var b=a.target,c=b.date;b&&c&&!b.hasClass("disabled")&&!b.hasClass("blank")&&(b.addClass("selected"),this.fire("date-set",{date:c.getDate(),month:c.getMonth(),year:c.getFullYear()}))}}),B=new t(u,{initialize:function(a){this.$super("table",{"class":"greed"}),this.months=[];var b=(new u("tbody")).insertTo(this),c;for(var d=0;d<a.numberOfMonths[1];d++){var e=(new u("tr")).insertTo(b);for(var f=0;f<a.numberOfMonths[0];f++)this.months.push(c=new A(a)),(new u("td")).insertTo(e).insert(c)}},setDate:function(a,b){var c=this.months,d=c.length;b=b||a;for(var e=-Math.ceil(d-d/2)+1,f=0;e<Math.floor(d-d/2)+1;e++,f++){var g=new Date(a);g.setMonth(a.getMonth()+e),c[f].setDate(g,b)}}}),C=new t(u,{initialize:function(a){this.$super("div",{"class":"timepicker"}),this.options=a;var b=k(this.timeChanged).bind(this);this.insert([this.hours=(new u("select")).onChange(b),this.minutes=(new u("select")).onChange(b)]);var c=a.timePeriod<60?a.timePeriod:60,d=a.timePeriod<60?1:Math.ceil(a.timePeriod/60);for(var e=0;e<60;e++){var f=j(e);e<24&&e%d==0&&(a.twentyFourHour?this.hours.insert(new u("option",{value:e,html:f})):e<12&&this.hours.insert(new u("option",{value:e,html:e==0?12:e}))),e%c==0&&this.minutes.insert(new u("option",{value:e,html:f}))}a.twentyFourHour||(this.meridian=(new u("select")).onChange(b).insertTo(this),k(k(a.format).includes(/%P/)?["am","pm"]:["AM","PM"]).each(function(a){this.meridian.insert(new u("option",{value:a.toLowerCase(),html:a}))},this))},setDate:function(a){var b=this.options,c=b.timePeriod<60?a.getHours():Math.round(a.getHours()/(b.timePeriod/60))*(b.timePeriod/60),d=Math.round(a.getMinutes()/(b.timePeriod%60))*b.timePeriod;this.meridian&&(this.meridian.setValue(c<12?"am":"pm"),c=c==0||c==12?12:c>12?c-12:c),this.hours.setValue(c),this.minutes.setValue(d)},timeChanged:function(a){a.stopPropagation();var c=b(this.hours.value()),d=b(this.minutes.value());this.meridian&&(c==12&&(c=0),this.meridian.value()=="pm"&&(c+=12)),this.fire("time-set",{hours:c,minutes:d})}}),D=new t(u,{initialize:function(a){this.$super("div",{"class":"buttons"}),this.insert([(new e(a.i18n.Now,{"class":"now"})).onClick("fire","now-clicked"),(new e(a.i18n.Done,{"class":"done"})).onClick("fire","done-clicked")])}});y.include({parse:function(a){var c;if(q(a)&&a){var d=w.escape(this.options.format),e=k(d.match(/%[a-z]/ig)).map("match",/[a-z]$/i).map("first").without("%"),f=new w("^"+d.replace(/%p/i,"(pm|PM|am|AM)").replace(/(%[a-z])/ig,"(.+?)")+"$"),g=k(a).trim().match(f);if(g){g.shift();var h=null,i=null,j=null,l=null,m=null,n;while(g.length){var o=g.shift(),p=e.shift();if(p.toLowerCase()=="b")i=this.options.i18n[p=="b"?"monthNamesShort":"monthNames"].indexOf(o);else if(p.toLowerCase()=="p")n=o.toLowerCase();else{o=b(o,10);switch(p){case"d":case"e":c=o;break;case"m":i=o-1;break;case"y":case"Y":h=o;break;case"H":case"k":case"I":case"l":j=o;break;case"M":l=o;break;case"S":m=o}}}n&&(j=j==12?0:j,j=n=="pm"?j+12:j),c=new Date(h,i,c,j,l,m)}}else if(a instanceof Date||Date.parse(a))c=new Date(a);return!c||isNaN(c.getTime())?null:c},format:function(a){var b=this.options.i18n,c=this.date.getDay(),d=this.date.getMonth(),e=this.date.getDate(),f=this.date.getFullYear(),g=this.date.getHours(),h=this.date.getMinutes(),i=this.date.getSeconds(),k=g==0?12:g<13?g:g-12,l={a:b.dayNamesShort[c],A:b.dayNames[c],b:b.monthNamesShort[d],B:b.monthNames[d],d:j(e),e:""+e,m:(d<9?"0":"")+(d+1),y:(""+f).substring(2,4),Y:""+f,H:j(g),k:""+g,I:(g>0&&(g<10||g>12&&g<22)?"0":"")+k,l:""+k,p:g<12?"AM":"PM",P:g<12?"am":"pm",M:j(h),S:j(i),"%":"%"},m=a||this.options.format;for(var n in l)m=m.replace("%"+n,l[n]);return m}}),y.include({initEvents:function(){var a="_shiftDate",b=this._terminate;this.on({"prev-day":[a,{Date:-1}],"next-day":[a,{Date:1}],"prev-week":[a,{Date:-7}],"next-week":[a,{Date:7}],"prev-month":[a,{Month:-1}],"next-month":[a,{Month:1}],"prev-year":[a,{FullYear:-1}],"next-year":[a,{FullYear:1}],"date-set":this._changeDate,"time-set":this._changeTime,"now-clicked":this._setNow,"done-clicked":this.done,click:b,mousedown:b,focus:b,blur:b})},_shiftDate:function(a){var b=new Date(this.date),c=this.options;for(var d in a)b["set"+d](b["get"+d]()+a[d]);this.setDate(b)},_changeDate:function(a){var b=new Date(this.date);b.setDate(a.date),b.setMonth(a.month),b.setFullYear(a.year),this.setDate(b,!0),this.options.hideOnPick&&this.done()},_changeTime:function(a){var b=new Date(this.date);b.setHours(a.hours),b.setMinutes(a.minutes),this.setDate(b)},_setNow:function(){this.setDate(new Date)},_terminate:function(a){a.stopPropagation(),this._hide_delay&&(this._hide_delay.cancel(),this._hide_delay=null)}}),l(a).on({focus:function(a){var b=a.target instanceof v&&a.target.get("type")=="text"?a.target:null;y.hideAll(),b&&(b.calendar||b.match(y.Options.cssRule))&&(b.calendar||new y({update:b})).setValue(b.value()).showAt(b)},blur:function(a){var b=a.target,c=b.calendar;c&&(c._hide_delay=k(function(){c.hide()}).delay(200))},click:function(a){var b=a.target instanceof u?a.target:null;if(b&&(b.calendar||b.match(y.Options.cssRule))){if(!(b instanceof v)||b.get("type")!="text")a.stop(),(b.calendar||new y({trigger:b})).hide(null).toggleAt(b.assignedInput)}else a.find("div.rui-calendar")||y.hideAll()},keydown:function(a){var b=y.current,c=({27:"hide",37:"prev-day",39:"next-day",38:"prev-week",40:"next-week",33:"prev-month",34:"next-month",13:"done"})[a.keyCode];c&&b&&b.visible()&&(a.stop(),s(b[c])?b[c]():b.fire(c))}});var E=a.createElement("style"),F=a.createTextNode(".rui-panel{margin:0;padding:.5em;position:relative;background-color:#EEE;border:1px solid #BBB;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;box-shadow:.15em .3em .5em #BBB;-moz-box-shadow:.15em .3em .5em #BBB;-webkit-box-shadow:.15em .3em .5em #BBB;cursor:default} *.rui-button{display:inline-block; *display:inline; *zoom:1;height:1em;line-height:1em;margin:0;padding:.2em .5em;text-align:center;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;cursor:pointer;color:#333;background-color:#FFF;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-button:hover{color:#111;border-color:#999;background-color:#DDD;box-shadow:#888 0 0 .1em;-moz-box-shadow:#888 0 0 .1em;-webkit-box-shadow:#888 0 0 .1em} *.rui-button:active{color:#000;border-color:#777;text-indent:1px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none} *.rui-button-disabled, *.rui-button-disabled:hover, *.rui-button-disabled:active{color:#888;background:#DDD;border-color:#CCC;cursor:default;text-indent:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}div.rui-calendar .swaps,div.rui-calendar .greed,div.rui-calendar .timepicker,div.rui-calendar .buttons,div.rui-calendar table,div.rui-calendar table tr,div.rui-calendar table th,div.rui-calendar table td,div.rui-calendar table tbody,div.rui-calendar table thead,div.rui-calendar table caption{background:none;border:none;width:auto;height:auto;margin:0;padding:0}div.rui-calendar-inline{position:relative;display:inline-block; *display:inline; *zoom:1;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-calendar .swaps{position:relative}div.rui-calendar .swaps .rui-button{position:absolute;float:left;width:1em;padding:.15em .4em}div.rui-calendar .swaps .next-month{right:0em;_right:.5em}div.rui-calendar .swaps .prev-year{left:2.05em}div.rui-calendar .swaps .next-year{right:2.05em;_right:2.52em}div.rui-calendar .greed{border-spacing:0px;border-collapse:collapse;border-size:0}div.rui-calendar .greed td{vertical-align:top;padding-left:.4em}div.rui-calendar .greed>tbody>tr>td:first-child{padding:0}div.rui-calendar .month{margin-top:.2em;border-spacing:1px;border-collapse:separate}div.rui-calendar .month caption{text-align:center}div.rui-calendar .month th{color:#666;text-align:center}div.rui-calendar .month td{text-align:right;padding:.1em .3em;background-color:#FFF;border:1px solid #CCC;cursor:pointer;color:#555;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.rui-calendar .month td:hover{background-color:#CCC;border-color:#AAA;color:#000}div.rui-calendar .month td.blank{background:transparent;cursor:default;border:none}div.rui-calendar .month td.selected{background-color:#BBB;border-color:#AAA;color:#222;font-weight:bold;padding:.1em .2em}div.rui-calendar .month td.disabled{color:#888;background:#EEE;border-color:#CCC;cursor:default}div.rui-calendar .timepicker{border-top:1px solid #ccc;margin-top:.3em;padding-top:.5em;text-align:center}div.rui-calendar .timepicker select{margin:0 .4em}div.rui-calendar .buttons{position:relative;margin-top:.5em}div.rui-calendar .buttons div.rui-button{width:4em;padding:.25em .5em}div.rui-calendar .buttons .done{position:absolute;right:0em;top:0}");E.type="text/css",a.getElementsByTagName("head")[0].appendChild(E),E.styleSheet?E.styleSheet.cssText=F.nodeValue:E.appendChild(F);return y}(document,parseInt,RightJS)