right-rails 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/CHANGELOG +5 -0
  2. data/lib/right_rails/helpers/forms.rb +81 -47
  3. data/lib/right_rails/helpers.rb +9 -0
  4. data/public/javascripts/right/autocompleter-src.js +1 -1
  5. data/public/javascripts/right/autocompleter.js +1 -1
  6. data/public/javascripts/right/billboard-src.js +1 -1
  7. data/public/javascripts/right/billboard.js +1 -1
  8. data/public/javascripts/right/calendar-src.js +1 -1
  9. data/public/javascripts/right/calendar.js +1 -1
  10. data/public/javascripts/right/casting-src.js +183 -0
  11. data/public/javascripts/right/casting.js +7 -0
  12. data/public/javascripts/right/colorpicker-src.js +1 -1
  13. data/public/javascripts/right/colorpicker.js +1 -1
  14. data/public/javascripts/right/dialog-src.js +1 -1
  15. data/public/javascripts/right/dialog.js +1 -1
  16. data/public/javascripts/right/dnd-src.js +20 -20
  17. data/public/javascripts/right/dnd.js +2 -2
  18. data/public/javascripts/right/in-edit-src.js +1 -1
  19. data/public/javascripts/right/in-edit.js +1 -1
  20. data/public/javascripts/right/lightbox-src.js +24 -5
  21. data/public/javascripts/right/lightbox.js +2 -2
  22. data/public/javascripts/right/rails-src.js +1 -1
  23. data/public/javascripts/right/rails.js +1 -1
  24. data/public/javascripts/right/rater-src.js +1 -1
  25. data/public/javascripts/right/rater.js +1 -1
  26. data/public/javascripts/right/resizable-src.js +29 -3
  27. data/public/javascripts/right/resizable.js +2 -2
  28. data/public/javascripts/right/selectable-src.js +1 -1
  29. data/public/javascripts/right/selectable.js +1 -1
  30. data/public/javascripts/right/slider-src.js +5 -5
  31. data/public/javascripts/right/slider.js +2 -2
  32. data/public/javascripts/right/sortable-src.js +1 -1
  33. data/public/javascripts/right/sortable.js +1 -1
  34. data/public/javascripts/right/tabs-src.js +8 -6
  35. data/public/javascripts/right/tabs.js +2 -2
  36. data/public/javascripts/right/tags-src.js +745 -0
  37. data/public/javascripts/right/tags.js +7 -0
  38. data/public/javascripts/right/tooltips-src.js +1 -1
  39. data/public/javascripts/right/tooltips.js +1 -1
  40. data/public/javascripts/right/uploader-src.js +4 -3
  41. data/public/javascripts/right/uploader.js +2 -2
  42. data/public/javascripts/right-safe-src.js +2 -2
  43. data/public/javascripts/right-safe.js +2 -2
  44. data/public/javascripts/right-src.js +60 -47
  45. data/public/javascripts/right.js +2 -2
  46. data/spec/lib/right_rails/helpers/forms_spec.rb +67 -40
  47. metadata +10 -15
@@ -1,7 +1,7 @@
1
1
  /**
2
- * RightJS v2.2.2 - http://rightjs.org
2
+ * RightJS v2.2.3 - http://rightjs.org
3
3
  * Released under the terms of MIT license
4
4
  *
5
5
  * Copyright (C) 2008-2011 Nikolay Nemshilov
6
6
  */
7
- var RightJS=function(a,b,c,d,e,f,g,h){function cE(a,b,c,d){var e={},f=a.marginLeft.toFloat()||0,g=a.marginTop.toFloat()||0,h=c==="right",i=c==="bottom",j=c==="top"||i;d==="out"?(e[j?"height":"width"]="0px",h?e.marginLeft=f+b.x+"px":i&&(e.marginTop=g+b.y+"px")):(j?(e.height=b.y+"px",a.height="0px"):(e.width=b.x+"px",a.width="0px"),h?(e.marginLeft=f+"px",a.marginLeft=f+b.x+"px"):i&&(e.marginTop=g+"px",a.marginTop=g+b.y+"px"));return e}function cD(a,b,c){var d=a.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(a.size().x).setStyle(b),e;a.parent()&&a.insert(d,"before"),e=cC(d,c),d.remove();return e}function cC(a,b){var c=0,d=b.length,e=a.computedStyles(),f={},g;for(;c<d;c++)g=b[c],g in e&&(f[g]=""+e[g]),g==="opacity"&&(f[g]=f[g].replace(",","."));return f}function cB(a,b,c){var d;for(d in c)(d=="width"||d=="height")&&b[d]=="auto"&&(b[d]=a._["offset"+d.capitalize()]+"px");c.filter&&!b.filter&&(b.filter="alpha(opacity=100)"),cz(a,b,c);for(d in c){if(c[d]!==b[d]&&/color/i.test(d)){bn&&(c[d]=c[d].replace(/"/g,""),b[d]=b[d].replace(/"/g,"")),cy(c[d])||(c[d]=c[d].toRgb()),cy(b[d])||(b[d]=b[d].toRgb());if(!c[d]||!b[d])c[d]=b[d]=""}/\d/.test(c[d])&&!/\d/.test(b[d])&&(b[d]=c[d].replace(/[\d\.\-]+/g,"0"));if(c[d]===b[d]||!/\d/.test(b[d])||!/\d/.test(c[d]))delete c[d],delete b[d]}}function cA(a){var b={},c=/[\d\.\-]+/g,d,e,f,g;for(e in a){d=a[e].match(c),f=d.map("toFloat"),f.t=a[e].split(c),f.r=f.t[0]==="rgb(",f.t.length==1&&f.t.unshift("");for(g=0;g<f.length;g++)f.t.splice(g*2+1,0,f[g]);b[e]=f}return b}function cz(a,b,c){for(var d=0;d<4;d++){var e="border"+cv[d]+"Style",f="border"+cv[d]+"Width",g="border"+cv[d]+"Color";if(e in b&&b[e]!=c[e]){var h=a._.style;b[e]=="none"&&(h[f]="0px"),h[e]=c[e],cy(b[g])&&(h[g]=a.getStyle("Color"))}}}function cy(a){return a==="transparent"||a==="rgba(0, 0, 0, 0)"}function cx(a){var b=[],c=["Style","Color","Width"],d,e,f;for(d in a)if(d.startsWith("border"))for(e=0;e<3;e++)for(f=0;f<4;f++)b.push("border"+cv[f]+c[e]);else d==="margin"||d==="padding"?cw(b,d,cv):d.startsWith("background")?cw(b,"background",["Color","Position","PositionX","PositionY"]):d==="opacity"&&bo?b.push("filter"):b.push(d);return b}function cw(a,b,c){for(var d=0;d<c.length;d++)a.push(b+c[d])}function cu(a){function g(){for(var a in f)e[a]=f[a]}var b=this.options,d=this.element,e=d._.style,f=c.only(d.computedStyles(),cq,cr,cs);this.onFinish(g).onCancel(function(){e[cq]="none",setTimeout(g,1)}),e[cq]="all",e[cr]=(cc.Durations[b.duration]||b.duration)+"ms",e[cs]=ct[b.transition]||b.transition,setTimeout(function(){d.setStyle(a)},0)}function cn(a,b,c){var d=H(c).compact(),e=y(d.last())?d.pop():{},f=new(cc[b.capitalize()])(a,e);f.start.apply(f,d);return a}function cm(a){a._timer&&clearInterval(a._timer)}function cl(a,b,c,d){var e=1;a._timer=setInterval(function(){e>d?a.finish():(a.render(b(e/d)),e++)},c)}function ck(a){var b=G(a._);(ce[b]||[]).each("cancel"),(cd[b]||[]).splice(0)}function cj(a){var b=a.ch,c=b.shift();if(c=b[0])c[1].$ch=!0,c[1].start.apply(c[1],c[0])}function ci(a){var b=a.cr;b&&b.splice(b.indexOf(a),1)}function ch(a){a.cr&&a.cr.push(a)}function cg(a,b){var c=a.ch,d=a.options.queue;if(!c||a.$ch)return a.$ch=!1;d&&c.push([b,a]);return d&&c[0][1]!==a}function cf(a){var b=G((a.element||{})._||{});a.ch=cd[b]=cd[b]||[],a.cr=ce[b]=ce[b]||[]}function cb(a,b){a.stop(),this.send(b)}function b$(a,b){var d=a[0],e,f,g=bZ(a),h=!c.keys(g).length;return(b.$listeners||[]).filter(function(a){return a.dr&&a.n===d&&(h||function(){for(var b in g)if(a.dr===b)for(e=0,f=g[b];e<f.length;e++)if(!f[e].length||f[e][0]===a.dc)return!0;return!1}())})}function bZ(a){var b=H(a),c=b[1]||{},d={},e;w(c)?(d[c]=b.slice(2),z(d[c][0])&&(d[c]=d[c][0].map(L))):d=c;for(e in d)d[e]=L(d[e]),d[e]=z(d[e][0])?d[e]:[d[e]];return d}function bY(a,b,c){var d=H(b),e=d.shift();return function(b){var c=b.find(a);return c===undefined?c:typeof e==="string"?c[e].apply(c,d):e.apply(c,[b].concat(d))}}function bX(){bT&&(bT=!1,bo?(b.attachEvent("onmouseover",bV),a.attachEvent("blur",bW)):(b.addEventListener("mouseover",bV,!1),a.addEventListener("blur",bW,!1)))}function bW(a){bS.each(function(b,c){b&&o[c]&&bU(a,o[c]._,c,!1)})}function bV(a){var b=a.target||a.srcElement,c=a.relatedTarget||a.fromElement,d=b,e=!1,f=[],g,h;while(d.nodeType===1)g=G(d),bS[g]===undefined&&bU(a,d,g,bS[g]=!0),d===c&&(e=!0),f.push(d),d=d.parentNode;if(c&&!e)while(c!==null&&c.nodeType===1&&f.indexOf(c)===-1)g=G(c),bS[g]!==undefined&&bU(a,c,g,bS[g]=undefined),c=c.parentNode}function bU(a,b,c,d){var e=new bA(a);e.type=d===!0?"mouseenter":"mouseleave",e.bubbles=!1,e.stopped=!0,e.target=bw(b),e.find=function(a){return D(a,!0).indexOf(this.target._)===-1?undefined:this.target},e.target.fire(e),by.fire(e)}function bR(a){var b=new bA(a),c=b.target,d=c.parent&&c.parent();b.type=a.type==="focusin"||a.type==="focus"?"focus":"blur",d&&d.fire(b)}function bO(a){a=F(a),bB=bB.concat(a),bj(bC.prototype,a),bj(bx.prototype,a)}function bN(a,b){b=b.camelize();if(b==="opacity")return bo?(/opacity=(\d+)/i.exec(a.filter||"")||["","100"])[1].toInt()/100+"":a[b].replace(",",".");b==="float"&&(b=bo?"styleFloat":"cssFloat");var c=a[b];bn&&/color/i.test(b)&&c&&(c=c.replace(/"/g,""));return c}function bM(a,b){if(typeof b==="string"){var c=a.tagName,d=bL,e=c in bJ?bJ[c]:["","",1],f=e[2];d.innerHTML=e[0]+"<"+c+">"+b+"</"+c+">"+e[1];while(f--!==0)d=d.firstChild;b=d.childNodes;while(b.length!==0)bK.appendChild(b[0])}else for(var g=0,h=b.length,i;g<h;g++)i=b[b.length===h?g:0],bK.appendChild(i instanceof bC?i._:i);return bK}function bH(a,b,c){var d=a._,e=[],f=0,g=!c;while(d=d[b])d.nodeType===1&&(g||bw(d).match(c))&&(e[f++]=bw(d));return e}function bG(a,b,c){if(typeof b==="string"){a._=bF(b,c);if(c!==undefined)for(var d in c)switch(d){case"id":a._.id=c[d];break;case"html":a._.innerHTML=c[d];break;case"class":a._.className=c[d];break;case"on":a.on(c[d]);break;default:a.set(d,c[d])}}else a._=b}function bw(a){if(a!=null){var b=p in a?o[a[p]]:undefined;if(b!==undefined)return b;if(a.nodeType===1)return new bC(a);if(a.nodeType===9)return new bx(a);if(a.window==a)return new bz(a);if(A(a.target)||A(a.srcElement))return new bA(a)}return a}function bv(a,b){typeof a==="string"&&(a=q({type:a},b),this.stopped=a.bubbles===!1,y(b)&&q(this,b)),this._=a,this.type=a.type,this.which=a.which,this.keyCode=a.keyCode,this.target=bw(a.target!=null&&"nodeType"in a.target&&a.target.nodeType===3?a.target.parentNode:a.target),this.currentTarget=bw(a.currentTarget),this.relatedTarget=bw(a.relatedTarget),this.pageX=a.pageX,this.pageY=a.pageY;if(bq&&"srcElement"in a){this.which=a.button===2?3:a.button===4?2:1,this.target=bw(a.srcElement)||b,this.relatedTarget=this.target._===a.fromElement?bw(a.toElement):this.target,this.currentTarget=b;var c=this.target.win().scrolls();this.pageX=a.clientX+c.x,this.pageY=a.clientY+c.y}}function bu(a,b){bG(this,a,b);var c=this,d=c._,e=bs.Cast(d),f=p in d?d[p]:d[p]=n++;e!==undefined&&(c=new e(d,b),"$listeners"in this&&(c.$listeners=this.$listeners)),o[f]=c;return c}function bt(){return function(a,b){bf(this),this.initialize.apply(this,arguments);var c=this._,d=p in c?c[p]:c[p]=(c.nodeType===1?1:-1)*n++;o[d]=this}}function bl(a,b,c,d){if(y(b))for(var e in b)a.stopObserving(e,b[e]);else w(b)||(c=b,b=null),w(c)&&(c=a[c]),a.$listeners=(a.$listeners||[]).filter(function(a){var e=b&&c?a.e!==b||a.f!==c:b?a.e!==b:a.f!==c;e||d(a);return e})}function bk(a,b,c){var d=l.call(b,2),e=b[0],f=b[1],g=!1;if(w(e))switch(typeof f){case"string":g=f,f=f in a?a[f]:function(){};case"function":("$listeners"in a?a.$listeners:a.$listeners=[]).push(c({e:e,f:f,a:d,r:g||!1,t:a}));break;default:if(z(f))for(var h=0;h<f.length;h++)a.on.apply(a,[e].concat(L(f[h])).concat(d))}else{d=l.call(b,1);for(g in e)a.on.apply(a,[g].concat(L(e[g])).concat(d))}}function bf(a){"prebind"in a&&z(a.prebind)&&a.prebind.each(function(b){a[b]=a[b].bind(a)})}function be(a,b){var c=b.toUpperCase(),d=a.constructor,e=[a,d].concat(d.ancestors||[]),f=0;for(;f<e.length;f++){if(c in e[f])return e[f][c];if(b in e[f])return e[f][b]}return null}function bd(a,b,c){(b[bb[c?0:2]]||b[bb[c?1:3]]||function(){}).call(b,a)}function bc(a,b){return c.without.apply(c,[a].concat(bb.concat(b?F("prototype parent ancestors"):["constructor"])))}function $(a,b){return a>b?1:a<b?-1:0}function Z(a){return!!a}function Y(a,b,c){try{return a.apply(b,W(c,b))}catch(d){if(!(d instanceof X))throw d}return undefined}function X(){}function W(a,b){var c=a[0],d=l.call(a,1),e=b,f;typeof c==="string"?(f=c,b.length!==0&&typeof b[0][f]==="function"?c=function(a){return a[f].apply(a,d)}:c=function(a){return a[f]}):e=d[0];return[c,e]}function L(a){return z(a)?a:[a]}var i=function(a){return a};i.version="2.2.2",i.modules=["core","dom","form","events","xhr","fx","cookie"];var j=d.prototype,k=c.prototype.toString,l=j.slice,m=b.documentElement,n=1,o=[],p="uniqueNumber",q=i.$ext=function(a,b,c){var d=b||{},e;for(e in d)if(!c||!(e in a))a[e]=d[e];return a},r=i.$eval=function(b){b&&("execScript"in a?by.win()._.execScript(b):E("script",{text:b}).insertTo(m))},s=i.$break=function(){throw new X},t=i.$alias=function(a,b){for(var c in b)a[c]=a[b[c]];return a},u=i.defined=function(a){return typeof a!=="undefined"},v=i.isFunction=function(a){return typeof a==="function"},w=i.isString=function(a){return typeof a==="string"},x=i.isNumber=function(a){return typeof a==="number"},y=i.isHash=function(a){return k.call(a)==="[object Object]"},z=i.isArray=function(a){return k.call(a)==="[object Array]"},A=i.isElement=function(a){return a!=null&&a.nodeType===1},B=i.isNode=function(a){return a!=null&&a.nodeType!=null},C=i.$=function(a){if(a instanceof bs)return a;typeof a==="string"&&(a=b.getElementById(a));return bw(a)},D=i.$$=function(a,b){return by.find(a,b)},E=i.$E=function(a,b){return new bC(a,b)},F=i.$w=function(a){return a.trim().split(/\s+/)},G=i.$uid=function(a){return p in a?a[p]:a[p]=n++},H=i.$A=function(a){return l.call(a,0)};j.map||(H=i.$A=function(a){try{return l.call(a,0)}catch(b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=a[d];return c}}),y(m)&&(y=i.isHash=function(a){return k.call(a)==="[object Object]"&&a!=null&&a.hasOwnProperty!=null});var I=0,J="Array Function Number String Date RegExp".split(" "),K=function(){for(var a=0;a<arguments.length;a++)y(arguments[a])&&(q(this.prototype,arguments[a]),q(this.Methods,arguments[a]))};for(;I<J.length;I++)q(i[J[I]]=a[J[I]],{Methods:{},include:K});i.Object=c,i.Math=h,q(c,{keys:function(a){var b=[],c;for(c in a)b.push(c);return b},values:function(a){var b=[],c;for(c in a)b.push(a[c]);return b},each:function(a,b,c){for(var d in a)b.call(c,d,a[d]);return a},empty:function(a){for(var b in a)return!1;return!0},clone:function(a){return c.merge(a)},without:function(){var a=H(arguments),b=a.shift(),c={},d;for(d in b)a.include(d)||(c[d]=b[d]);return c},only:function(){var a=H(arguments),b=a.shift(),c={},d=0,e=a.length;for(;d<e;d++)a[d]in b&&(c[a[d]]=b[a[d]]);return c},merge:function(){var a={},b=0,d=arguments,e;for(;b<d.length;b++)if(y(d[b]))for(e in d[b])a[e]=y(d[b][e])&&!(d[b][e]instanceof _)?c.merge(e in a?a[e]:{},d[b][e]):d[b][e];return a},toQueryString:function(a){var b=[],c,d,e=encodeURIComponent;for(c in a){d=L(a[c]);for(var f=0;f<d.length;f++)b.push(e(c)+"="+e(d[f]))}return b.join("&")}},!0);var M=h.random;h.random=function(a,b){if(arguments.length===0)return M();arguments.length===1&&(b=a,a=0);return~~(M()*(b-a+1)+~~a)};var N=j.sort,O=j.forEach||function(a,b){for(var c=0;c<this.length;c++)a.call(b,this[c],c,this)},P=j.filter||function(a,b){for(var c=[],d=0,e=0;e<this.length;e++)a.call(b,this[e],e,this)&&(c[d++]=this[e]);return c},Q=function(a,b){for(var c=[],d=0,e=0;e<this.length;e++)a.call(b,this[e],e,this)||(c[d++]=this[e]);return c},R=j.map||function(a,b){for(var c=[],d=0;d<this.length;d++)c[d]=a.call(b,this[d],d,this);return c},S=j.some||function(a,b){for(var c=0;c<this.length;c++)if(a.call(b,this[c],c,this))return!0;return!1},T=j.every||function(a,b){for(var c=0;c<this.length;c++)if(!a.call(b,this[c],c,this))return!1;return!0},U=function(a,b){for(var c=0;c<this.length;c++)if(a.call(b,this[c],c,this))return this[c];return undefined},V=function(a,b){for(var c=this.length-1;c>-1;c--)if(a.call(b,this[c],c,this))return this[c];return undefined};d.include({indexOf:j.indexOf||function(a,b){for(var c=b<0?h.max(0,this.length+b):b||0;c<this.length;c++)if(this[c]===a)return c;return-1},lastIndexOf:j.lastIndexOf||function(a){for(var b=this.length-1;b>-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?Y(U,this,arguments):this[0]},last:function(){return arguments.length?Y(V,this,arguments):this[this.length-1]},random:function(){return this.length===0?undefined:this[h.random(this.length-1)]},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return this.length===0},clone:function(){return this.slice(0)},each:function(){Y(O,this,arguments);return this},forEach:O,map:function(){return Y(R,this,arguments)},filter:function(){return Y(P,this,arguments)},reject:function(){return Y(Q,this,arguments)},some:function(a){return Y(S,this,a?arguments:[Z])},every:function(a){return Y(T,this,a?arguments:[Z])},walk:function(){this.map.apply(this,arguments).forEach(function(a,b){this[b]=a},this);return this},merge:function(){for(var a=this.clone(),b,c=0;c<arguments.length;c++){b=L(arguments[c]);for(var d=0;d<b.length;d++)a.indexOf(b[d])==-1&&a.push(b[d])}return a},flatten:function(){var a=[];this.forEach(function(b){z(b)?a=a.concat(b.flatten()):a.push(b)});return a},compact:function(){return this.without(null,undefined)},uniq:function(){return[].merge(this)},includes:function(){for(var a=0;a<arguments.length;a++)if(this.indexOf(arguments[a])===-1)return!1;return!0},without:function(){var a=l.call(arguments);return this.filter(function(b){return a.indexOf(b)===-1})},shuffle:function(){var a=this.clone(),b,c,d=a.length;for(;d>0;b=h.random(d-1),c=a[--d],a[d]=a[b],a[b]=c){}return a},sort:function(a){return N.apply(this,a||!x(this[0])?arguments:[$])},sortBy:function(){var a=W(arguments,this);return this.sort(function(b,c){return $(a[0].call(a[1],b),a[0].call(a[1],c))})},min:function(){return h.min.apply(h,this)},max:function(){return h.max.apply(h,this)},sum:function(){for(var a=0,b=0;b<this.length;a+=this[b++]){}return a}}),j.include=j.includes,e.include({empty:function(){return this==""},blank:function(){return this==!1},trim:e.prototype.trim||function(){var a=this.replace(/^\s\s*/,""),b=a.length;while(/\s/.test(a.charAt(--b))){}return a.slice(0,b+1)},stripTags:function(){return this.replace(/<\/?[^>]+>/ig,"")},stripScripts:function(a){var b="",c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/img,function(a,c){b+=c+"\n";return""});a===!0?r(b):v(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(!0);return this},camelize:function(){return this.replace(/(\-|_)+(.)?/g,function(a,b,c){return c?c.toUpperCase():""})},underscored:function(){return this.replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/\-/g,"_").toLowerCase()},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){return(b!==!0?this.indexOf(a):this.toLowerCase().indexOf(a.toLowerCase()))===0},endsWith:function(a,b){return this.length-(b!==!0?this.lastIndexOf(a):this.toLowerCase().lastIndexOf(a.toLowerCase()))===a.length},toInt:function(a){return parseInt(this,a===undefined?10:a)},toFloat:function(a){return parseFloat(a===!0?this:this.replace(",",".").replace(/(\d)-(\d)/,"$1.$2"))}}),e.prototype.include=e.prototype.includes,f.include({bind:function(){var a=H(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length!==0||arguments.length!==0?a.concat(H(arguments)):a)}},bindAsEventListener:function(){var a=H(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(H(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(H(arguments)))},rcurry:function(){var a=H(arguments),b=this;return function(){return b.apply(b,H(arguments).concat(a))}},delay:function(){var a=H(arguments),b=a.shift(),c=new g(setTimeout(this.bind.apply(this,[this].concat(a)),b));c.cancel=function(){clearTimeout(this)};return c},periodical:function(){var a=H(arguments),b=a.shift(),c=new g(setInterval(this.bind.apply(this,[this].concat(a)),b));c.stop=function(){clearInterval(this)};return c},chain:function(){var a=H(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}}),g.include({times:function(a,b){for(var c=0;c<this;c++)a.call(b,c);return this},upto:function(a,b,c){for(var d=this+0;d<=a;d++)b.call(c,d);return this},downto:function(a,b,c){for(var d=this+0;d>=a;d--)b.call(c,d);return this},abs:function(){return h.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):h.round(this)},ceil:function(){return h.ceil(this)},floor:function(){return h.floor(this)},min:function(a){return this<a?a:this+0},max:function(a){return this>a?a:this+0}}),RegExp.escape=function(a){return(""+a).replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1")};var _=i.Class=function(){var a=H(arguments).slice(0,2),b=a.pop()||{},c=a.pop(),d=arguments[2],e=function(){};!a.length&&!y(b)&&(c=b,b={}),!d&&c&&(c===bs||c.ancestors.include(bs))&&(d=bt()),d=q(d||function(){bf(this);return"initialize"in this?this.initialize.apply(this,arguments):this},ba),c=c||_,e.prototype=c.prototype,d.prototype=new e,d.parent=c,d.prototype.constructor=d,d.ancestors=[];while(c)d.ancestors.push(c),c=c.parent;["extend","include"].each(function(a){a in b&&d[a].apply(d,L(b[a]))});return d.include(b)},ba={extend:function(){H(arguments).filter(y).each(function(a){q(this,bc(a,!0)),bd(this,a,!0)},this);return this},include:function(){var a=[this].concat(this.ancestors);H(arguments).filter(y).each(function(b){c.each(bc(b,!1),function(b,c){for(var d,e=0;e<a.length;e++)if(b in a[e].prototype){d=a[e].prototype[b];break}this.prototype[b]=v(c)&&v(d)?function(){this.$super=d;return c.apply(this,arguments)}:c},this),bd(this,b,!1)},this);return this}},bb=F("selfExtended self_extended selfIncluded self_included extend include");q(_,ba),_.prototype.$super=undefined;var bg=i.Options={setOptions:function(a){var b=this.options=q(q({},c.clone(be(this,"Options"))),a),d,e;if(v(this.on))for(e in b)if(d=e.match(/on([A-Z][A-Za-z]+)/))this.on(d[1].toLowerCase(),b[e]),delete b[e];return this},cutOptions:function(a){var b=H(a);this.setOptions(y(b.last())?b.pop():{});return b}},bh=i.Observer=new _({include:bg,initialize:function(a){this.setOptions(a),bj(this,be(this,"Events"));return this},on:function(){bk(this,arguments,function(a){return a});return this},observes:function(a,b){w(a)||(b=a,a=null),w(b)&&(b=b in this?this[b]:null);return(this.$listeners||[]).some(function(c){return a&&b?c.e===a&&c.f===b:a?c.e===a:c.f===b})},stopObserving:function(a,b){bl(this,a,b,function(){});return this},listeners:function(a){return(this.$listeners||[]).filter(function(b){return!a||b.e===a}).map(function(a){return a.f}).uniq()},fire:function(){var a=H(arguments),b=a.shift();(this.$listeners||[]).each(function(c){c.e===b&&c.f.apply(this,c.a.concat(a))},this);return this}}),bi=bh.create=function(a,b){q(a,c.without(bh.prototype,"initialize","setOptions"),!0);return bj(a,b||be(a,"Events"))},bj=bh.createShortcuts=function(a,b){(b||[]).each(function(b){var c="on"+b.replace(/(^|_|:)([a-z])/g,function(a,b,c){return c.toUpperCase()});c in a||(a[c]=function(){return this.on.apply(this,[b].concat(H(arguments)))})});return a},bm=navigator.userAgent,bn="opera"in a,bo="attachEvent"in a&&!bn,bp=i.Browser={IE:bo,Opera:bn,WebKit:bm.include("AppleWebKit/"),Gecko:bm.include("Gecko")&&!bm.include("KHTML"),MobileSafari:/Apple.*Mobile.*Safari/.test(bm),Konqueror:bm.include("Konqueror"),OLD:!b.querySelector,IE8L:!1},bq=!1;try{b.createElement("<input/>"),bp.OLD=bp.IE8L=bq=!0}catch(br){}var bs=i.Wrapper=new _({_:undefined,initialize:function(a){this._=a}});bs.Cache=o,bs.Cast=function(a){return a.tagName in bD?bD[a.tagName]:undefined};var bx=i.Document=new _(bs,{win:function(){return bw(this._.defaultView||this._.parentWindow)}}),by=bw(b),bz=i.Window=new _(bs,{win:function(){return this},size:function(){var a=this._,b=a.document.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=this._,b=a.document,c=b.body,d=b.documentElement;return a.pageXOffset||a.pageYOffset?{x:a.pageXOffset,y:a.pageYOffset}:c&&(c.scrollLeft||c.scrollTop)?{x:c.scrollLeft,y:c.scrollTop}:{x:d.scrollLeft,y:d.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=x(a)?null:C(a);f instanceof bC&&(a=f.position()),y(a)&&(e=a.y,d=a.x),y(c=c||b)&&i.Fx?(new cc.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),bA=i.Event=new _(bs,{type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,pageX:null,pageY:null,initialize:bv,stopPropagation:function(){this._.stopPropagation?this._.stopPropagation():this._.cancelBubble=!0,this.stopped=!0;return this},preventDefault:function(){this._.preventDefault?this._.preventDefault():this._.returnValue=!1;return this},stop:function(){return this.stopPropagation().preventDefault()},position:function(){return{x:this.pageX,y:this.pageY}},offset:function(){if(this.target instanceof bC){var a=this.target.position();return{x:this.pageX-a.x,y:this.pageY-a.y}}return null},find:function(a){if(this.target instanceof bs&&this.currentTarget instanceof bs){var b=this.target._,c=this.currentTarget.find(a,!0);while(b){if(c.indexOf(b)!==-1)return bw(b);b=b.parentNode}}return undefined}},bv),bB=[],bC=i.Element=new _(bs,{initialize:function(a,b){bG(this,a,b)}},bu),bD=bC.Wrappers={},bE={},bF=function(a,c){return(a in bE?bE[a]:bE[a]=b.createElement(a)).cloneNode(!1)};bq&&(bF=function(a,c){a==="input"&&c!==undefined&&(a='<input name="'+c.name+'" type='+c.type+(c.checked?" checked":"")+"/>");return b.createElement(a)}),bC.include({parent:function(a){var b=this._.parentNode,c=b&&b.nodeType;return a?this.parents(a)[0]:c===1||c===9?bw(b):null},parents:function(a){return bH(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(a){return a._.parentNode===this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))},nextSiblings:function(a){return bH(this,"nextSibling",a)},prevSiblings:function(a){return bH(this,"previousSibling",a)},next:function(a){return this.nextSiblings(a)[0]},prev:function(a){return this.prevSiblings(a)[0]},remove:function(){var a=this._,b=a.parentNode;b&&b.removeChild(a);return this},insert:function(a,b){var c=null,d=this._;b=b===undefined?"bottom":b,typeof a!=="object"?c=a=""+a:a instanceof bC&&(a=a._),bI[b](d,a.nodeType===undefined?bM(b==="bottom"||b==="top"?d:d.parentNode,a):a),c!==null&&c.evalScripts();return this},insertTo:function(a,b){C(a).insert(this,b);return this},append:function(a){return this.insert(w(a)?H(arguments).join(""):arguments)},update:function(a){if(typeof a!=="object"){a=""+a;try{this._.innerHTML=a}catch(b){return this.clean().insert(a)}a.evalScripts();return this}return this.clean().insert(a)},html:function(a){return a===undefined?this._.innerHTML:this.update(a)},text:function(a){return a===undefined?this._.textContent||this._.innerText:this.update(this.doc()._.createTextNode(a))},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;c&&(a=C(a)._,c.replaceChild(a,b),a.appendChild(b));return this},clean:function(){while(this._.firstChild)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){return new bC(this._.cloneNode(!0))},index:function(){var a=this._,b=a.parentNode.firstChild,c=0;while(b!==a)b.nodeType===1&&c++,b=b.nextSibling;return c}});var bI={bottom:function(a,b){a.appendChild(b)},top:function(a,b){a.firstChild!==null?a.insertBefore(b,a.firstChild):a.appendChild(b)},after:function(a,b){var c=a.parentNode,d=a.nextSibling;d!==null?c.insertBefore(b,d):c.appendChild(b)},before:function(a,b){a.parentNode.insertBefore(b,a)},instead:function(a,b){a.parentNode.replaceChild(b,a)}},bJ={TBODY:["<TABLE>","</TABLE>",2],TR:["<TABLE><TBODY>","</TBODY></TABLE>",3],TD:["<TABLE><TBODY><TR>","</TR></TBODY></TABLE>",4],COL:["<TABLE><COLGROUP>","</COLGROUP><TBODY></TBODY></TABLE>",2],LEGEND:["<FIELDSET>","</FIELDSET>",2],AREA:["<map>","</map>",2],OPTION:["<SELECT>","</SELECT>",2]};t(bJ,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var bK=b.createDocumentFragment(),bL=b.createElement("DIV");bC.include({setStyle:function(a,b){var c,d,e={},f=this._.style;b!==undefined?(e[a]=b,a=e):w(a)&&(a.split(";").each(function(a){var b=a.split(":").map("trim");b[0]&&b[1]&&(e[b[0]]=b[1])}),a=e);for(c in a)d=c.indexOf("-")<0?c:c.camelize(),c==="opacity"?bo?f.filter="alpha(opacity="+a[c]*100+")":f.opacity=a[c]:c==="float"&&(d=bo?"styleFloat":"cssFloat"),f[d]=a[c];return this},getStyle:function(a){return bN(this._.style,a)||bN(this.computedStyles(),a)},computedStyles:m.currentStyle?function(){return this._.currentStyle||{}}:m.runtimeStyle?function(){return this._.runtimeStyle||{}}:function(){return this._.ownerDocument.defaultView.getComputedStyle(this._,null)},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},getClass:function(){return this._.className},addClass:function(a){var b=" "+this._.className+" ";b.indexOf(" "+a+" ")==-1&&(this._.className+=(b===" "?"":" ")+a);return this},removeClass:function(a){this._.className=(" "+this._.className+" ").replace(" "+a+" "," ").trim();return this},toggleClass:function(a){return this[this.hasClass(a)?"removeClass":"addClass"](a)},radioClass:function(a){this.siblings().each("removeClass",a);return this.addClass(a)}}),bC.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b,a=c}var d,e=this._;for(d in a)d==="style"?this.setStyle(a[d]):(d in e||e.setAttribute(d,""+a[d]),e[d]=a[d]);return this},get:function(a){var b=this._,c=b[a]||b.getAttribute(a);return c===""?null:c},has:function(a){return this.get(a)!==null},erase:function(a){this._.removeAttribute(a);return this},hidden:function(){return this.getStyle("display")==="none"},visible:function(){return!this.hidden()},hide:function(a,b){this.visible()&&(this._d=this.getStyle("display"),this._.style.display="none");return this},show:function(){if(this.hidden()){var a=this._,b=this._d,c;if(!b||b==="none")c=E(a.tagName).insertTo(m),b=c.getStyle("display"),c.remove();b==="none"&&(b="block"),a.style.display=b}return this},toggle:function(){return this[this.visible()?"hide":"show"]()},radio:function(a,b){this.siblings().each("hide",a,b);return this.show()}}),bC.include({doc:function(){return bw(this._.ownerDocument)},win:function(){return this.doc().win()},size:function(){return{x:this._.offsetWidth,y:this._.offsetHeight}},position:function(){var a=this._.getBoundingClientRect(),b=this.doc()._.documentElement,c=this.win().scrolls();return{x:a.left+c.x-b.clientLeft,y:a.top+c.y-b.clientTop}},scrolls:function(){return{x:this._.scrollLeft,y:this._.scrollTop}},dimensions:function(){var a=this.size(),b=this.scrolls(),c=this.position();return{top:c.y,left:c.x,width:a.x,height:a.y,scrollLeft:b.x,scrollTop:b.y}},overlaps:function(a){var b=this.position(),c=this.size();return a.x>b.x&&a.x<b.x+c.x&&a.y>b.y&&a.y<b.y+c.y},setWidth:function(a){var b=this._.style;b.width=a+"px",b.width=2*a-this._.offsetWidth+"px";return this},setHeight:function(a){var b=this._.style;b.height=a+"px",b.height=2*a-this._.offsetHeight+"px";return this},resize:function(a,b){y(a)&&(b=a.y,a=a.x);return this.setWidth(a).setHeight(b)},moveTo:function(a,b){y(a)&&(b=a.y,a=a.x);return this.setStyle({left:a+"px",top:b+"px"})},scrollTo:function(a,b){y(a)&&(b=a.y,a=a.x),this._.scrollLeft=a,this._.scrollTop=b;return this},scrollThere:function(a){this.win().scrollTo(this,a);return this}}),[bC,bx,bz].each("include",q(bi({}),{on:function(){bk(this,arguments,function(a){a.e==="mouseenter"||a.e==="mouseleave"?(bX(),a.n=a.e,a.w=function(){}):(a.e==="contextmenu"&&bp.Konqueror?a.n="rightclick":a.e==="mousewheel"&&bp.Gecko?a.n="DOMMouseScroll":a.n=a.e,a.w=function(b){b=new bA(b,a.t),a.f.apply(a.t,(a.r?[]:[b]).concat(a.a))===!1&&b.stop()},bq?a.t._.attachEvent("on"+a.n,a.w):a.t._.addEventListener(a.n,a.w,!1));return a});return this},stopObserving:function(a,b){bl(this,a,b,function(a){bq?a.t._.detachEvent("on"+a.n,a.w):a.t._.removeEventListener(a.n,a.w,!1)});return this},fire:function(a,b){var c=this.parent&&this.parent();a instanceof bA||(a=new bA(a,q({target:this._},b))),a.currentTarget=this,(this.$listeners||[]).each(function(b){b.e===a.type&&b.f.apply(this,(b.r?[]:[a]).concat(b.a))===!1&&a.stop()},this),c&&c.fire&&!a.stopped&&c.fire(a);return this},stopEvent:function(){return!1}})),bj(bz.prototype,F("blur focus scroll resize load")),bO("click rightclick contextmenu mousedown mouseup mouseover mouseout mousemove keypress keydown keyup"),[bC,bx].each("include",{first:function(a){return bw(this._.querySelector(a||"*"))},find:function(a,b){var c=this._.querySelectorAll(a||"*"),d,e=0,f=c.length;if(b===!0)d=H(c);else for(d=[];e<f;e++)d[e]=bw(c[e]);return d},match:function(a){var c=this._,d=c,e,f=!1;while(d.parentNode!==null&&d.parentNode.nodeType!==11)d=d.parentNode;c===d&&(d=b.createElement("div"),d.appendChild(c),f=!0),e=bw(d).find(a,!0).indexOf(c)!==-1,f&&d.removeChild(c);return e}}),bx.include({on:function(a){if(a==="ready"&&!this._iR){var b=this._,c=this.fire.bind(this,"ready");"readyState"in b?function(){["loaded","complete"].include(b.readyState)?c():arguments.callee.delay(50)}():b.addEventListener("DOMContentLoaded",c,!1),this._iR=!0}return this.$super.apply(this,arguments)}}),bj(bx.prototype,["ready"]);var bP=i.Form=bD.FORM=new _(bC,{initialize:function(a){var b=a||{},d="remote"in b,e=b;y(b)&&!A(b)&&(e="form",b=c.without(b,"remote")),this.$super(e,b),d&&this.remotize()},elements:function(){return this.find("input,button,select,textarea")},inputs:function(){return this.elements().filter(function(a){return!["submit","button","reset","image",null].include(a._.type)})},input:function(a){return bw(this._[a])},focus:function(){var a=this.inputs().first(function(a){return a._.type!=="hidden"});a&&a.focus();return this},blur:function(){this.elements().each("blur");return this},disable:function(){this.elements().each("disable");return this},enable:function(){this.elements().each("enable");return this},values:function(){var a={},b,c,d,e;this.inputs().each(function(d){e=d._,c=e.name,!e.disabled&&c&&(!["checkbox","radio"].include(e.type)||e.checked)&&(b=d.getValue(),c.endsWith("[]")&&(b=(a[c]||[]).concat([b])),a[c]=b)});return a},serialize:function(){return c.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});bO("submit reset focus blur disable enable change");var bQ=i.Input=bD.INPUT=bD.BUTTON=bD.SELECT=bD.TEXTAREA=bD.OPTGROUP=new _(bC,{initialize:function(a,b){if(!a||y(a)&&!A(a))b=a||{},/textarea|select/.test(b.type||"")?(a=b.type,delete b.type):a="input";this.$super(a,b)},form:function(){return bw(this._.form)},insert:function(a,b){this.$super(a,b),this.find("option").each(function(a){a._.selected=!!a.get("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?this.find("option").map(function(a){return a._.selected?a._.value:null}).compact():this._.value},setValue:function(a){this._.type=="select-multiple"?(a=L(a).map(e),this.find("option").each(function(b){b._.selected=a.include(b._.value)})):this._.value=a;return this},value:function(a){return this[a===undefined?"getValue":"setValue"](a)},focus:function(){this._.focus(),this.focused=!0,bo&&this.fire("focus",{bubbles:!1});return this},blur:function(){this._.blur(),this.focused=!1,bo&&this.fire("blur",{bubbles:!1});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=!0;return this.fire("disable")},enable:function(){this._.disabled=!1;return this.fire("enable")},disabled:function(a){return a===undefined?this._.disabled:this[a?"disable":"enable"]()},checked:function(a){a===undefined?a=this._.checked:(this._.checked=a,a=this);return a}});bq?(b.attachEvent("onfocusin",bR),b.attachEvent("onfocusout",bR)):(b.addEventListener("focus",bR,!0),b.addEventListener("blur",bR,!0));var bS=[],bT=!0;bO("mouseenter mouseleave"),[bC,bx].each("include",{delegate:function(a){var b=bZ(arguments),c,d,e,f;for(c in b)for(d=0,f=b[c];d<f.length;d++)this.on(a,bY(c,f[d],this)),q(this.$listeners.last(),{dr:c,dc:f[d][0]});return this},undelegate:function(a){b$(arguments,this).each(function(a){this.stopObserving(a.n,a.f)},this);return this},delegates:function(){return!!b$(arguments,this).length}}),c.each({on:"delegate",stopObserving:"undelegate",observes:"delegates"},function(a,b){e.prototype[a]=function(){var a=H(arguments),c;a.splice(1,0,""+this),c=by[b].apply(by,a);return c===by?this:c}});var b_=e.prototype.on;e.prototype.on=function(a){if(y(a))for(var b in a)b_.apply(this,[b].concat([a[b]]));else b_.apply(this,arguments);return this},bB.each(function(a){e.prototype["on"+a.capitalize()]=function(){return this.on.apply(this,[a].concat(H(arguments)))}}),F("Element Input Form").each(function(a){c.each(a in i?i[a].prototype:{},function(a,b){v(b)&&!(a in e.prototype)&&(e.prototype[a]=function(){var b=D(this,!0),c=0,d=b.length,e=!0,f,g;for(;c<d;c++){f=bw(b[c]),g=f[a].apply(f,arguments);if(e){if(g!==f)return g;e=!1}}return null})})});var ca=i.Xhr=new _(bh,{extend:{EVENTS:F("success failure complete request cancel create"),Options:{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript,text/html,application/xml,text/xml,*/*"},method:"post",encoding:"utf-8",async:!0,evalScripts:!1,evalResponse:!1,evalJS:!0,evalJSON:!0,secureJSON:!0,urlEncoded:!0,spinner:null,spinnerFx:"fade",params:null,iframed:!1,jsonp:!1},load:function(a,b){return(new this(a,q({method:"get"},b))).send()}},initialize:function(a,b){this.initCallbacks(),this.url=a,q(this.$super(b),this.options),ca.Options.spinner&&C(this.spinner)===C(ca.Options.spinner)&&(this.spinner=null)},setHeader:function(a,b){this.headers[a]=b;return this},getHeader:function(a){var b;try{b=this.xhr.getResponseHeader(a)}catch(c){}return b},successful:function(){return this.status>=200&&this.status<300},send:function(a){var b={},c=this.url,d=this.method.toLowerCase(),e=this.headers,f,g;if(d=="put"||d=="delete")b._method=d,d="post";var h=this.prepareData(this.params,this.prepareParams(a),b);this.urlEncoded&&d=="post"&&!e["Content-type"]&&this.setHeader("Content-type","application/x-www-form-urlencoded;charset="+this.encoding),d=="get"&&(h&&(c+=(c.include("?")?"&":"?")+h),h=null),g=this.xhr=this.createXhr(),this.fire("create"),g.open(d,c,this.async),g.onreadystatechange=this.stateChanged.bind(this);for(f in e)g.setRequestHeader(f,e[f]);g.send(h),this.fire("request"),this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(b){a.update(b.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort(),a.onreadystatechange=function(){},a.canceled=!0;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},createXhr:function(){return this.jsonp?new ca.JSONP(this):this.form&&this.form.first("input[type=file]")?new ca.IFramed(this.form):"ActiveXObject"in a?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest},prepareParams:function(a){a&&a instanceof bP&&(this.form=a,a=a.values());return a},prepareData:function(){return H(arguments).map(function(a){w(a)||(a=c.toQueryString(a));return a.blank()?null:a}).compact().join("&")},stateChanged:function(){var a=this.xhr;if(a.readyState==4&&!a.canceled){try{this.status=a.status}catch(b){this.status=0}this.text=this.responseText=a.responseText,this.xml=this.responseXML=a.responseXML,this.fire("complete").fire(this.successful()?"success":"failure")}},tryScripts:function(a){var b=this.getHeader("Content-type");this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(b)?r(this.text):/json/.test(b)&&this.evalJSON?this.json=this.responseJSON=this.sanitizedJSON():this.evalScripts&&this.text.evalScripts()},sanitizedJSON:function(){if(!/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){if(this.secureJSON)throw"JSON error: "+this.text;return null}return"JSON"in a?JSON.parse(this.text):(new f("return "+this.text))()},initCallbacks:function(){this.on({success:"tryScripts",create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"}),ca.EVENTS.each(function(a){this.on(a,function(){ca.fire(a,this,this.xhr)})},this)},showSpinner:function(){ca.showSpinner.call(this,this)},hideSpinner:function(){ca.hideSpinner.call(this,this)}});q(bi(ca),{counter:0,showSpinner:function(a){ca.trySpinner(a,"show")},hideSpinner:function(a){ca.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||ca.Options,d=C(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){ca.counter++,ca.showSpinner()},countOut:function(){ca.counter--,ca.counter<1&&ca.hideSpinner()}}).on({create:"countIn",complete:"countOut",cancel:"countOut"}),bP.include({send:function(a){a=a||{},a.method=a.method||this._.method||"post",this.xhr=(new ca(this._.action||b.location.href,q({spinner:this.first(".spinner")},a))).onComplete(this.enable.bind(this)).onCancel(this.enable.bind(this)).send(this),this.disable.bind(this).delay(1);return this},cancelXhr:function(){this.xhr instanceof ca&&this.xhr.cancel();return this},remotize:function(a){this.remote||(this.on("submit",cb,a),this.remote=!0);return this},unremotize:function(){this.stopObserving("submit",cb),this.remote=!1;return this}}),bC.include({load:function(a,b){(new ca(a,q({method:"get"},b))).update(this);return this}}),ca.Dummy={open:function(){},setRequestHeader:function(){},onreadystatechange:function(){}},ca.IFramed=new _({include:ca.Dummy,initialize:function(a){this.form=a,this.id="xhr_"+(new Date).getTime(),this.form.doc().first("body").append('<i><iframe name="'+this.id+'" id="'+this.id+'" width="0" height="0" frameborder="0" src="about:blank"></iframe></i>',"after"),C(this.id).on("load",this.onLoad.bind(this))},send:function(){this.form.set("target",this.id).submit()},onLoad:function(){this.status=200,this.readyState=4,this.form.set("target","");try{this.responseText=a[this.id].document.documentElement.innerHTML}catch(b){}this.onreadystatechange()},abort:function(){C(this.id).set("src","about:blank")}}),ca.JSONP=new _({include:ca.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=a,this.name=this.prefix+(new Date).getTime(),this.param=(w(a.jsonp)?a.jsonp:"callback")+"="+this.name,this.script=E("script",{charset:a.encoding,async:a.async})},open:function(a,b,c){this.url=b,this.method=a},send:function(b){a[this.name]=this.finish.bind(this),this.script.set("src",this.url+(this.url.include("?")?"&":"?")+this.param+"&"+b).insertTo(D("script").last(),"after")},finish:function(a){this.status=200,this.readyState=4,this.xhr.json=this.xhr.responseJSON=a,this.onreadystatechange()},abort:function(){a[this.name]=function(){}}});var cc=i.Fx=new _(bh,{extend:{EVENTS:F("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:bq?40:60,duration:"normal",transition:"Sin",queue:!0},Transitions:{Sin:function(a){return-(h.cos(h.PI*a)-1)/2},Cos:function(a){return h.asin((a-.5)*2)/h.PI+.5},Exp:function(a){return h.pow(2,8*(a-1))},Log:function(a){return 1-h.pow(2,-8*a)},Lin:function(a){return a}}},initialize:function(a,b){this.$super(b),this.element=C(a),cf(this)},start:function(){if(cg(this,arguments))return this;var a=this.options,b=cc.Durations[a.duration]||a.duration,c=cc.Transitions[a.transition]||a.transition,d=(b/1e3*this.options.fps).ceil(),e=(1e3/this.options.fps).round();ch(this),this.prepare.apply(this,arguments),cl(this,c,e,d);return this.fire("start",this)},finish:function(){cm(this),ci(this),this.fire("finish"),cj(this);return this},cancel:function(){cm(this),ci(this);return this.fire("cancel")},prepare:function(){},render:function(){}}),cd=[],ce=[];e.COLORS={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",brown:"#a52a2a"},e.include({toHex:function(){var a=/^#(\w)(\w)(\w)$/.exec(this);a?a="#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(this))?a="#"+a.slice(1).map(function(a){a=(a-0).toString(16);return a.length==1?"0"+a:a}).join(""):a=e.COLORS[this]||this;return a},toRgb:function(a){var b=/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(this.toHex()||"");b&&(b=b.slice(1).map("toInt",16),b=a?b:"rgb("+b+")");return b}}),bC.include({stop:function(){ck(this);return this},hide:function(a,b){return a&&this.visible()?cn(this,a,["out",b]):this.$super()},show:function(a,b){return a&&!this.visible()?cn(this,a,["in",b]):this.$super()},toggle:function(a,b){return a?cn(this,a,["toggle",b]):this.$super()},remove:function(a,b){return a&&this.visible()?cn(this,a,["out",q(b||{},{onFinish:this.$super.bind(this)})]):this.$super()},morph:function(a,b){return cn(this,"morph",[a,b||{}])},highlight:function(){return cn(this,"highlight",arguments)},fade:function(){return cn(this,"fade",arguments)},slide:function(){return cn(this,"slide",arguments)},scroll:function(a,b){return cn(this,"scroll",[a,b||{}])},scrollTo:function(a,b){return y(b)?this.scroll(a,b):this.$super.apply(this,arguments)}});var co=["WebkitT","OT","MozT","MsT","t"].first(function(a){return a+"ransition"in m.style}),cp=co+"ransition",cq=cp+"Property",cr=cp+"Duration",cs=cp+"TimingFunction",ct={Sin:"cubic-bezier(.3,0,.6,1)",Cos:"cubic-bezier(0,.3,.6,0)",Log:"cubic-bezier(0.6,.3,.8)",Exp:"cubic-bezier(.6,0,.8,.3)",Lin:"cubic-bezier(0,0,1,1)"};cc.Options.engine=co===undefined||bn?"javascript":"native",cc.Morph=new _(cc,{prepare:function(a){if(this.options.engine==="native"&&co!==undefined)this.render=this.transition=function(){},cu.call(this,a);else{var b=cx(a),c=cC(this.element,b),d=cD(this.element,a,b);cB(this.element,c,d),this.before=cA(c),this.after=cA(d)}},render:function(a){var b,c,d,e=this.element._.style,f,g,i;for(f in this.after){b=this.before[f],c=this.after[f];for(g=0,i=c.length;g<i;g++)d=b[g]+(c[g]-b[g])*a,c.r&&(d=h.round(d)),c.t[g*2+1]=d;e[f]=c.t.join("")}}});var cv=F("Top Left Right Bottom");cc.Highlight=new _(cc.Morph,{extend:{Options:c.merge(cc.Options,{color:"#FF8",transition:"Exp"})},prepare:function(a,b){var c=this.element,d=c._.style,e="backgroundColor",f=b||c.getStyle(e);cy(f)&&(this.onFinish(function(){d[e]="transparent"}),f=[c].concat(c.parents()).map("getStyle",e).reject(cy).compact().first()||"#FFF"),d[e]=a||this.options.color;return this.$super({backgroundColor:f})}}),cc.Twin=new _(cc.Morph,{finish:function(){this.how==="out"&&bC.prototype.hide.call(this.element);return this.$super()},setHow:function(a){this.how=a||"toggle",this.how==="toggle"&&(this.how=this.element.visible()?"out":"in")}}),cc.Slide=new _(cc.Twin,{extend:{Options:c.merge(cc.Options,{direction:"top"})},prepare:function(a){function f(){for(var a in e)d[a]=e[a]}this.setHow(a);var b=bC.prototype.show.call(this.element),d=b._.style,e=c.only(d,"overflow","width","height","marginTop","marginLeft");this.onFinish(f).onCancel(f),d.overflow="hidden";return this.$super(cE(d,b.size(),this.options.direction,this.how))}}),cc.Fade=new _(cc.Twin,{prepare:function(a){this.setHow(a),this.how==="in"&&bC.prototype.show.call(this.element.setStyle({opacity:0}));return this.$super({opacity:this.how==="in"?1:0})}}),cc.Attr=new _(cc,{prepare:function(a){this.before={},this.after=a;var b,c=this.element._;for(b in a)this.before[b]=c[b]},render:function(a){var b,c=this.element._,d=this.before;for(b in d)c[b]=d[b]+(this.after[b]-d[b])*a}}),cc.Scroll=new _(cc.Attr,{initialize:function(a,b){a=C(a),this.$super(a instanceof bz?a._.document[bp.WebKit?"body":"documentElement"]:a,b)},prepare:function(a){var b={};"x"in a&&(b.scrollLeft=a.x),"y"in a&&(b.scrollTop=a.y),this.$super(b)}});var cF=i.Cookie=new _({include:bg,extend:{set:function(a,b,c){return(new this(a,c)).set(b)},get:function(a){return(new this(a)).get()},remove:function(a){return(new this(a)).remove()},enabled:function(){b.cookie="__t=1";return b.cookie.indexOf("__t=1")!=-1},Options:{secure:!1,document:b}},initialize:function(a,b){this.name=a,this.setOptions(b)},set:function(a){var b=encodeURIComponent(a),c=this.options;c.domain&&(b+="; domain="+c.domain),c.path&&(b+="; path="+c.path);if(c.duration){var d=new Date;d.setTime(d.getTime()+c.duration*24*60*60*1e3),b+="; expires="+d.toGMTString()}c.secure&&(b+="; secure"),c.document.cookie=this.name+"="+b;return this},get:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+RegExp.escape(this.name)+"=([^;]*)");return a?decodeURIComponent(a[1]):null},remove:function(){this.options.duration=-1;return this.set("")}});q(a,c.without(i,"version","modules"));return i}(window,document,Object,Array,String,Function,Number,Math);RightJS.Browser.OLD&&function(a){var b=a.createElement("script"),c=a.getElementsByTagName("script"),d=c[c.length-1];b.src=d.src.replace(/(^|\/)(right)([^\/]+)$/,"$1$2-olds$3"),d.parentNode.appendChild(b)}(document)
7
+ var RightJS=function(a,b,c,d,e,f,g,h,i){function cH(a,b,c,d){var e={},f=a.marginLeft.toFloat()||0,g=a.marginTop.toFloat()||0,h=c==="right",i=c==="bottom",j=c==="top"||i;d==="out"?(e[j?"height":"width"]="0px",h?e.marginLeft=f+b.x+"px":i&&(e.marginTop=g+b.y+"px")):(j?(e.height=b.y+"px",a.height="0px"):(e.width=b.x+"px",a.width="0px"),h?(e.marginLeft=f+"px",a.marginLeft=f+b.x+"px"):i&&(e.marginTop=g+"px",a.marginTop=g+b.y+"px"));return e}function cG(a,b,c){var d=a.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(a.size().x).setStyle(b),e;a.parent()&&a.insert(d,"before"),e=cF(d,c),d.remove();return e}function cF(a,b){var c=0,d=b.length,e=a.computedStyles(),f={},g;for(;c<d;c++)g=b[c],g in e&&(f[g]=""+e[g],g==="opacity"&&(f[g]=f[g].replace(",",".")));return f}function cE(a,b,c){var d;for(d in c)(d=="width"||d=="height")&&b[d]=="auto"&&(b[d]=a._["offset"+d.capitalize()]+"px");bt&&c.filter&&!b.filter&&(b.filter="alpha(opacity=100)"),cC(a,b,c);for(d in c){if(c[d]!==b[d]&&/color/i.test(d)){bp&&(c[d]=c[d].replace(/"/g,""),b[d]=b[d].replace(/"/g,"")),cB(c[d])||(c[d]=c[d].toRgb()),cB(b[d])||(b[d]=b[d].toRgb());if(!c[d]||!b[d])c[d]=b[d]=""}/\d/.test(c[d])&&!/\d/.test(b[d])&&(b[d]=c[d].replace(/[\d\.\-]+/g,"0"));if(c[d]===b[d]||!/\d/.test(b[d])||!/\d/.test(c[d]))delete c[d],delete b[d]}}function cD(a){var b={},c=/[\d\.\-]+/g,d,e,f,g;for(e in a){d=a[e].match(c),f=d.map("toFloat"),f.t=a[e].split(c),f.r=f.t[0]==="rgb(",f.t.length==1&&f.t.unshift("");for(g=0;g<f.length;g++)f.t.splice(g*2+1,0,f[g]);b[e]=f}return b}function cC(a,b,c){for(var d=0;d<4;d++){var e="border"+cy[d]+"Style",f="border"+cy[d]+"Width",g="border"+cy[d]+"Color";if(e in b&&b[e]!=c[e]){var h=a._.style;b[e]=="none"&&(h[f]="0px"),h[e]=c[e],cB(b[g])&&(h[g]=a.getStyle("Color"))}}}function cB(a){return a==="transparent"||a==="rgba(0, 0, 0, 0)"}function cA(a){var b=[],c=["Style","Color","Width"],d,e,f;for(d in a)if(d.startsWith("border"))for(e=0;e<3;e++)for(f=0;f<4;f++)b.push("border"+cy[f]+c[e]);else d==="margin"||d==="padding"?cz(b,d,cy):d.startsWith("background")?cz(b,"background",["Color","Position","PositionX","PositionY"]):d==="opacity"&&bt?b.push("filter"):b.push(d);return b}function cz(a,b,c){for(var d=0;d<c.length;d++)a.push(b+c[d])}function cx(a){function g(){for(var a in f)e[a]=f[a]}var b=this.options,d=this.element,e=d._.style,f=c.only(d.computedStyles(),ct,cu,cv);this.onFinish(g).onCancel(function(){e[ct]="none",setTimeout(g,1)}),e[ct]="all",e[cu]=(cf.Durations[b.duration]||b.duration)+"ms",e[cv]=cw[b.transition]||b.transition,setTimeout(function(){d.setStyle(a)},0)}function cq(a,b,c){var d=J(c).compact(),e=A(d.last())?d.pop():{},f=new(cf[b.capitalize()])(a,e);f.start.apply(f,d);return a}function cp(a){a._timer&&clearInterval(a._timer)}function co(a,b,c,d){var e=1;a._timer=setInterval(function(){e>d?a.finish():(a.render(b(e/d)),e++)},c)}function cn(a){var b=I(a._);(ch[b]||[]).each("cancel"),(cg[b]||[]).splice(0)}function cm(a){var b=a.ch,c=b.shift();if(c=b[0])c[1].$ch=!0,c[1].start.apply(c[1],c[0])}function cl(a){var b=a.cr;b&&b.splice(b.indexOf(a),1)}function ck(a){a.cr&&a.cr.push(a)}function cj(a,b){var c=a.ch,d=a.options.queue;if(!c||a.$ch)return a.$ch=!1;d&&c.push([b,a]);return d&&c[0][1]!==a}function ci(a){var b=I((a.element||{})._||{});a.ch=cg[b]=cg[b]||[],a.cr=ch[b]=ch[b]||[]}function ce(a,b){a.stop(),this.send(b)}function cb(a,b){var d=a[0],e,f,g=ca(a),h=!c.keys(g).length;return(b.$listeners||[]).filter(function(a){return a.dr&&a.n===d&&(h||function(){for(var b in g)if(a.dr===b)for(e=0,f=g[b];e<f.length;e++)if(!f[e].length||f[e][0]===a.dc)return!0;return!1}())})}function ca(a){var b=J(a),c=b[1]||{},d={},e;y(c)?(d[c]=b.slice(2),B(d[c][0])&&(d[c]=d[c][0].map(N))):d=c;for(e in d)d[e]=N(d[e]),d[e]=B(d[e][0])?d[e]:[d[e]];return d}function b_(a,b,c){var d=J(b),e=d.shift();return function(b){var c=b.find(a);return c===i?c:typeof e==="string"?c[e].apply(c,d):e.apply(c,[b].concat(d))}}function b$(){bW&&(bW=!1,bq?(b.attachEvent("onmouseover",bY),a.attachEvent("blur",bZ)):(b.addEventListener("mouseover",bY,!1),a.addEventListener("blur",bZ,!1)))}function bZ(a){bV.each(function(b,c){b&&q[c]&&bX(a,q[c]._,c,!1)})}function bY(a){var b=a.target||a.srcElement,c=a.relatedTarget||a.fromElement,d=b,e=!1,f=[],g,h;while(d.nodeType===1)g=I(d),bV[g]===i&&bX(a,d,g,bV[g]=!0),d===c&&(e=!0),f.push(d),d=d.parentNode;if(c&&!e)while(c!==null&&c.nodeType===1&&f.indexOf(c)===-1)g=I(c),bV[g]!==i&&bX(a,c,g,bV[g]=i),c=c.parentNode}function bX(a,b,c,d){var e=new bD(a);e.type=d===!0?"mouseenter":"mouseleave",e.bubbles=!1,e.stopped=!0,e.target=bz(b),e.find=function(a){return F(a,!0).indexOf(this.target._)===-1?i:this.target},e.target.fire(e),bB.fire(e)}function bU(a){var b=new bD(a),c=b.target,d=c.parent&&c.parent();b.type=a.type==="focusin"||a.type==="focus"?"focus":"blur",d&&d.fire(b)}function bR(a){a=H(a),bE=bE.concat(a),bl(bF.prototype,a),bl(bA.prototype,a)}function bQ(a,b){b=b.camelize();if(b==="opacity")return bt?(/opacity=(\d+)/i.exec(a.filter||"")||["","100"])[1].toInt()/100+"":a[b].replace(",",".");b==="float"&&(b=bq?"styleFloat":"cssFloat");var c=a[b];bp&&/color/i.test(b)&&c&&(c=c.replace(/"/g,""));return c}function bP(a,b){if(typeof b==="string"){var c=a.tagName,d=bO,e=c in bM?bM[c]:["","",1],f=e[2];d.innerHTML=e[0]+"<"+c+">"+b+"</"+c+">"+e[1];while(f--!==0)d=d.firstChild;b=d.childNodes;while(b.length!==0)bN.appendChild(b[0])}else for(var g=0,h=b.length,i;g<h;g++)i=b[b.length===h?g:0],bN.appendChild(i instanceof bF?i._:i);return bN}function bK(a,b,c){var d=a._,e=[],f=0,g=!c;while(d=d[b])d.nodeType===1&&(g||bz(d).match(c))&&(e[f++]=bz(d));return e}function bJ(a,b,c){if(typeof b==="string"){a._=bI(b,c);if(c!==i)for(var d in c)switch(d){case"id":a._.id=c[d];break;case"html":a._.innerHTML=c[d];break;case"class":a._.className=c[d];break;case"on":a.on(c[d]);break;default:a.set(d,c[d])}}else a._=b}function bz(a){if(a!=null){var b=r in a?q[a[r]]:i;if(b!==i)return b;if(a.nodeType===1)return new bF(a);if(a.nodeType===9)return new bA(a);if(a.window==a)return new bC(a);if(C(a.target)||C(a.srcElement))return new bD(a)}return a}function by(a,b){typeof a==="string"&&(a=s({type:a},b),this.stopped=a.bubbles===!1,A(b)&&s(this,b)),this._=a,this.type=a.type,this.which=a.which,this.keyCode=a.keyCode,this.target=bz(a.target!=null&&"nodeType"in a.target&&a.target.nodeType===3?a.target.parentNode:a.target),this.currentTarget=bz(a.currentTarget),this.relatedTarget=bz(a.relatedTarget),this.pageX=a.pageX,this.pageY=a.pageY;if(bs&&"srcElement"in a){this.which=a.button===2?3:a.button===4?2:1,this.target=bz(a.srcElement)||b,this.relatedTarget=this.target._===a.fromElement?bz(a.toElement):this.target,this.currentTarget=b;var c=this.target.win().scrolls();this.pageX=a.clientX+c.x,this.pageY=a.clientY+c.y}}function bx(a,b){bJ(this,a,b);var c=this,d=c._,e=bv.Cast(d),f=r in d?d[r]:d[r]=p++;e!==i&&(c=new e(d,b),"$listeners"in this&&(c.$listeners=this.$listeners)),q[f]=c;return c}function bw(){return function(a,b){bh(this),this.initialize.apply(this,arguments);var c=this._,d=r in c?c[r]:c[r]=(c.nodeType===1?1:-1)*p++;q[d]=this}}function bn(a,b,c,d){if(A(b))for(var e in b)a.stopObserving(e,b[e]);else y(b)||(c=b,b=null),y(c)&&(c=a[c]),a.$listeners=(a.$listeners||[]).filter(function(a){var e=b&&c?a.e!==b||a.f!==c:b?a.e!==b:a.f!==c;e||d(a);return e})}function bm(a,b,c){var d=n.call(b,2),e=b[0],f=b[1],g=!1;if(y(e))switch(typeof f){case"string":g=f,f=f in a?a[f]:function(){};case"function":("$listeners"in a?a.$listeners:a.$listeners=[]).push(c({e:e,f:f,a:d,r:g||!1,t:a}));break;default:if(B(f))for(var h=0;h<f.length;h++)a.on.apply(a,[e].concat(N(f[h])).concat(d))}else{d=n.call(b,1);for(g in e)a.on.apply(a,[g].concat(N(e[g])).concat(d))}}function bh(a){"prebind"in a&&B(a.prebind)&&a.prebind.each(function(b){a[b]=a[b].bind(a)})}function bg(a,b){var c=b.toUpperCase(),d=a.constructor,e=[a,d].concat(d.ancestors||[]),f=0;for(l=e.length;f<l;f++){if(c in e[f])return e[f][c];if(b in e[f])return e[f][b]}return null}function bf(a,b,c){(b[bd[c?0:2]]||b[bd[c?1:3]]||function(){}).call(b,a)}function be(a,b){return c.without.apply(c,[a].concat(bd.concat(b?H("prototype parent ancestors"):["constructor"])))}function ba(a,b){return a>b?1:a<b?-1:0}function _(a){return!!a}function $(a,b,c){try{return a.apply(b,Y(c,b))}catch(d){if(!(d instanceof Z))throw d}return i}function Z(){}function Y(a,b){var c=a[0],d=n.call(a,1),e=b,f;typeof c==="string"?(f=c,b.length!==0&&typeof b[0][f]==="function"?c=function(a){return a[f].apply(a,d)}:c=function(a){return a[f]}):e=d[0];return[c,e]}function N(a){return B(a)?a:[a]}function K(a){return s(a,{Methods:{},include:function(){for(var b=0,c=arguments.length;b<c;b++)A(arguments[b])&&(s(a.prototype,arguments[b]),s(a.Methods,arguments[b]))}})}var j=function(a){return a};j.version="2.2.3",j.modules=["core","dom","form","events","xhr","fx","cookie"];var k=d.prototype,m=c.prototype.toString,n=k.slice,o=b.documentElement,p=1,q=[],r="uniqueNumber",s=j.$ext=function(a,b,c){var d=b||{},e;for(e in d)if(!c||!(e in a))a[e]=d[e];return a},t=j.$eval=function(b){b&&("execScript"in a?bB.win()._.execScript(b):G("script",{text:b}).insertTo(o))},u=j.$break=function(){throw new Z},v=j.$alias=function(a,b){for(var c in b)a[c]=a[b[c]];return a},w=j.defined=function(a){return typeof a!=="undefined"},x=j.isFunction=function(a){return typeof a==="function"},y=j.isString=function(a){return typeof a==="string"},z=j.isNumber=function(a){return typeof a==="number"},A=j.isHash=function(a){return m.call(a)==="[object Object]"},B=j.isArray=function(a){return m.call(a)==="[object Array]"},C=j.isElement=function(a){return a!=null&&a.nodeType===1},D=j.isNode=function(a){return a!=null&&a.nodeType!=null},E=j.$=function(a){if(a instanceof bv)return a;typeof a==="string"&&(a=b.getElementById(a));return bz(a)},F=j.$$=function(a,b){return bB.find(a,b)},G=j.$E=function(a,b){return new bF(a,b)},H=j.$w=function(a){return a.trim().split(/\s+/)},I=j.$uid=function(a){return r in a?a[r]:a[r]=p++},J=j.$A=function(a){return n.call(a,0)};k.map||(J=j.$A=function(a){try{return n.call(a,0)}catch(b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=a[d];return c}}),A(o)&&(A=j.isHash=function(a){return m.call(a)==="[object Object]"&&a!=null&&a.hasOwnProperty!=null});for(var L=0,M="Array Function Number String Date RegExp".split(" ");L<M.length;L++)j[M[L]]=K((new f("return "+M[L]))());j.Object=c,j.Math=h,s(c,{keys:function(a){var b=[],c;for(c in a)b.push(c);return b},values:function(a){var b=[],c;for(c in a)b.push(a[c]);return b},each:function(a,b,c){for(var d in a)b.call(c,d,a[d]);return a},empty:function(a){for(var b in a)return!1;return!0},clone:function(a){return c.merge(a)},without:function(){var a=J(arguments),b=a.shift(),c={},d;for(d in b)a.include(d)||(c[d]=b[d]);return c},only:function(){var a=J(arguments),b=a.shift(),c={},d=0,e=a.length;for(;d<e;d++)a[d]in b&&(c[a[d]]=b[a[d]]);return c},merge:function(){var a={},b=0,d=arguments,e;for(l=d.length;b<l;b++)if(A(d[b]))for(e in d[b])a[e]=A(d[b][e])&&!(d[b][e]instanceof bb)?c.merge(e in a?a[e]:{},d[b][e]):d[b][e];return a},toQueryString:function(a){var b=[],c,d,e=encodeURIComponent;for(c in a){d=N(a[c]);for(var f=0,g=d.length;f<g;f++)b.push(e(c)+"="+e(d[f]))}return b.join("&")}},!0);var O=h.random;h.random=function(a,b){if(arguments.length===0)return O();arguments.length===1&&(b=a,a=0);return~~(O()*(b-a+1)+~~a)};var P=k.sort,Q=k.forEach||function(a,b){for(var c=0,d=this.length;c<d;c++)a.call(b,this[c],c,this)},R=k.filter||function(a,b){for(var c=[],d=0,e=0,f=this.length;e<f;e++)a.call(b,this[e],e,this)&&(c[d++]=this[e]);return c},S=function(a,b){for(var c=[],d=0,e=0,f=this.length;e<f;e++)a.call(b,this[e],e,this)||(c[d++]=this[e]);return c},T=k.map||function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)c[d]=a.call(b,this[d],d,this);return c},U=k.some||function(a,b){for(var c=0,d=this.length;c<d;c++)if(a.call(b,this[c],c,this))return!0;return!1},V=k.every||function(a,b){for(var c=0,d=this.length;c<d;c++)if(!a.call(b,this[c],c,this))return!1;return!0},W=function(a,b){for(var c=0,d=this.length;c<d;c++)if(a.call(b,this[c],c,this))return this[c];return i},X=function(a,b){for(var c=this.length-1;c>-1;c--)if(a.call(b,this[c],c,this))return this[c];return i};d.include({indexOf:k.indexOf||function(a,b){for(var c=b<0?h.max(0,this.length+b):b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:k.lastIndexOf||function(a){for(var b=this.length-1;b>-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?$(W,this,arguments):this[0]},last:function(){return arguments.length?$(X,this,arguments):this[this.length-1]},random:function(){return this.length===0?i:this[h.random(this.length-1)]},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return this.length===0},clone:function(){return this.slice(0)},each:function(){$(Q,this,arguments);return this},forEach:Q,map:function(){return $(T,this,arguments)},filter:function(){return $(R,this,arguments)},reject:function(){return $(S,this,arguments)},some:function(a){return $(U,this,a?arguments:[_])},every:function(a){return $(V,this,a?arguments:[_])},walk:function(){this.map.apply(this,arguments).forEach(function(a,b){this[b]=a},this);return this},merge:function(){for(var a=this.clone(),b,c=0;c<arguments.length;c++){b=N(arguments[c]);for(var d=0;d<b.length;d++)a.indexOf(b[d])==-1&&a.push(b[d])}return a},flatten:function(){var a=[];this.forEach(function(b){B(b)?a=a.concat(b.flatten()):a.push(b)});return a},compact:function(){return this.without(null,i)},uniq:function(){return[].merge(this)},includes:function(){for(var a=0;a<arguments.length;a++)if(this.indexOf(arguments[a])===-1)return!1;return!0},without:function(){var a=n.call(arguments);return this.filter(function(b){return a.indexOf(b)===-1})},shuffle:function(){var a=this.clone(),b,c,d=a.length;for(;d>0;b=h.random(d-1),c=a[--d],a[d]=a[b],a[b]=c){}return a},sort:function(a){return P.apply(this,a||!z(this[0])?arguments:[ba])},sortBy:function(){var a=Y(arguments,this);return this.sort(function(b,c){return ba(a[0].call(a[1],b),a[0].call(a[1],c))})},min:function(){return h.min.apply(h,this)},max:function(){return h.max.apply(h,this)},sum:function(){for(var a=0,b=0,c=this.length;b<c;a+=this[b++]){}return a}}),k.include=k.includes,e.include({empty:function(){return this==""},blank:function(){return this==!1},trim:e.prototype.trim||function(){var a=this.replace(/^\s\s*/,""),b=a.length;while(/\s/.test(a.charAt(--b))){}return a.slice(0,b+1)},stripTags:function(){return this.replace(/<\/?[^>]+>/ig,"")},stripScripts:function(a){var b="",c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/img,function(a,c){b+=c+"\n";return""});a===!0?t(b):x(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(!0);return this},camelize:function(){return this.replace(/(\-|_)+(.)?/g,function(a,b,c){return c?c.toUpperCase():""})},underscored:function(){return this.replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/\-/g,"_").toLowerCase()},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){return(b!==!0?this.indexOf(a):this.toLowerCase().indexOf(a.toLowerCase()))===0},endsWith:function(a,b){return this.length-(b!==!0?this.lastIndexOf(a):this.toLowerCase().lastIndexOf(a.toLowerCase()))===a.length},toInt:function(a){return parseInt(this,a===i?10:a)},toFloat:function(a){return parseFloat(a===!0?this:this.replace(",",".").replace(/(\d)-(\d)/,"$1.$2"))}}),e.prototype.include=e.prototype.includes,f.include({bind:function(){var a=J(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length!==0||arguments.length!==0?a.concat(J(arguments)):a)}},bindAsEventListener:function(){var a=J(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(J(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(J(arguments)))},rcurry:function(){var a=J(arguments),b=this;return function(){return b.apply(b,J(arguments).concat(a))}},delay:function(){var a=J(arguments),b=a.shift(),c=new g(setTimeout(this.bind.apply(this,[this].concat(a)),b));c.cancel=function(){clearTimeout(this)};return c},periodical:function(){var a=J(arguments),b=a.shift(),c=new g(setInterval(this.bind.apply(this,[this].concat(a)),b));c.stop=function(){clearInterval(this)};return c},chain:function(){var a=J(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}}),g.include({times:function(a,b){for(var c=0;c<this;c++)a.call(b,c);return this},upto:function(a,b,c){for(var d=this+0;d<=a;d++)b.call(c,d);return this},downto:function(a,b,c){for(var d=this+0;d>=a;d--)b.call(c,d);return this},abs:function(){return h.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):h.round(this)},ceil:function(){return h.ceil(this)},floor:function(){return h.floor(this)},min:function(a){return this<a?a:this+0},max:function(a){return this>a?a:this+0}}),RegExp.escape=function(a){return(""+a).replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1")};var bb=j.Class=function(){var a=J(arguments).slice(0,2),b=a.pop()||{},c=a.pop(),d=arguments[2],e=function(){};!a.length&&!A(b)&&(c=b,b={}),!d&&c&&(c===bv||c.ancestors.include(bv))&&(d=bw()),d=s(d||function(){bh(this);return"initialize"in this?this.initialize.apply(this,arguments):this},bc),c=c||bb,e.prototype=c.prototype,d.prototype=new e,d.parent=c,d.prototype.constructor=d,d.ancestors=[];while(c)d.ancestors.push(c),c=c.parent;["extend","include"].each(function(a){a in b&&d[a].apply(d,N(b[a]))});return d.include(b)},bc={extend:function(){J(arguments).filter(A).each(function(a){s(this,be(a,!0)),bf(this,a,!0)},this);return this},include:function(){var a=[this].concat(this.ancestors);J(arguments).filter(A).each(function(b){c.each(be(b,!1),function(b,c){for(var d,e=0,f=a.length;e<f;e++)if(b in a[e].prototype){d=a[e].prototype[b];break}this.prototype[b]=x(c)&&x(d)?function(){this.$super=d;return c.apply(this,arguments)}:c},this),bf(this,b,!1)},this);return this}},bd=H("selfExtended self_extended selfIncluded self_included extend include");s(bb,bc),bb.prototype.$super=i;var bi=j.Options={setOptions:function(a){var b=this.options=s(s({},c.clone(bg(this,"Options"))),a),d,e;if(x(this.on))for(e in b)if(d=e.match(/on([A-Z][A-Za-z]+)/))this.on(d[1].toLowerCase(),b[e]),delete b[e];return this},cutOptions:function(a){var b=J(a);this.setOptions(A(b.last())?b.pop():{});return b}},bj=j.Observer=new bb({include:bi,initialize:function(a){this.setOptions(a),bl(this,bg(this,"Events"));return this},on:function(){bm(this,arguments,function(a){return a});return this},observes:function(a,b){y(a)||(b=a,a=null),y(b)&&(b=b in this?this[b]:null);return(this.$listeners||[]).some(function(c){return a&&b?c.e===a&&c.f===b:a?c.e===a:c.f===b})},stopObserving:function(a,b){bn(this,a,b,function(){});return this},listeners:function(a){return(this.$listeners||[]).filter(function(b){return!a||b.e===a}).map(function(a){return a.f}).uniq()},fire:function(){var a=J(arguments),b=a.shift();(this.$listeners||[]).each(function(c){c.e===b&&c.f.apply(this,c.a.concat(a))},this);return this}}),bk=bj.create=function(a,b){s(a,c.without(bj.prototype,"initialize","setOptions"),!0);return bl(a,b||bg(a,"Events"))},bl=bj.createShortcuts=function(a,b){(b||[]).each(function(b){var c="on"+b.replace(/(^|_|:)([a-z])/g,function(a,b,c){return c.toUpperCase()});c in a||(a[c]=function(){return this.on.apply(this,[b].concat(J(arguments)))})});return a},bo=navigator.userAgent,bp="opera"in a,bq="attachEvent"in a&&!bp,br=j.Browser={IE:bq,Opera:bp,WebKit:bo.include("AppleWebKit/"),Gecko:bo.include("Gecko")&&!bo.include("KHTML"),MobileSafari:/Apple.*Mobile.*Safari/.test(bo),Konqueror:bo.include("Konqueror"),OLD:!b.querySelector,IE8L:!1},bs=!1,bt=!("opacity"in o.style)&&"filter"in o.style;try{b.createElement("<input/>"),br.OLD=br.IE8L=bs=!0}catch(bu){}var bv=j.Wrapper=new bb({_:i,initialize:function(a){this._=a}});bv.Cache=q,bv.Cast=function(a){return a.tagName in bG?bG[a.tagName]:i};var bA=j.Document=new bb(bv,{win:function(){return bz(this._.defaultView||this._.parentWindow)}}),bB=bz(b),bC=j.Window=new bb(bv,{win:function(){return this},size:function(){var a=this._,b=a.document.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=this._,b=a.document,c=b.body,d=b.documentElement;return a.pageXOffset||a.pageYOffset?{x:a.pageXOffset,y:a.pageYOffset}:c&&(c.scrollLeft||c.scrollTop)?{x:c.scrollLeft,y:c.scrollTop}:{x:d.scrollLeft,y:d.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=z(a)?null:E(a);f instanceof bF&&(a=f.position()),A(a)&&(e=a.y,d=a.x),A(c=c||b)&&j.Fx?(new cf.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),bD=j.Event=new bb(bv,{type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,pageX:null,pageY:null,initialize:by,stopPropagation:function(){this._.stopPropagation?this._.stopPropagation():this._.cancelBubble=!0,this.stopped=!0;return this},preventDefault:function(){this._.preventDefault?this._.preventDefault():this._.returnValue=!1;return this},stop:function(){return this.stopPropagation().preventDefault()},position:function(){return{x:this.pageX,y:this.pageY}},offset:function(){if(this.target instanceof bF){var a=this.target.position();return{x:this.pageX-a.x,y:this.pageY-a.y}}return null},find:function(a){if(this.target instanceof bv&&this.currentTarget instanceof bv){var b=this.target._,c=this.currentTarget.find(a,!0);while(b){if(c.indexOf(b)!==-1)return bz(b);b=b.parentNode}}return i}},by),bE=[],bF=j.Element=new bb(bv,{initialize:function(a,b){bJ(this,a,b)}},bx),bG=bF.Wrappers={},bH={},bI=function(a,c){return(a in bH?bH[a]:bH[a]=b.createElement(a)).cloneNode(!1)};bs&&(bI=function(a,c){a==="input"&&c!==i&&(a='<input name="'+c.name+'" type='+c.type+(c.checked?" checked":"")+"/>");return b.createElement(a)}),bF.include({parent:function(a){var b=this._.parentNode,c=b&&b.nodeType;return a?this.parents(a)[0]:c===1||c===9?bz(b):null},parents:function(a){return bK(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(a){return a._.parentNode===this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))},nextSiblings:function(a){return bK(this,"nextSibling",a)},prevSiblings:function(a){return bK(this,"previousSibling",a)},next:function(a){return!a&&this._.nextElementSibling!==i?bz(this._.nextElementSibling):this.nextSiblings(a)[0]},prev:function(a){return!a&&this._.previousElementSibling!==i?bz(this._.previousElementSibling):this.prevSiblings(a)[0]},remove:function(){var a=this._,b=a.parentNode;b&&b.removeChild(a);return this},insert:function(a,b){var c=null,d=this._;b=b===i?"bottom":b,typeof a!=="object"?c=a=""+a:a instanceof bF&&(a=a._),bL[b](d,a.nodeType===i?bP(b==="bottom"||b==="top"?d:d.parentNode,a):a),c!==null&&c.evalScripts();return this},insertTo:function(a,b){E(a).insert(this,b);return this},append:function(a){return this.insert(y(a)?J(arguments).join(""):arguments)},update:function(a){if(typeof a!=="object"){a=""+a;try{this._.innerHTML=a}catch(b){return this.clean().insert(a)}a.evalScripts();return this}return this.clean().insert(a)},html:function(a){return a===i?this._.innerHTML:this.update(a)},text:function(a){return a===i?this._.textContent||this._.innerText:this.update(this.doc()._.createTextNode(a))},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;c&&(a=E(a)._,c.replaceChild(a,b),a.appendChild(b));return this},clean:function(){while(this._.firstChild)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){return new bF(this._.cloneNode(!0))},index:function(){var a=this._,b=a.parentNode.firstChild,c=0;while(b!==a)b.nodeType===1&&c++,b=b.nextSibling;return c}});var bL={bottom:function(a,b){a.appendChild(b)},top:function(a,b){a.firstChild!==null?a.insertBefore(b,a.firstChild):a.appendChild(b)},after:function(a,b){var c=a.parentNode,d=a.nextSibling;d!==null?c.insertBefore(b,d):c.appendChild(b)},before:function(a,b){a.parentNode.insertBefore(b,a)},instead:function(a,b){a.parentNode.replaceChild(b,a)}},bM={TBODY:["<TABLE>","</TABLE>",2],TR:["<TABLE><TBODY>","</TBODY></TABLE>",3],TD:["<TABLE><TBODY><TR>","</TR></TBODY></TABLE>",4],COL:["<TABLE><COLGROUP>","</COLGROUP><TBODY></TBODY></TABLE>",2],LEGEND:["<FIELDSET>","</FIELDSET>",2],AREA:["<map>","</map>",2],OPTION:["<SELECT>","</SELECT>",2]};v(bM,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var bN=b.createDocumentFragment(),bO=b.createElement("DIV");bF.include({setStyle:function(a,b){var c,d,e={},f=this._.style;b!==i?(e[a]=b,a=e):y(a)&&(a.split(";").each(function(a){var b=a.split(":").map("trim");b[0]&&b[1]&&(e[b[0]]=b[1])}),a=e);for(c in a)d=c.indexOf("-")<0?c:c.camelize(),bt&&c==="opacity"?f.filter="alpha(opacity="+a[c]*100+")":c==="float"&&(d=bq?"styleFloat":"cssFloat"),f[d]=a[c];return this},getStyle:function(a){return bQ(this._.style,a)||bQ(this.computedStyles(),a)},computedStyles:o.currentStyle?function(){return this._.currentStyle||{}}:o.runtimeStyle?function(){return this._.runtimeStyle||{}}:function(){return this._.ownerDocument.defaultView.getComputedStyle(this._,null)},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},getClass:function(){return this._.className},addClass:function(a){var b=" "+this._.className+" ";b.indexOf(" "+a+" ")==-1&&(this._.className+=(b===" "?"":" ")+a);return this},removeClass:function(a){this._.className=(" "+this._.className+" ").replace(" "+a+" "," ").trim();return this},toggleClass:function(a){return this[this.hasClass(a)?"removeClass":"addClass"](a)},radioClass:function(a){this.siblings().each("removeClass",a);return this.addClass(a)}}),bF.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b,a=c}var d,e=this._;for(d in a)d==="style"?this.setStyle(a[d]):(d in e||e.setAttribute(d,""+a[d]),e[d]=a[d]);return this},get:function(a){var b=this._,c=b[a]||b.getAttribute(a);return c===""?null:c},has:function(a){return this.get(a)!==null},erase:function(a){this._.removeAttribute(a);return this},hidden:function(){return this.getStyle("display")==="none"},visible:function(){return!this.hidden()},hide:function(a,b){this.visible()&&(this._d=this.getStyle("display"),this._.style.display="none");return this},show:function(){if(this.hidden()){var a=this._,b=this._d,c;if(!b||b==="none")c=G(a.tagName).insertTo(o),b=c.getStyle("display"),c.remove();b==="none"&&(b="block"),a.style.display=b}return this},toggle:function(){return this[this.visible()?"hide":"show"]()},radio:function(a,b){this.siblings().each("hide",a,b);return this.show()}}),bF.include({doc:function(){return bz(this._.ownerDocument)},win:function(){return this.doc().win()},size:function(){return{x:this._.offsetWidth,y:this._.offsetHeight}},position:function(){var a=this._.getBoundingClientRect(),b=this.doc()._.documentElement,c=this.win().scrolls();return{x:a.left+c.x-b.clientLeft,y:a.top+c.y-b.clientTop}},scrolls:function(){return{x:this._.scrollLeft,y:this._.scrollTop}},dimensions:function(){var a=this.size(),b=this.scrolls(),c=this.position();return{top:c.y,left:c.x,width:a.x,height:a.y,scrollLeft:b.x,scrollTop:b.y}},overlaps:function(a){var b=this.position(),c=this.size();return a.x>b.x&&a.x<b.x+c.x&&a.y>b.y&&a.y<b.y+c.y},setWidth:function(a){var b=this._.style;b.width=a+"px",b.width=2*a-this._.offsetWidth+"px";return this},setHeight:function(a){var b=this._.style;b.height=a+"px",b.height=2*a-this._.offsetHeight+"px";return this},resize:function(a,b){A(a)&&(b=a.y,a=a.x);return this.setWidth(a).setHeight(b)},moveTo:function(a,b){A(a)&&(b=a.y,a=a.x);return this.setStyle({left:a+"px",top:b+"px"})},scrollTo:function(a,b){A(a)&&(b=a.y,a=a.x),this._.scrollLeft=a,this._.scrollTop=b;return this},scrollThere:function(a){this.win().scrollTo(this,a);return this}}),[bF,bA,bC].each("include",s(bk({}),{on:function(){bm(this,arguments,function(a){a.e==="mouseenter"||a.e==="mouseleave"?(b$(),a.n=a.e,a.w=function(){}):(a.e==="contextmenu"&&br.Konqueror?a.n="rightclick":a.e==="mousewheel"&&br.Gecko?a.n="DOMMouseScroll":a.n=a.e,a.w=function(b){b=new bD(b,a.t),a.f.apply(a.t,(a.r?[]:[b]).concat(a.a))===!1&&b.stop()},bs?a.t._.attachEvent("on"+a.n,a.w):a.t._.addEventListener(a.n,a.w,!1));return a});return this},stopObserving:function(a,b){bn(this,a,b,function(a){bs?a.t._.detachEvent("on"+a.n,a.w):a.t._.removeEventListener(a.n,a.w,!1)});return this},fire:function(a,b){var c=this.parent&&this.parent();a instanceof bD||(a=new bD(a,s({target:this._},b))),a.currentTarget=this,(this.$listeners||[]).each(function(b){b.e===a.type&&b.f.apply(this,(b.r?[]:[a]).concat(b.a))===!1&&a.stop()},this),c&&c.fire&&!a.stopped&&c.fire(a);return this},stopEvent:function(){return!1}})),bl(bC.prototype,H("blur focus scroll resize load")),bR("click rightclick contextmenu mousedown mouseup mouseover mouseout mousemove keypress keydown keyup"),[bF,bA].each("include",{first:function(a){return bz(a===i&&this._.firstElementChild!==i?this._.firstElementChild:this._.querySelector(a||"*"))},find:function(a,b){var c=this._.querySelectorAll(a||"*"),d,e=0,f=c.length;if(b===!0)d=J(c);else for(d=[];e<f;e++)d[e]=bz(c[e]);return d},match:function(a){var c=this._,d=c,e,f=!1;while(d.parentNode!==null&&d.parentNode.nodeType!==11)d=d.parentNode;c===d&&(d=b.createElement("div"),d.appendChild(c),f=!0),e=bz(d).find(a,!0).indexOf(c)!==-1,f&&d.removeChild(c);return e}}),bA.include({on:function(a){if(a==="ready"&&!this._iR){var b=this._,c=this.fire.bind(this,"ready");"readyState"in b?function(){["loaded","complete"].include(b.readyState)?c():arguments.callee.delay(50)}():b.addEventListener("DOMContentLoaded",c,!1),this._iR=!0}return this.$super.apply(this,arguments)}}),bl(bA.prototype,["ready"]);var bS=j.Form=bG.FORM=new bb(bF,{initialize:function(a){var b=a||{},d="remote"in b,e=b;A(b)&&!C(b)&&(e="form",b=c.without(b,"remote")),this.$super(e,b),d&&this.remotize()},elements:function(){return this.find("input,button,select,textarea")},inputs:function(){return this.elements().filter(function(a){return!["submit","button","reset","image",null].include(a._.type)})},input:function(a){return bz(this._[a])},focus:function(){var a=this.inputs().first(function(a){return a._.type!=="hidden"});a&&a.focus();return this},blur:function(){this.elements().each("blur");return this},disable:function(){this.elements().each("disable");return this},enable:function(){this.elements().each("enable");return this},values:function(){var a={},b,c,d,e;this.inputs().each(function(d){e=d._,c=e.name,!e.disabled&&c&&(!["checkbox","radio"].include(e.type)||e.checked)&&(b=d.getValue(),c.endsWith("[]")&&(b=(a[c]||[]).concat([b])),a[c]=b)});return a},serialize:function(){return c.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});bR("submit reset focus blur disable enable change");var bT=j.Input=bG.INPUT=bG.BUTTON=bG.SELECT=bG.TEXTAREA=bG.OPTGROUP=new bb(bF,{initialize:function(a,b){if(!a||A(a)&&!C(a))b=a||{},/textarea|select/.test(b.type||"")?(a=b.type,delete b.type):a="input";this.$super(a,b)},form:function(){return bz(this._.form)},insert:function(a,b){this.$super(a,b),this.find("option").each(function(a){a._.selected=!!a.get("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?this.find("option").map(function(a){return a._.selected?a._.value:null}).compact():this._.value},setValue:function(a){this._.type=="select-multiple"?(a=N(a).map(e),this.find("option").each(function(b){b._.selected=a.include(b._.value)})):this._.value=a;return this},value:function(a){return this[a===i?"getValue":"setValue"](a)},focus:function(){this._.focus(),this.focused=!0,bq&&this.fire("focus",{bubbles:!1});return this},blur:function(){this._.blur(),this.focused=!1,bq&&this.fire("blur",{bubbles:!1});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=!0;return this.fire("disable")},enable:function(){this._.disabled=!1;return this.fire("enable")},disabled:function(a){return a===i?this._.disabled:this[a?"disable":"enable"]()},checked:function(a){a===i?a=this._.checked:(this._.checked=a,a=this);return a}});bs?(b.attachEvent("onfocusin",bU),b.attachEvent("onfocusout",bU)):(b.addEventListener("focus",bU,!0),b.addEventListener("blur",bU,!0));var bV=[],bW=!0;bR("mouseenter mouseleave"),[bF,bA].each("include",{delegate:function(a){var b=ca(arguments),c,d,e,f;for(c in b)for(d=0,f=b[c];d<f.length;d++)this.on(a,b_(c,f[d],this)),s(this.$listeners.last(),{dr:c,dc:f[d][0]});return this},undelegate:function(a){cb(arguments,this).each(function(a){this.stopObserving(a.n,a.f)},this);return this},delegates:function(){return!!cb(arguments,this).length}}),c.each({on:"delegate",stopObserving:"undelegate",observes:"delegates"},function(a,b){e.prototype[a]=function(){var a=J(arguments),c;a.splice(1,0,""+this),c=bB[b].apply(bB,a);return c===bB?this:c}});var cc=e.prototype.on;e.prototype.on=function(a){if(A(a))for(var b in a)cc.apply(this,[b].concat([a[b]]));else cc.apply(this,arguments);return this},bE.each(function(a){e.prototype["on"+a.capitalize()]=function(){return this.on.apply(this,[a].concat(J(arguments)))}}),H("Element Input Form").each(function(a){c.each(a in j?j[a].prototype:{},function(a,b){x(b)&&!(a in e.prototype)&&(e.prototype[a]=function(){var b=F(this,!0),c=0,d=b.length,e=!0,f,g;for(;c<d;c++){f=bz(b[c]),g=f[a].apply(f,arguments);if(e){if(g!==f)return g;e=!1}}return null})})});var cd=j.Xhr=new bb(bj,{extend:{EVENTS:H("success failure complete request cancel create"),Options:{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript,text/html,application/xml,text/xml,*/*"},method:"post",encoding:"utf-8",async:!0,evalScripts:!1,evalResponse:!1,evalJS:!0,evalJSON:!0,secureJSON:!0,urlEncoded:!0,spinner:null,spinnerFx:"fade",params:null,iframed:!1,jsonp:!1},load:function(a,b){return(new this(a,s({method:"get"},b))).send()}},initialize:function(a,b){this.initCallbacks(),this.url=a,s(this.$super(b),this.options),this.params!=cd.Options.params&&(this.params=this.prepareData(cd.Options.params,this.params)),cd.Options.spinner&&E(this.spinner)===E(cd.Options.spinner)&&(this.spinner=null)},setHeader:function(a,b){this.headers[a]=b;return this},getHeader:function(a){var b;try{b=this.xhr.getResponseHeader(a)}catch(c){}return b},successful:function(){return this.status>=200&&this.status<300},send:function(a){var b={},c=this.url,d=this.method.toLowerCase(),e=this.headers,f,g;if(d=="put"||d=="delete")b._method=d,d="post";var h=this.prepareData(this.params,this.prepareParams(a),b);this.urlEncoded&&d=="post"&&!e["Content-type"]&&this.setHeader("Content-type","application/x-www-form-urlencoded;charset="+this.encoding),d=="get"&&(h&&(c+=(c.include("?")?"&":"?")+h),h=null),g=this.xhr=this.createXhr(),this.fire("create"),g.open(d,c,this.async),g.onreadystatechange=this.stateChanged.bind(this);for(f in e)g.setRequestHeader(f,e[f]);g.send(h),this.fire("request"),this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(b){a.update(b.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort(),a.onreadystatechange=function(){},a.canceled=!0;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},createXhr:function(){return this.jsonp?new cd.JSONP(this):this.form&&this.form.first("input[type=file]")?new cd.IFramed(this.form):"ActiveXObject"in a?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest},prepareParams:function(a){a&&a instanceof bS&&(this.form=a,a=a.values());return a},prepareData:function(){return J(arguments).map(function(a){y(a)||(a=c.toQueryString(a));return a.blank()?null:a}).compact().join("&")},stateChanged:function(){var a=this.xhr;if(a.readyState==4&&!a.canceled){try{this.status=a.status}catch(b){this.status=0}this.text=this.responseText=a.responseText,this.xml=this.responseXML=a.responseXML,this.fire("complete").fire(this.successful()?"success":"failure")}},tryScripts:function(a){var b=this.getHeader("Content-type");this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(b)?t(this.text):/json/.test(b)&&this.evalJSON?this.json=this.responseJSON=this.sanitizedJSON():this.evalScripts&&this.text.evalScripts()},sanitizedJSON:function(){if(!/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){if(this.secureJSON)throw"JSON error: "+this.text;return null}return"JSON"in a?JSON.parse(this.text):(new f("return "+this.text))()},initCallbacks:function(){this.on({success:"tryScripts",create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"}),cd.EVENTS.each(function(a){this.on(a,function(){cd.fire(a,this,this.xhr)})},this)},showSpinner:function(){cd.showSpinner.call(this,this)},hideSpinner:function(){cd.hideSpinner.call(this,this)}});s(bk(cd),{counter:0,showSpinner:function(a){cd.trySpinner(a,"show")},hideSpinner:function(a){cd.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||cd.Options,d=E(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){cd.counter++,cd.showSpinner()},countOut:function(){cd.counter--,cd.counter<1&&cd.hideSpinner()}}).on({create:"countIn",complete:"countOut",cancel:"countOut"}),bS.include({send:function(a){a=a||{},a.method=a.method||this._.method||"post",this.xhr=(new cd(this._.action||b.location.href,s({spinner:this.first(".spinner")},a))).onComplete(this.enable.bind(this)).onCancel(this.enable.bind(this)).send(this),this.disable.bind(this).delay(1);return this},cancelXhr:function(){this.xhr instanceof cd&&this.xhr.cancel();return this},remotize:function(a){this.remote||(this.on("submit",ce,a),this.remote=!0);return this},unremotize:function(){this.stopObserving("submit",ce),this.remote=!1;return this}}),bF.include({load:function(a,b){(new cd(a,s({method:"get"},b))).update(this);return this}}),cd.Dummy={open:function(){},setRequestHeader:function(){},onreadystatechange:function(){}},cd.IFramed=new bb({include:cd.Dummy,initialize:function(a){this.form=a,this.id="xhr_"+(new Date).getTime(),this.form.doc().first("body").append('<i><iframe name="'+this.id+'" id="'+this.id+'" width="0" height="0" frameborder="0" src="about:blank"></iframe></i>',"after"),E(this.id).on("load",this.onLoad.bind(this))},send:function(){this.form.set("target",this.id).submit()},onLoad:function(){this.status=200,this.readyState=4,this.form.set("target","");try{this.responseText=a[this.id].document.documentElement.innerHTML}catch(b){}this.onreadystatechange()},abort:function(){E(this.id).set("src","about:blank")}}),cd.JSONP=new bb({include:cd.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=a,this.name=this.prefix+(new Date).getTime(),this.param=(y(a.jsonp)?a.jsonp:"callback")+"="+this.name,this.script=G("script",{charset:a.encoding,async:a.async})},open:function(a,b,c){this.url=b,this.method=a},send:function(b){a[this.name]=this.finish.bind(this),this.script.set("src",this.url+(this.url.include("?")?"&":"?")+this.param+"&"+b).insertTo(F("script").last(),"after")},finish:function(a){this.status=200,this.readyState=4,this.xhr.json=this.xhr.responseJSON=a,this.onreadystatechange()},abort:function(){a[this.name]=function(){}}});var cf=j.Fx=new bb(bj,{extend:{EVENTS:H("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:bs?40:60,duration:"normal",transition:"Sin",queue:!0},Transitions:{Sin:function(a){return-(h.cos(h.PI*a)-1)/2},Cos:function(a){return h.asin((a-.5)*2)/h.PI+.5},Exp:function(a){return h.pow(2,8*(a-1))},Log:function(a){return 1-h.pow(2,-8*a)},Lin:function(a){return a}}},initialize:function(a,b){this.$super(b),this.element=E(a),ci(this)},start:function(){if(cj(this,arguments))return this;var a=this.options,b=cf.Durations[a.duration]||a.duration,c=cf.Transitions[a.transition]||a.transition,d=(b/1e3*this.options.fps).ceil(),e=(1e3/this.options.fps).round();ck(this),this.prepare.apply(this,arguments),co(this,c,e,d);return this.fire("start",this)},finish:function(){cp(this),cl(this),this.fire("finish"),cm(this);return this},cancel:function(){cp(this),cl(this);return this.fire("cancel")},prepare:function(){},render:function(){}}),cg=[],ch=[];e.COLORS={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",brown:"#a52a2a"},e.include({toHex:function(){var a=/^#(\w)(\w)(\w)$/.exec(this);a?a="#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(this))?a="#"+a.slice(1).map(function(a){a=(a-0).toString(16);return a.length==1?"0"+a:a}).join(""):a=e.COLORS[this]||this;return a},toRgb:function(a){var b=/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(this.toHex()||"");b&&(b=b.slice(1).map("toInt",16),b=a?b:"rgb("+b+")");return b}}),bF.include({stop:function(){cn(this);return this},hide:function(a,b){return a&&this.visible()?cq(this,a,["out",b]):this.$super()},show:function(a,b){return a&&!this.visible()?cq(this,a,["in",b]):this.$super()},toggle:function(a,b){return a?cq(this,a,["toggle",b]):this.$super()},remove:function(a,b){return a&&this.visible()?cq(this,a,["out",s(b||{},{onFinish:this.$super.bind(this)})]):this.$super()},morph:function(a,b){return cq(this,"morph",[a,b||{}])},highlight:function(){return cq(this,"highlight",arguments)},fade:function(){return cq(this,"fade",arguments)},slide:function(){return cq(this,"slide",arguments)},scroll:function(a,b){return cq(this,"scroll",[a,b||{}])},scrollTo:function(a,b){return A(b)?this.scroll(a,b):this.$super.apply(this,arguments)}});var cr=["WebkitT","OT","MozT","MsT","t"].first(function(a){return a+"ransition"in o.style}),cs=cr+"ransition",ct=cs+"Property",cu=cs+"Duration",cv=cs+"TimingFunction",cw={Sin:"cubic-bezier(.3,0,.6,1)",Cos:"cubic-bezier(0,.3,.6,0)",Log:"cubic-bezier(0.6,.3,.8)",Exp:"cubic-bezier(.6,0,.8,.3)",Lin:"cubic-bezier(0,0,1,1)"};cf.Options.engine=cr===i||bp?"javascript":"native",cf.Morph=new bb(cf,{prepare:function(a){if(this.options.engine==="native"&&cr!==i)this.render=this.transition=function(){},cx.call(this,a);else{var b=cA(a),c=cF(this.element,b),d=cG(this.element,a,b);cE(this.element,c,d),this.before=cD(c),this.after=cD(d)}},render:function(a){var b,c,d,e=this.element._.style,f,g,i;for(f in this.after){b=this.before[f],c=this.after[f];for(g=0,i=c.length;g<i;g++)d=b[g]+(c[g]-b[g])*a,c.r&&(d=h.round(d)),c.t[g*2+1]=d;e[f]=c.t.join("")}}});var cy=H("Top Left Right Bottom");cf.Highlight=new bb(cf.Morph,{extend:{Options:c.merge(cf.Options,{color:"#FF8",transition:"Exp"})},prepare:function(a,b){var c=this.element,d=c._.style,e="backgroundColor",f=b||c.getStyle(e);cB(f)&&(this.onFinish(function(){d[e]="transparent"}),f=[c].concat(c.parents()).map("getStyle",e).reject(cB).compact().first()||"#FFF"),d[e]=a||this.options.color;return this.$super({backgroundColor:f})}}),cf.Twin=new bb(cf.Morph,{finish:function(){this.how==="out"&&bF.prototype.hide.call(this.element);return this.$super()},setHow:function(a){this.how=a||"toggle",this.how==="toggle"&&(this.how=this.element.visible()?"out":"in")}}),cf.Slide=new bb(cf.Twin,{extend:{Options:c.merge(cf.Options,{direction:"top"})},prepare:function(a){function f(){for(var a in e)d[a]=e[a]}this.setHow(a);var b=bF.prototype.show.call(this.element),d=b._.style,e=c.only(d,"overflow","width","height","marginTop","marginLeft");this.onFinish(f).onCancel(f),d.overflow="hidden";return this.$super(cH(d,b.size(),this.options.direction,this.how))}}),cf.Fade=new bb(cf.Twin,{prepare:function(a){this.setHow(a),this.how==="in"&&bF.prototype.show.call(this.element.setStyle({opacity:0}));return this.$super({opacity:this.how==="in"?1:0})}}),cf.Attr=new bb(cf,{prepare:function(a){this.before={},this.after=a;var b,c=this.element._;for(b in a)this.before[b]=c[b]},render:function(a){var b,c=this.element._,d=this.before;for(b in d)c[b]=d[b]+(this.after[b]-d[b])*a}}),cf.Scroll=new bb(cf.Attr,{initialize:function(a,b){a=E(a),this.$super(a instanceof bC?a._.document["body"in a._.document?"body":"documentElement"]:a,b)},prepare:function(a){var b={};"x"in a&&(b.scrollLeft=a.x),"y"in a&&(b.scrollTop=a.y),this.$super(b)}});var cI=j.Cookie=new bb({include:bi,extend:{set:function(a,b,c){return(new this(a,c)).set(b)},get:function(a){return(new this(a)).get()},remove:function(a){return(new this(a)).remove()},enabled:function(){b.cookie="__t=1";return b.cookie.indexOf("__t=1")!=-1},Options:{secure:!1,document:b}},initialize:function(a,b){this.name=a,this.setOptions(b)},set:function(a){var b=encodeURIComponent(a),c=this.options;c.domain&&(b+="; domain="+c.domain),c.path&&(b+="; path="+c.path);if(c.duration){var d=new Date;d.setTime(d.getTime()+c.duration*24*60*60*1e3),b+="; expires="+d.toGMTString()}c.secure&&(b+="; secure"),c.document.cookie=this.name+"="+b;return this},get:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+RegExp.escape(this.name)+"=([^;]*)");return a?decodeURIComponent(a[1]):null},remove:function(){this.options.duration=-1;return this.set("")}});s(a,c.without(j,"version","modules"));return j}(window,document,Object,Array,String,Function,Number,Math);RightJS.Browser.OLD&&function(a){var b=a.createElement("script"),c=a.getElementsByTagName("script"),d=c[c.length-1];b.src=d.src.replace(/(^|\/)(right)([^\/]+)$/,"$1$2-olds$3"),d.parentNode.appendChild(b)}(document)
@@ -6,20 +6,20 @@ describe RightRails::Helpers::Forms do
6
6
  include ActionView::Helpers::JavaScriptHelper
7
7
  include RightRails::Helpers::Basic
8
8
  include RightRails::Helpers::Forms
9
-
9
+
10
10
  def url_for(options) options end
11
11
  def escape_javascript(str) str end
12
12
  def rightjs_required_files
13
13
  RightRails::Helpers.required_js_files(self)
14
14
  end
15
-
15
+
16
16
  before :each do
17
17
  RightRails::Config.reset!
18
18
  end
19
-
19
+
20
20
  describe ".calendar_field" do
21
21
  it "should generate a basic calendar_field_tag" do
22
- calendar_field_tag('name', 'value').should ==
22
+ calendar_field_tag('name', 'value').should ==
23
23
  %Q{<input data-calendar="{}" id="name" name="name" type="text" value="value" />}
24
24
 
25
25
  rightjs_required_files.should include('right/calendar')
@@ -30,25 +30,25 @@ describe RightRails::Helpers::Forms do
30
30
  %Q{<input data-calendar="{format:'%Y/%m/%d'}" id="name" }+
31
31
  %Q{name="name" type="text" value="value" />}
32
32
  end
33
-
33
+
34
34
  it "should generate a basic calendar_field" do
35
35
  calendar_field('model', 'method').should ==
36
36
  %Q{<input data-calendar="{}" id="model_method" name="model[method]" size="30" type="text" />}
37
37
  end
38
-
38
+
39
39
  it "should generate a calendar_field with options" do
40
40
  calendar_field('model', 'method', :hide_on_pick => true).should ==
41
41
  %Q{<input data-calendar="{hideOnPick:true}" id="model_method" }+
42
42
  %Q{name="model[method]" size="30" type="text" />}
43
43
  end
44
-
44
+
45
45
  describe "in RightJS 1 mode" do
46
46
  before :each do
47
47
  RightRails::Config.rightjs_version = 1
48
48
  end
49
-
49
+
50
50
  it "should generate a basic calendar_field_tag" do
51
- calendar_field_tag('name', 'value').should ==
51
+ calendar_field_tag('name', 'value').should ==
52
52
  %Q{<input id="name" name="name" rel="calendar" type="text" value="value" />}
53
53
 
54
54
  rightjs_required_files.should include('right/calendar')
@@ -59,12 +59,12 @@ describe RightRails::Helpers::Forms do
59
59
  %Q{<input data-calendar-options="{format:'%Y/%m/%d'}" id="name" name="name" }+
60
60
  %Q{rel="calendar" type="text" value="value" />}
61
61
  end
62
-
62
+
63
63
  it "should generate a basic calendar_field" do
64
64
  calendar_field('model', 'method').should ==
65
65
  %Q{<input id="model_method" name="model[method]" rel="calendar" size="30" type="text" />}
66
66
  end
67
-
67
+
68
68
  it "should generate a calendar_field with options" do
69
69
  calendar_field('model', 'method', :hide_on_pick => true).should ==
70
70
  %Q{<input data-calendar-options="{hideOnPick:true}" id="model_method" }+
@@ -72,7 +72,7 @@ describe RightRails::Helpers::Forms do
72
72
  end
73
73
  end
74
74
  end
75
-
75
+
76
76
  describe ".autocomplete_field" do
77
77
  it "should generate a basic autocomplete_field_tag" do
78
78
  autocomplete_field_tag('name', 'value', :url => '/foo').should ==
@@ -86,23 +86,23 @@ describe RightRails::Helpers::Forms do
86
86
  %Q{<input autocomplete="off" data-autocompleter="{minLength:2,spinner:'spinner',url:'/foo'}" }+
87
87
  %Q{id="name" name="name" type="text" value="value" />}
88
88
  end
89
-
89
+
90
90
  it "should generate a basic autocomplete_field" do
91
91
  autocomplete_field('object', 'method', :url => '/foo').should ==
92
92
  %Q{<input autocomplete="off" data-autocompleter="{url:'/foo'}" id="object_method" name="object[method]" size="30" type="text" />}
93
93
  end
94
-
94
+
95
95
  it "should generate an autocomplete_field with options" do
96
96
  autocomplete_field('object', 'method', :url => '/foo', :fx_name => 'fade').should ==
97
97
  %Q{<input autocomplete="off" data-autocompleter="{fxName:'fade',url:'/foo'}" id="object_method" }+
98
98
  %Q{name="object[method]" size="30" type="text" />}
99
99
  end
100
-
100
+
101
101
  describe "in RightJS 1 mode" do
102
102
  before :each do
103
103
  RightRails::Config.rightjs_version = 1
104
104
  end
105
-
105
+
106
106
  it "should generate a basic autocomplete_field_tag" do
107
107
  autocomplete_field_tag('name', 'value', :url => '/foo').should ==
108
108
  %Q{<input autocomplete="off" id="name" name="name" rel="autocompleter[/foo]" type="text" value="value" />}
@@ -115,12 +115,12 @@ describe RightRails::Helpers::Forms do
115
115
  %Q{<input autocomplete="off" data-autocompleter-options="{minLength:2,spinner:'spinner'}" }+
116
116
  %Q{id="name" name="name" rel="autocompleter[/foo]" type="text" value="value" />}
117
117
  end
118
-
118
+
119
119
  it "should generate a basic autocomplete_field" do
120
120
  autocomplete_field('object', 'method', :url => '/foo').should ==
121
121
  %Q{<input autocomplete="off" id="object_method" name="object[method]" rel="autocompleter[/foo]" size="30" type="text" />}
122
122
  end
123
-
123
+
124
124
  it "should generate an autocomplete_field with options" do
125
125
  autocomplete_field('object', 'method', :url => '/foo', :fx_name => 'fade').should ==
126
126
  %Q{<input autocomplete="off" data-autocompleter-options="{fxName:'fade'}" id="object_method" }+
@@ -128,9 +128,9 @@ describe RightRails::Helpers::Forms do
128
128
  end
129
129
  end
130
130
  end
131
-
131
+
132
132
  describe ".slider" do
133
-
133
+
134
134
  it "should generate a basic slider_tag" do
135
135
  slider_tag('some_field', 22).should ==
136
136
  %Q{<input id="some_field" name="some_field" type="hidden" value="22" />\n}+
@@ -139,7 +139,7 @@ describe RightRails::Helpers::Forms do
139
139
  %Q{//]]>\n}+
140
140
  %Q{</script>}
141
141
  end
142
-
142
+
143
143
  it "should generate a slider_tag with options" do
144
144
  slider_tag('some_field', 22, :min => 10, :max => 40).should ==
145
145
  %Q{<input id="some_field" name="some_field" type="hidden" value="22" />\n}+
@@ -148,12 +148,12 @@ describe RightRails::Helpers::Forms do
148
148
  %Q{//]]>\n}+
149
149
  %Q{</script>}
150
150
  end
151
-
151
+
152
152
  it "should generate a slider with options" do
153
153
  model = {}
154
154
  model.should_receive('method').twice.and_return(22)
155
155
  should_receive(:instance_variable_get).twice.with('@object').and_return(model)
156
-
156
+
157
157
  slider('object', 'method', :value => 22, :min => 20, :max => 80).should ==
158
158
  %Q{<input id="object_method" name="object[method]" type="hidden" value="22" />\n}+
159
159
  %Q{<script type="text/javascript">\n//<![CDATA[\n}+
@@ -162,20 +162,20 @@ describe RightRails::Helpers::Forms do
162
162
  %Q{</script>}
163
163
  end
164
164
  end
165
-
165
+
166
166
  describe ".rater" do
167
167
  it "should generate a simple rater" do
168
168
  model = {}
169
169
  model.should_receive('method').twice.and_return(2)
170
170
  should_receive(:instance_variable_get).twice.with('@object').and_return(model)
171
-
171
+
172
172
  rater('object', 'method', :value => 2).should ==
173
173
  %Q{<input id="object_method" name="object[method]" type="hidden" value="2" />\n}+
174
174
  %Q{<script type="text/javascript">\n//<![CDATA[\n}+
175
175
  %Q{new Rater({value:2}).insertTo('object_method','after').assignTo('object_method');\n}+
176
176
  %Q{//]]>\n</script>}
177
177
  end
178
-
178
+
179
179
  it "should generate a #rater_tag" do
180
180
  rater_tag('some_field', 2).should ==
181
181
  %Q{<input id="some_field" name="some_field" type="hidden" value="2" />\n}+
@@ -183,7 +183,7 @@ describe RightRails::Helpers::Forms do
183
183
  %Q{new Rater({value:2}).insertTo('some_field','after').assignTo('some_field');\n}+
184
184
  %Q{//]]>\n</script>}
185
185
  end
186
-
186
+
187
187
  it "should generate the #rater_display tag" do
188
188
  rater_display(4).should ==
189
189
  %Q{<div class="rui-rater rui-rater-disabled">}+
@@ -194,12 +194,12 @@ describe RightRails::Helpers::Forms do
194
194
  %Q{<div>&#9733;</div>}+
195
195
  %Q{</div>}
196
196
  end
197
-
197
+
198
198
  describe "in RightJS 1 mode" do
199
199
  before :each do
200
200
  RightRails::Config.rightjs_version = 1
201
201
  end
202
-
202
+
203
203
  it "should generate the #rater_display tag" do
204
204
  rater_display(4).should ==
205
205
  %Q{<div class="right-rater right-rater-disabled">}+
@@ -212,41 +212,41 @@ describe RightRails::Helpers::Forms do
212
212
  end
213
213
  end
214
214
  end
215
-
215
+
216
216
  describe ".colorpicker" do
217
217
  it "should generate a simple colorpicker_field_tag" do
218
- colorpicker_field_tag('name', '#FF0').should ==
218
+ colorpicker_field_tag('name', '#FF0').should ==
219
219
  %Q{<input data-colorpicker="{}" id="name" name="name" type="text" value="#FF0" />}
220
220
  end
221
221
 
222
222
  it "should generate a colorpicker_field_tag with options" do
223
- colorpicker_field_tag('name', '#FF0', :format => 'rgb').should ==
223
+ colorpicker_field_tag('name', '#FF0', :format => 'rgb').should ==
224
224
  %Q{<input data-colorpicker="{format:'rgb'}" }+
225
225
  %Q{id="name" name="name" type="text" value="#FF0" />}
226
226
  end
227
-
227
+
228
228
  it "should generate a colorpicker_field with options" do
229
229
  colorpicker_field('object', 'method', :fx_name => 'slide').should ==
230
230
  %Q{<input data-colorpicker="{fxName:'slide'}" id="object_method" }+
231
231
  %Q{name="object[method]" size="30" type="text" />}
232
232
  end
233
-
233
+
234
234
  describe "in RightJS 1 mode" do
235
235
  before :each do
236
236
  RightRails::Config.rightjs_version = 1
237
237
  end
238
-
238
+
239
239
  it "should generate a simple colorpicker_field_tag" do
240
- colorpicker_field_tag('name', '#FF0').should ==
240
+ colorpicker_field_tag('name', '#FF0').should ==
241
241
  %Q{<input id="name" name="name" rel="colorpicker" type="text" value="#FF0" />}
242
242
  end
243
243
 
244
244
  it "should generate a colorpicker_field_tag with options" do
245
- colorpicker_field_tag('name', '#FF0', :format => 'rgb').should ==
245
+ colorpicker_field_tag('name', '#FF0', :format => 'rgb').should ==
246
246
  %Q{<input data-colorpicker-options="{format:'rgb'}" }+
247
247
  %Q{id="name" name="name" rel="colorpicker" type="text" value="#FF0" />}
248
248
  end
249
-
249
+
250
250
  it "should generate a colorpicker_field with options" do
251
251
  colorpicker_field('object', 'method', :fx_name => 'slide').should ==
252
252
  %Q{<input data-colorpicker-options="{fxName:'slide'}" id="object_method" }+
@@ -254,6 +254,33 @@ describe RightRails::Helpers::Forms do
254
254
  end
255
255
  end
256
256
  end
257
-
258
-
257
+
258
+ describe ".tags_field" do
259
+ it "should automatically require the 'right/tags.js' file" do
260
+ tags_field_tag('name', 'one,two,three')
261
+ rightjs_required_files.should include('right/tags')
262
+ end
263
+
264
+ it "should generate a simple tags_field_tag" do
265
+ tags_field_tag('name', 'one,two,three').should ==
266
+ %Q{<input data-tags="{}" id="name" name="name" type="text" value="one,two,three" />}
267
+ end
268
+
269
+ it "should generate a tags_field_tag with options" do
270
+ tags_field_tag('name', 'one,two,three', {
271
+ :tags => ['one', 'two', 'three'],
272
+ :allow_new => false
273
+ }).should ==
274
+ %Q{<input data-tags="{allowNew:false,tags:[&quot;one&quot;, &quot;two&quot;, &quot;three&quot;]}" }+
275
+ %Q{id="name" name="name" type="text" value="one,two,three" />}
276
+ end
277
+
278
+ it "should generate a tags_field with options" do
279
+ tags_field('object', 'method', {:tags => ['one', 'two', 'three']}).should ==
280
+ %Q{<input data-tags="{tags:[&quot;one&quot;, &quot;two&quot;, &quot;three&quot;]}" } +
281
+ %Q{id="object_method" name="object[method]" size="30" type="text" />}
282
+ end
283
+ end
284
+
285
+
259
286
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
4
  prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 0
10
- version: 1.1.0
5
+ version: 1.2.0
11
6
  platform: ruby
12
7
  authors:
13
8
  - Nikolay Nemshilov
@@ -15,7 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-03-01 00:00:00 +03:00
13
+ date: 2011-04-04 00:00:00 +04:00
19
14
  default_executable:
20
15
  dependencies: []
21
16
 
@@ -49,6 +44,8 @@ files:
49
44
  - public/javascripts/right/billboard.js
50
45
  - public/javascripts/right/calendar-src.js
51
46
  - public/javascripts/right/calendar.js
47
+ - public/javascripts/right/casting-src.js
48
+ - public/javascripts/right/casting.js
52
49
  - public/javascripts/right/colorpicker-src.js
53
50
  - public/javascripts/right/colorpicker.js
54
51
  - public/javascripts/right/dialog-src.js
@@ -97,6 +94,8 @@ files:
97
94
  - public/javascripts/right/table.js
98
95
  - public/javascripts/right/tabs-src.js
99
96
  - public/javascripts/right/tabs.js
97
+ - public/javascripts/right/tags-src.js
98
+ - public/javascripts/right/tags.js
100
99
  - public/javascripts/right/tooltips-src.js
101
100
  - public/javascripts/right/tooltips.js
102
101
  - public/javascripts/right/uploader-src.js
@@ -139,7 +138,9 @@ has_rdoc: true
139
138
  homepage: http://github.com/MadRabbit/right-rails
140
139
  licenses: []
141
140
 
142
- post_install_message:
141
+ post_install_message: "\n\
142
+ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< RIGHT RAILS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n Please run the following command to copy RightJS scripts and modules in place\n\n rails g right_rails\n\n\
143
+ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< RIGHT RAILS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n"
143
144
  rdoc_options: []
144
145
 
145
146
  require_paths:
@@ -149,23 +150,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
150
  requirements:
150
151
  - - ">="
151
152
  - !ruby/object:Gem::Version
152
- hash: 3
153
- segments:
154
- - 0
155
153
  version: "0"
156
154
  required_rubygems_version: !ruby/object:Gem::Requirement
157
155
  none: false
158
156
  requirements:
159
157
  - - ">="
160
158
  - !ruby/object:Gem::Version
161
- hash: 3
162
- segments:
163
- - 0
164
159
  version: "0"
165
160
  requirements: []
166
161
 
167
162
  rubyforge_project:
168
- rubygems_version: 1.5.2
163
+ rubygems_version: 1.6.1
169
164
  signing_key:
170
165
  specification_version: 3
171
166
  summary: RightJS plugin for Rails