right-rails 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/init.rb +37 -8
  2. data/javascripts/right-autocompleter-src.js +55 -41
  3. data/javascripts/right-autocompleter.js +2 -2
  4. data/javascripts/right-behavior-src.js +5 -5
  5. data/javascripts/right-behavior.js +2 -2
  6. data/javascripts/right-calendar-src.js +139 -67
  7. data/javascripts/right-calendar.js +2 -2
  8. data/javascripts/right-dnd-src.js +7 -7
  9. data/javascripts/right-dnd.js +2 -2
  10. data/javascripts/right-effects-src.js +9 -9
  11. data/javascripts/right-effects.js +2 -2
  12. data/javascripts/right-events-src.js +8 -8
  13. data/javascripts/right-events.js +2 -2
  14. data/javascripts/right-in-edit-src.js +10 -8
  15. data/javascripts/right-in-edit.js +2 -2
  16. data/javascripts/right-json-src.js +14 -15
  17. data/javascripts/right-json.js +2 -2
  18. data/javascripts/right-lightbox-src.js +141 -86
  19. data/javascripts/right-lightbox.js +3 -3
  20. data/javascripts/right-olds-src.js +26 -48
  21. data/javascripts/right-olds.js +2 -2
  22. data/javascripts/right-rails-src.js +109 -31
  23. data/javascripts/right-rails.js +2 -2
  24. data/javascripts/right-rater-src.js +20 -12
  25. data/javascripts/right-rater.js +2 -2
  26. data/javascripts/right-selectable-src.js +3 -3
  27. data/javascripts/right-selectable.js +1 -1
  28. data/javascripts/right-slider-src.js +3 -3
  29. data/javascripts/right-slider.js +1 -1
  30. data/javascripts/right-sortable-src.js +28 -28
  31. data/javascripts/right-sortable.js +2 -2
  32. data/javascripts/right-src.js +612 -405
  33. data/javascripts/right-tabs-src.js +115 -44
  34. data/javascripts/right-tabs.js +2 -2
  35. data/javascripts/right-tooltips-src.js +131 -74
  36. data/javascripts/right-tooltips.js +2 -2
  37. data/javascripts/right-ui-i18n-fr.js +4 -4
  38. data/javascripts/right-uploader-src.js +170 -0
  39. data/javascripts/right-uploader.js +9 -0
  40. data/javascripts/right.js +2 -4
  41. data/lib/right_rails.rb +1 -1
  42. data/lib/right_rails/helpers/basic.rb +10 -2
  43. data/lib/right_rails/helpers/misc.rb +16 -17
  44. data/lib/right_rails/helpers/rails.rb +0 -7
  45. data/spec/lib/right_rails/helpers/basic_spec.rb +0 -1
  46. data/spec/lib/right_rails/helpers/rails_spec.rb +24 -0
  47. data/spec/spec_helper.rb +9 -1
  48. metadata +14 -5
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Home page: http://rightjs.org/ui/lightbox
5
5
  *
6
- * @copyright (C) 2009 Nikolay V. Nemshilov aka St.
6
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
7
7
  */
8
- if (!RightJS || !Fx) { throw "Gimme RightJS with Fx. Please." };
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})("85.IE6=navigator.userAgent.134(\"MSIE 6\")!=-1;21 19=140 Class({82:141,extend:{Version:\"1.0.0\",141:{147:0.8,42:300,47OnEsc:108,47OnOutClick:108,36181176:108,b33Content:131,relName:'14'},96:{160:'&times;',146:'181',171:'&149;&149;&149;',162:'177ious 163',172:'&151;&151;&151;',152:'175 163'},142:[],rescan:16(s){21 k=19.141.relName;21 g=16(e){21 d=e.get('data-'+k+'-29');17 eval('('+d+')')||{}};($(s)||44).select('a[rel='+k+']').129(16(b){if(!b.3619){21 o=g(b);b.3619=16(e){e.s79();140 19(o).36(13)};b.71(b.3619)}});21 r=$$('a[rel=\"'+k+'[31]\"]');r.129(16(b){if(b.3619)b.s79Observing(b.3619);21 o=g(b);b.31=r;b.3619=16(e){e.s79();140 19(o).36(13)};b.71(b.3619)})}},initialize:16(o){13.set141(o).89().60();19.142.push(13)},118:16(t){13.72.154('out',{65:13.29.42/2,119:16(){13.72.57(t).154('in',{65:13.29.42/2})}.41(13)});17 13},47:16(){13.24.47('154',{65:13.29.42/2,119:13.24.remove.41(13.24)});17 13},36:16(c,s){17 13.36ing178(16(){13.33();13.32.57(c||'');13.59(s)}.41(13))},59:16(s,n){13.26.51.79=(114.48().y-13.26.48().y)/2+'px';21 a=13.32Size(s);21 h=13.26.48().y-13.22.48().y;21 b=a.43.70()||13.117();21 d={79:(13.24.48().y-b-h)/2+'px'};if(85.IE6){21 p=13.22179.getStyle('74').70()>0?15:0;13.22179.49('74: '+p+'px');d.46=(a.46.70()+p*2)+'px'}if(n===108){13.22.49(a);13.26.49(d);13.52=131}126 13.59Fx(a,d);17 13},33:16(){13.22174.93('14-22-33-90').93('14-22-33-52').36();if(85.OLD)13.22174.49(\"83: 1\");17 13},un33:16(){if(13.29.b33Content)13.22174.121('14-22-33-90');126 13.22174.47();17 13},59174:16(){13.33().32.47()},59Un33:16(){13.un33().32.36('154',{65:13.29.42/2});13.52=131},32Size:16(s){21 s=s===13.$listeners?null:s,a=13.24.offsetWidth*0.8,m=13.24.offsetHeight*0.8;if(s)13.32.49(s);s=13.32.48();17{46:(s.x>a?a:s.x)+\"px\",43:(s.y>m?m:s.y)+\"px\"}},103:16(r){13.24.59(114.48());if(85.IE6){13.33er.59(114.48());13.24.51.38='55';13.24.51.79=44.44Element.scrollTop+'px'}17 13.59(131,108)},36ing178:16(c){19.142.without(13).129('47');if(13.24.hidden()){13.33er.49('83:0');13.26.49('83:0');13.24.78(44.22).36();13.103();21 o={65:13.29.42};13.33er.morph({83:13.29.147},o);13.26.morph({83:1},o);c.delay(13.29.42)}126 c();17 13},89:16(){13.24=13.E('14').49('76: 155');13.33er=13.E('14-33er',13.24);13.26=13.E('14-26',13.24);13.72=13.E('14-72',13.26);13.22179=13.E('14-22-159',13.26);13.22=13.E('14-22',13.22179);13.32=13.E('14-32',13.22);13.22174=13.E('14-22-33',13.22).47();if(13.29.36181176)13.102176=13.E('14-102-95',13.26).71(13.47.41(13)).57(19.96.160).set('104',19.96.146);if(13.29.47OnOutClick)13.33er.71(13.47.41(13));44.on('mousewheel',16(a){if(13.24.133()){a.s79();13[(a.detail||-a.wheelDelta)<0?'36177':'36175']()}}.41(13));17 13},60:16(){if(13.29.47OnEsc)44.158(16(e){if(e.132==27){e.s79();13.47()}}.41AsEventListener(13));114.on('59',13.103.41(13));17 13},117:16(){21 e=$E('20',{'166':'14-22',51:'28: 155; 38: 55'}).78(44.22),h=e.48().y;e.remove();17 h},59Fx:16(g,m){13.59174();21 f=13.22.48().x;21 c=g.46.70();21 e=13.22.48().y;21 a=g.43.70();21 k=13.26.51.79.70();21 i=m.79.70();21 l=13.26.48().x;21 j=(m.46||'0').70();21 b=13.22;21 h=13.26;$ext(140 Fx(13.26,{65:13.29.42}),{render:16(d){b.51.46=(f+(c-f)*d)+'px';b.51.43=(e+(a-e)*d)+'px';h.51.79=(k+(i-k)*d)+'px';if(85.IE6)h.51.46=(l+(j-l)*d)+'px'}}).119(13.59Un33.41(13)).start()},E:16(k,p){21 e=$E('20',{'166':k});if(p)e.78(p);17 e}});19.82((16(){21 f=19.56.36;21 e=19.56.89;17{36:16(c){if(c&&c.106)17 13.128(c.106,{63:16(r){13.118(c.104).32.57(r.124)}.41(13)});126 17 f.81(13,45)},128:16(u,o){21 o=o||{};$w('164 63').129(16(n){o[n]=o[n]?isArray(o[n])?o[n]:[o[n]]:[]});if(o.63.empty()&&!o.onSuccess)o.63.push(16(r){13.32.57(r.124)}.41(13));o.164.unshift(13.120.41(13));o.63.push(13.59.41(13));o.method=o.method||'get';17 13.36ing178(Xhr.128.41(Xhr,u,o))},120:16(){13.52=108;13.33().22174.121('14-22-33-52');17 13},89:16(){21 r=e.81(13,45);21 s=13.E('14-22-33-73',13.22174);21 b='1234'.173('').map(16(a){17 $E('20',{'166':a==1?'glow':null}).78(s)});(16(){21 d=b.pop();d.78(s,'79');b.unshift(d)}).periodical(400);17 r}}})());19.82((16(){21 b=19.56.36;21 o=19.56.89;21 a=19.56.60;17{36:16(c){13.25=(c&&c.31)?c:null;17 b.81(13,45)},89:16(){21 r=o.81(13,45);13.107180=13.E('14-107-62',13.26).71(13.36177.41(13)).57(19.96.171).set('104',19.96.162).47();13.127180=13.E('14-127-62',13.26).71(13.36175.41(13)).57(19.96.172).set('104',19.96.152).47();17 r},60:16(){21 r=a.81(13,45);44.158(16(e){if(e.132==37){e.s79();13.36177()}if(e.132==39){e.s79();13.36175()}}.41(13));17 r},36177:16(){if(13.138()&&13.24.133()&&!13.52)13.36(13.25.31[13.25.31.134(13.25)-1]);17 13},36175:16(){if(13.137()&&13.24.133()&&!13.52)13.36(13.25.31[13.25.31.134(13.25)+1]);17 13},113:16(){13.107180[13.138()?'36':'47']();13.127180[13.137()?'36':'47']();17 13},138:16(){17 13.25&&13.25.31&&13.25.31.first()!=13.25},137:16(){17 13.25&&13.25.31&&13.25.31.last()!=13.25}}})());19.82((16(){21 o=19.56.36;17{116:$w('jpg jpeg gif png bmp'),36:16(c){13.24[(c&&(c.tagName=='IMG'||13.98(c.106)))?'121':'93']('14-64');if(c&&c.106&&13.98(c.106))17 13.36ing178(16(){13.120().25=c;21 i=140 163();i.on128=13.57163.41(13,i,c);i.src=c.106}.41(13));126 17 o.81(13,45)},57163:16(i,l){13.32.57(i);13.113().118(l.104).59()},98:16(u){17 13.116.82(String(u).toLowerCase().173('?').first().173('.').last())}}})());19.extend({47:16(){13.142.129('47')},36:16(){17 13.inst('36',45)},128:16(){17 13.inst('128',45)},inst:16(n,a){21 i=140 19();17 i[n].81(i,a)}});44.onReady(16(){19.rescan()});44.write(\"<51 type=\\\"130/css\\\">20.14{38:fixed;79:94;68:94;46:156%;130-144:center;z-index:9999}20.14 20{line-43:normal}20.14-33er{38:55;79:94;68:94;46:156%;43:156%;28-67:black}20.14-26{76:112-b33;*76:112;*zoom:1;38:165;130-144:68;74-80:1.157}20.14-22-159{28-67:92;74:84;54-58:.157;-moz-54-58:.157;-115-54-58:.157;-moz-box-148:#111 .84 .84 .4em;-115-box-148:#111 .84 .84 .4em}20.14-22{38:165;43:161;46:161;min-43:161;min-46:161;overflow:hidden;*28-67:92}20.14-32{38:55;*28-67:92}20.14-22-33{28-67:92;38:55;68:94;79:94;46:156%;43:156%;130-144:center}20.14-22-33-73{76:155;38:55;80:0;135:0}20.14-22-33-73 20{float:68;46:.5em;43:.9em;28:#AAA;97-68:.84;-moz-54-58:.15em;-115-54-58:.15em}20.14-22-33-73 20.glow{28:#666;43:84;97-79:-0.05em}20.14-22-33-52 20.14-22-33-73{76:112-b33;*76:112;*zoom:1}20.14-22-33-90{28:155}20.14-72{43:1.139;97:0 .7em;97-80:.84;92-space:no159;67:#DDD;110-weight:bold;110-size:1.157;110-family:Helvetica;130-148:black 2px 2px 2px}20.14-102-95,20.14-107-62,20.14-127-62{38:55;80:0;67:#888;cursor:pointer;110-size:150%;110-weight:bold;110-family:Arial}20.14-102-95:168,20.14-107-62:168,20.14-127-62:168{67:92}20.14-102-95{135:.5em}20.14-107-62,20.14-127-62{74:0 .139;80:2px}20.14-107-62{68:.139}20.14-127-62{68:139}20.14-64 20.14-22-159{74:0;54:1px solid #777;54-58:94;-moz-54-58:94;-115-54-58:94}20.14-64 20.14-32 img{vertical-144:middle}20.14-64 20.14-72{97-68:.139}20.14-64 20.14-22-159,20.14-64 20.14-22-33{28-67:#DDD}20.14-64 20.14-22-33-73{80:84;135:84}20.14-64 20.14-102-95{135:.139}20.14-64 20.14-107-62{68:0}</51>\");",",,,,,,,,,,,,,this,lightbox,,function,return,,Lightbox,div,var,body,,element,roadLink,dialog,,background,options,,roadtrip,content,lock,,showLightbox,show,,position,,,bind,fxDuration,height,document,arguments,width,hide,sizes,setStyle,,style,loading,bodyLock,border,absolute,prototype,update,radius,resize,connectEvents,,link,onComplete,image,duration,,color,left,locker,toInt,onClick,caption,spinner,padding,showingSelf,display,,insertTo,top,bottom,apply,include,opacity,1em,Browser,bodyWrap,showPrev,,build,transparent,showNext,white,removeClass,0px,button,i18n,margin,isImageUrl,,,showCloseButton,close,boxResize,title,stop,href,prev,true,hideOnOutClick,font,,inline,checkRoadtrip,window,webkit,IMAGE_FORMATS,minBodyHeight,setTitle,onFinish,loadLock,addClass,resizeUnlock,,responseText,blockContent,else,next,load,each,text,false,keyCode,visible,indexOf,right,contentSize,hasNext,hasPrev,2em,new,Options,boxes,updateImage,align,resizeLock,CloseTitle,endOpacity,shadow,lsaquo,,rsaquo,NextTitle,hideOnEsc,fade,none,100,6em,onKeydown,wrap,CloseText,10em,PrevTitle,Image,onCreate,relative,class,nextLink,hover,resizeFx,prevLink,PrevText,NextText,split,Lock,Next,Button,Prev,Self,Wrap,Link,Close".split(",")));
8
+ if (!RightJS) { throw "Gimme RightJS please." };
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})("92.IE6=navigator.userAgent.140(\"MSIE 6\")!=-1;22 21=175 Class({81:154,extend:{Version:\"1.0.0\",154:{endOpacity:0.8,65:200,49OnEsc:119,49OnOutClick:119,38Close186:119,b33Content:145,113:\"a[rel^=14]\",116Width:425,116185:350},110:{174:'&times;',157:'Close',188Text:'&159;&159;&159;',170:'188ious Image',183Text:'&160;&160;&160;',167:'183 Image'},Medias:[[/(163:\\/\\/.*?youtube\\.[a-z]+)\\/watch\\?v=([^&]+)/,'$1/v/$2','139'],[/(163:\\/\\/video.google.com)\\/videoplay\\?docid=([^&]+)/,'$1/googleplayer.139?docId=$2','139'],[/(163:\\/\\/vimeo\\.[a-z]+)\\/([0-9]+).*?/,'$1/moogaloop.139?clip_id=$2','139']],141:[],rescan:16(){}},initialize:16(o){13.set154(o).97().63();21.141.push(13)},103:16(t){(16(){13.75.59(t)}).36(13).delay(13.31.65);17 13},49:16(){13.26.49('fade',{131:13.31.65/2,179:13.26.remove.36(13.26)});17 13},38:16(c,s){17 13.38ing184(16(){13.33();13.32.59(c||'');13.62(s)}.36(13))},62:16(s,n){13.29.72.86=(126.52().y-13.29.52().y)/2+'px';22 a=13.32Size(s);22 h=13.29.52().y-13.24.52().y;22 b=a.41.78()||13.128();22 d={86:(13.26.52().y-b-h)/2+'px'};if(92.IE6){22 p=13.24187.getStyle('80').78()>0?15:0;13.24187.71('80: '+p+'px');d.48=(a.48.78()+p*2)+'px'}if(n===119){13.24.71(a);13.29.71(d);13.56=145}172 13.62Fx(a,d);17 13},33:16(){13.24182.76('14-24-33-102').76('14-24-33-56').38();if(92.OLD)13.24182.71(\"151: 1\");17 13},un33:16(){if(13.31.b33Content)13.24182.105('14-24-33-102');172 13.24182.49();17 13},62182:16(){13.33().32.49()},62Un33:16(){13.un33().32.38('fade',{131:13.31.65/2});13.56=145},32Size:16(s){22 s=s===13.$listeners?173:s,a=13.26.offsetWidth*0.8,m=13.26.offset185*0.8;if(s)13.32.71(s);s=13.32.52();17{48:(s.x>a?a:s.x)+\"px\",41:(s.y>m?m:s.y)+\"px\"}},120:16(r){13.26.62(126.52());if(92.IE6){13.33er.62(126.52());13.26.72.46='57';13.26.72.86=51.51Element.scrollTop+'px'}17 13.62(145,119)},38ing184:16(c){21.141.without(13).each('49');if(13.26.hidden()){13.26.85(51.24).38();13.120()}c();17 13},97:16(){13.26=13.E('14').71('83: 166');13.33er=13.E('14-33er',13.26);13.29=13.E('14-29',13.26);13.75=13.E('14-75',13.29);13.24187=13.E('14-24-124',13.29);13.24=13.E('14-24',13.24187);13.32=13.E('14-32',13.24);13.24182=13.E('14-24-33',13.24).49();if(13.31.38Close186)13.122186=13.E('14-122-107',13.29).91(13.49.36(13)).59(21.110.174).set('94',21.110.157);if(13.31.49OnOutClick)13.33er.91(13.49.36(13));51.on('mousewheel',16(a){if(13.26.143()){a.s86();13[(a.detail||-a.wheelDelta)<0?'38188':'38183']()}}.36(13));17 13},63:16(){if(13.31.49OnEsc)51.176(16(e){if(e.149==27){e.s86();13.49()}}.36AsEventListener(13));126.on('62',13.120.36(13));17 13},128:16(){22 e=$E('19',{'180':'14-24',72:'30: 166; 46: 57'}).85(51.24),h=e.52().y;e.remove();17 h},62Fx:16(f,k){13.62182();22 e=13.24.52().x;22 a=f.48.78();22 c=13.24.52().y;22 b=f.41.78();22 i=13.29.72.86.78();22 g=k.86.78();22 j=13.29.52().x;22 h=(k.48||'0').78();22 f=13.24.72;22 k=13.29.72;$ext(175 Fx(13.29,{131:13.31.65}),{render:16(d){f.48=(e+(a-e)*d)+'px';f.41=(c+(b-c)*d)+'px';k.86=(i+(g-i)*d)+'px';if(92.IE6)k.48=(j+(h-j)*d)+'px'}}).179(13.62Un33.36(13)).start()},E:16(k,p){22 e=$E('19',{'180':k});if(p)e.85(p);17 e}});21.81((16(p){22 f=p.38;22 e=p.97;17{38:16(c){if(c&&c.93)17 13.135(c.93,{67:16(r){13.73(c).103(c.94).32.59(r.133)}.36(13)});172 17 f.82(13,43)},135:16(u,o){22 o=o||{};$w('onCreate 67').each(16(n){o[n]=o[n]?isArray(o[n])?o[n]:[o[n]]:[]});if(o.67.empty()&&!o.onSuccess)o.67.push(16(r){13.32.59(r.133)}.36(13));o.onCreate.unshift(13.130.36(13));o.67.push(13.62.36(13));o.method=o.method||'get';17 13.38ing184(Xhr.135.36(Xhr,u,o))},130:16(){13.56=119;13.33().24182.105('14-24-33-56');17 13},97:16(){22 r=e.82(13,43);22 s=13.E('14-24-33-79',13.24182);22 b='1234'.87('').map(16(a){17 $E('19',{'180':a==1?'glow':173}).85(s)});(16(){22 d=b.pop();d.85(s,'86');b.unshift(d)}).periodical(400);17 r}}})(21.90));21.81((16(p){22 d=p.38;22 o=p.97;22 b=p.63;17{38:16(c){13.28=(c&&c.47)?c:173;17 d.82(13,43)},97:16(){22 r=o.82(13,43);13.117189=13.E('14-117-68',13.29).91(13.38188.36(13)).59(21.110.188Text).set('94',21.110.170).49();13.137189=13.E('14-137-68',13.29).91(13.38183.36(13)).59(21.110.183Text).set('94',21.110.167).49();17 r},63:16(){22 r=b.82(13,43);51.176(16(e){if(e.149==37){e.s86();13.38188()}if(e.149==39){e.s86();13.38183()}}.36(13));17 r},38188:16(){if(13.153()&&13.26.143()&&!13.56)13.38(13.28.47[13.28.47.140(13.28)-1]);17 13},38183:16(){if(13.147()&&13.26.143()&&!13.56)13.38(13.28.47[13.28.47.140(13.28)+1]);17 13},129:16(){13.117189[13.153()?'38':'49']();13.137189[13.147()?'38':'49']();17 13},153:16(){17 13.28&&13.28.47&&13.28.47.118()!=13.28},147:16(){17 13.28&&13.28.47&&13.28.47.168()!=13.28},73:16(l){if(171(l)){22 r=13.31.113.87('[').168(),v=l.get(r.87('^=').118())||'',a=v.match(/\\[(.+?)\\]/);if(a){22 m=r.87('^=').168().87(']').118();l.47=$$(13.31.113.replace(m,\"'\"+m+\"[\"+a[1]+\"]'\"))}}13.28=l;17 13}}})(21.90));21.81((16(){22 o=21.90.38;17{127:$w('jpg jpeg gif png bmp'),38:16(c){13.26[(c&&(c.tagName=='IMG'||13.111(c.93)))?'105':'76']('14-70');if(c&&c.93&&13.111(c.93))17 13.38ing184(16(){13.73(c).130();22 i=175 Image();i.on135=13.59Image.36(13,i,c);i.src=c.93}.36(13));172 17 o.82(13,43)},59Image:16(i,l){13.32.59(i);13.129().103(l.94).62()},111:16(u){17 13.127.81(String(u).toLowerCase().87('?').118().87('.').168())}}})());21.81((16(p){22 o=p.38;22 e={139:['D27CDB6E-AE6D-11cf-96B8-444553540000','163://down135.macro116.com/pub/165/cabs/flash/139lash.cab#version=6,0,40,0','application/x-165-flash']};16 b(a,t){22 s=' 48=\"'+13.31.116Width+'\" 41=\"'+13.31.116185+'\"';17 '<object 180id=\"clsid:'+e[t][0]+'\" codebase=\"'+e[t][1]+'\"'+s+'>'+'<param name=\"src\" value=\"'+a+'\" />'+'<embed src=\"'+a+'\" type=\"'+e[t][2]+'\"'+s+' />'+'</object>'};16 c(l){if(171(l)&&l.93){22 a=l.93;17 21.Medias.map(16(d){17 a.match(d[0])?b.call(13,a.replace(d[0],d[1]),d[2]):173},13).compact()[0]}}17{38:16(l){22 m=c.call(13,l);13.26[m?'105':'76']('14-116');if(m){13.32.59(m);17 13.38ing184(16(){13.73(l).103(l.94)}.36(13))}17 o.82(13,43)}}})(21.90));21.extend({49:16(){13.141.each('49')},38:16(){17 13.inst('38',43)},135:16(){17 13.inst('135',43)},inst:16(n,a){22 i=175 21();17 i[n].82(i,a)}});$(51.51Element).91(16(e){22 t=$(e.target);22 s=[t].concat(t.parents());22 l=s.slice(0,s.length-2).118('match',21.154.113);if(l){e.s86();175 21(eval('('+l.get('data-14-31')+')')).38(l)}});51.write(\"<72 type=\\\"178/css\\\">19.14{46:fixed;86:104;74:104;48:169%;178-155:center;z-index:9999}19.14 19{line-41:normal}19.14-33er{46:57;86:104;74:104;48:169%;41:169%;30-69:#000;151:0.84;filter:alpha(151=84)}19.14-29{83:125-b33;*83:125;*zoom:1;46:relative;178-155:74;80-89:1.177}19.14-24-124{30-69:101;80:146;58-64:.177;-moz-58-64:.177;-161-58-64:.177}19.14-24{46:relative;41:162;48:162;min-41:162;min-48:162;overflow:hidden;*30-69:101}19.14-32{46:57;*30-69:101}19.14-24-33{30-69:101;46:57;74:104;86:104;48:169%;41:169%;178-155:center}19.14-24-33-79{83:166;46:57;89:0;142:0}19.14-24-33-79 19{float:74;48:.5em;41:.9em;30:#AAA;108-74:.146;-moz-58-64:.15em;-161-58-64:.15em}19.14-24-33-79 19.glow{30:#666;41:146;108-86:-0.05em}19.14-24-33-56 19.14-24-33-79{83:125-b33;*83:125;*zoom:1}19.14-24-33-102{30:166}19.14-75{41:1.138;108:0 .7em;108-89:.146;101-space:no124;69:#DDD;121-weight:bold;121-size:1.177;121-family:Helvetica}19.14-122-107,19.14-117-68,19.14-137-68{46:57;89:0;69:#888;cursor:pointer;121-size:150%;121-weight:bold;121-family:Arial}19.14-122-107:hover,19.14-117-68:hover,19.14-137-68:hover{69:101}19.14-122-107{142:.5em}19.14-117-68,19.14-137-68{80:0 .138;89:2px}19.14-117-68{74:.138}19.14-137-68{74:138}19.14-70 19.14-24-124,19.14-116 19.14-24-124{80:0;58:1px solid #777;58-64:104;-moz-58-64:104;-161-58-64:104}19.14-70 19.14-32 img{vertical-155:middle}19.14-70 19.14-75,19.14-116 19.14-75{108-74:.138}19.14-70 19.14-24-124,19.14-70 19.14-24-33,19.14-116 19.14-24-124,19.14-116 19.14-24-33{30-69:#DDD}19.14-70 19.14-24-33-79{89:146;142:146}19.14-70 19.14-122-107{142:.138}19.14-70 19.14-117-68{74:0}</72>\");",",,,,,,,,,,,,,this,lightbox,,function,return,,div,,Lightbox,var,,body,,element,,roadLink,dialog,background,options,content,lock,,,bind,,show,,,height,,arguments,,,position,roadtrip,width,hide,,document,sizes,,,,loading,absolute,border,update,bodyLock,showingSelf,resize,connectEvents,radius,fxDuration,,onComplete,link,color,image,setStyle,style,checkTheRoad,left,caption,removeClass,,toInt,spinner,padding,include,apply,display,,insertTo,top,split,,bottom,prototype,onClick,Browser,href,title,showNext,,build,showPrev,,,white,transparent,setTitle,0px,addClass,bodyWrap,button,margin,locker,i18n,isImageUrl,showCloseButton,cssRule,documentElement,hideOnOutClick,media,prev,first,true,boxResize,font,close,,wrap,inline,window,IMAGE_FORMATS,minBodyHeight,checkRoadtrip,loadLock,duration,blockContent,responseText,resizeUnlock,load,stop,next,2em,swf,indexOf,boxes,right,visible,contentSize,false,1em,hasNext,mediaHeight,keyCode,,opacity,updateImage,hasPrev,Options,align,resizeLock,CloseTitle,mediaWidth,lsaquo,rsaquo,webkit,10em,http,hideOnEsc,shockwave,none,NextTitle,last,100,PrevTitle,isElement,else,null,CloseText,new,onKeydown,6em,text,onFinish,class,resizeFx,Lock,Next,Self,Height,Button,Wrap,Prev,Link".split(",")));
@@ -4,37 +4,31 @@
4
4
  * The library released under terms of the MIT license
5
5
  * Visit http://rightjs.org for more details
6
6
  *
7
- * Copyright (C) 2008-2009 Nikolay V. Nemshilov aka St.
7
+ * Copyright (C) 2008-2010 Nikolay V. Nemshilov
8
8
  */
9
9
  /**
10
10
  * Old IE browser hacks
11
11
  *
12
12
  * Keep them in one place so they were more compact
13
13
  *
14
- * Copyright (C) 2009-2010 Nikolay V. Nemshilov aka St.
14
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
15
15
  */
16
16
  if (Browser.OLD) {
17
17
  // loads DOM element extensions for selected elements
18
18
  $ = (function(old_function) {
19
19
  return function(id) {
20
20
  var element = old_function(id);
21
+
22
+ // old IE browses match both, ID and NAME
23
+ if (element !== null && isString(id) && element.id !== id)
24
+ element = $$('#'+id)[0];
25
+
21
26
  return element ? Element.prepare(element) : element;
22
27
  }
23
28
  })($);
24
29
 
25
30
 
26
31
  $ext(document, {
27
- /* TODO Not sure about this thing for now
28
- It's kinda makes sense, but it will perform
29
- double check in node search operations
30
-
31
- getElementById: (function(old_method) {
32
- return function(id) {
33
- return Element.prepare(old_method(id));
34
- };
35
- })(document.getElementById),
36
- */
37
-
38
32
  /**
39
33
  * Overloading the native method to extend the new elements as it is
40
34
  * in all the other browsers
@@ -62,7 +56,7 @@ if (Browser.OLD) {
62
56
  if (element && element.tagName && !element.set) {
63
57
  $ext(element, Element.Methods, true);
64
58
 
65
- if (self['Form']) {
59
+ if (window.Form) {
66
60
  switch(element.tagName) {
67
61
  case 'FORM':
68
62
  Form.ext(element);
@@ -95,7 +89,7 @@ if (Browser.OLD) {
95
89
  /**
96
90
  * Konqueror browser fixes
97
91
  *
98
- * Copyright (C) 2009-2010 Nikolay V. Nemshilov aka St.
92
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
99
93
  */
100
94
 
101
95
  /**
@@ -124,6 +118,13 @@ if (!$E('p').getBoundingClientRect) {
124
118
  return {x: left, y: top};
125
119
  }
126
120
  });
121
+
122
+ // Konq doesn't have the Form#elements reference
123
+ Form.include({
124
+ getElements: function() {
125
+ return this.select('input,select,textarea,button');
126
+ }
127
+ })
127
128
  }
128
129
 
129
130
 
@@ -139,7 +140,7 @@ if (!$E('p').getBoundingClientRect) {
139
140
  * - Sizzle (http://sizzlejs.org) Copyright (C) John Resig
140
141
  * - MooTools (http://mootools.net) Copyright (C) Valerio Proietti
141
142
  *
142
- * Copyright (C) 2009-2010 Nikolay V. Nemshilov aka St.
143
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
143
144
  */
144
145
  if (!document.querySelector) {
145
146
  Element.include((function() {
@@ -297,7 +298,7 @@ if (!document.querySelector) {
297
298
  * @return Object atom matcher
298
299
  */
299
300
  var atoms_cache = {};
300
- var build_atom = function(atom) {
301
+ function build_atom(atom) {
301
302
  if (!atoms_cache[atom]) {
302
303
  //
303
304
  // HACK HACK HACK
@@ -346,11 +347,7 @@ if (!document.querySelector) {
346
347
  // a list of elements in a single call
347
348
  //
348
349
  if (i || c.length || a || p) {
349
- var filter = 'function(y){'+
350
- 'var e,r=[];'+
351
- 'for(var z=0,x=y.length;z<x;z++){'+
352
- 'e=y[z];_f_'+
353
- '}return r}';
350
+ var filter = 'function(y){var e,r=[];for(var z=0,x=y.length;z<x;z++){e=y[z];_f_}return r}';
354
351
  var patch_filter = function(code) {
355
352
  filter = filter.replace('_f_', code + '_f_');
356
353
  };
@@ -360,31 +357,12 @@ if (!document.querySelector) {
360
357
 
361
358
  // adding the classes matching code
362
359
  if (c.length) patch_filter(
363
- 'if(e.className){'+
364
- 'var n=e.className.split(" ");'+
365
- 'if(n.length==1&&c.indexOf(n[0])==-1)continue;'+
366
- 'else{'+
367
- 'for(var i=0,l=c.length,b=false;i<l;i++)'+
368
- 'if(n.indexOf(c[i])==-1){'+
369
- 'b=true;break;}'+
370
-
371
- 'if(b)continue;}'+
372
- '}else continue;'
360
+ 'if(e.className){var n=e.className.split(" ");if(n.length==1&&c.indexOf(n[0])==-1)continue;else{for(var i=0,l=c.length,b=false;i<l;i++)if(n.indexOf(c[i])==-1){b=true;break;}if(b)continue;}}else continue;'
373
361
  );
374
362
 
375
363
  // adding the attributes matching conditions
376
364
  if (a) patch_filter(
377
- 'var p,o,v,b=false;'+
378
- 'for (var k in a){p=e.getAttribute(k)||"";o=a[k].o;v=a[k].v;'+
379
- 'if('+
380
- '(o=="="&&p!=v)||'+
381
- '(o=="*="&&!p.includes(v))||'+
382
- '(o=="^="&&!p.startsWith(v))||'+
383
- '(o=="$="&&!p.endsWith(v))||'+
384
- '(o=="~="&&!p.split(" ").includes(v))||'+
385
- '(o=="|="&&!p.split("-").includes(v))'+
386
- '){b=true;break;}'+
387
- '}if(b){continue;}'
365
+ 'var p,o,v,b=false;for (var k in a){p=e.getAttribute(k)||"";o=a[k].o;v=a[k].v;if((o=="="&&p!=v)||(o=="*="&&!p.includes(v))||(o=="^="&&!p.startsWith(v))||(o=="$="&&!p.endsWith(v))||(o=="~="&&!p.split(" ").includes(v))||(o=="|="&&!p.split("-").includes(v))){b=true;break;}}if(b){continue;}'
388
366
  );
389
367
 
390
368
  // adding the pseudo matchers check
@@ -393,7 +371,7 @@ if (!document.querySelector) {
393
371
  patch_filter('if(!s[p].call(e,v,s))continue;');
394
372
  }
395
373
 
396
- desc.filter = eval('({f:'+ filter.replace('_f_', 'r.push(e)') +'})').f;
374
+ desc.filter = eval('['+ filter.replace('_f_', 'r.push(e)') +']')[0];
397
375
  }
398
376
 
399
377
  atoms_cache[atom] = desc;
@@ -409,7 +387,7 @@ if (!document.querySelector) {
409
387
  * @return Function selector
410
388
  */
411
389
  var tokens_cache = {};
412
- var build_selector = function(rule) {
390
+ function build_selector(rule) {
413
391
  var rule_key = rule.join('');
414
392
  if (!tokens_cache[rule_key]) {
415
393
  for (var i=0; i < rule.length; i++) {
@@ -475,7 +453,7 @@ if (!document.querySelector) {
475
453
  * @return Array of selectors
476
454
  */
477
455
  var selectors_cache = {}, chunks_cache = {};
478
- var split_rule_to_selectors = function(css_rule) {
456
+ function split_rule_to_selectors(css_rule) {
479
457
  if (!selectors_cache[css_rule]) {
480
458
  chunker.lastIndex = 0;
481
459
 
@@ -511,7 +489,7 @@ if (!document.querySelector) {
511
489
  * @param String raw css-rule
512
490
  * @return Array search result
513
491
  */
514
- var select_all = function(element, css_rule) {
492
+ function select_all(element, css_rule) {
515
493
  var selectors = split_rule_to_selectors(css_rule), result = [];
516
494
  for (var i=0, length = selectors.length; i < length; i++)
517
495
  result = result.concat(selectors[i](element));
@@ -541,7 +519,7 @@ if (!document.querySelector) {
541
519
  $ext(document, dom_extension);
542
520
 
543
521
  // patching the $$ function to make it more efficient
544
- self.$$ = function(css_rule) {
522
+ window.$$ = function(css_rule) {
545
523
  return select_all(document, css_rule || '*');
546
524
  };
547
525
 
@@ -4,6 +4,6 @@
4
4
  * The library released under terms of the MIT license
5
5
  * Visit http://rightjs.org for more details
6
6
  *
7
- * Copyright (C) 2008-2009 Nikolay V. Nemshilov aka St.
7
+ * Copyright (C) 2008-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})("if(49.64){$=(7(o){8 7(i){9 e=o(i);8 e?14.23(e):e}})($);44(22,{create14:(7(o){8 7(t){8 14.23(o(t))}})(22.create14)});44(14,{23:7(e){if(e&&e.11&&!e.set){44(e,14.53,30);if(61['56'])switch(e.11){37 'FORM':56.63(e);34;37 'INPUT':37 'SELECT':37 'BUTTON':37 'TEXTAREA':56.14.63(e);34}}8 e}});14.38((7(){9 o=14.53.46;8{46:7(a,c){8 o.21(12,a,c).each(14.23)}}})())}if(!$E('p').getBoundingClientRect)14.38({28:7(){9 l=12.offsetLeft,t=12.offsetTop,a=12.45('28'),p=12.31,b=12.ownerDocument.body;16(p&&p.11){if(p===b||p.45('28')!='static'){if(p!==b||a!='absolute'){9 s=p.28();l+=s.x;t+=s.y}34}p=p.31}8{x:l,y:t}}});if(!22.querySelector)14.38((7(){9 H={' ':7(e,t){8 $A(e.get14sByTagName(t))},'>':7(e,t){9 r=[],n=e.27Child;16(n){if(t=='*'||n.11==t)r.29(n);n=n.19}8 r},'+':7(e,t){16(e=e.19)if(e.11)8(t=='*'||e.11==t)?[e]:[];8[]},'~':7(e,t){9 r=[];16(e=e.19)if(t=='*'||e.11==t)r.29(e);8 r}};9 G={52:7(){8 12.52},48:7(){8 12.48},empty:7(){8!(12.innerT63||12.innerHTML||12.t63Content||'').13},'27-17':7(t){9 n=12;16(n=n.20)if(n.11&&(!t||n.11==t))8 25;8 30},'27-of-43':7(){8 15[1]['27-17'].21(12,12.11)},'42-17':7(t){9 n=12;16(n=n.19)if(n.11&&(!t||n.11==t))8 25;8 30},'42-of-43':7(){8 15[1]['42-17'].21(12,12.11)},'55-17':7(t,m){8 m['27-17'].21(12,t)&&m['42-17'].21(12,t)},'55-of-43':7(){8 15[1]['55-17'].21(12,12.11,15[1])},'59-17':7(d,c,t){if(!12.31)8 25;d=d.toLower67();if(d=='n')8 30;if(d.26('n')){9 a=b=0;if(m=d.24(/^([+-]?\\d*)?n([+-]?\\d*)?$/)){a=m[1]=='-'?-1:47(m[1],10)||1;b=47(m[2],10)||0}9 i=1,n=12;16((n=n.20))if(n.11&&(!t||n.11==t))i++;8(i-b)% a==0&&(i-b)/a>=0}36 8 c['60'].21(12,d.58()-1,c,t)},'59-of-43':7(n){8 15[1]['59-17'].21(12,n,15[1],12.11)},60:7(a,m,t){a=is66(a)?a.58():a;9 n=12,c=0;16((n=n.20))if(n.11&&(!t||n.11==t)&&++c>a)8 25;8 c==a}};9 A=/((?:\\((?:\\([^()]+\\)|[^()]+)+\\)|\\[(?:\\[[^[\\]]*\\]|['\"][^'\"]*['\"]|[^[\\]'\"]+)+\\]|\\\\.|[^ >+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?/g;9 E=/#([\\w\\-_]+)/;9 L=/^[\\w\\*]+/;9 C=/\\.([\\w\\-\\._]+)/;9 F=/:([\\w\\-]+)(\\((.+?)\\))*$/;9 w=/\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*((['\"])([^\\4]*?)\\4|([^'\"][^\\]]*?)))?\\]/;9 q={};9 x=7(b){if(!q[b]){9 i,t,c,a,p,v,m,d={};16(m=b.24(w)){a=a||{};a[m[1]]={o:m[2],v:m[5]||m[6]};b=b.33(m[0],'')}if(m=b.24(F)){p=m[1];v=m[3]==''?62:m[3];b=b.33(m[0],'')}i=(b.24(E)||[1,62])[1];t=(b.24(L)||'*').to66().toUpper67();c=(b.24(C)||[1,''])[1].39('.').without('');d.65=t;if(i||c.13||a||p){9 f='7(y){'+'9 e,r=[];'+'32(9 z=0,x=y.13;z<x;z++){'+'e=y[z];50'+'}8 r}';9 e=7(c){f=f.33('50',c+'50')};if(i)e('if(e.id!=i)18;');if(c.13)e('if(e.41){'+'9 n=e.41.39(\" \");'+'if(n.13==1&&c.54(n[0])==-1)18;'+'36{'+'32(9 i=0,l=c.13,b=25;i<l;i++)'+'if(n.54(c[i])==-1){'+'b=30;34;}'+'if(b)18;}'+'}36 18;');if(a)e('9 p,o,v,b=25;'+'32 (9 k in a){p=e.getAttribute(k)||\"\";o=a[k].o;v=a[k].v;'+'if('+'(o==\"=\"&&p!=v)||'+'(o==\"*=\"&&!p.26(v))||'+'(o==\"^=\"&&!p.starts68(v))||'+'(o==\"$=\"&&!p.ends68(v))||'+'(o==\"~=\"&&!p.39(\" \").26(v))||'+'(o==\"|=\"&&!p.39(\"-\").26(v))'+'){b=30;34;}'+'}if(b){18;}');if(p&&G[p]){9 s=G;e('if(!s[p].21(e,v,s))18;')}d.40=eval('({f:'+f.33('50','r.29(e)')+'})').f}q[b]=d}8 q[b]};9 M={};9 y=7(g){9 h=g.join('');if(!M[h]){32(9 i=0;i<g.13;i++)g[i][1]=x(g[i][1]);9 c=$uid;9 k=7(e){9 b=[],a=[],u;32(9 i=0,l=e.13;i<l;i++){u=c(e[i]);if(!a[u]){b.29(e[i]);a[u]=30}}8 b};9 d=7(e,a){9 r=H[a[0]](e,a[1].65);8 a[1].40?a[1].40(r):r};M[h]=7(e){9 f,s;32(9 i=0,a=g.13;i<a;i++){if(i==0)f=d(e,g[i]);36{if(i>1)f=k(f);32(9 j=0;j<f.13;j++){s=d(f[j],g[i]);s.51(1);s.51(j);f.splice.apply(f,s);j+=s.13-3}}}8 g.13>1?k(f):f}}8 M[h]};9 J={},B={};9 K=7(c){if(!J[c]){A.42Index=0;9 b=[],a=[],r=' ',m,t;16(m=A.exec(c)){t=m[1];if(t=='+'||t=='>'||t=='~')r=t;36{a.29([r,t]);r=' '}if(m[2]){b.29(y(a));a=[]}}b.29(y(a));J[c]=b}8 J[c]};9 I=7(e,c){9 s=K(c),r=[];32(9 i=0,l=s.13;i<l;i++)r=r.concat(s[i](e));if(49.64)r.32Each(14.23);8 r};9 D={27:7(c){8 12.57(c).27()},57:7(c){8 I(12,c||'*')}};44(22,D);61.$$=7(c){8 I(22,c||'*')};8 D})());",",,,,,,,function,return,var,,tagName,this,length,Element,arguments,while,child,continue,nextSibling,previousSibling,call,document,prepare,match,false,includes,first,position,push,true,parentNode,for,replace,break,createElement,else,case,include,split,filter,className,last,type,$ext,getStyle,rCollect,parseInt,disabled,Browser,_f_,unshift,checked,Methods,indexOf,only,Form,select,toInt,nth,index,self,null,ext,OLD,tag,String,Case,With".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})("if(56.66){$=(7(o){8 7(i){9 e=o(i);if(e!==58&&50(i)&&e.id!==i)e=$$('#'+i)[0];8 e?14.23(e):e}})($);46(21,{create14:(7(o){8 7(t){8 14.23(o(t))}})(21.create14)});46(14,{23:7(e){if(e&&e.11&&!e.set){46(e,14.53,29);if(60.45)switch(e.11){39 'FORM':45.64(e);35;39 'INPUT':39 'SELECT':39 'BUTTON':39 'TEXTAREA':45.14.64(e);35}}8 e}});14.34((7(){9 o=14.53.49;8{49:7(a,c){8 o.22(12,a,c).each(14.23)}}})())}if(!$E('p').getBoundingClientRect){14.34({27:7(){9 l=12.offsetLeft,t=12.offsetTop,a=12.51('27'),p=12.31,b=12.ownerDocument.body;15(p&&p.11){if(p===b||p.51('27')!='static'){if(p!==b||a!='absolute'){9 s=p.27();l+=s.x;t+=s.y}35}p=p.31}8{x:l,y:t}}});45.34({get14s:7(){8 12.37('input,37,t64area,button')}})}if(!21.querySelector)14.34((7(){9 H={' ':7(e,t){8 $A(e.get14sByTagName(t))},'>':7(e,t){9 r=[],n=e.26Child;15(n){if(t=='*'||n.11==t)r.30(n);n=n.19}8 r},'+':7(e,t){15(e=e.19)if(e.11)8(t=='*'||e.11==t)?[e]:[];8[]},'~':7(e,t){9 r=[];15(e=e.19)if(t=='*'||e.11==t)r.30(e);8 r}};9 G={57:7(){8 12.57},47:7(){8 12.47},empty:7(){8!(12.innerT64||12.innerHTML||12.t64Content||'').13},'26-16':7(t){9 n=12;15(n=n.20)if(n.11&&(!t||n.11==t))8 24;8 29},'26-of-44':7(){8 17[1]['26-16'].22(12,12.11)},'42-16':7(t){9 n=12;15(n=n.19)if(n.11&&(!t||n.11==t))8 24;8 29},'42-of-44':7(){8 17[1]['42-16'].22(12,12.11)},'59-16':7(t,m){8 m['26-16'].22(12,t)&&m['42-16'].22(12,t)},'59-of-44':7(){8 17[1]['59-16'].22(12,12.11,17[1])},'63-16':7(d,c,t){if(!12.31)8 24;d=d.toLower68();if(d=='n')8 29;if(d.25('n')){9 a=b=0;if(m=d.28(/^([+-]?\\d*)?n([+-]?\\d*)?$/)){a=m[1]=='-'?-1:48(m[1],10)||1;b=48(m[2],10)||0}9 i=1,n=12;15((n=n.20))if(n.11&&(!t||n.11==t))i++;8(i-b)% a==0&&(i-b)/a>=0}38 8 c['61'].22(12,d.62()-1,c,t)},'63-of-44':7(n){8 17[1]['63-16'].22(12,n,17[1],12.11)},61:7(a,m,t){a=50(a)?a.62():a;9 n=12,c=0;15((n=n.20))if(n.11&&(!t||n.11==t)&&++c>a)8 24;8 c==a}};9 A=/((?:\\((?:\\([^()]+\\)|[^()]+)+\\)|\\[(?:\\[[^[\\]]*\\]|['\"][^'\"]*['\"]|[^[\\]'\"]+)+\\]|\\\\.|[^ >+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?/g;9 E=/#([\\w\\-_]+)/;9 L=/^[\\w\\*]+/;9 C=/\\.([\\w\\-\\._]+)/;9 F=/:([\\w\\-]+)(\\((.+?)\\))*$/;9 w=/\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*((['\"])([^\\4]*?)\\4|([^'\"][^\\]]*?)))?\\]/;9 q={};7 x(b){if(!q[b]){9 i,t,c,a,p,v,m,d={};15(m=b.28(w)){a=a||{};a[m[1]]={o:m[2],v:m[5]||m[6]};b=b.33(m[0],'')}if(m=b.28(F)){p=m[1];v=m[3]==''?58:m[3];b=b.33(m[0],'')}i=(b.28(E)||[1,58])[1];t=(b.28(L)||'*').toString().toUpper68();c=(b.28(C)||[1,''])[1].40('.').without('');d.65=t;if(i||c.13||a||p){9 f='7(y){9 e,r=[];32(9 z=0,x=y.13;z<x;z++){e=y[z];55}8 r}';9 e=7(c){f=f.33('55',c+'55')};if(i)e('if(e.id!=i)18;');if(c.13)e('if(e.43){9 n=e.43.40(\" \");if(n.13==1&&c.54(n[0])==-1)18;38{32(9 i=0,l=c.13,b=24;i<l;i++)if(n.54(c[i])==-1){b=29;35;}if(b)18;}}38 18;');if(a)e('9 p,o,v,b=24;32 (9 k in a){p=e.getAttribute(k)||\"\";o=a[k].o;v=a[k].v;if((o==\"=\"&&p!=v)||(o==\"*=\"&&!p.25(v))||(o==\"^=\"&&!p.starts67(v))||(o==\"$=\"&&!p.ends67(v))||(o==\"~=\"&&!p.40(\" \").25(v))||(o==\"|=\"&&!p.40(\"-\").25(v))){b=29;35;}}if(b){18;}');if(p&&G[p]){9 s=G;e('if(!s[p].22(e,v,s))18;')}d.41=eval('['+f.33('55','r.30(e)')+']')[0]}q[b]=d}8 q[b]};9 M={};7 y(g){9 h=g.join('');if(!M[h]){32(9 i=0;i<g.13;i++)g[i][1]=x(g[i][1]);9 c=$uid;9 k=7(e){9 b=[],a=[],u;32(9 i=0,l=e.13;i<l;i++){u=c(e[i]);if(!a[u]){b.30(e[i]);a[u]=29}}8 b};9 d=7(e,a){9 r=H[a[0]](e,a[1].65);8 a[1].41?a[1].41(r):r};M[h]=7(e){9 f,s;32(9 i=0,a=g.13;i<a;i++){if(i==0)f=d(e,g[i]);38{if(i>1)f=k(f);32(9 j=0;j<f.13;j++){s=d(f[j],g[i]);s.52(1);s.52(j);f.splice.apply(f,s);j+=s.13-3}}}8 g.13>1?k(f):f}}8 M[h]};9 J={},B={};7 K(c){if(!J[c]){A.42Index=0;9 b=[],a=[],r=' ',m,t;15(m=A.exec(c)){t=m[1];if(t=='+'||t=='>'||t=='~')r=t;38{a.30([r,t]);r=' '}if(m[2]){b.30(y(a));a=[]}}b.30(y(a));J[c]=b}8 J[c]};7 I(e,c){9 s=K(c),r=[];32(9 i=0,l=s.13;i<l;i++)r=r.concat(s[i](e));if(56.66)r.32Each(14.23);8 r};9 D={26:7(c){8 12.37(c).26()},37:7(c){8 I(12,c||'*')}};46(21,D);60.$$=7(c){8 I(21,c||'*')};8 D})());",",,,,,,,function,return,var,,tagName,this,length,Element,while,child,arguments,continue,nextSibling,previousSibling,document,call,prepare,false,includes,first,position,match,true,push,parentNode,for,replace,include,break,createElement,select,else,case,split,filter,last,className,type,Form,$ext,disabled,parseInt,rCollect,isString,getStyle,unshift,Methods,indexOf,_f_,Browser,checked,null,only,window,index,toInt,nth,ext,tag,OLD,With,Case".split(",")));
@@ -4,15 +4,14 @@
4
4
  *
5
5
  * http://github.com/MadRabbit/right-rails
6
6
  *
7
- * Copyright (C) Nikolay V. Nemshilov aka St.
7
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
8
8
  */
9
9
 
10
10
  /**
11
11
  * RR is the common ajax operations wrapper for ruby on rails
12
12
  *
13
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
13
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
14
14
  */
15
- ;
16
15
  var RR = {
17
16
  /**
18
17
  * Basic options
@@ -31,6 +30,9 @@ var RR = {
31
30
 
32
31
  removeFx: 'fade',
33
32
 
33
+ linkToAjaxEdit: '.ajax_edit',
34
+ linkToAjaxDelete: '.ajax_delete',
35
+
34
36
  rescanWithScopes: true // if it should rescan only updated elements
35
37
  },
36
38
 
@@ -164,29 +166,23 @@ var RR = {
164
166
  },
165
167
 
166
168
  /**
167
- * Hijacks the action links and makes them remote
169
+ * watches link clicks and processes the ajax edit/delete operations
168
170
  *
169
- * @return RR self
171
+ * @param Event event
170
172
  */
171
- hijack_links: function() {
172
- this._links = this._links || [];
173
+ process_click: function(event) {
174
+ var target = event.target, link = [target].concat(target.parents()).first('match', 'a');
173
175
 
174
- $$('a.edit, a.destroy').each(function(link) {
175
- var uid = $uid(link);
176
- if (!this._links[uid]) {
177
- this._links[uid] = true;
176
+ if (link) {
177
+ if (link.match(this.Options.linkToAjaxEdit)) {
178
+ event.stop();
179
+ Xhr.load(link.href + '.' + this.Options.format);
178
180
 
179
- if (link.hasClass('destroy')) {
180
- link.onclick = eval('({f:'+ link.onclick.toString().replace('.submit', '.send')+'})').f;
181
- } else if (link.hasClass('edit')) {
182
- link.onclick = function(event) { event.stop();
183
- Xhr.load(link.href + '.' + this.Options.format);
184
- }.bind(this);
185
- }
181
+ } else if (link.match(this.Options.linkToAjaxDelete) && link.has('onclick')) {
182
+ event.stop();
183
+ eval('({f:'+ link.onclick.toString().replace('.submit', '.send')+'})').f.call(link);
186
184
  }
187
- }, this);
188
-
189
- return this;
185
+ }
190
186
  },
191
187
 
192
188
  /**
@@ -195,10 +191,7 @@ var RR = {
195
191
  * @return RR this
196
192
  */
197
193
  rescan: function(scope) {
198
- this.hijack_links();
199
-
200
- $w('Lightbox Calendar Autocompleter Draggable Droppable Sortable Tabs Slider Rater Selectable'
201
- ).each(function(name) {
194
+ $w('Draggable Droppable Tabs Slider Selectable').each(function(name) {
202
195
  if (self[name]) self[name].rescan(this.Options.rescanWithScopes ? scope : null);
203
196
  }, this);
204
197
 
@@ -207,14 +200,99 @@ var RR = {
207
200
  }
208
201
  };
209
202
 
203
+ /**
204
+ * Rails 3 UJS support module
205
+ *
206
+ * Copyright (C) 2010 Nikolay V. Nemshilov
207
+ */
208
+ (function() {
209
+ // tries to cancel the event via confirmation
210
+ var user_cancels = function(event, element) {
211
+ var message = element.get('data-confirm');
212
+ if (message && !confirm(message)) {
213
+ event.stop();
214
+ return true;
215
+ }
216
+ };
217
+
218
+ // adds XHR events to the element
219
+ var add_xhr_events = function(element, options) {
220
+ return Object.merge({
221
+ onCreate: function() { element.fire('ajax:loading', this) },
222
+ onComplete: function() { element.fire('ajax:complete', this) },
223
+ onSuccess: function() { element.fire('ajax:success', this) },
224
+ onFailure: function() { element.fire('ajax:failure', this) }
225
+ }, options);
226
+ };
227
+
228
+ // processes link clicks
229
+ var try_link_submit = function(event, link) {
230
+ var method = link.get('data-method'), remote = link.get('data-remote');
231
+
232
+ if (user_cancels(event, link)) return;
233
+ if (method || remote) event.stop();
234
+
235
+ if (remote)
236
+ Xhr.load(link.href, add_xhr_events(link, {
237
+ method: method || 'get',
238
+ spinner: link.get('data-spinner')
239
+ }));
240
+
241
+ else if (method) {
242
+ var param = $$('meta[name=csrf-param]')[0],
243
+ token = $$('meta[name=csrf-token]')[0],
244
+ form = $E('form', {action: link.href, method: 'post'});
245
+
246
+ if (param && token)
247
+ form.insert('<input type="hidden" name="'+param.get('content')+'" value="'+token.get('content')+'" />');
248
+ form.insert('<input type="hidden" name="_method" value="'+method+'"/>')
249
+ .insertTo(document.body).submit();
250
+ }
251
+ };
252
+
253
+ // processes form submits
254
+ var try_form_submit = function(event, button) {
255
+ if (!user_cancels(event, button) && $(button.form).has('data-remote')) {
256
+ event.stop();
257
+ button.form.send(add_xhr_events(button.form));
258
+ }
259
+ };
260
+
261
+ // global events listeners
262
+ document.on({
263
+ click: function (event) {
264
+ var target = event.target, form = target.form,
265
+ link = [target].concat(target.parents()).first('match', 'a');
266
+
267
+ if (form && ['submit', 'image'].include(target.type))
268
+ try_form_submit(event, target);
269
+ else if (link)
270
+ try_link_submit(event, link);
271
+ },
272
+
273
+ keydown: function(event) {
274
+ var target = event.target, form = target.form;
275
+ if (form && target.tagName === 'INPUT' && event.keyCode == 13) {
276
+ try_form_submit(event, target);
277
+ }
278
+ }
279
+ });
280
+ })();
281
+
210
282
  // the document onload hook
211
- document.onReady(function() {
212
- RR.hide_flash().rescan();
283
+ document.on({
284
+ ready: function() {
285
+ RR.hide_flash();
286
+ },
287
+
288
+ click: function(event) {
289
+ RR.process_click(event);
290
+ }
213
291
  });
214
292
  /**
215
293
  * Underscored aliases for Ruby On Rails
216
294
  *
217
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
295
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
218
296
  */
219
297
 
220
298
  // the language and window level aliases
@@ -222,7 +300,7 @@ document.onReady(function() {
222
300
  for (var key in object) {
223
301
  try { // some keys are not accessable
224
302
 
225
- if (/[A-Z]/.test(key) && typeof(object[key]) == 'function') {
303
+ if (/[A-Z]/.test(key) && typeof(object[key]) === 'function') {
226
304
  var u_key = key.underscored();
227
305
  if (object[u_key] === null || object[u_key] === undefined) {
228
306
  object[u_key] = object[key];
@@ -238,12 +316,12 @@ document.onReady(function() {
238
316
  var aliases = {}, methods = object.Methods;
239
317
 
240
318
  for (var key in methods) {
241
- if (/[A-Z]/.test(key) && typeof(methods[key]) == 'function') {
319
+ if (/[A-Z]/.test(key) && typeof(methods[key]) === 'function') {
242
320
  aliases[key.underscored()] = methods[key];
243
321
  }
244
322
  }
245
323
 
246
- object.addMethods(aliases);
324
+ object.include(aliases);
247
325
  });
248
326
 
249
327
 
@@ -4,6 +4,6 @@
4
4
  *
5
5
  * http://github.com/MadRabbit/right-rails
6
6
  *
7
- * Copyright (C) Nikolay V. Nemshilov aka St.
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})(";12 RR={6:{31:'js',26:'flashes',27:'slide',13:3200,1558:42,23:'fade',96160:42},update_flash:4(c){12 e=$(5.6.26);if(e)5.11(e,c).18();7 5},18:4(){if(5.6.13>-1){12 e=$(5.6.26);if(e&&e.visible())e.53.41(e,5.6.27).delay(5.6.13)}7 5},15:4(i){if(5.6.1558)$(i).15();7 5},33:4(a,w){7 5.15($(a).33(w).lastChild).9(a)},11:4(i,s){$(i).11(s);7 5.15(i).9(i)},30:4(i){12 e=$(i);if(e){12 r=e.30.41(e).chain(36.9);if(5.6.23)e.53(5.6.23,{onFinish:r});54 r}},14:4(i){12 f=$(i);if(f)f.remotize().enable().action+='.'+5.6.31;7 5},11_55:4(i,s){12 f=$(i);if(f){f.11(s);5.14(i)}7 5.9(i)},show_55_57:4(i,s){$(i).select('55').25('30');$(i).33(s);7 5.14($(i).first('55')).9(i)},hijack22:4(){5.22=5.22||[];$$('a.50, a.40').25(4(l){12 u=$uid(l);if(!5.22[u]){5.22[u]=42;if(l.34('40'))l.29=eval('({f:'+l.29.to44().11('.submit','.send')+'})').f;54 if(l.34('50')){l.29=4(e){e.stop();Xhr.load(l.href+'.'+5.6.31)}.41(5)}}},5);7 5},9:4(s){5.hijack22();$w('36 Calendar Autocompleter Draggable Droppable Sortable Tabs Slider Rater Selectable').25(4(n){if(56[n])56[n].9(5.6.96160?s:49)},5);7 5}};37.onReady(4(){RR.18().9()});[44.8,48.8,Function.8,Object,6,35,35.8,window,37].25(4(o){57(12 k in o)try{if(/[A-Z]/.52(k)&&46(o[k])=='4'){12 u=k.28();if(o[u]===49||o[u]===undefined)o[u]=o[k]}}catch(e){}});[39,Event,51,51.39].25(4(o){12 a={},m=o.59;57(12 k in m)if(/[A-Z]/.52(k)&&46(m[k])=='4')a[k.28()]=m[k];o.add59(a)});45(44.8,{38:'19',21:'10',to_f:'toFloat',to_i:'toInt',gsub:'11',downcase:'toLower62',upcase:'toUpper62',47:'19',43:'10',strip:'trim'});45(48.8,{collect:'map',detect:'filter',38:'19',21:'10',47:'19',43:'10'});",",,,,function,this,Options,return,prototype,rescan,lastIndexOf,replace,var,flashHideDelay,remotize_form,highlight,rescanWithScopes,highlightUpdates,hide_flash,indexOf,,last_index_of,_links,removeFx,hijack_links,each,flashId,flashHideFx,underscored,onclick,remove,format,,insert,hasClass,Observer,Lightbox,document,index_of,Element,destroy,bind,true,rindex,String,$alias,typeof,index,Array,null,edit,Form,test,hide,else,form,self,for,Updates,Methods,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',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(",")));
@@ -3,14 +3,14 @@
3
3
  *
4
4
  * Visit http://rightjs.org/ui/rater for details
5
5
  *
6
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
6
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
7
7
  */
8
8
  if (!self.RightJS) throw "Gimme RightJS";
9
9
 
10
10
  /**
11
11
  * The Rating widget
12
12
  *
13
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
13
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
14
14
  */
15
15
  var Rater = new Class(Observer, {
16
16
  extend: {
@@ -28,13 +28,9 @@ var Rater = new Class(Observer, {
28
28
  param: 'rate', // the value param name
29
29
  Xhr: null // additional Xhr options
30
30
  },
31
-
32
- // searches and initializes rating units
33
- rescan: function(scope) {
34
- ($(scope)||document).select('div.right-rater').each(function(element) {
35
- if (!element._rater) new Rater(element);
36
- });
37
- }
31
+
32
+ // DEPRECATED: searches and initializes rating units
33
+ rescan: function(scope) {}
38
34
  },
39
35
 
40
36
  /**
@@ -51,6 +47,9 @@ var Rater = new Class(Observer, {
51
47
 
52
48
  if (!this.element) this.element = this.build();
53
49
 
50
+ if (!this.options.value)
51
+ this.options.value = this.element.select('.right-rater-glow').length;
52
+
54
53
  this.element._rater = this.init();
55
54
  },
56
55
 
@@ -241,8 +240,17 @@ var Rater = new Class(Observer, {
241
240
  /**
242
241
  * Document on-load trigger for units auto-discovery
243
242
  *
244
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
243
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
245
244
  */
246
- document.onReady(function() { Rater.rescan(); });
245
+ document.onMouseover(function(event) {
246
+ var target = event.target, element = [target].concat(target.parents()).first('hasClass', 'right-rater');
247
+
248
+ if (element) {
249
+ var rater = element._rater || new Rater(element);
250
+ if (target.parentNode === element)
251
+ target.fire('mouseover');
252
+ }
253
+
254
+ });
247
255
 
248
- document.write("<style type=\"text/css\">div.right-rater,div.right-rater div{margin:0;padding:0;background:none;border:none;display:inline-block;*display:inline;*zoom:1;font-family:Arial;font-size:110%}div.right-rater{width:6em;vertical-align:middle}div.right-rater div{width:1em;height:1em;line-height:1em;text-align:center;cursor:pointer;color:#888}div.right-rater div.right-rater-glow{color:brown;text-shadow:#666 .05em .05em .15em}div.right-rater-disabled div{cursor:default}</style>");
256
+ document.write("<style type=\"text/css\">div.right-rater,div.right-rater div{margin:0;padding:0;background:none;border:none;display:inline-block;*display:inline;*zoom:1;font-family:Arial;font-size:110%}div.right-rater{width:6em;height:1em;vertical-align:middle}div.right-rater div{float:left;width:1em;height:1em;line-height:1em;text-align:center;cursor:pointer;color:#888}div.right-rater div.right-rater-glow{color:brown;text-shadow:#666 .05em .05em .15em}div.right-rater-disabled div{cursor:default}</style>");