right-rails 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -4,7 +4,7 @@ RightRails is a RubyOnRails plugin for RightJS javascript framework.
4
4
 
5
5
  It works as a drop in replacement for all the Prototype/Scriptaculous
6
6
  methods, plus it brings some more sweets and routine ajax operations
7
- organization.
7
+ helpers.
8
8
 
9
9
 
10
10
  h2. Features
@@ -28,6 +28,10 @@ See the wiki-pages for the documentation
28
28
 
29
29
  <a href="http://wiki.github.com/MadRabbit/right-rails">http://wiki.github.com/MadRabbit/right-rails</a>
30
30
 
31
+ See also the demo application for examples
32
+
33
+ <a herf="http://github.com/MadRabbit/right-rails-demo">http://github.com/MadRabbit/right-rails-demo</a>
34
+
31
35
 
32
36
  h3. Usage
33
37
 
@@ -45,11 +49,7 @@ You also will have an ajax-friendly scaffold generator
45
49
 
46
50
  h4. Ruby Gem
47
51
 
48
- Ruby gem version is now also available. You need to add gemcutter to the list of sources
49
-
50
- <pre><code>gem sources -a http://gemcutter.org</code></pre>
51
-
52
- Install the gem:
52
+ Ruby gem version is now also available.
53
53
 
54
54
  <pre><code>gem install right-rails</code></pre>
55
55
 
@@ -62,4 +62,4 @@ end</code></pre>
62
62
 
63
63
 
64
64
 
65
- Copyright (c) 2009 Nikolay V. Nemshilov, released under the MIT license
65
+ Copyright (c) 2009-2010 Nikolay V. Nemshilov, released under the MIT license
data/init.rb CHANGED
@@ -1,4 +1,14 @@
1
1
  # Include hook code here
2
+
3
+ require 'right_rails'
4
+ require 'right_rails/controller_extensions'
5
+ require 'right_rails/java_script_generator'
6
+ require 'right_rails/helpers'
7
+ require 'right_rails/helpers/basic'
8
+ require 'right_rails/helpers/forms'
9
+ require 'right_rails/helpers/misc'
10
+ require 'right_rails/helpers/rails'
11
+
2
12
  if defined?(Rails)
3
13
  if Rails::VERSION::MAJOR == 2
4
14
  # Rails 2.x.x initalizer
@@ -19,15 +29,6 @@ if defined?(Rails)
19
29
  require 'action_controller/railtie'
20
30
 
21
31
  if defined?(ActionController)
22
- require 'right_rails'
23
- require 'right_rails/controller_extensions'
24
- require 'right_rails/java_script_generator'
25
- require 'right_rails/helpers'
26
- require 'right_rails/helpers/basic'
27
- require 'right_rails/helpers/forms'
28
- require 'right_rails/helpers/misc'
29
- require 'right_rails/helpers/rails'
30
-
31
32
  class ActionController::Base
32
33
  include RightRails::ControllerExtensions
33
34
 
@@ -110,12 +110,12 @@ var RR = {
110
110
  remove: function(id) {
111
111
  var element = $(id);
112
112
  if (element) {
113
- var remove_element = element.remove.bind(element).chain(Lightbox.rescan);
113
+ var remove_element = element.remove.bind(element);
114
114
 
115
115
  if (this.Options.removeFx) {
116
116
  element.hide(this.Options.removeFx, {onFinish: remove_element});
117
117
  } else {
118
- remove_element;
118
+ remove_element();
119
119
  }
120
120
  }
121
121
  },
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * Copyright (C) 2009-2010 Nikolay V. Nemshilov
8
8
  */
9
- eval((function(s,d){for(var i=d.length-1;i>-1;i--)if(d[i])s=s.replace(new RegExp(i,'g'),d[i]);return s})("8 RR={6:{17at:'js',36:'flashes',37:'slide',14:3200,1688:59,30:'fade',26:'.45_edit',23:'.45_delete',109089:59},update_flash:4(c){8 e=$(5.6.36);if(e)5.11(e,c).24();7 5},24:4(){if(5.6.14>-1){8 e=$(5.6.36);if(e&&e.visible())e.79.82(e,5.6.37).delay(5.6.14)}7 5},16:4(i){if(5.6.1688)$(i).16();7 5},19:4(a,w){7 5.16($(a).19(w).lastChild).10(a)},11:4(i,s){$(i).11(s);7 5.16(i).10(i)},41:4(i){8 e=$(i);if(e){8 r=e.41.82(e).chain(Lightbox.10);if(5.6.30)e.79(5.6.30,{onFinish:r});47 r}},15:4(i){8 f=$(i);if(f)f.remotize().enable().65+='.'+5.6.17at;7 5},11_17:4(i,s){8 f=$(i);if(f){f.11(s);5.15(i)}7 5.10(i)},show_17_86:4(i,s){$(i).select('17').46('41');$(i).19(s);7 5.15($(i).50('17')).10(i)},28:4(e){8 t=e.tar29,l=[t].68(t.53()).50('34','a');if(l){if(l.34(5.6.26)){e.33();85.81(l.58+'.'+5.6.17at)}47 if(l.34(5.6.23)&&l.87('52')){e.33();eval('({f:'+l.52.to66().11('.39','.78')+'})').f.call(l)}}},10:4(s){$w('Draggable Droppable Tabs Slider Selectable').46(4(n){if(84[n])84[n].10(5.6.109089?s:80)},5);7 5}};(4(){8 u=4(a,e){8 m=e.29('31-57');if(m&&!57(m)){a.33();7 59}};8 c=4(e,o){7 63.merge({onCreate:4(){e.43('45:81ing',5)},onComplete:4(){e.43('45:complete',5)},onSuccess:4(){e.43('45:success',5)},onFailure:4(){e.43('45:failure',5)}},o)};8 g=4(e,l){8 m=l.29('31-38'),r=l.29('31-69');if(u(e,l))7;if(m||r)e.33();if(r)85.81(l.58,c(l,{38:m||'29',55:l.29('31-55')}));47 if(m){8 p=$$('83[44=77-param]')[0],t=$$('83[44=77-token]')[0],f=$E('17',{65:l.58,38:'post'});if(p&&t)f.19('<73 60=\"62\" 44=\"'+p.29('56')+'\" 71=\"'+t.29('56')+'\" />');f.19('<73 60=\"62\" 44=\"_38\" 71=\"'+m+'\"/>').19To(18.body).39()}};8 d=4(e,b){if(!u(e,b)&&$(b.17).87('31-69')){e.33();b.17.78(c(b.17))}};18.on({72:4(e){8 t=e.tar29,f=t.17,l=[t].68(t.53()).50('34','a');if(f&&['39','image'].54(t.60))d(e,t);47 if(l)g(e,l)},keydown:4(e){8 t=e.tar29,f=t.17;if(f&&t.tagName==='INPUT'&&e.keyCode==13)d(e,t)}})})();18.on({ready:4(){RR.24()},72:4(e){RR.28(e)}});[66.9,70.9,Function.9,63,6,49,49.9,window,18].46(4(o){86(8 k in o)try{if(/[A-Z]/.76(k)&&60of(o[k])==='4'){8 u=k.35();if(o[u]===80||o[u]===undefined)o[u]=o[k]}}catch(e){}});[51,Event,75,75.51].46(4(o){8 a={},m=o.Methods;86(8 k in m)if(/[A-Z]/.76(k)&&60of(m[k])==='4')a[k.35()]=m[k];o.54(a)});61(66.9,{48:'25',27:'12',to_f:'toFloat',to_i:'toInt',gsub:'11',downcase:'toLower91',upcase:'toUpper91',74:'25',67:'12',strip:'trim'});61(70.9,{collect:'map',detect:'filter',48:'25',27:'12',74:'25',67:'12'});",",,,,function,this,Options,return,var,prototype,rescan,replace,lastIndexOf,,flashHideDelay,remotize_form,highlight,form,document,insert,,highlightUpdates,rescanWithScopes,linkToAjaxDelete,hide_flash,indexOf,linkToAjaxEdit,last_index_of,process_click,get,removeFx,data,,stop,match,underscored,flashId,flashHideFx,method,submit,format,remove,target,fire,name,ajax,each,else,index_of,Observer,first,Element,onclick,parents,include,spinner,content,confirm,href,true,type,$alias,hidden,Object,typeof,action,String,rindex,concat,remote,Array,value,click,input,index,Form,test,csrf,send,hide,null,load,bind,meta,self,Xhr,for,has,Updates,Scopes,With,Case".split(",")));
9
+ eval((function(s,d){for(var i=d.length-1;i>-1;i--)if(d[i])s=s.replace(new RegExp(i,'g'),d[i]);return s})("8 RR={6:{17at:'js',36:'flashes',37:'slide',12:3200,1688:60,30:'fade',26:'.45_edit',23:'.45_delete',149089:60},update_flash:4(c){8 e=$(5.6.36);if(e)5.10(e,c).24();7 5},24:4(){if(5.6.12>-1){8 e=$(5.6.36);if(e&&e.visible())e.79.82(e,5.6.37).delay(5.6.12)}7 5},16:4(i){if(5.6.1688)$(i).16();7 5},19:4(a,w){7 5.16($(a).19(w).lastChild).14(a)},10:4(i,s){$(i).10(s);7 5.16(i).14(i)},41:4(i){8 e=$(i);if(e){8 r=e.41.82(e);if(5.6.30)e.79(5.6.30,{onFinish:r});47 r()}},15:4(i){8 f=$(i);if(f)f.remotize().enable().65+='.'+5.6.17at;7 5},10_17:4(i,s){8 f=$(i);if(f){f.10(s);5.15(i)}7 5.14(i)},show_17_86:4(i,s){$(i).select('17').46('41');$(i).19(s);7 5.15($(i).49('17')).14(i)},28:4(e){8 t=e.tar29,l=[t].68(t.53()).49('34','a');if(l){if(l.34(5.6.26)){e.33();85.81(l.58+'.'+5.6.17at)}47 if(l.34(5.6.23)&&l.87('52')){e.33();eval('({f:'+l.52.to66().10('.39','.78')+'})').f.call(l)}}},14:4(s){$w('Draggable Droppable Tabs Slider Selectable').46(4(n){if(84[n])84[n].14(5.6.149089?s:80)},5);7 5}};(4(){8 u=4(a,e){8 m=e.29('31-51');if(m&&!51(m)){a.33();7 60}};8 c=4(e,o){7 63.merge({onCreate:4(){e.43('45:81ing',5)},onComplete:4(){e.43('45:complete',5)},onSuccess:4(){e.43('45:success',5)},onFailure:4(){e.43('45:failure',5)}},o)};8 g=4(e,l){8 m=l.29('31-38'),r=l.29('31-69');if(u(e,l))7;if(m||r)e.33();if(r)85.81(l.58,c(l,{38:m||'29',55:l.29('31-55')}));47 if(m){8 p=$$('83[44=77-param]')[0],t=$$('83[44=77-token]')[0],f=$E('17',{65:l.58,38:'post'});if(p&&t)f.19('<73 59=\"62\" 44=\"'+p.29('56')+'\" 71=\"'+t.29('56')+'\" />');f.19('<73 59=\"62\" 44=\"_38\" 71=\"'+m+'\"/>').19To(18.body).39()}};8 d=4(e,b){if(!u(e,b)&&$(b.17).87('31-69')){e.33();b.17.78(c(b.17))}};18.on({72:4(e){8 t=e.tar29,f=t.17,l=[t].68(t.53()).49('34','a');if(f&&['39','image'].57(t.59))d(e,t);47 if(l)g(e,l)},keydown:4(e){8 t=e.tar29,f=t.17;if(f&&t.tagName==='INPUT'&&e.keyCode==13)d(e,t)}})})();18.on({ready:4(){RR.24()},72:4(e){RR.28(e)}});[66.9,70.9,Function.9,63,6,48,48.9,window,18].46(4(o){86(8 k in o)try{if(/[A-Z]/.76(k)&&59of(o[k])==='4'){8 u=k.35();if(o[u]===80||o[u]===undefined)o[u]=o[k]}}catch(e){}});[54,Event,75,75.54].46(4(o){8 a={},m=o.Methods;86(8 k in m)if(/[A-Z]/.76(k)&&59of(m[k])==='4')a[k.35()]=m[k];o.57(a)});61(66.9,{50:'25',27:'11',to_f:'toFloat',to_i:'toInt',gsub:'10',downcase:'toLower91',upcase:'toUpper91',74:'25',67:'11',strip:'trim'});61(70.9,{collect:'map',detect:'filter',50:'25',27:'11',74:'25',67:'11'});",",,,,function,this,Options,return,var,prototype,replace,lastIndexOf,flashHideDelay,,rescan,remotize_form,highlight,form,document,insert,,highlightUpdates,rescanWithScopes,linkToAjaxDelete,hide_flash,indexOf,linkToAjaxEdit,last_index_of,process_click,get,removeFx,data,,stop,match,underscored,flashId,flashHideFx,method,submit,format,remove,target,fire,name,ajax,each,else,Observer,first,index_of,confirm,onclick,parents,Element,spinner,content,include,href,type,true,$alias,hidden,Object,typeof,action,String,rindex,concat,remote,Array,value,click,input,index,Form,test,csrf,send,hide,null,load,bind,meta,self,Xhr,for,has,Updates,Scopes,With,Case".split(",")));
@@ -130,8 +130,7 @@ var Selectable = new Class(Observer, {
130
130
  * @return Selectable this
131
131
  */
132
132
  insertTo: function(element, position) {
133
- this.element.insertTo(element, position);
134
- if (this.isSingle) this.container.insertTo(this.element, 'before');
133
+ this[this.isSingle ? 'container' : 'element'].insertTo(element, position);
135
134
  return this;
136
135
  },
137
136
 
@@ -469,24 +468,36 @@ var Selectable = new Class(Observer, {
469
468
  // builds a container for a single-select
470
469
  buildSingle: function() {
471
470
  this.container = $E('div', {'class': this.containerClass})
472
- .insert([$E('div', {'html': this.options.hCont, 'class': 'right-selectable-handle'}), $E('ul')])
473
- .insertTo(this.element, 'before')
474
- .onClick(this.showList.bind(this));
471
+ .insert([
472
+ $E('div', {'html': this.options.hCont, 'class': 'right-selectable-handle'}),
473
+ $E('ul', {'class': 'right-selectable-display'})
474
+ ])
475
+ .insertTo(this.element, 'instead')
476
+ .insert(this.element)
477
+ .onClick(this.toggleList.bind(this));
475
478
 
476
479
  document.onClick(this.hideList.bind(this));
477
480
 
478
481
  return this;
479
482
  },
480
483
 
484
+ // toggles the single-selects list
485
+ toggleList: function(event) {
486
+ event.stop();
487
+ return this.element.visible() ? this.hideList() : this.showList(event);
488
+ },
489
+
481
490
  // shows list for the single-selects
482
491
  showList: function(event) {
483
492
  event.stop();
484
493
  if (this.isSingle) {
485
- var dims = this.container.dimensions();
494
+ $$('.right-selectable-single').without(this.element).each('hide');
495
+
496
+ var dims = this.container.dimensions(), pos = this.container.position();
486
497
 
487
498
  this.element.setStyle({
488
- top: (dims.top + dims.height) + 'px',
489
- left: dims.left + 'px',
499
+ top: (dims.top + dims.height - pos.y) + 'px',
500
+ left: (dims.left - pos.x) + 'px',
490
501
  width: dims.width + 'px'
491
502
  }).show(this.options.fxName, {
492
503
  duration: this.options.fxDuration,
@@ -549,4 +560,4 @@ var Selectable = new Class(Observer, {
549
560
  */
550
561
  document.onReady(function() { Selectable.rescan(); });
551
562
 
552
- document.write("<style type=\"text/css\">*.right-selectable,*.right-selectable li,*.right-selectable dt,*.right-selectable dd,*.right-selectable ul,div.right-selectable-container ul,div.right-selectable-container ul li{margin:0;padding:0;border:none;background:none;list-style:none}*.right-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}*.right-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC}*.right-selectable li:hover{background:#EEE}*.right-selectable li.right-selectable-selected{font-weight:bold;background:#DDD}*.right-selectable li.right-selectable-disabled,*.right-selectable li.right-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.right-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.right-selectable dd li{padding-left:1.5em}*.right-selectable-single{-moz-box-shadow:#AAA .2em .2em .5em;-webkit-box-shadow:#AAA .2em .2em .5em;display:none;position:absolute;background:#FFF}div.right-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}div.right-selectable-container div.right-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.right-selectable-container:hover div{color:#666}div.right-selectable-container ul{display:block;width:auto;margin-right:2em;overflow:hidden}div.right-selectable-container ul li{line-height:1.6em;padding:0 .5em}</style>");
563
+ document.write("<style type=\"text/css\">*.right-selectable,*.right-selectable li,*.right-selectable dt,*.right-selectable dd,*.right-selectable ul,div.right-selectable-container ul.right-selectable-display,div.right-selectable-container ul.right-selectable-display li{margin:0;padding:0;border:none;background:none;list-style:none}*.right-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}*.right-selectable li{padding:.3em 1em;cursor:pointer;border-bottom:1px solid #CCC}*.right-selectable li:hover{background:#EEE}*.right-selectable li.right-selectable-selected{font-weight:bold;background:#DDD}*.right-selectable li.right-selectable-disabled,*.right-selectable li.right-selectable-disabled:hover{background:#CCC;color:#777;cursor:default}dl.right-selectable dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE;border-bottom:1px solid #CCC}dl.right-selectable dd li{padding-left:1.5em}*.right-selectable-single{-moz-box-shadow:#AAA .2em .2em .5em;-webkit-box-shadow:#AAA .2em .2em .5em;display:none;position:absolute;background:#FFF;z-index:99999}div.right-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.right-selectable-container div.right-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.right-selectable-container:hover div.right-selectable-handle{color:#666}div.right-selectable-container ul.right-selectable-display{display:block;width:auto;margin-right:2em;overflow:hidden}div.right-selectable-container ul.right-selectable-display li{line-height:1.6em;padding:0 .5em}</style>");
@@ -4,4 +4,4 @@
4
4
  * Copyright (C) 2009 Nikolay V. Nemshilov
5
5
  */
6
6
  if (!self.RightJS) throw "Gimme RightJS";
7
- eval((function(s,d){for(var i=d.length-1;i>-1;i--)if(d[i])s=s.replace(new RegExp(i,'g'),d[i]);return s})("24 70=new 165(Observer,{extend:{EVENTS:$w('149 25 un25 72 111 79 155 116 115'),Options:{13:35,18:35,23:35,41:96,67:'slide',69:'short',36:35,132:156,128:35,154:'&bull;',52:96},150:11(s){($(s)||42).25('*.14-12').33(11(e){if(!e._12)new 70(e)})}},114:'14-12',58:'14-12-143',18165:'14-12-18',23165:'14-12-23',17165:'14-12-17',164ialize:11(){24 a=$A(75),s;if(a[0]&&!148(a[0]))9.16=$(a[0]);9.106(148(a.161())?a.161():9.16?eval('('+9.16.get('data-12-13')+')'):35);if(!9.16)9.16=9.127();43 if((s=9.16.134=='SELECT')){9.25box=9.84(9.16);9.16=9.127().45(9.25box,'108')}9.16._12=9.164();if(s)9.94(9.95(9.25box))},destroy:11(){9.21.33(11(i){i.30('103',9.54).30('64',9.68).30('53',9.63).30('50',9.56).30('71',9.76)},9);delete(9.16._12)},62:11(v){if(92(v))v=v.split(',').113('trim').89(11(a){15!a.blank()});9.21.33('38',9.18165);15 9.25(v)},59:11(){if(9.22){24 a=9.21.131('28',9.18165);15 a?9.74(a):35}43 15 9.21.89('28',9.18165).113(11(i){15 9.74(i)},9)},45:11(e,p){9.16.45(e,p);if(9.22)9.17.45(9.16,'108');15 9},94:11(b){24 a=11(e,v){if(e=$(e)){if(v===undefined||v===35)v='';e[e.62?'62':'36'](e.type=='25-41'?v:''+v)}}.158(b);24 c=11(e,o){24 e=$(e);if(e&&e.93)e.93(11(){9.62(e.83)}.31(o))}.158(b);if($(b)){a(9.59());c(9)}43 42.135(11(){a(9.59());c(9)}.31(9));15 9.93(a)},72:11(k){9.46(k).33(11(i){9.32('72',i.57(9.23165))},9);15 9},111:11(k){9.46(k).33(11(i){9.32('111',i.38(9.23165))},9);15 9},23:11(k){15 9.46(k).159('28',9.23165)},25:11(k){24 b=9.47(k),d=9.18165;if(9.22&&b){9.21.33('38',d);b=[b[0]]}if(!9.22&&9.13.128){24 s=9.21.89('28',d),c=[];while(b.107&&(s.107+c.107)<9.13.128){24 a=b.shift();if(!s.139(a))c.142(a)}b=c}b.33(11(i){9.32('25',i.57(d))},9);15 9},un25:11(k){9.47(k).33(11(i){9.32('un25',i.38(9.18165))},9);15 9},18:11(k){15 9.47(k).159('28',9.18165)},52:11(){9.21=9.16.25('li').33(11(i){if(!9.21||!9.21.139(i))i.on({103:9.54,71:9.76,50:9.56,53:9.63,64:9.68})},9);15 9},164:11(){9.16.57(9.114);if(9.22=!9.13.41||9.16.28(9.58))9.101().16.57(9.58);9.56=9.50.31(9);9.76=9.71.31(9);9.63=9.53.31(9);9.68=9.64.31(9);9.54=9.103.31(9);9.83=35;24 a=11(){24 v=9.59();if(v!=9.83){9.83=v;9.32('149',v,9)}}.31(9);9.52().91(a).onUn25(a);if(9.22)9.91('116Item');if(9.13.23)9.72(9.13.23);if(9.13.18)9.25(9.13.18);if(9.13.36)9.94(9.13.36);if(9.22){if(9.13.18===35)9.25(9.21[0]);9.91('90')}if(9.13.52){24 o=9.16.36;9.16.36=11(){24 r=o.153(9.16,75);9.52();15 r}.31(9)}15 9},74:11(i){15 i.id?9.13.132?i.id.match(/\\d+/):i.id:9.21.73(i)},32:11(n,i){if(i&&i.134)9.106(n,i,9.21.73(i),9);43 9.106.153(9,75);15 9},113:11(c){if(!137(c))c=[c];15 c.113(11(k){24 i=(92(k)&&/^\\d+$/.test(k))?k.toInt():k,b=k;if(isNumber(i))b=9.21[i];43 if(92(k))b=9.21.131(11(a){15 a.id==k});15 b},9).compact()},46:11(k){15 defined(k)?9.113(k):9.21},47:11(k){15 9.46(k).89(11(i){15!i.28(9.23165)},9)},50:11(e){e.121();24 c=e.104;if(!9.23(c)){if(9.22)9.25(c);43 if(9.18(c)){9.un25(c);9.60=96}43{9.25(c);9.55=96}if((e.shiftKey||e.metaKey)&&9.49){24 a=9.21.73(9.49);24 b=9.21.73(c);if(a!=b){if(a>b){24 t=a;a=b;b=a}for(24 i=a;i<b;i++)9[9.49.28(9.18165)?'25':'un25'](9.21[i])}}9.49=c}},71:11(e){e.121();9.60=9.55=156},53:11(e){24 i=e.104;9.32('79',i);if(!9.22){if(9.55)9.25(i);43 if(9.60)9.un25(i)}},64:11(e){9.32('155',e.104)},103:11(e){e.121()},127:11(){24 e=$E('ul'),a=9.13.13;if(137(a))a.33(11(o){e.112($E('li',{141:o}))});43 for(24 k in a)e.112($E('li',{id:k,141:a[k]}));15 e},101:11(){9.17=$E('40',{'157':9.17165}).112([$E('40',{'141':9.13.154,'157':'14-12-144'}),$E('ul')]).45(9.16,'108').54(9.116List.31(9));42.54(9.90.31(9));15 9},116List:11(e){e.121();if(9.22){24 d=9.17.dimensions();9.16.setStyle({top:(d.top+d.48)+'px',119:d.119+'px',37:d.37+'px'}).116(9.13.67,{125:9.13.69,126:9.32.31(9,'116',9)});if(!9.13.67)9.32('116',9)}},90:11(){if(9.22&&9.16.visible()){9.16.115(9.13.67,{125:9.13.69,126:9.32.31(9,'115',9)});if(!9.13.67)9.32('115',9)}},116Item:11(i){9.17.131('ul').36(i?i.cloneNode(96):'<li>&nbsp;</li>')},84:11(b){24 a=9.13;if(b){a.41=b.has('41');a.13={};a.18=[];a.23=[];$A(b.getElementsByTagName('OPTION')).33(11(o,i){a.13[$(o).get('83')||o.120]=o.120;if(o.18)a.18.142(i);if(o.23)a.23.142(i)});if(a.18.empty())a.18=0}15 b},95:11(e){15 e.wrap($E('40',{80:'123:130;z-index:-1;visibility:105;37:0;48:0;122:105'}))}});42.135(11(){70.150()});42.write(\"<80 type=\\\"163/css\\\">*.14-12,*.14-12 li,*.14-12 dt,*.14-12 dd,*.14-12 ul,40.14-12-17 ul,40.14-12-17 ul li{146:0;51:0;26:97;27:97;list-80:97}*.14-12{26:117 82 #99;26-110:97;39:86-124;*39:86;*162:1;min-37:140;-151-26-85:.61;-109-26-85:.61}*.14-12 li{51:.3em 1em;87:138;26-110:117 82 #99}*.14-12 li:79{27:#EEE}*.14-12 li.14-12-18{98-145:bold;27:#DDD}*.14-12 li.14-12-23,*.14-12 li.14-12-23:79{27:#99;102:#777;87:136}dl.14-12 dt{51:.3em .118;87:136;98-145:bold;98-80:italic;102:#444;27:#EEE;26-110:117 82 #99}dl.14-12 dd li{51-119:1.118}*.14-12-143{-151-box-147:#AAA .61 .61 .118;-109-box-147:#AAA .61 .61 .118;39:97;123:130;27:#FFF}40.14-12-17{26:117 82 #99;-151-26-85:.61;-109-26-85:.61;39:86-124;*39:86;*162:1;*37:140;vertical-152:middle;min-37:140;87:138;48:1.6em}40.14-12-17 40.14-12-144{98-family:Arial;float:14;37:0.8em;27:#DDD;163-152:center;48:100%;160-48:0.8em;98-size:200%;102:#888;26-119:117 82 #99}40.14-12-17:79 40{102:#666}40.14-12-17 ul{39:124;37:auto;146-14:61;122:105}40.14-12-17 ul li{160-48:1.6em;51:0 .118}</80>\");",",,,,,,,,,this,,function,selectable,options,right,return,element,container,selected,selectedClass,,items,isSingle,disabled,var,select,border,background,hasClass,disabledClass,stopObserving,bind,fire,each,unselect,null,update,width,removeClass,display,div,multiple,document,else,,insertTo,mapOrAll,mapEnabled,height,_prevItem,mousedown,padding,refresh,mouseover,onClick,_massSelect,onMousedown,addClass,singleClass,getValue,_massRemove,2em,setValue,onMouseover,mouseout,_selectable,,fxName,onMouseout,fxDuration,Selectable,mouseup,disable,indexOf,itemValue,arguments,onMouseup,,selectbox,hover,style,containerClass,solid,value,harvestOptions,radius,inline,cursor,,filter,hideList,onSelect,isString,onChange,assignTo,hideOriginal,true,none,font,CCC,,buildSingle,color,click,target,hidden,$super,length,before,webkit,bottom,enable,insert,map,baseClass,hide,show,1px,5em,left,innerHTML,stop,overflow,position,block,duration,onFinish,build,limit,showList,absolute,first,parseIds,showItem,tagName,onReady,default,isArray,pointer,include,10em,html,push,single,handle,weight,margin,shadow,isHash,change,rescan,moz,align,apply,hCont,leave,false,class,curry,every,line,last,zoom,text,init,Class".split(",")));
7
+ eval((function(s,d){for(var i=d.length-1;i>-1;i--)if(d[i])s=s.replace(new RegExp(i,'g'),d[i]);return s})("25 71=new 167(Observer,{extend:{EVENTS:$w('154 26 un26 76 118 79 161 122 101'),Options:{15:37,19:37,23:37,42:102,70:'slide',72:'short',38:37,130:158,135:37,157:'&bull;',50:102},151:12(s){($(s)||46).26('*.14-13').34(12(e){if(!e._13)new 71(e)})}},120:'14-13',69:'14-13-112',19167:'14-13-19',23167:'14-13-23',18167:'14-13-18',initialize:12(){25 a=$A(84),s;if(a[0]&&!150(a[0]))11.17=$(a[0]);11.115(150(a.last())?a.last():11.17?eval('('+11.17.get('data-13-15')+')'):37);if(!11.17)11.17=11.134();43 if((s=11.17.141=='SELECT')){11.26box=11.86(11.17);11.17=11.134().58(11.26box,'before')}11.17._13=11.init();if(s)11.94(11.98(11.26box))},destroy:12(){11.22.34(12(i){i.31('109',11.51).31('61',11.73).31('52',11.55).31('49',11.59).31('75',11.78)},11);delete(11.17._13)},67:12(v){if(97(v))v=v.split(',').123('trim').89(12(a){16!a.blank()});11.22.34('39',11.19167);16 11.26(v)},62:12(){if(11.24){25 a=11.22.133('30',11.19167);16 a?11.85(a):37}43 16 11.22.89('30',11.19167).123(12(i){16 11.85(i)},11)},58:12(e,p){11[11.24?'18':'17'].58(e,p);16 11},94:12(b){25 a=12(e,v){if(e=$(e)){if(v===undefined||v===37)v='';e[e.67?'67':'38'](e.type=='26-42'?v:''+v)}}.156(b);25 c=12(e,o){25 e=$(e);if(e&&e.95)e.95(12(){11.67(e.81)}.33(o))}.156(b);if($(b)){a(11.62());c(11)}43 46.144(12(){a(11.62());c(11)}.33(11));16 11.95(a)},76:12(k){11.45(k).34(12(i){11.35('76',i.60(11.23167))},11);16 11},118:12(k){11.45(k).34(12(i){11.35('118',i.39(11.23167))},11);16 11},23:12(k){16 11.45(k).160('30',11.23167)},26:12(k){25 b=11.47(k),d=11.19167;if(11.24&&b){11.22.34('39',d);b=[b[0]]}if(!11.24&&11.15.135){25 s=11.22.89('30',d),c=[];while(b.117&&(s.117+c.117)<11.15.135){25 a=b.shift();if(!s.140(a))c.147(a)}b=c}b.34(12(i){11.35('26',i.60(d))},11);16 11},un26:12(k){11.47(k).34(12(i){11.35('un26',i.39(11.19167))},11);16 11},19:12(k){16 11.47(k).160('30',11.19167)},50:12(){11.22=11.17.26('li').34(12(i){if(!11.22||!11.22.140(i))i.on({109:11.51,75:11.78,49:11.59,52:11.55,61:11.73})},11);16 11},init:12(){11.17.60(11.120);if(11.24=!11.15.42||11.17.30(11.69))11.106().17.60(11.69);11.59=11.49.33(11);11.78=11.75.33(11);11.55=11.52.33(11);11.73=11.61.33(11);11.51=11.109.33(11);11.81=37;25 a=12(){25 v=11.62();if(v!=11.81){11.81=v;11.35('154',v,11)}}.33(11);11.50().96(a).onUn26(a);if(11.24)11.96('122Item');if(11.15.23)11.76(11.15.23);if(11.15.19)11.26(11.15.19);if(11.15.38)11.94(11.15.38);if(11.24){if(11.15.19===37)11.26(11.22[0]);11.96('65')}if(11.15.50){25 o=11.17.38;11.17.38=12(){25 r=o.159(11.17,84);11.50();16 r}.33(11)}16 11},85:12(i){16 i.id?11.15.130?i.id.match(/\\d+/):i.id:11.22.74(i)},35:12(n,i){if(i&&i.141)11.115(n,i,11.22.74(i),11);43 11.115.159(11,84);16 11},123:12(c){if(!143(c))c=[c];16 c.123(12(k){25 i=(97(k)&&/^\\d+$/.test(k))?k.toInt():k,b=k;if(isNumber(i))b=11.22[i];43 if(97(k))b=11.22.133(12(a){16 a.id==k});16 b},11).compact()},45:12(k){16 defined(k)?11.123(k):11.22},47:12(k){16 11.45(k).89(12(i){16!i.30(11.23167)},11)},49:12(e){e.105();25 c=e.116;if(!11.23(c)){if(11.24)11.26(c);43 if(11.19(c)){11.un26(c);11.64=102}43{11.26(c);11.56=102}if((e.shiftKey||e.metaKey)&&11.54){25 a=11.22.74(11.54);25 b=11.22.74(c);if(a!=b){if(a>b){25 t=a;a=b;b=a}for(25 i=a;i<b;i++)11[11.54.30(11.19167)?'26':'un26'](11.22[i])}}11.54=c}},75:12(e){e.105();11.64=11.56=158},52:12(e){25 i=e.116;11.35('79',i);if(!11.24){if(11.56)11.26(i);43 if(11.64)11.un26(i)}},61:12(e){11.35('161',e.116)},109:12(e){e.105()},134:12(){25 e=$E('ul'),a=11.15.15;if(143(a))a.34(12(o){e.90($E('li',{146:o}))});43 for(25 k in a)e.90($E('li',{id:k,146:a[k]}));16 e},106:12(){11.18=$E('41',{'131':11.18167}).90([$E('41',{'146':11.15.157,'131':'14-13-119'}),$E('ul',{'131':'14-13-27'})]).58(11.17,'instead').90(11.17).51(11.110.33(11));46.51(11.65.33(11));16 11},110:12(e){e.105();16 11.17.142()?11.65():11.122List(e)},122List:12(e){e.105();if(11.24){$$('.14-13-112').without(11.17).34('101');25 d=11.18.dimensions(),p=11.18.68();11.17.setStyle({top:(d.top+d.48-p.y)+'px',121:(d.121-p.x)+'px',40:d.40+'px'}).122(11.15.70,{127:11.15.72,132:11.35.33(11,'122',11)});if(!11.15.70)11.35('122',11)}},65:12(){if(11.24&&11.17.142()){11.17.101(11.15.70,{127:11.15.72,132:11.35.33(11,'101',11)});if(!11.15.70)11.35('101',11)}},122Item:12(i){11.18.133('ul').38(i?i.cloneNode(102):'<li>&nbsp;</li>')},86:12(b){25 a=11.15;if(b){a.42=b.has('42');a.15={};a.19=[];a.23=[];$A(b.getElementsByTagName('OPTION')).34(12(o,i){a.15[$(o).get('81')||o.126]=o.126;if(o.19)a.19.147(i);if(o.23)a.23.147(i)});if(a.19.empty())a.19=0}16 b},98:12(e){16 e.wrap($E('41',{87:'68:138;z-162:-1;visibility:114;40:0;48:0;129:114'}))}});46.144(12(){71.151()});46.write(\"<87 type=\\\"165/css\\\">*.14-13,*.14-13 li,*.14-13 dt,*.14-13 dd,*.14-13 ul,41.14-13-18 ul.14-13-27,41.14-13-18 ul.14-13-27 li{149:0;53:0;29:104;28:104;list-87:104}*.14-13{29:125 83 #107;29-111:104;27:92-137;*27:92;*zoom:1;min-40:148;-155-29-91:.63;-113-29-91:.63}*.14-13 li{53:.3em 1em;93:145;29-111:125 83 #107}*.14-13 li:79{28:#EEE}*.14-13 li.14-13-19{103-152:166;28:#DDD}*.14-13 li.14-13-23,*.14-13 li.14-13-23:79{28:#107;108:#777;93:139}dl.14-13 dt{53:.3em .124;93:139;103-152:166;103-87:italic;108:#444;28:#EEE;29-111:125 83 #107}dl.14-13 dd li{53-121:1.124}*.14-13-112{-155-box-153:#AAA .63 .63 .124;-113-box-153:#AAA .63 .63 .124;27:104;68:138;28:#FFF;z-162:99999}41.14-13-18{29:125 83 #107;-155-29-91:.63;-113-29-91:.63;27:92-137;*27:92;*zoom:1;*40:148;vertical-163:middle;min-40:148;93:145;48:1.6em;68:relative}41.14-13-18 41.14-13-119{103-family:Arial;float:14;40:0.8em;28:#DDD;165-163:center;48:100%;164-48:0.8em;103-size:200%;108:#888;29-121:125 83 #107}41.14-13-18:79 41.14-13-119{108:#666}41.14-13-18 ul.14-13-27{27:137;40:auto;149-14:63;129:114}41.14-13-18 ul.14-13-27 li{164-48:1.6em;53:0 .124}</87>\");",",,,,,,,,,,,this,function,selectable,right,options,return,element,container,selected,,selectedClass,items,disabled,isSingle,var,select,display,background,border,hasClass,stopObserving,disabledClass,bind,each,fire,unselect,null,update,removeClass,width,div,multiple,else,,mapOrAll,document,mapEnabled,height,mousedown,refresh,onClick,mouseover,padding,_prevItem,onMouseover,_massSelect,_selectable,insertTo,onMousedown,addClass,mouseout,getValue,2em,_massRemove,hideList,,setValue,position,singleClass,fxName,Selectable,fxDuration,onMouseout,indexOf,mouseup,disable,,onMouseup,hover,selectbox,value,containerClass,solid,arguments,itemValue,harvestOptions,style,,filter,insert,radius,inline,cursor,assignTo,onChange,onSelect,isString,hideOriginal,,,hide,true,font,none,stop,buildSingle,CCC,color,click,toggleList,bottom,single,webkit,hidden,$super,target,length,enable,handle,baseClass,left,show,map,5em,1px,innerHTML,duration,showList,overflow,parseIds,class,onFinish,first,build,limit,showItem,block,absolute,default,include,tagName,visible,isArray,onReady,pointer,html,push,10em,margin,isHash,rescan,weight,shadow,change,moz,curry,hCont,false,apply,every,leave,index,align,line,text,bold,Class".split(",")));
@@ -121,6 +121,8 @@ module RightRails::Helpers::Forms
121
121
  # Builds a dummy rater, just for displaying purposes
122
122
  #
123
123
  def rater_display(value, options={})
124
+ rightjs_include_module 'rater'
125
+
124
126
  content_tag :div, (0...(options[:size] || 5)).to_a.collect{ |i|
125
127
  content_tag :div, '&#9733;', :class => i < value ? 'right-rater-glow' : nil
126
128
  }.join(''), :class => 'right-rater right-rater-disabled'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 2
9
- version: 0.5.2
8
+ - 3
9
+ version: 0.5.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nikolay Nemshilov
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-20 00:00:00 +04:00
17
+ date: 2010-04-24 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20