right-rails 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,8 +1,8 @@
1
1
  /**
2
- * Resizable unit for RightJS
2
+ * RightJS-UI Resizable v2.2.2
3
3
  * http://rightjs.org/ui/resizable
4
4
  *
5
- * Copyright (C) 2010 Nikolay Nemshilov
5
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
6
6
  */
7
7
  var Resizable = RightJS.Resizable = (function(document, RightJS) {
8
8
  /**
@@ -10,24 +10,9 @@ var Resizable = RightJS.Resizable = (function(document, RightJS) {
10
10
  * it creates an abstract proxy with the common functionality
11
11
  * which then we reuse and override in the actual widgets
12
12
  *
13
- * Copyright (C) 2010 Nikolay Nemshilov
13
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
14
14
  */
15
15
 
16
- /**
17
- * The filenames to include
18
- *
19
- * Copyright (C) 2010 Nikolay Nemshilov
20
- */
21
- var R = RightJS,
22
- $ = RightJS.$,
23
- $w = RightJS.$w,
24
- $E = RightJS.$E,
25
- Wrapper = RightJS.Wrapper,
26
- Element = RightJS.Element;
27
-
28
-
29
-
30
-
31
16
  /**
32
17
  * The widget units constructor
33
18
  *
@@ -46,7 +31,7 @@ function Widget(tag_name, methods) {
46
31
  *
47
32
  * Copyright (C) 2010 Nikolay Nemshilov
48
33
  */
49
- 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, {
50
35
  /**
51
36
  * The common constructor
52
37
  *
@@ -78,7 +63,8 @@ function Widget(tag_name, methods) {
78
63
  options = {};
79
64
  }
80
65
  this.setOptions(options, this);
81
- return this;
66
+
67
+ return (RightJS.Wrapper.Cache[RightJS.$uid(this._)] = this);
82
68
  },
83
69
 
84
70
  // protected
@@ -91,12 +77,16 @@ function Widget(tag_name, methods) {
91
77
  * @return void
92
78
  */
93
79
  setOptions: function(options, element) {
94
- element = element || this;
95
- RightJS.Options.setOptions.call(this,
96
- RightJS.Object.merge(options, eval("("+(
80
+ if (element) {
81
+ options = RightJS.Object.merge(options, new Function("return "+(
97
82
  element.get('data-'+ this.key) || '{}'
98
- )+")"))
99
- );
83
+ ))());
84
+ }
85
+
86
+ if (options) {
87
+ RightJS.Options.setOptions.call(this, RightJS.Object.merge(this.options, options));
88
+ }
89
+
100
90
  return this;
101
91
  }
102
92
  });
@@ -105,7 +95,7 @@ function Widget(tag_name, methods) {
105
95
  * Creating the actual widget class
106
96
  *
107
97
  */
108
- var Klass = new RightJS.Wrapper(AbstractWidget, methods);
98
+ var Klass = new RightJS.Class(AbstractWidget, methods);
109
99
 
110
100
  // creating the widget related shortcuts
111
101
  RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
@@ -114,14 +104,29 @@ function Widget(tag_name, methods) {
114
104
  }
115
105
 
116
106
 
107
+ /**
108
+ * The filenames to include
109
+ *
110
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
111
+ */
112
+ var R = RightJS,
113
+ $ = RightJS.$,
114
+ $w = RightJS.$w,
115
+ $E = RightJS.$E,
116
+ Class = RightJS.Class,
117
+ Element = RightJS.Element;
118
+
119
+
120
+
121
+
117
122
  /**
118
123
  * The resizable unit main file
119
124
  *
120
- * Copyright (C) 2010 Nikolay Nemshilov
125
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
121
126
  */
122
127
  var Resizable = new Widget({
123
128
  extend: {
124
- version: '2.0.0',
129
+ version: '2.2.2',
125
130
 
126
131
  EVENTS: $w('resize start release'),
127
132
 
@@ -155,9 +160,21 @@ var Resizable = new Widget({
155
160
 
156
161
  // initializing the inner structure
157
162
  this.content = this.first('.rui-resizable-content') ||
158
- $E('div', {'class': 'rui-resizable-content'}).insert(this._.childNodes).insertTo(this);
163
+ $E('div', {'class': 'rui-resizable-content'}).insert(this.children()).insertTo(this);
159
164
  this.handle = this.first('.rui-resizable-handle') ||
160
165
  $E('div', {'class': 'rui-resizable-handle'}).insertTo(this);
166
+
167
+ // resizing the content block so it fully fit the resizable element
168
+ this.content.setWidth(this.size().x -
169
+ parseInt(this.getStyle('borderLeftWidth'), 10) -
170
+ parseInt(this.getStyle('borderRightWidth'), 10)
171
+ );
172
+ if (this.options.direction !== 'left' && this.options.direction !== 'right') {
173
+ this.content.setHeight(this.size().y -
174
+ parseInt(this.getStyle('borderTopWidth'), 10) -
175
+ parseInt(this.getStyle('borderBottomWidth'), 10)
176
+ );
177
+ }
161
178
  },
162
179
 
163
180
  /**
@@ -341,7 +358,7 @@ $(document).on({
341
358
  if (handle) {
342
359
  var resizable = handle.parent();
343
360
 
344
- if (resizable instanceof Element) {
361
+ if (!(resizable instanceof Resizable)) {
345
362
  resizable = new Resizable(resizable);
346
363
  }
347
364
 
@@ -388,8 +405,7 @@ Element.include({
388
405
  * @return Element this
389
406
  */
390
407
  makeResizable: function(options) {
391
- new Resizable(this, options);
392
- return this;
408
+ return new Resizable(this, options);
393
409
  },
394
410
 
395
411
  /**
@@ -406,7 +422,18 @@ Element.include({
406
422
  });
407
423
 
408
424
 
409
- document.write("<style type=\"text/css\">.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom,.rui-resizable-content .rui-resizable-handle{margin:0;padding:0;overflow:none;border:none;background:none;width:auto;height:auto;min-width:none;max-width:none;min-height:none;max-height:none}.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom{position:relative;min-width:8em;min-height:8em;border:1px solid #DDD}.rui-resizable-content{overflow:auto;padding:.5em;position:relative}.rui-resizable-handle{position:absolute;background-image:url(/images/rightjs-ui/resizable.png);background-repeat:no-repeat;background-color:#DDD;cursor:move}.rui-resizable .rui-resizable-handle{right:0;bottom:0;background-position:-2px -2px;background-color:transparent;width:16px;height:16px}.rui-resizable-top .rui-resizable-handle,.rui-resizable-bottom .rui-resizable-handle{height:8px;width:100%;background-position:center -26px;cursor:row-resize}.rui-resizable-left .rui-resizable-handle,.rui-resizable-right .rui-resizable-handle{top:0px;width:8px;height:100%;background-position:-26px center;cursor:col-resize}.rui-resizable-top .rui-resizable-content{padding-top:1em}.rui-resizable-top .rui-resizable-handle{top:0}.rui-resizable-bottom .rui-resizable-content{padding-bottom:1em}.rui-resizable-bottom .rui-resizable-handle{bottom:0}.rui-resizable-left .rui-resizable-content{padding-left:1em}.rui-resizable-left .rui-resizable-handle{left:0}.rui-resizable-right .rui-resizable-content{padding-right:1em}.rui-resizable-right .rui-resizable-handle{right:0}</style>");
425
+ var embed_style = document.createElement('style'),
426
+ embed_rules = document.createTextNode(".rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom,.rui-resizable-content .rui-resizable-handle{margin:0;padding:0;overflow:none;border:none;background:none;width:auto;height:auto;min-width:none;max-width:none;min-height:none;max-height:none}.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom{position:relative;min-width:8em;min-height:8em;border:1px solid #DDD}.rui-resizable-content{overflow:auto;padding:.5em;position:relative}.rui-resizable-handle{position:absolute;background-image:url(/images/rightjs-ui/resizable.png);background-repeat:no-repeat;background-color:#DDD;cursor:move}.rui-resizable .rui-resizable-handle{right:0;bottom:0;background-position:-2px -2px;background-color:transparent;width:16px;height:16px}.rui-resizable-top .rui-resizable-handle,.rui-resizable-bottom .rui-resizable-handle{height:8px;width:100%;background-position:center -26px;cursor:row-resize}.rui-resizable-left .rui-resizable-handle,.rui-resizable-right .rui-resizable-handle{top:0px;width:8px;height:100%;background-position:-26px center;cursor:col-resize}.rui-resizable-top .rui-resizable-content{padding-top:1em}.rui-resizable-top .rui-resizable-handle{top:0}.rui-resizable-bottom .rui-resizable-content{padding-bottom:1em}.rui-resizable-bottom .rui-resizable-handle{bottom:0}.rui-resizable-left .rui-resizable-content{padding-left:1em}.rui-resizable-left .rui-resizable-handle{left:0}.rui-resizable-right .rui-resizable-content{padding-right:1em}.rui-resizable-right .rui-resizable-handle{right:0}");
427
+
428
+ embed_style.type = 'text/css';
429
+ document.getElementsByTagName('head')[0].appendChild(embed_style);
430
+
431
+ if(embed_style.styleSheet) {
432
+ embed_style.styleSheet.cssText = embed_rules.nodeValue;
433
+ } else {
434
+ embed_style.appendChild(embed_rules);
435
+ }
436
+
410
437
 
411
438
  return Resizable;
412
439
  })(document, RightJS);
@@ -1,15 +1,7 @@
1
1
  /**
2
- * Resizable unit for RightJS
2
+ * RightJS-UI Resizable v2.2.2
3
3
  * http://rightjs.org/ui/resizable
4
4
  *
5
- * Copyright (C) 2010 Nikolay Nemshilov
5
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
6
6
  */
7
- var Resizable=RightJS.Resizable=function(r,c){var k=c.$,l=c.$w,m=c.$E,t=c.Wrapper,s=c.Element,g=new (function(a,b){if(!b){b=a;a="DIV"}var f=new c.Wrapper(c.Element.Wrappers[a]||c.Element,{initialize:function(h,d){this.key=h;var e=[{"class":"rui-"+h}];this instanceof c.Input||this instanceof c.Form||e.unshift(a);this.$super.apply(this,e);if(c.isString(d))d=c.$(d);if(d instanceof c.Element){this._=d._;if("$listeners"in d)d.$listeners=d.$listeners;d={}}this.setOptions(d,this);return this},setOptions:function(h,
8
- d){d=d||this;c.Options.setOptions.call(this,c.Object.merge(h,eval("("+(d.get("data-"+this.key)||"{}")+")")));return this}});f=new c.Wrapper(f,b);c.Observer.createShortcuts(f.prototype,f.EVENTS||[]);return f})({extend:{version:"2.0.0",EVENTS:l("resize start release"),Options:{direction:null,minWidth:null,maxWidth:null,minHeight:null,maxHeight:null}},initialize:function(a,b){this.$super("resizable",this.old_inst=k(a)).setOptions(b);this.options.direction?this.addClass("rui-resizable-"+this.options.direction):
9
- this.addClass("rui-resizable");this.content=this.first(".rui-resizable-content")||m("div",{"class":"rui-resizable-content"}).insert(this._.childNodes).insertTo(this);this.handle=this.first(".rui-resizable-handle")||m("div",{"class":"rui-resizable-handle"}).insertTo(this)},destroy:function(){this.removeClass("rui-resizable").removeClass("rui-resizable-top").removeClass("rui-resizable-left").removeClass("rui-resizable-right").removeClass("rui-resizable-bottom").insert(this.content._.childNodes);this.content.remove();
10
- this.handle.remove();if(this.old_inst)t.Cache[$uid(this._)]=this.old_inst;return this},setOptions:function(a,b){a=a||{};l("top left right bottom").each(function(f){if(this.hasClass("rui-resizable-"+f))a.direction=f},this);return this.$super(a,b)},start:function(a){this.prevSizes=this.size();this.prevEvPos=a.position();this.contXDiff=this.size().x-this.content.size().x;this.contYDiff=this.size().y-this.content.size().y;l("minWidth maxWidth minHeight maxHeight").each(function(b){this[b]=this.findDim(b)},
11
- this);return this.fire("start",{original:a})},track:function(a){var b=a.position(),f=this.prevEvPos,h=this.handle.dimensions(),d=this.prevSizes,e=d.x,i=d.y,u=f.y-b.y,n=this.minWidth,o=this.maxWidth,p=this.minHeight,q=this.maxHeight,j=this.options.direction;e+=(j==="left"?1:-1)*(f.x-b.x);i+=(j==="top"?1:-1)*u;if(e<n)e=n;if(e>o)e=o;if(i<p)i=p;if(i>q)i=q;d.x!==e&&j!=="top"&&j!=="bottom"&&this.setWidth(e);d.y!==i&&j!=="left"&&j!=="right"&&this.setHeight(i);if(e==n||e==o)b.x=h.left+h.width/2;if(i==p||
12
- i==q)b.y=h.top+h.height/2;this.prevEvPos=b;this.prevSizes=this.size();this.fire("resize",{original:a})},setWidth:function(a){this.content.setWidth(a-this.contXDiff);return this.$super(a)},setHeight:function(a){this.content.setHeight(a-this.contYDiff);return this.$super(a)},release:function(a){return this.fire("release",{original:a})},findDim:function(a){var b=this.options[a]||this.getStyle(a);if(b&&/\d+/.test(b)&&parseFloat(b)>0){a=c(a).include("Width")?"width":"height";b=(this._dummy||(this._dummy=
13
- m("div",{style:"visibility:hidden;z-index:-1"}))).setStyle(a,b).insertTo(this,"before");a=b._["offset"+c(a).capitalize()];b.remove();return a}}});k(r).on({mousedown:function(a){var b=a.find(".rui-resizable-handle");if(b){b=b.parent();if(b instanceof s)b=new g(b);g.current=b.start(a.stop())}},mousemove:function(a){var b=g.current;b&&b.track(a)},mouseup:function(a){var b=g.current;if(b){b.release(a);g.current=null}}});k(window).onBlur(function(a){var b=g.current;if(b){b.release(a);g.current=null}});
14
- s.include({makeResizable:function(a){new g(this,a);return this},undoResizable:function(){this instanceof g&&this.destroy();return this}});r.write('<style type="text/css">.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom,.rui-resizable-content .rui-resizable-handle{margin:0;padding:0;overflow:none;border:none;background:none;width:auto;height:auto;min-width:none;max-width:none;min-height:none;max-height:none}.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom{position:relative;min-width:8em;min-height:8em;border:1px solid #DDD}.rui-resizable-content{overflow:auto;padding:.5em;position:relative}.rui-resizable-handle{position:absolute;background-image:url(/images/rightjs-ui/resizable.png);background-repeat:no-repeat;background-color:#DDD;cursor:move}.rui-resizable .rui-resizable-handle{right:0;bottom:0;background-position:-2px -2px;background-color:transparent;width:16px;height:16px}.rui-resizable-top .rui-resizable-handle,.rui-resizable-bottom .rui-resizable-handle{height:8px;width:100%;background-position:center -26px;cursor:row-resize}.rui-resizable-left .rui-resizable-handle,.rui-resizable-right .rui-resizable-handle{top:0px;width:8px;height:100%;background-position:-26px center;cursor:col-resize}.rui-resizable-top .rui-resizable-content{padding-top:1em}.rui-resizable-top .rui-resizable-handle{top:0}.rui-resizable-bottom .rui-resizable-content{padding-bottom:1em}.rui-resizable-bottom .rui-resizable-handle{bottom:0}.rui-resizable-left .rui-resizable-content{padding-left:1em}.rui-resizable-left .rui-resizable-handle{left:0}.rui-resizable-right .rui-resizable-content{padding-right:1em}.rui-resizable-right .rui-resizable-handle{right:0}</style>');
15
- return g}(document,RightJS);
7
+ var Resizable=RightJS.Resizable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var d=b,e=b.$,f=b.$w,g=b.$E,h=b.Class,i=b.Element,j=new c({extend:{version:"2.2.2",EVENTS:f("resize start release"),Options:{direction:null,minWidth:null,maxWidth:null,minHeight:null,maxHeight:null}},initialize:function(a,b){this.$super("resizable",this.old_inst=e(a)).setOptions(b),this.options.direction?this.addClass("rui-resizable-"+this.options.direction):this.addClass("rui-resizable"),this.content=this.first(".rui-resizable-content")||g("div",{"class":"rui-resizable-content"}).insert(this.children()).insertTo(this),this.handle=this.first(".rui-resizable-handle")||g("div",{"class":"rui-resizable-handle"}).insertTo(this),this.content.setWidth(this.size().x-parseInt(this.getStyle("borderLeftWidth"),10)-parseInt(this.getStyle("borderRightWidth"),10)),this.options.direction!=="left"&&this.options.direction!=="right"&&this.content.setHeight(this.size().y-parseInt(this.getStyle("borderTopWidth"),10)-parseInt(this.getStyle("borderBottomWidth"),10))},destroy:function(){this.removeClass("rui-resizable").removeClass("rui-resizable-top").removeClass("rui-resizable-left").removeClass("rui-resizable-right").removeClass("rui-resizable-bottom").insert(this.content._.childNodes),this.content.remove(),this.handle.remove(),this.old_inst&&(Wrapper.Cache[$uid(this._)]=this.old_inst);return this},setOptions:function(a,b){a=a||{},f("top left right bottom").each(function(b){this.hasClass("rui-resizable-"+b)&&(a.direction=b)},this);return this.$super(a,b)},start:function(a){this.prevSizes=this.size(),this.prevEvPos=a.position(),this.contXDiff=this.size().x-this.content.size().x,this.contYDiff=this.size().y-this.content.size().y,f("minWidth maxWidth minHeight maxHeight").each(function(a){this[a]=this.findDim(a)},this);return this.fire("start",{original:a})},track:function(a){var b=a.position(),c=this.prevEvPos,d=this.handle.dimensions(),e=this.prevSizes,f=e.x,g=e.y,h=c.x-b.x,i=c.y-b.y,j=this.minWidth,k=this.maxWidth,l=this.minHeight,m=this.maxHeight,n=this.options,o=n.direction;f+=(o==="left"?1:-1)*h,g+=(o==="top"?1:-1)*i,f<j&&(f=j),f>k&&(f=k),g<l&&(g=l),g>m&&(g=m),e.x!==f&&o!=="top"&&o!=="bottom"&&this.setWidth(f),e.y!==g&&o!=="left"&&o!=="right"&&this.setHeight(g);if(f==j||f==k)b.x=d.left+d.width/2;if(g==l||g==m)b.y=d.top+d.height/2;this.prevEvPos=b,this.prevSizes=this.size(),this.fire("resize",{original:a})},setWidth:function(a){this.content.setWidth(a-this.contXDiff);return this.$super(a)},setHeight:function(a){this.content.setHeight(a-this.contYDiff);return this.$super(a)},release:function(a){return this.fire("release",{original:a})},findDim:function(a){var b=this.options[a]||this.getStyle(a);if(b&&/\d+/.test(b)&&parseFloat(b)>0){var c=d(a).include("Width")?"width":"height",e=(this._dummy||(this._dummy=g("div",{style:"visibility:hidden;z-index:-1"}))).setStyle(c,b).insertTo(this,"before"),f=e._["offset"+d(c).capitalize()];e.remove();return f}}});e(a).on({mousedown:function(a){var b=a.find(".rui-resizable-handle");if(b){var c=b.parent();c instanceof j||(c=new j(c)),j.current=c.start(a.stop())}},mousemove:function(a){var b=j.current;b&&b.track(a)},mouseup:function(a){var b=j.current;b&&(b.release(a),j.current=null)}}),e(window).onBlur(function(a){var b=j.current;b&&(b.release(a),j.current=null)}),i.include({makeResizable:function(a){return new j(this,a)},undoResizable:function(){this instanceof j&&this.destroy();return this}});var k=a.createElement("style"),l=a.createTextNode(".rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom,.rui-resizable-content .rui-resizable-handle{margin:0;padding:0;overflow:none;border:none;background:none;width:auto;height:auto;min-width:none;max-width:none;min-height:none;max-height:none}.rui-resizable,.rui-resizable-top,.rui-resizable-left,.rui-resizable-right,.rui-resizable-bottom{position:relative;min-width:8em;min-height:8em;border:1px solid #DDD}.rui-resizable-content{overflow:auto;padding:.5em;position:relative}.rui-resizable-handle{position:absolute;background-image:url(/images/rightjs-ui/resizable.png);background-repeat:no-repeat;background-color:#DDD;cursor:move}.rui-resizable .rui-resizable-handle{right:0;bottom:0;background-position:-2px -2px;background-color:transparent;width:16px;height:16px}.rui-resizable-top .rui-resizable-handle,.rui-resizable-bottom .rui-resizable-handle{height:8px;width:100%;background-position:center -26px;cursor:row-resize}.rui-resizable-left .rui-resizable-handle,.rui-resizable-right .rui-resizable-handle{top:0px;width:8px;height:100%;background-position:-26px center;cursor:col-resize}.rui-resizable-top .rui-resizable-content{padding-top:1em}.rui-resizable-top .rui-resizable-handle{top:0}.rui-resizable-bottom .rui-resizable-content{padding-bottom:1em}.rui-resizable-bottom .rui-resizable-handle{bottom:0}.rui-resizable-left .rui-resizable-content{padding-left:1em}.rui-resizable-left .rui-resizable-handle{left:0}.rui-resizable-right .rui-resizable-content{padding-right:1em}.rui-resizable-right .rui-resizable-handle{right:0}");k.type="text/css",a.getElementsByTagName("head")[0].appendChild(k),k.styleSheet?k.styleSheet.cssText=l.nodeValue:k.appendChild(l);return j}(document,RightJS)
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Selectable unit for RightJS
2
+ * RightJS-UI Selectable v2.2.2
3
3
  * http://rightjs.org/ui/selectable
4
4
  *
5
- * Copyright (C) 2009-2010 Nikolay Nemshilov
5
+ * Copyright (C) 2009-2011 Nikolay Nemshilov
6
6
  */
7
7
  var Selectable = RightJS.Selectable = (function(document, RightJS) {
8
8
  /**
@@ -10,35 +10,9 @@ var Selectable = RightJS.Selectable = (function(document, RightJS) {
10
10
  * it creates an abstract proxy with the common functionality
11
11
  * which then we reuse and override in the actual widgets
12
12
  *
13
- * Copyright (C) 2010 Nikolay Nemshilov
13
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
14
14
  */
15
15
 
16
- /**
17
- * The filenames to include
18
- *
19
- * Copyright (C) 2010 Nikolay Nemshilov
20
- */
21
- var R = RightJS,
22
- $ = RightJS.$,
23
- $$ = RightJS.$$,
24
- $w = RightJS.$w,
25
- $E = RightJS.$E,
26
- $A = RightJS.$A,
27
- isHash = RightJS.isHash,
28
- isArray = RightJS.isArray,
29
- isString = RightJS.isString,
30
- isNumber = RightJS.isNumber,
31
- defined = RightJS.defined,
32
- Input = RightJS.Input,
33
- Element = RightJS.Element;
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
16
  /**
43
17
  * The widget units constructor
44
18
  *
@@ -57,7 +31,7 @@ function Widget(tag_name, methods) {
57
31
  *
58
32
  * Copyright (C) 2010 Nikolay Nemshilov
59
33
  */
60
- 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, {
61
35
  /**
62
36
  * The common constructor
63
37
  *
@@ -89,7 +63,8 @@ function Widget(tag_name, methods) {
89
63
  options = {};
90
64
  }
91
65
  this.setOptions(options, this);
92
- return this;
66
+
67
+ return (RightJS.Wrapper.Cache[RightJS.$uid(this._)] = this);
93
68
  },
94
69
 
95
70
  // protected
@@ -102,12 +77,16 @@ function Widget(tag_name, methods) {
102
77
  * @return void
103
78
  */
104
79
  setOptions: function(options, element) {
105
- element = element || this;
106
- RightJS.Options.setOptions.call(this,
107
- RightJS.Object.merge(options, eval("("+(
80
+ if (element) {
81
+ options = RightJS.Object.merge(options, new Function("return "+(
108
82
  element.get('data-'+ this.key) || '{}'
109
- )+")"))
110
- );
83
+ ))());
84
+ }
85
+
86
+ if (options) {
87
+ RightJS.Options.setOptions.call(this, RightJS.Object.merge(this.options, options));
88
+ }
89
+
111
90
  return this;
112
91
  }
113
92
  });
@@ -116,7 +95,7 @@ function Widget(tag_name, methods) {
116
95
  * Creating the actual widget class
117
96
  *
118
97
  */
119
- var Klass = new RightJS.Wrapper(AbstractWidget, methods);
98
+ var Klass = new RightJS.Class(AbstractWidget, methods);
120
99
 
121
100
  // creating the widget related shortcuts
122
101
  RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
@@ -170,16 +149,43 @@ var Updater = {
170
149
  };
171
150
 
172
151
 
152
+ /**
153
+ * The filenames to include
154
+ *
155
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
156
+ */
157
+ var R = RightJS,
158
+ $ = RightJS.$,
159
+ $$ = RightJS.$$,
160
+ $w = RightJS.$w,
161
+ $E = RightJS.$E,
162
+ $A = RightJS.$A,
163
+ Object = RightJS.Object,
164
+ isHash = RightJS.isHash,
165
+ isArray = RightJS.isArray,
166
+ isString = RightJS.isString,
167
+ isNumber = RightJS.isNumber,
168
+ defined = RightJS.defined,
169
+ Input = RightJS.Input,
170
+ Element = RightJS.Element;
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
173
179
  /**
174
180
  * Selectable unit main script
175
181
  *
176
- * Copyright (C) 2009-2010 Nikolay Nemshilov
182
+ * Copyright (C) 2009-2011 Nikolay Nemshilov
177
183
  */
178
184
  var Selectable = new Widget('UL', {
179
185
  include: Updater,
180
186
 
181
187
  extend: {
182
- version: '2.0.1',
188
+ version: '2.2.2',
183
189
 
184
190
  EVENTS: $w('change select unselect disable enable hover leave show hide'),
185
191
 
@@ -224,13 +230,14 @@ var Selectable = new Widget('UL', {
224
230
  // figuring out the arguments
225
231
  if (!isHash(options) || options instanceof Element) {
226
232
  element = $(element || options);
227
- options = {};
233
+ options = null;
228
234
  }
229
235
 
230
236
  // converting the selectboxes
231
- if (element && element instanceof Input) {
232
- options = this.harvestOptions(selectbox = element);
233
- element = options;
237
+ if (element && (element = $(element)) instanceof Input) {
238
+ this.selectbox = selectbox = element;
239
+ options = Object.merge(this.harvestOptions(element), options);
240
+ element = null;
234
241
  }
235
242
 
236
243
  // main initialization
@@ -420,13 +427,24 @@ var Selectable = new Widget('UL', {
420
427
  * @return Selectable this
421
428
  */
422
429
  insertTo: function(target, where) {
423
- Element.prototype.insertTo.call(
430
+ this.$super.call(
424
431
  (this.isSingle ? this.container : this), target, where
425
432
  );
426
433
 
427
434
  return this;
428
435
  },
429
436
 
437
+ /**
438
+ * Overloading the method so that single selectables were removed
439
+ * properly
440
+ *
441
+ * @return Selectable this
442
+ */
443
+ remove: function() {
444
+ this.$super.call(this.isSingle ? this.container : this);
445
+ return this;
446
+ },
447
+
430
448
  // protected
431
449
 
432
450
  // wrapping the events trigger to feed it with some more options
@@ -441,8 +459,11 @@ var Selectable = new Widget('UL', {
441
459
 
442
460
  // finds out the value for the item
443
461
  itemValue: function(item) {
444
- var value = item.get('id') || item.get('val');
445
- return value ? this.options.parseIds ? value.match(/\d+/) : value : this.items().indexOf(item);
462
+ var value = R([item._value, item.get('id') || item.get('val')]).compact()[0];
463
+
464
+ return value !== undefined ? (
465
+ this.options.parseIds ? value.match(/\d+/) : value
466
+ ) : this.items().indexOf(item);
446
467
  },
447
468
 
448
469
  // returns the list of items
@@ -573,7 +594,9 @@ var Selectable = new Widget('UL', {
573
594
  }
574
595
 
575
596
  items.each(function(option) {
576
- this.insert($E('li', {val: option[1], html: option[0]}));
597
+ var item = $E('li', {val: option[1], html: option[0]});
598
+ item._value = option[1];
599
+ this.insert(item);
577
600
  }, this);
578
601
 
579
602
  return this;
@@ -652,15 +675,17 @@ var Selectable = new Widget('UL', {
652
675
 
653
676
  // harvests options from a selectbox element
654
677
  harvestOptions: function(selectbox) {
655
- var options = {};
678
+ var options = new Function('return '+ selectbox.get('data-selectable'))() || {};
656
679
 
657
- options.multiple = selectbox.has('multiple');
680
+ options.multiple = selectbox._.type == 'select-multiple';
658
681
  options.options = R([]);
659
682
  options.selected = R([]);
660
683
  options.disabled = R([]);
661
684
 
662
685
  $A(selectbox._.getElementsByTagName('OPTION')).each(function(option, index) {
663
- options.options.push([option.innerHTML, $(option).get('value') || option.innerHTML]);
686
+ var html = option.innerHTML, value = option.getAttribute('value');
687
+
688
+ options.options.push([html, value === null ? html : value]);
664
689
 
665
690
  if (option.selected && !selectbox._.disabled) { options.selected.push(index); }
666
691
  if (option.disabled || selectbox._.disabled) { options.disabled.push(index); }
@@ -683,7 +708,18 @@ $(document).onReady(function() {
683
708
  });
684
709
 
685
710
 
686
- document.write("<style type=\"text/css\"> *.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em} *.rui-selectable, *.rui-selectable li, *.rui-selectable dt, *.rui-selectable dd, *.rui-selectable ul,div.rui-selectable-container ul.rui-selectable-display,div.rui-selectable-container ul.rui-selectable-display li{margin:0;padding:0;border:none;background:none;list-style:none} *.rui-selectable{border:1px solid #CCC;border-bottom:none;display:inline-block; *display:inline; *zoom:1;min-width:10em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC} *.rui-selectable li:hover{background:#EEE} *.rui-selectable li.rui-selectable-selected{font-weight:bold;background:#DDD} *.rui-selectable li.rui-selectable-disabled, *.rui-selectable li.rui-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.rui-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.rui-selectable dd li{padding-left:1.5em} *.rui-selectable-single{background:#FFF;display:none}div.rui-selectable-container{border:1px solid #CCC;-moz-border-radius:.2em;-webkit-border-radius:.2em;display:inline-block; *display:inline; *zoom:1; *width:10em;vertical-align:middle;min-width:10em;cursor:pointer;height:1.6em;position:relative}div.rui-selectable-container div.rui-selectable-handle{font-family:Arial;float:right;width:0.8em;background:#DDD;text-align:center;height:100%;line-height:0.8em;font-size:200%;color:#888;border-left:1px solid #CCC}div.rui-selectable-container:hover div.rui-selectable-handle{color:#666}div.rui-selectable-container ul.rui-selectable-display{display:block;width:auto;margin-right:2em;overflow:hidden}div.rui-selectable-container ul.rui-selectable-display li{line-height:1.6em;padding:0 .5em}select.rui-selectable{visibility:hidden}</style>");
711
+ var embed_style = document.createElement('style'),
712
+ embed_rules = document.createTextNode("*.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em} *.rui-selectable, *.rui-selectable li, *.rui-selectable dt, *.rui-selectable dd, *.rui-selectable ul,div.rui-selectable-container ul.rui-selectable-display,div.rui-selectable-container ul.rui-selectable-display li{margin:0;padding:0;border:none;background:none;list-style:none} *.rui-selectable{border:1px solid #CCC;border-bottom:none;display:inline-block; *display:inline; *zoom:1;min-width:10em;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC} *.rui-selectable li:hover{background:#EEE} *.rui-selectable li.rui-selectable-selected{font-weight:bold;background:#DDD} *.rui-selectable li.rui-selectable-disabled, *.rui-selectable li.rui-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.rui-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.rui-selectable dd li{padding-left:1.5em} *.rui-selectable-single{background:#FFF;display:none} *.rui-selectable-single li{overflow:hidden}div.rui-selectable-container{border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;display:inline-block; *display:inline; *zoom:1; *width:10em;vertical-align:middle;min-width:10em;cursor:pointer;height:1.6em;position:relative}div.rui-selectable-container div.rui-selectable-handle{font-family:Arial;position:absolute;right:0;width:0.8em;background:#DDD;text-align:center;height:100%;line-height:0.8em;font-size:200%;color:#888;border-left:1px solid #CCC}div.rui-selectable-container:hover div.rui-selectable-handle{color:#666}div.rui-selectable-container ul.rui-selectable-display{display:block;width:auto;overflow:hidden;margin-right:2em}div.rui-selectable-container ul.rui-selectable-display li{line-height:1.6em;padding:0 .5em;overflow:hidden;width:100%;white-space:nowrap}select.rui-selectable{visibility:hidden}");
713
+
714
+ embed_style.type = 'text/css';
715
+ document.getElementsByTagName('head')[0].appendChild(embed_style);
716
+
717
+ if(embed_style.styleSheet) {
718
+ embed_style.styleSheet.cssText = embed_rules.nodeValue;
719
+ } else {
720
+ embed_style.appendChild(embed_rules);
721
+ }
722
+
687
723
 
688
724
  return Selectable;
689
725
  })(document, RightJS);
@@ -1,22 +1,7 @@
1
1
  /**
2
- * Selectable unit for RightJS
2
+ * RightJS-UI Selectable v2.2.2
3
3
  * http://rightjs.org/ui/selectable
4
4
  *
5
- * Copyright (C) 2009-2010 Nikolay Nemshilov
5
+ * Copyright (C) 2009-2011 Nikolay Nemshilov
6
6
  */
7
- var Selectable=RightJS.Selectable=function(h,e){var g=e.$,p=e.$$,q=e.$w,i=e.$E,o=e.$A,r=e.isHash,l=e.isArray,m=e.isString,s=e.isNumber,t=e.defined,u=e.Input,n=e.Element,k=new (function(a,b){if(!b){b=a;a="DIV"}var d=new e.Wrapper(e.Element.Wrappers[a]||e.Element,{initialize:function(c,f){this.key=c;var j=[{"class":"rui-"+c}];this instanceof e.Input||this instanceof e.Form||j.unshift(a);this.$super.apply(this,j);if(e.isString(f))f=e.$(f);if(f instanceof e.Element){this._=f._;if("$listeners"in f)f.$listeners=
8
- f.$listeners;f={}}this.setOptions(f,this);return this},setOptions:function(c,f){f=f||this;e.Options.setOptions.call(this,e.Object.merge(c,eval("("+(f.get("data-"+this.key)||"{}")+")")));return this}});d=new e.Wrapper(d,b);e.Observer.createShortcuts(d.prototype,d.EVENTS||[]);return d})("UL",{include:{assignTo:function(a){var b=e(function(c,f){if(c=g(c))c[c.setValue?"setValue":"update"](f.target.getValue())}).curry(a),d=e(function(c,f){(c=g(c))&&c.onChange&&c.onChange(e(function(){this.setValue(c.value())}).bind(f))}).curry(a);
9
- if(g(a)){b({target:this});d(this)}else g(h).onReady(e(function(){b({target:this});d(this)}.bind(this)));return this.onChange(b)}},extend:{version:"2.0.1",EVENTS:q("change select unselect disable enable hover leave show hide"),Options:{options:null,selected:null,disabled:null,multiple:true,fxName:"slide",fxDuration:"short",update:null,parseIds:false,limit:null,hCont:"&bull;"},rescan:function(a){g(a||h).find(".rui-selectable").each(function(b){b instanceof k||new k(b)})}},initialize:function(){var a=
10
- o(arguments).compact(),b=a.pop();a=a.pop();var d;if(!r(b)||b instanceof n){a=g(a||b);b={}}if(a&&a instanceof u)a=b=this.harvestOptions(d=a);this.$super("selectable",a).setOptions(b).on({mousedown:this._mousedown,mouseover:this._mouseover,mouseout:this._mouseout,mouseup:this._mouseup,click:this._click,select:this._change,unselect:this._change});this.empty()&&this.build();b=this.options;if(!b.multiple||this.hasClass("rui-selectable-single")){this.isSingle=true;this.addClass("rui-selectable-single");
11
- this.buildSingle();b.selected===null&&this.select(this.items()[0])}b.disabled&&this.disable(b.disabled);b.selected&&this.select(b.selected);b.update&&this.assignTo(b.update);if(d){this.assignTo(d).insertTo(d,"before");d.wrap(i("div",{style:"position:absolute;z-index:-1;visibility:hidden;width:0;height:0;overflow:hidden"}))}},setValue:function(a){if(m(a))a=a.split(",").map("trim").filter(function(b){return!b.blank()});this.items().each("removeClass","rui-selectable-selected");return this.select(a)},
12
- getValue:function(){if(this.isSingle){var a=this.items().first("hasClass","rui-selectable-selected");return a?this.itemValue(a):null}else return this.items().filter("hasClass","rui-selectable-selected").map(function(b){return this.itemValue(b)},this)},disable:function(a){this.mapOrAll(a).each(function(b){this.fire("disable",b.addClass("rui-selectable-disabled"))},this);return this},enable:function(a){this.mapOrAll(a).each(function(b){this.fire("enable",b.removeClass("rui-selectable-disabled"))},this);
13
- return this},disabled:function(a){return this.mapOrAll(a).every("hasClass","rui-selectable-disabled")},select:function(a){a=this.mapEnabled(a);if(this.isSingle&&a){this.items().each("removeClass","rui-selectable-selected");a=e([a[0]])}if(!this.isSingle&&this.options.limit){for(var b=this.items().filter("hasClass","rui-selectable-selected"),d=[];a.length&&b.length+d.length<this.options.limit;){var c=a.shift();b.include(c)||d.push(c)}a=d}a.compact().each(function(f){this.fire("select",f.addClass("rui-selectable-selected"))},
14
- this);return this},unselect:function(a){this.getValue();this.mapEnabled(a).each(function(b){this.fire("unselect",b.removeClass("rui-selectable-selected"))},this);return this},selected:function(a){return this.mapEnabled(a).every("hasClass","rui-selectable-selected")},insertTo:function(a,b){n.prototype.insertTo.call(this.isSingle?this.container:this,a,b);return this},fire:function(a,b){b&&b instanceof n?this.$super(a,{item:b,index:this.items().indexOf(b)}):this.$super.apply(this,arguments);return this},
15
- itemValue:function(a){var b=a.get("id")||a.get("val");return b?this.options.parseIds?b.match(/\d+/):b:this.items().indexOf(a)},items:function(){return this.find("li")},mapOrAll:function(a){var b=this.items();if(t(a)){l(a)||(a=[a]);b=e(a).map(function(d){var c=m(d)&&/^\d+$/.test(d)?parseInt(d,10):d,f=d;if(s(c))f=b[c];else if(m(d))f=b.first(function(j){return j.id==d||j.val==d});return f},this).compact()}return b},mapEnabled:function(a){return this.mapOrAll(a).filter(function(b){return!b.hasClass("rui-selectable-disabled")},
16
- this)},_mousedown:function(a){a.stop();var b=a.target,d=this.items();if(d.include(b)&&!this.disabled(b)){if(this.isSingle)this.select(b);else if(this.selected(b)){this.unselect(b);this._massRemove=true}else{this.select(b);this._massSelect=true}if((a.shiftKey||a.metaKey)&&this._prevItem){var c=d.indexOf(this._prevItem);a=d.indexOf(b);if(c!=a){if(c>a)a=c=a;for(c=c;c<a;c++)this[this._prevItem.hasClass("rui-selectable-selected")?"select":"unselect"](d[c])}}this._prevItem=b}},_mouseup:function(a){a.stop();
17
- this._massRemove=this._massSelect=false},_mouseover:function(a){a=a.target;this.fire("hover",a);if(!this.isSingle)if(this._massSelect)this.select(a);else this._massRemove&&this.unselect(a)},_mouseout:function(a){this.fire("leave",a.target)},_click:function(a){a.stop()},_change:function(){if(""+this.value!=""+this.getValue()){this.value=this.getValue();this.fire("change")}},build:function(){var a=this.options.options,b=e([]);if(l(a))a.each(function(c){b.push(l(c)?c:[c,c])});else for(var d in a)b.push([a[d],
18
- d]);b.each(function(c){this.insert(i("li",{val:c[1],html:c[0]}))},this);return this},buildSingle:function(){this.container=i("div",{"class":"rui-selectable-container"}).insert([this.trigger=i("div",{html:this.options.hCont,"class":"rui-selectable-handle"}),this.display=i("ul",{"class":"rui-selectable-display"})]).onClick(e(this.toggleList).bind(this));this.parent()&&this.container.insertTo(this,"instead");this.container.insert(this);g(h).onClick(e(this.hideList).bind(this));return this.onSelect("showItem").onSelect("hideList").addClass("rui-dd-menu")},
19
- toggleList:function(a){a.stop();return this.visible()?this.hideList():this.showList(a)},showList:function(a){a.stop();p(".rui-selectable-single").without(this).each("hide");a=this.container.dimensions();var b=this.container.position();this.setStyle({top:a.top+a.height-b.y-1+"px",left:a.left-b.x+"px",width:a.width+"px"}).show(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"show",this)});this.options.fxName||this.fire("show",this)},hideList:function(){if(this.isSingle&&
20
- this.visible()){this.hide(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"hide")});this.options.fxName||this.fire("hide")}},showItem:function(){var a=this.items().first("hasClass","rui-selectable-selected")||this.items().first();this.display.html("<li>"+(a?a.html():"&nbsp;")+"</li>")},harvestOptions:function(a){var b={};b.multiple=a.has("multiple");b.options=e([]);b.selected=e([]);b.disabled=e([]);o(a._.getElementsByTagName("OPTION")).each(function(d,c){b.options.push([d.innerHTML,
21
- g(d).get("value")||d.innerHTML]);d.selected&&!a._.disabled&&b.selected.push(c);if(d.disabled||a._.disabled)b.disabled.push(c)});if(b.selected.empty())b.selected=0;return b}});g(h).onReady(function(){k.rescan()});h.write('<style type="text/css"> *.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em} *.rui-selectable, *.rui-selectable li, *.rui-selectable dt, *.rui-selectable dd, *.rui-selectable ul,div.rui-selectable-container ul.rui-selectable-display,div.rui-selectable-container ul.rui-selectable-display li{margin:0;padding:0;border:none;background:none;list-style:none} *.rui-selectable{border:1px solid #CCC;border-bottom:none;display:inline-block; *display:inline; *zoom:1;min-width:10em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC} *.rui-selectable li:hover{background:#EEE} *.rui-selectable li.rui-selectable-selected{font-weight:bold;background:#DDD} *.rui-selectable li.rui-selectable-disabled, *.rui-selectable li.rui-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.rui-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.rui-selectable dd li{padding-left:1.5em} *.rui-selectable-single{background:#FFF;display:none}div.rui-selectable-container{border:1px solid #CCC;-moz-border-radius:.2em;-webkit-border-radius:.2em;display:inline-block; *display:inline; *zoom:1; *width:10em;vertical-align:middle;min-width:10em;cursor:pointer;height:1.6em;position:relative}div.rui-selectable-container div.rui-selectable-handle{font-family:Arial;float:right;width:0.8em;background:#DDD;text-align:center;height:100%;line-height:0.8em;font-size:200%;color:#888;border-left:1px solid #CCC}div.rui-selectable-container:hover div.rui-selectable-handle{color:#666}div.rui-selectable-container ul.rui-selectable-display{display:block;width:auto;margin-right:2em;overflow:hidden}div.rui-selectable-container ul.rui-selectable-display li{line-height:1.6em;padding:0 .5em}select.rui-selectable{visibility:hidden}</style>');
22
- return k}(document,RightJS);
7
+ var Selectable=RightJS.Selectable=function(a,b){function c(a,c){c||(c=a,a="DIV");var d=new b.Class(b.Element.Wrappers[a]||b.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof b.Input||this instanceof b.Form||e.unshift(a),this.$super.apply(this,e),b.isString(d)&&(d=b.$(d)),d instanceof b.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return b.Wrapper.Cache[b.$uid(this._)]=this},setOptions:function(a,c){c&&(a=b.Object.merge(a,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),a&&b.Options.setOptions.call(this,b.Object.merge(this.options,a));return this}}),e=new b.Class(d,c);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var d={assignTo:function(b){var c=e(function(a,b){(a=f(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=e(function(a,b){a=f(a),a&&a.onChange&&a.onChange(e(function(){this.setValue(a.value())}).bind(b))}).curry(b);f(b)?(c({target:this}),d(this)):f(a).onReady(e(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},e=b,f=b.$,g=b.$$,h=b.$w,i=b.$E,j=b.$A,k=b.Object,l=b.isHash,m=b.isArray,n=b.isString,o=b.isNumber,p=b.defined,q=b.Input,r=b.Element,s=new c("UL",{include:d,extend:{version:"2.2.2",EVENTS:h("change select unselect disable enable hover leave show hide"),Options:{options:null,selected:null,disabled:null,multiple:!0,fxName:"slide",fxDuration:"short",update:null,parseIds:!1,limit:null,hCont:"&bull;"},rescan:function(b){f(b||a).find(".rui-selectable").each(function(a){a instanceof s||new s(a)})}},initialize:function(){var a=j(arguments).compact(),b=a.pop(),c=a.pop(),d;if(!l(b)||b instanceof r)c=f(c||b),b=null;c&&(c=f(c))instanceof q&&(this.selectbox=d=c,b=k.merge(this.harvestOptions(c),b),c=null),this.$super("selectable",c).setOptions(b).on({mousedown:this._mousedown,mouseover:this._mouseover,mouseout:this._mouseout,mouseup:this._mouseup,click:this._click,select:this._change,unselect:this._change}),this.empty()&&this.build(),b=this.options;if(!b.multiple||this.hasClass("rui-selectable-single"))this.isSingle=!0,this.addClass("rui-selectable-single"),this.buildSingle(),b.selected===null&&this.select(this.items()[0]);b.disabled&&this.disable(b.disabled),b.selected&&this.select(b.selected),b.update&&this.assignTo(b.update),d&&(this.assignTo(d).insertTo(d,"before"),d.wrap(i("div",{style:"position:absolute;z-index:-1;visibility:hidden;width:0;height:0;overflow:hidden"})))},setValue:function(a){n(a)&&(a=a.split(",").map("trim").filter(function(a){return!a.blank()})),this.items().each("removeClass","rui-selectable-selected");return this.select(a)},getValue:function(){if(this.isSingle){var a=this.items().first("hasClass","rui-selectable-selected");return a?this.itemValue(a):null}return this.items().filter("hasClass","rui-selectable-selected").map(function(a){return this.itemValue(a)},this)},disable:function(a){this.mapOrAll(a).each(function(a){this.fire("disable",a.addClass("rui-selectable-disabled"))},this);return this},enable:function(a){this.mapOrAll(a).each(function(a){this.fire("enable",a.removeClass("rui-selectable-disabled"))},this);return this},disabled:function(a){return this.mapOrAll(a).every("hasClass","rui-selectable-disabled")},select:function(a){var b=this.mapEnabled(a),c="rui-selectable-selected";this.isSingle&&b&&(this.items().each("removeClass",c),b=e([b[0]]));if(!this.isSingle&&this.options.limit){var d=this.items().filter("hasClass",c),f=[];while(b.length&&d.length+f.length<this.options.limit){var g=b.shift();d.include(g)||f.push(g)}b=f}b.compact().each(function(a){this.fire("select",a.addClass(c))},this);return this},unselect:function(a){var b=this.getValue();this.mapEnabled(a).each(function(a){this.fire("unselect",a.removeClass("rui-selectable-selected"))},this);return this},selected:function(a){return this.mapEnabled(a).every("hasClass","rui-selectable-selected")},insertTo:function(a,b){this.$super.call(this.isSingle?this.container:this,a,b);return this},remove:function(){this.$super.call(this.isSingle?this.container:this);return this},fire:function(a,b){b&&b instanceof r?this.$super(a,{item:b,index:this.items().indexOf(b)}):this.$super.apply(this,arguments);return this},itemValue:function(a){var b=e([a._value,a.get("id")||a.get("val")]).compact()[0];return b!==undefined?this.options.parseIds?b.match(/\d+/):b:this.items().indexOf(a)},items:function(){return this.find("li")},mapOrAll:function(a){var b=this.items();p(a)&&(m(a)||(a=[a]),b=e(a).map(function(a){var c=n(a)&&/^\d+$/.test(a)?parseInt(a,10):a,d=a;o(c)?d=b[c]:n(a)&&(d=b.first(function(b){return b.id==a||b.val==a}));return d},this).compact());return b},mapEnabled:function(a){return this.mapOrAll(a).filter(function(a){return!a.hasClass("rui-selectable-disabled")},this)},_mousedown:function(a){a.stop();var b=a.target,c=this.items();if(c.include(b)&&!this.disabled(b)){this.isSingle?this.select(b):this.selected(b)?(this.unselect(b),this._massRemove=!0):(this.select(b),this._massSelect=!0);if((a.shiftKey||a.metaKey)&&this._prevItem){var d=c.indexOf(this._prevItem),e=c.indexOf(b);if(d!=e){if(d>e){var f=d;d=e,e=d}for(var g=d;g<e;g++)this[this._prevItem.hasClass("rui-selectable-selected")?"select":"unselect"](c[g])}}this._prevItem=b}},_mouseup:function(a){a.stop(),this._massRemove=this._massSelect=!1},_mouseover:function(a){var b=a.target;this.fire("hover",b),this.isSingle||(this._massSelect?this.select(b):this._massRemove&&this.unselect(b))},_mouseout:function(a){this.fire("leave",a.target)},_click:function(a){a.stop()},_change:function(){""+this.value!=""+this.getValue()&&(this.value=this.getValue(),this.fire("change"))},build:function(){var a=this.options.options,b=e([]);if(m(a))a.each(function(a){b.push(m(a)?a:[a,a])});else for(var c in a)b.push([a[c],c]);b.each(function(a){var b=i("li",{val:a[1],html:a[0]});b._value=a[1],this.insert(b)},this);return this},buildSingle:function(){this.container=i("div",{"class":"rui-selectable-container"}).insert([this.trigger=i("div",{html:this.options.hCont,"class":"rui-selectable-handle"}),this.display=i("ul",{"class":"rui-selectable-display"})]).onClick(e(this.toggleList).bind(this)),this.parent()&&this.container.insertTo(this,"instead"),this.container.insert(this),f(a).onClick(e(this.hideList).bind(this));return this.onSelect("showItem").onSelect("hideList").addClass("rui-dd-menu")},toggleList:function(a){a.stop();return this.visible()?this.hideList():this.showList(a)},showList:function(a){a.stop(),g(".rui-selectable-single").without(this).each("hide");var b=this.container.dimensions(),c=this.container.position();this.setStyle({top:b.top+b.height-c.y-1+"px",left:b.left-c.x+"px",width:b.width+"px"}).show(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"show",this)}),this.options.fxName||this.fire("show",this)},hideList:function(){this.isSingle&&this.visible()&&(this.hide(this.options.fxName,{duration:this.options.fxDuration,onFinish:this.fire.bind(this,"hide")}),this.options.fxName||this.fire("hide"))},showItem:function(){var a=this.items().first("hasClass","rui-selectable-selected")||this.items().first();this.display.html("<li>"+(a?a.html():"&nbsp;")+"</li>")},harvestOptions:function(a){var b=(new Function("return "+a.get("data-selectable")))()||{};b.multiple=a._.type=="select-multiple",b.options=e([]),b.selected=e([]),b.disabled=e([]),j(a._.getElementsByTagName("OPTION")).each(function(c,d){var e=c.innerHTML,f=c.getAttribute("value");b.options.push([e,f===null?e:f]),c.selected&&!a._.disabled&&b.selected.push(d),(c.disabled||a._.disabled)&&b.disabled.push(d)}),b.selected.empty()&&(b.selected=0);return b}});f(a).onReady(function(){s.rescan()});var t=a.createElement("style"),u=a.createTextNode("*.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em} *.rui-selectable, *.rui-selectable li, *.rui-selectable dt, *.rui-selectable dd, *.rui-selectable ul,div.rui-selectable-container ul.rui-selectable-display,div.rui-selectable-container ul.rui-selectable-display li{margin:0;padding:0;border:none;background:none;list-style:none} *.rui-selectable{border:1px solid #CCC;border-bottom:none;display:inline-block; *display:inline; *zoom:1;min-width:10em;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC} *.rui-selectable li:hover{background:#EEE} *.rui-selectable li.rui-selectable-selected{font-weight:bold;background:#DDD} *.rui-selectable li.rui-selectable-disabled, *.rui-selectable li.rui-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.rui-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.rui-selectable dd li{padding-left:1.5em} *.rui-selectable-single{background:#FFF;display:none} *.rui-selectable-single li{overflow:hidden}div.rui-selectable-container{border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;display:inline-block; *display:inline; *zoom:1; *width:10em;vertical-align:middle;min-width:10em;cursor:pointer;height:1.6em;position:relative}div.rui-selectable-container div.rui-selectable-handle{font-family:Arial;position:absolute;right:0;width:0.8em;background:#DDD;text-align:center;height:100%;line-height:0.8em;font-size:200%;color:#888;border-left:1px solid #CCC}div.rui-selectable-container:hover div.rui-selectable-handle{color:#666}div.rui-selectable-container ul.rui-selectable-display{display:block;width:auto;overflow:hidden;margin-right:2em}div.rui-selectable-container ul.rui-selectable-display li{line-height:1.6em;padding:0 .5em;overflow:hidden;width:100%;white-space:nowrap}select.rui-selectable{visibility:hidden}");t.type="text/css",a.getElementsByTagName("head")[0].appendChild(t),t.styleSheet?t.styleSheet.cssText=u.nodeValue:t.appendChild(u);return s}(document,RightJS)
@@ -1,23 +1,28 @@
1
1
  /**
2
- * Sizzle engine support for RightJS
2
+ * Sizzle Engine Support v2.2.0
3
+ * http://rightjs.org/plugins/sizzle
3
4
  *
4
- * Copyright (C) 2010 Nikolay Nemshilov
5
+ * Copyright (C) 2009-2011 Nikolay Nemshilov
5
6
  */
6
- /*!
7
- * Sizzle CSS Selector Engine - v1.0
8
- * Copyright 2009, The Dojo Foundation
9
- * Released under the MIT, BSD, and GPL Licenses.
10
- * More information: http://sizzlejs.com/
11
- */
12
-
13
7
  /**
14
8
  * sizzle initialization script
15
9
  *
16
- * Copyright (C) 2010 Nikolay Nemshilov
10
+ * Copyright (C) 2010-2011 Nikolay Nemshilov
17
11
  */
18
12
 
13
+ RightJS.Sizzle = {
14
+ version: '2.2.0'
15
+ };
16
+
17
+
19
18
 
20
19
 
20
+ /*!
21
+ * Sizzle CSS Selector Engine - v1.0
22
+ * Copyright 2009, The Dojo Foundation
23
+ * Released under the MIT, BSD, and GPL Licenses.
24
+ * More information: http://sizzlejs.com/
25
+ */
21
26
  (function(){
22
27
 
23
28
  var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,