right-rails 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -2
- data/Rakefile +28 -28
- data/lib/right_rails/java_script_generator.rb +59 -51
- data/public/images/{colorpicker.png → rightjs-ui/colorpicker.png} +0 -0
- data/public/images/{resizable.png → rightjs-ui/resizable.png} +0 -0
- data/public/javascripts/right-olds-src.js +47 -46
- data/public/javascripts/right-safe-src.js +103 -102
- data/public/javascripts/right-safe.js +1 -1
- data/public/javascripts/right-src.js +611 -541
- data/public/javascripts/right.js +86 -85
- data/public/javascripts/right/autocompleter-src.js +81 -77
- data/public/javascripts/right/autocompleter.js +1 -1
- data/public/javascripts/right/calendar-src.js +209 -197
- data/public/javascripts/right/calendar.js +6 -6
- data/public/javascripts/right/colorpicker-src.js +127 -117
- data/public/javascripts/right/colorpicker.js +6 -6
- data/public/javascripts/right/dnd-src.js +63 -63
- data/public/javascripts/right/dnd.js +2 -2
- data/public/javascripts/right/in-edit-src.js +53 -48
- data/public/javascripts/right/in-edit.js +2 -2
- data/public/javascripts/right/lightbox-src.js +107 -99
- data/public/javascripts/right/lightbox.js +2 -2
- data/public/javascripts/right/rater-src.js +48 -46
- data/public/javascripts/right/rater.js +3 -3
- data/public/javascripts/right/resizable-src.js +53 -61
- data/public/javascripts/right/resizable.js +4 -4
- data/public/javascripts/right/selectable-src.js +97 -95
- data/public/javascripts/right/selectable.js +2 -2
- data/public/javascripts/right/slider-src.js +47 -45
- data/public/javascripts/right/slider.js +8 -8
- data/public/javascripts/right/sortable-src.js +54 -52
- data/public/javascripts/right/tabs-src.js +181 -171
- data/public/javascripts/right/tooltip-src.js +39 -37
- data/public/javascripts/right/uploader-src.js +21 -19
- data/spec/lib/right_rails/java_script_generator_spec.rb +61 -56
- metadata +9 -7
data/public/javascripts/right.js
CHANGED
@@ -4,89 +4,90 @@
|
|
4
4
|
*
|
5
5
|
* Copyright (C) 2008-2010 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var RightJS=function(
|
8
|
-
|
9
|
-
c;b++){d=a[a.length===c?b:0];
|
10
|
-
b){var c=a||"*",d=b._;d="tagName"in d?d.tagName:null;return d===null?c:c.replace(/(^|,)/g,"$1"+d+" ")}function
|
11
|
-
d;if(B(b)){c[b]=a.slice(2);if(
|
12
|
-
a==="rgba(0, 0, 0, 0)"}function
|
13
|
-
|
14
|
-
|
15
|
-
b){return j(b||
|
16
|
-
0
|
17
|
-
return c},only:function(){for(var a=k(arguments),b=a.shift(),c={},d=0,e=a.length;d<e;d++)if(a[d]in b)c[a[d]]=b[a[d]];return c},merge:function(){for(var a={},b=0,c=arguments.length;b<c;b++)s(arguments[b])&&y(a,arguments[b]);return a},toQueryString:function(a){var b=[],c,d,e=encodeURIComponent;for(c in a){d=
|
18
|
-
a;a=0}return~~(
|
19
|
-
"return [][0]"),Za=function(a,b){for(var c=this.length-1;c>-1;c--)if(a.call(b,this[c],c,this))return this[c];return null};w.include({indexOf:z.indexOf||function(a,b){for(var c=b<0?r.max(0,this.length+b):b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:z.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?
|
20
|
-
this[this.length-1]},random:function(){return this.length?this[r.random(this.length-1)]:null},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return!this.length},clone:function(){return this.slice(0)},each:function(){
|
21
|
-
every:function(a){return
|
22
|
-
includes:function(){for(var a=0,b=arguments.length;a<b;a++)if(this.indexOf(arguments[a])==-1)return false;return true},without:function(){var a=k(arguments);return this.filter(function(b){return!a.includes(b)})},shuffle:function(){for(var a=this.clone(),b,c,d=a.length;d>0;b=r.random(d-1),c=a[--d],a[d]=a[b],a[b]=c);return a},sort:function(a){return Sa.apply(this,a||!
|
23
|
-
c))})},min:function(){return r.min.apply(r,this)},max:function(){return r.max.apply(r,this)},sum:function(){for(var a=0,b=this.length,c=0;a<b;c+=this[a++]);return c}});u(z,{include:"includes"});
|
24
|
-
c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/img,function(d,e){b+=e+"\n";return""});if(a===true)
|
25
|
-
this.substring(1).toLowerCase()},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){var c=this.substr(0,a.length);return b?c.toLowerCase()===a.toLowerCase():c===a},endsWith:function(a,b){var c=this.substring(this.length-a.length);return b?c.toLowerCase()===a.toLowerCase():c===a},toInt:function(a){return parseInt(this,a||10)},toFloat:function(a){return parseFloat(a?this:this.replace(",",".").replace(/(\d)-(\d)/g,
|
26
|
-
k(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length||arguments.length?a.concat(k(arguments)):a)}},bindAsEventListener:function(){var a=k(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(k(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(k(arguments)))},rcurry:function(){var a=k(arguments),b=this;return function(){return b.apply(b,k(arguments).concat(a))}},
|
27
|
-
[this].concat(a)),b));a.cancel=function(){clearTimeout(this)};return a},periodical:function(){var a=k(arguments),b=a.shift();a=new
|
28
|
-
return this},downto:function(a,b,c){for(var d=this+0;d>=a;d--)b.call(c,d);return this},abs:function(){return r.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):r.round(this)},ceil:function(){return r.ceil(this)},floor:function(){return r.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,
|
29
|
-
this.prebind.each(function(e){this[e]=this[e].bind(this)},this);return this.initialize?this.initialize.apply(this,arguments):this}var b=k(arguments),c=b.pop()||{},d=b.pop();if(!b.length&&!s(c)){d=c;c={}}y(a,
|
30
|
-
a=a.parent}return this[
|
31
|
-
return e.apply(this,arguments)}},this);c&&c.call(b,this)},this);return this}};
|
32
|
-
b=a.shift(),c;if(B(b)){if(!("$listeners"in this))this.$listeners=[];var d=a.shift();switch(typeof d){case "string":c=d;d=this[d];case "function":var e={};e.e=b;e.f=d;e.a=a;e.r=c;this.$listeners.push(e);break;default:if(
|
33
|
-
a&&c.f===b:a?c.e===a:c.f===b})},stopObserving:function(a,b){if(s(a))for(var c in a)this.stopObserving(c,a[c]);else{if(!B(a)){b=a;a=null}if(B(b))b=this[b];this.$listeners=(this.$listeners||[]).filter(function(d){return a&&b?d.e!==a||d.f!==b:a?d.e!==a:d.f!==b},this)}return this},listeners:function(a){return(this.$listeners||[]).filter(function(b){return!a||b.e===a}).map(function(b){return b.f}).uniq()},fire:function(){var a=k(arguments),
|
34
|
-
c.a.concat(a))},this);return this}});z=
|
35
|
-
|
36
|
-
b)};
|
37
|
-
y:a.pageYOffset}:c.scrollLeft||c.scrollTop?{x:c.scrollLeft,y:c.scrollTop}:{x:b.scrollLeft,y:b.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=j(a);if(f&&f instanceof m)a=f.position();if(s(a)){e=a.y;d=a.x}s(c=c||b)&&h.Fx?(new q.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),
|
38
|
-
a.bubbles===false;s(b)&&y(this,b)}this._=a;this.type=a.type;this.which=a.which;this.keyCode=a.keyCode;this.target=j(a.target);this.currentTarget=j(a.currentTarget);this.relatedTarget=j(a.relatedTarget);this.pageX=a.pageX;this.pageY=a.pageY;if(!("target"in a)&&"srcElement"in a){this.which=a.button==2?3:a.button==4?2:1;this.target=j(a.srcElement)||b;this.relatedTarget=this.target._===a.fromElement?
|
39
|
-
c.x;this.pageY=a.clientY+c.y}else if(a.target&&"nodeType"in a.target&&a.target.nodeType===3)this.target=j(a.target.parentNode)},stopPropagation:function(){if("stopPropagation"in this._)this._.stopPropagation();else this._.cancelBubble=true;this.stopped=true;return this},preventDefault:function(){if("preventDefault"in this._)this._.preventDefault();else this._.returnValue=false;return this},stop:function(){return this.stopPropagation().preventDefault()},
|
40
|
-
find:function(a){if(this.target instanceof m){var b=this.target;b=[b].concat(b.parents());var c=this.currentTarget.find(a);return b.first(function(d){return c.include(d)})}}}),
|
41
|
-
'$1if($2==="input"&&$3)$2="<input name="+$3.name+" type="+$3.type+($3.checked?" checked":"")+"/>";')+"]")[0]
|
42
|
-
nextSiblings:function(a){return
|
43
|
-
c!==null&&c.evalScripts();return this},insertTo:function(a,b){j(a).insert(this,b);return this},append:function(){return this.insert(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}else return this.clean().insert(a)},html:function(a){return a===undefined?this._.innerHTML:
|
44
|
-
c.replaceChild(a,b);a.appendChild(b)}return this},clean:function(){for(;this._.firstChild;)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){var a=this._.cloneNode(true);a
|
45
|
-
b){a.parentNode.insertBefore(b,a)},instead:function(a,b){a.parentNode.replaceChild(b,a)}},
|
46
|
-
m.include({setStyle:function(a,b){var c,d,e={},f=this._.style;if(b){e[a]=b;a=e}else if(B(a)){a.split(";").each(function(g){g=g.split(":").map("trim");if(g[0]&&g[1])e[g[0]]=g[1]});a=e}for(c in a){d=c.indexOf("-")<0?c:c.camelize();if(c==="opacity")if(x.IE)f.filter="alpha(opacity="+a[c]*100+")";else f.opacity=a[c];else if(c==="float")d=x.IE?"styleFloat":"cssFloat";
|
47
|
-
return a.currentStyle||a.runtimeStyle||a.ownerDocument.defaultView.getComputedStyle(a,null)||{}},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},addClass:function(a){var b=" "+this._.className+" ";if(b.indexOf(" "+a+" ")==-1)this._.className+=(b===" "?"":" ")+a;return this},removeClass:function(a){this._.className=
|
48
|
-
"removeClass":"addClass"](a)},radioClass:function(a){this.siblings().each("removeClass",a);return this.addClass(a)}});m.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b;a=c}var d;c=this._;for(d in a){d in c||c.setAttribute(d,""+a[d]);c[d]=a[d]}return this},get:function(a){var b=this._;a=b[a]||b.getAttribute(a);return a===""?null:a},has:function(a){return this.get(a)!==
|
49
|
-
"none"},visible:function(){return!this.hidden()},hide:function(){if(this.visible()){this._d=this.getStyle("display");this._.style.display="none"}return this},show:function(){if(this.hidden()){var a=this._,b=a.tagName=="DIV"?"block":"inline";a.style.display=this._d=="none"?b:this._d||b}return this},toggle:function(a,b){return this[this.
|
50
|
-
window:function(){return this.document().window()},size:function(){return{x:this._.offsetWidth,y:this._.offsetHeight}},position:function(){var a=this._.getBoundingClientRect(),b=this.document()._.documentElement,c=this.window().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(),
|
51
|
-
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){if(s(a)){b=a.y;a=a.x}return this.setWidth(a).setHeight(b)},moveTo:function(a,
|
52
|
-
b){if(s(a)){b=a.y;a=a.x}this._.scrollLeft=a;this._.scrollTop=b;return this},scrollThere:function(a){this.window().scrollTo(this,a);return this}});var
|
53
|
-
(v?'$2.w=$2.w.bind(this);this._.attachEvent("on"+$2.n,$2.w);':"this._.addEventListener($2.n,$2.w,false);"));
|
54
|
-
'$1.type$4(this,(($2.r&&$1.r!=="stopEvent")?[]:[$3]).concat($2.a))');
|
55
|
-
this._.ownerDocument:this.parents().last();a=j(b||
|
56
|
-
{subNodes:"children",sizes:"size",select:"find"});u(
|
7
|
+
var RightJS=function(E,n,p,w,C,J,Y,r){function F(a){return K(a)?a:[a]}function ja(a,b){var c=a[0],d=ka.call(a,1),e=b,f;if(B(c)){f=c;c=b.length&&N(b[0][f])?function(g){return g[f].apply(g,d)}:function(g){return g[f]}}else e=d[0];return[c,e]}function G(a,b,c){var d;try{d=a.apply(b,ja(c,b))}catch(e){if(!(e instanceof h.Break))throw e;}return d}function la(a){return!!a}function ma(a,b){return a>b?1:a<b?-1:0}function na(a,b){["extend","include"].each(function(c){var d=b[c];if(s(d)||K(d)){a[c].apply(a,
|
8
|
+
F(d));delete b[c]}})}function Z(a,b){var c=b.toUpperCase(),d=b.capitalize(),e=a.constructor;return(e=[a,e].concat("ancestors"in e?e.ancestors:[]).first(function(f){return f&&(c in f||d in f)}))?e[c]||e[d]:null}function $(a,b,c){a=a._;for(var d=[];a=a[b];)if(a.tagName&&(!c||j(a).match(c)))d.push(j(a));return d}function Oa(a){if(typeof a==="string"){var b=this.tagName,c=Pa,d=oa[b]||["","",1],e=d[2];for(c.innerHTML=d[0]+"<"+b+">"+a+"</"+b+">"+d[1];e-- >0;)c=c.firstChild;a=c.childNodes}b=0;for(c=a.length;b<
|
9
|
+
c;b++){d=a[a.length===c?b:0];pa.appendChild(d instanceof m?d._:d)}return pa}function qa(a,b){var c,d=b.camelize();switch(d){case "opacity":c=!x.IE?a[d].replace(",","."):(/opacity=(\d+)/i.exec(a.filter||"")||["","100"])[1].toInt()/100+"";break;case "float":d=x.IE?"styleFloat":"cssFloat";default:c=a[d];if(x.Opera&&/color/i.test(d)&&c)c=c.replace(/"/g,"")}return c||null}function U(a,b,c){L[a]=eval("["+L[a].toString().replace(b,c)+"]")[0]}function ra(a){a=H(a);aa=aa.concat(a);O(m[l],a);O(M[l],a)}function sa(a,
|
10
|
+
b){var c=a||"*",d=b._;d="tagName"in d?d.tagName:null;return d===null?c:c.replace(/(^|,)/g,"$1"+d+" ")}function V(a){var b=new ta(a),c=b.target;c=c.parent&&c.parent();b.type=a.type==="focusin"||a.type==="focus"?"focus":"blur";c&&c.fire(b)}function ua(a,b){var c=n.createElement(b);c.setAttribute(a,";");return N(c[a])}function Qa(a,b,c){return function(d){var e=d.target,f=k(b),g=f.shift();if(c.find(a).includes(e))N(g)?g.apply(e,[d].concat(f)):e[g].apply(e,f)}}function va(a){a=k(a);var b=a[1]||{},c={},
|
11
|
+
d;if(B(b)){c[b]=a.slice(2);if(K(c[b][0]))c[b]=c[b][0].map(F)}else c=b;for(d in c){c[d]=F(c[d]);c[d]=K(c[d][0])?c[d]:[c[d]]}return c}function wa(a,b){var c=a[0],d,e,f=va(a),g=!p.keys(f).length;return(b.$listeners||[]).filter(function(t){return t.dr&&t.n===c&&(g||function(){for(var i in f)if(t.dr===i){d=0;for(e=f[i];d<e.length;d++)if(!e[d].length||e[d][0]===t.dc)return true}return false}())})}function ba(a,b){a.stop();this.send(p.merge({spinner:this.first(".spinner")},b))}function R(a){return a==="transparent"||
|
12
|
+
a==="rgba(0, 0, 0, 0)"}function xa(a){var b={},c=/[\d\.\-]+/g,d,e,f;for(e in a){d=a[e].match(c);d=d.map("toFloat");d.t=a[e].split(c);d.r=d.t[0]==="rgb(";d.t.length==1&&d.t.unshift("");for(f=0;f<d.length;f++)d.t.splice(f*2+1,0,d[f]);b[e]=d}return b}var h=function(a){return a};h.version="2.0.0";h.modules=["core","dom","form","events","xhr","fx","cookie"];var l="prototype",z=w[l],ca=p[l].toString,ka=z.slice,P=function(){return function(){}},ya=n.documentElement,da=1,W=[],y=h.$ext=function(a,b,c){b=b||
|
13
|
+
{};var d;for(d in b)if(!c||!(d in a))a[d]=b[d];return a},za=h.$eval=function(a){if(a)"execScript"in E?j(n).window()._.execScript(a):ea("script",{text:a}).insertTo(ya)};h.$break=function(){throw new h.Break;};var u=h.$alias=function(a,b){for(var c in b)a[c]=a[b[c]];return a};h.defined=function(a){return typeof a!=="undefined"};var N=h.isFunction=function(a){return typeof a==="function"},B=h.isString=function(a){return typeof a==="string"},Aa=h.isNumber=function(a){return typeof a==="number"},s=h.isHash=
|
14
|
+
function(a){return ca.call(a)==="[object Object]"},K=h.isArray=function(a){return ca.call(a)==="[object Array]"},Ba=h.isElement=function(a){return a&&a.tagName};h.isNode=function(a){return a&&a.nodeType};var j=h.$=function(a){if(typeof a==="string")a=n.getElementById(a);if(a)if("_rjs_id"in a&&a._rjs_id in W)a=W[a._rjs_id];else if(a.nodeType===1)a=new m(a);else if(Ba(a.target)||Ba(a.srcElement))a=new ta(a);else if(a.nodeType===9)a=new M(a);else if(a.window==a)a=new Q(a);return a},Ra=h.$$=function(a,
|
15
|
+
b){return j(b||n).find(a)},ea=h.$E=function(a,b){return new m(a,b)},H=h.$w=function(a){return a.trim().split(/\s+/)},k=h.$A=function(a){try{return ka.call(a)}catch(b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=a[d];return c}},Ca=h.$uid=function(a){return"_rjs_id"in a?a._rjs_id:a._rjs_id=da++};if(s(ya))s=h.isHash=function(a){return ca.call(a)==="[object Object]"&&a!==null&&typeof a!=="undefined"&&typeof a.hasOwnProperty!=="undefined"};for(var v=0,A="Array Function Number String Date RegExp".split(" "),
|
16
|
+
S=function(){for(var a=0;a<arguments.length;a++)if(s(arguments[a])){y(this[l],arguments[a]);y(this.Methods,arguments[a])}};v<A.length;v++)y(h[A[v]]=E[A[v]],{Methods:{},include:S});h.Object=p;h.Math=r;y(p,{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 false;return true},without:function(){var a=k(arguments),b=a.shift(),c=
|
17
|
+
{},d;for(d in b)a.includes(d)||(c[d]=b[d]);return c},only:function(){for(var a=k(arguments),b=a.shift(),c={},d=0,e=a.length;d<e;d++)if(a[d]in b)c[a[d]]=b[a[d]];return c},merge:function(){for(var a={},b=0,c=arguments.length;b<c;b++)s(arguments[b])&&y(a,arguments[b]);return a},toQueryString:function(a){var b=[],c,d,e=encodeURIComponent;for(c in a){d=F(a[c]);for(var f=0;f<d.length;f++)b.push(e(c)+"="+e(d[f]))}return b.join("&")}},true);var Da=r.random;r.random=function(a,b){if(arguments.length===0)return Da();
|
18
|
+
else if(arguments.length===1){b=a;a=0}return~~(Da()*(b-a+1)+~~a)};var Sa=z.sort;v=function(a,b,c){return eval("[function(c,s){for(var "+a+"i=0,l=this.length;i<l;i++){"+b.replace("_","c.call(s,this[i],i,this)")+"}"+c+"}]")[0]};var Ea=z.forEach||v("","_",""),Ta=z.filter||v("r=[],j=0,","if(_)r[j++]=this[i]","return r"),Ua=v("r=[],j=0,","if(!_)r[j++]=this[i]","return r"),Va=z.map||v("r=[],","r[i]=_","return r"),Wa=z.some||v("","if(_)return true","return false"),Xa=z.every||v("","if(!_)return false","return true"),
|
19
|
+
Ya=v("","if(_)return this[i]","return [][0]"),Za=function(a,b){for(var c=this.length-1;c>-1;c--)if(a.call(b,this[c],c,this))return this[c];return null};w.include({indexOf:z.indexOf||function(a,b){for(var c=b<0?r.max(0,this.length+b):b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:z.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?G(Ya,this,arguments):this[0]},last:function(){return arguments.length?
|
20
|
+
G(Za,this,arguments):this[this.length-1]},random:function(){return this.length?this[r.random(this.length-1)]:null},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return!this.length},clone:function(){return this.slice(0)},each:function(){G(Ea,this,arguments);return this},forEach:Ea,map:function(){return G(Va,this,arguments)},filter:function(){return G(Ta,this,arguments)},reject:function(){return G(Ua,this,arguments)},some:function(a){return G(Wa,this,
|
21
|
+
a?arguments:[la])},every:function(a){return G(Xa,this,a?arguments:[la])},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,d,e=arguments.length;c<e;c++){b=arguments[c];b=F(b);for(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){if(K(b))a=a.concat(b.flatten());else a.push(b)});return a},compact:function(){return this.without(null,undefined)},
|
22
|
+
uniq:function(){return[].merge(this)},includes:function(){for(var a=0,b=arguments.length;a<b;a++)if(this.indexOf(arguments[a])==-1)return false;return true},without:function(){var a=k(arguments);return this.filter(function(b){return!a.includes(b)})},shuffle:function(){for(var a=this.clone(),b,c,d=a.length;d>0;b=r.random(d-1),c=a[--d],a[d]=a[b],a[b]=c);return a},sort:function(a){return Sa.apply(this,a||!Aa(this[0])?arguments:[ma])},sortBy:function(){var a=ja(arguments,this);return this.sort(function(b,
|
23
|
+
c){return ma(a[0].call(a[1],b),a[0].call(a[1],c))})},min:function(){return r.min.apply(r,this)},max:function(){return r.max.apply(r,this)},sum:function(){for(var a=0,b=this.length,c=0;a<b;c+=this[a++]);return c}});u(z,{include:"includes"});C.include({empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},trim:C[l].trim||function(){for(var a=this.replace(/^\s\s*/,""),b=a.length;/\s/.test(a.charAt(--b)););return a.slice(0,b+1)},stripTags:function(){return this.replace(/<\/?[^>]+>/ig,
|
24
|
+
"")},stripScripts:function(a){var b="",c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/img,function(d,e){b+=e+"\n";return""});if(a===true)za(b);else N(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(true);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,
|
25
|
+
"_").toLowerCase()},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){var c=this.substr(0,a.length);return b?c.toLowerCase()===a.toLowerCase():c===a},endsWith:function(a,b){var c=this.substring(this.length-a.length);return b?c.toLowerCase()===a.toLowerCase():c===a},toInt:function(a){return parseInt(this,a||10)},toFloat:function(a){return parseFloat(a?this:this.replace(",",".").replace(/(\d)-(\d)/g,
|
26
|
+
"$1.$2"))}});u(C[l],{include:"includes"});J.include({bind:function(){var a=k(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length||arguments.length?a.concat(k(arguments)):a)}},bindAsEventListener:function(){var a=k(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(k(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(k(arguments)))},rcurry:function(){var a=k(arguments),b=this;return function(){return b.apply(b,k(arguments).concat(a))}},
|
27
|
+
delay:function(){var a=k(arguments),b=a.shift();a=new Y(setTimeout(this.bind.apply(this,[this].concat(a)),b));a.cancel=function(){clearTimeout(this)};return a},periodical:function(){var a=k(arguments),b=a.shift();a=new Y(setInterval(this.bind.apply(this,[this].concat(a)),b));a.stop=function(){clearInterval(this)};return a},chain:function(){var a=k(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}});Y.include({times:function(a,b){for(var c=0;c<this;c++)a.call(b,
|
28
|
+
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 r.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):r.round(this)},ceil:function(){return r.ceil(this)},floor:function(){return r.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,
|
29
|
+
"\\$1")};w=h.Class=function(){function a(){"prebind"in this&&K(this.prebind)&&this.prebind.each(function(e){this[e]=this[e].bind(this)},this);return this.initialize?this.initialize.apply(this,arguments):this}var b=k(arguments),c=b.pop()||{},d=b.pop();if(!b.length&&!s(c)){d=c;c={}}y(a,Fa).inherit(d);na(a,c);return a.include(c)};J=H("selfExtended self_extended selfIncluded self_included");var $a=J.concat(H(l+" parent extend include")),ab=J.concat(["constructor"]),Fa={inherit:function(a){if(a&&a[l]){var b=
|
30
|
+
P();b[l]=a[l];this[l]=new b;this.parent=a}for(this.ancestors=[];a;){this.ancestors.push(a);a=a.parent}return this[l].constructor=this},extend:function(){k(arguments).filter(s).each(function(a){var b=a.selfExtended||a.self_extended;y(this,p.without.apply(p,[a].concat($a)));b&&b.call(a,this)},this);return this},include:function(){var a=(this.ancestors||[]).map(l);k(arguments).filter(s).each(function(b){var c=b.selfIncluded||b.self_included;p.each(p.without.apply(p,[b].concat(ab)),function(d,e){var f=
|
31
|
+
a.first(function(g){return d in g&&N(g[d])});this[l][d]=!f?e:function(){this.$super=f[d];return e.apply(this,arguments)}},this);c&&c.call(b,this)},this);return this}};J=h.Options={setOptions:function(a){a=this.options=p.merge(Z(this,"options"),a);var b,c;if(N(this.on))for(c in a)if(b=c.match(/on([A-Z][A-Za-z]+)/)){this.on(b[1].toLowerCase(),a[c]);delete a[c]}return this},cutOptions:function(a){a=k(a);this.setOptions(s(a.last())?a.pop():{});return a}};var T=h.Observer=new w({include:J,initialize:function(a){this.setOptions(a);
|
32
|
+
O(this,Z(this,"events"));return this},on:function(){var a=k(arguments),b=a.shift(),c;if(B(b)){if(!("$listeners"in this))this.$listeners=[];var d=a.shift();switch(typeof d){case "string":c=d;d=this[d];case "function":var e={};e.e=b;e.f=d;e.a=a;e.r=c;this.$listeners.push(e);break;default:if(K(d))for(c=0;c<d.length;c++)this.on.apply(this,[b].concat(F(d[c])).concat(a))}}else for(c in b)this.on.apply(this,[c].concat(F(b[c])).concat(a));return this},observes:function(a,b){if(!B(a)){b=a;a=null}if(B(b))b=
|
33
|
+
this[b];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){if(s(a))for(var c in a)this.stopObserving(c,a[c]);else{if(!B(a)){b=a;a=null}if(B(b))b=this[b];this.$listeners=(this.$listeners||[]).filter(function(d){return a&&b?d.e!==a||d.f!==b:a?d.e!==a:d.f!==b},this)}return this},listeners:function(a){return(this.$listeners||[]).filter(function(b){return!a||b.e===a}).map(function(b){return b.f}).uniq()},fire:function(){var a=k(arguments),
|
34
|
+
b=a.shift();(this.$listeners||[]).each(function(c){c.e===b&&c.f.apply(this,c.a.concat(a))},this);return this}});z=T.create=function(a,b){y(a,p.without(T[l],"initialize","setOptions"),true);return O(a,b||Z(a,"events"))};var O=T.createShortcuts=function(a,b){(b||[]).each(function(c){var d="on"+c.replace(/(^|_|:)([a-z])/g,function(e,f,g){return g.toUpperCase()});d in a||(a[d]=function(){return this.on.apply(this,[c].concat(k(arguments)))})});return a};h.Break=new w(Error,{message:"Manual break"});A=
|
35
|
+
navigator.userAgent;v="attachEvent"in E;S="opera"in E;var x=h.Browser={IE:v&&!S,Opera:S,WebKit:A.include("AppleWebKit/"),Gecko:A.include("Gecko")&&!A.include("KHTML"),MobileSafari:/Apple.*Mobile.*Safari/.test(A),Konqueror:A.include("Konqueror"),OLD:v&&!S&&!n.querySelector},I=h.Wrapper=function(a,b){var c=function(d,e){this.initialize(d,e);var f=this,g=f._;if(this.constructor===m&&g.tagName in D){f=new D[g.tagName](g);if("$listeners"in this)f.$listeners=this.$listeners}g="_rjs_id"in g?g._rjs_id:g._rjs_id=
|
36
|
+
da++;return W[g]=f};if(!b){b=a;a=null}y(c,Fa).inherit(a||I);na(c,b);return c.include({_:undefined},b)};I.Cache=W;var M=h.Document=new I({initialize:function(a){this._=a},window:function(){return j(this._.defaultView||this._.parentWindow)}}),Q=h.Window=new I({initialize:function(a){this._=a;this.d=a.document},window:function(){return this},size:function(){var a=this._,b=this.d.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=
|
37
|
+
this._,b=this.d,c=b.body;b=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:b.scrollLeft,y:b.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=j(a);if(f&&f instanceof m)a=f.position();if(s(a)){e=a.y;d=a.x}s(c=c||b)&&h.Fx?(new q.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),ta=h.Event=new I({type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,
|
38
|
+
pageX:null,pageY:null,initialize:function(a,b){if(typeof a==="string"){a=p.merge({type:a},b);this.stopped=a.bubbles===false;s(b)&&y(this,b)}this._=a;this.type=a.type;this.which=a.which;this.keyCode=a.keyCode;this.target=j(a.target);this.currentTarget=j(a.currentTarget);this.relatedTarget=j(a.relatedTarget);this.pageX=a.pageX;this.pageY=a.pageY;if(!("target"in a)&&"srcElement"in a){this.which=a.button==2?3:a.button==4?2:1;this.target=j(a.srcElement)||b;this.relatedTarget=this.target._===a.fromElement?
|
39
|
+
j(a.toElement):this.target;this.currentTarget=b;var c=this.target.window().scrolls();this.pageX=a.clientX+c.x;this.pageY=a.clientY+c.y}else if(a.target&&"nodeType"in a.target&&a.target.nodeType===3)this.target=j(a.target.parentNode)},stopPropagation:function(){if("stopPropagation"in this._)this._.stopPropagation();else this._.cancelBubble=true;this.stopped=true;return this},preventDefault:function(){if("preventDefault"in this._)this._.preventDefault();else this._.returnValue=false;return this},stop:function(){return this.stopPropagation().preventDefault()},
|
40
|
+
position:function(){return{x:this.pageX,y:this.pageY}},find:function(a){if(this.target instanceof m){var b=this.target;b=[b].concat(b.parents());var c=this.currentTarget.find(a);return b.first(function(d){return c.include(d)})}}}),aa=[],Ga={id:"id",html:"innerHTML","class":"className"},Ha={style:"setStyle",on:"on"},D={},fa={};A=function(a,b){this._=a=(a in fa?fa[a]:fa[a]=n.createElement(a)).cloneNode(false);if(b!==undefined)for(var c in b)if(c in Ga)a[Ga[c]]=b[c];else c in Ha?this[Ha[c]](b[c]):this.set(c,
|
41
|
+
b[c])};try{n.createElement("<input/>");A=eval("["+A.toString().replace(/(\((\w+),\s*(\w+)\)\s*\{)/,'$1if($2==="input"&&$3)$2="<input name="+$3.name+" type="+$3.type+($3.checked?" checked":"")+"/>";')+"]")[0]}catch(eb){}var m=h.Element=new I({initialize:function(a,b){if(typeof a==="string")this.construct(a,b);else this._=a},construct:A});m.Wrappers=D;m.include({parent:function(a){return a?this.parents(a)[0]:j(this._.parentNode||null)},parents:function(a){return $(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(b){return b._.parentNode===
|
42
|
+
this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))},nextSiblings:function(a){return $(this,"nextSibling",a)},prevSiblings:function(a){return $(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||"bottom").toLowerCase();if(typeof a!=="object")c=a=""+a;
|
43
|
+
else if(a&&a instanceof m)a=a._;bb[b](d,a.tagName?a:Oa.call(b==="bottom"||b==="top"?d:d.parentNode,a));c!==null&&c.evalScripts();return this},insertTo:function(a,b){j(a).insert(this,b);return this},append:function(a){return this.insert(B(a)?k(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}else return this.clean().insert(a)},html:function(a){return a===undefined?this._.innerHTML:
|
44
|
+
this.update(a)},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;if(c){a=j(a)._;c.replaceChild(a,b);a.appendChild(b)}return this},clean:function(){for(;this._.firstChild;)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){var a=this._.cloneNode(true);a._rjs_id=da++;return new m(a)}});var bb={bottom:function(a,b){a.appendChild(b)},top:function(a,b){a.firstChild!==null?a.insertBefore(b,a.firstChild):
|
45
|
+
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)}},oa={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>",
|
46
|
+
"</SELECT>",2]};u(oa,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var pa=n.createDocumentFragment(),Pa=n.createElement("DIV");m.include({setStyle:function(a,b){var c,d,e={},f=this._.style;if(b){e[a]=b;a=e}else if(B(a)){a.split(";").each(function(g){g=g.split(":").map("trim");if(g[0]&&g[1])e[g[0]]=g[1]});a=e}for(c in a){d=c.indexOf("-")<0?c:c.camelize();if(c==="opacity")if(x.IE)f.filter="alpha(opacity="+a[c]*100+")";else f.opacity=a[c];else if(c==="float")d=x.IE?"styleFloat":"cssFloat";
|
47
|
+
f[d]=a[c]}return this},getStyle:function(a){return qa(this._.style,a)||qa(this.computedStyles(),a)},computedStyles:function(){var a=this._;return a.currentStyle||a.runtimeStyle||a.ownerDocument.defaultView.getComputedStyle(a,null)||{}},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},addClass:function(a){var b=" "+this._.className+" ";if(b.indexOf(" "+a+" ")==-1)this._.className+=(b===" "?"":" ")+a;return this},removeClass:function(a){this._.className=
|
48
|
+
(" "+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)}});m.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b;a=c}var d;c=this._;for(d in a){d in c||c.setAttribute(d,""+a[d]);c[d]=a[d]}return this},get:function(a){var b=this._;a=b[a]||b.getAttribute(a);return a===""?null:a},has:function(a){return this.get(a)!==
|
49
|
+
null},erase:function(a){this._.removeAttribute(a);return this},hidden:function(){return this.getStyle("display")==="none"},visible:function(){return!this.hidden()},hide:function(){if(this.visible()){this._d=this.getStyle("display");this._.style.display="none"}return this},show:function(){if(this.hidden()){var a=this._,b=a.tagName=="DIV"?"block":"inline";a.style.display=this._d=="none"?b:this._d||b}return this},toggle:function(a,b){return this[this.visible()?"hide":"show"](a,b)},radio:function(a,b){this.siblings().each("hide",
|
50
|
+
a,b);return this.show()}});m.include({document:function(){return j(this._.ownerDocument)},window:function(){return this.document().window()},size:function(){return{x:this._.offsetWidth,y:this._.offsetHeight}},position:function(){var a=this._.getBoundingClientRect(),b=this.document()._.documentElement,c=this.window().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(),
|
51
|
+
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){if(s(a)){b=a.y;a=a.x}return this.setWidth(a).setHeight(b)},moveTo:function(a,
|
52
|
+
b){if(s(a)){b=a.y;a=a.x}return this.setStyle({left:a+"px",top:b+"px"})},scrollTo:function(a,b){if(s(a)){b=a.y;a=a.x}this._.scrollLeft=a;this._.scrollTop=b;return this},scrollThere:function(a){this.window().scrollTo(this,a);return this}});var L=z({});U("on",/(\$listeners\.push\((\w+?)\);)/,'$1$2.e=$2.n=$2.e==="rightclick"?"contextmenu":$2.e;'+(x.Gecko?'if($2.n==="mousewheel")$2.n="DOMMouseScroll";':"")+(x.Konqueror?'if($2.n==="contextmenu")$2.n="rightclick";':"")+'$2.w=function(){var a=$A(arguments),_;$2.r&&$2.r!=="stopEvent"?a.shift():_=a[0]=new RightJS.Event(a[0],this);$2.f.apply($2.t,a.concat($2.a))===false&&_.stop()};$2.t=this;'+
|
53
|
+
(v?'$2.w=$2.w.bind(this);this._.attachEvent("on"+$2.n,$2.w);':"this._.addEventListener($2.n,$2.w,false);"));U("stopObserving",/(function\s*\((\w+)\)\s*\{\s*)(return\s*)([^}]+)/m,"$1var r=$4;if(!r)"+(v?'this._.detachEvent("on"+$2.n,$2.w);':"this._.removeEventListener($2.n,$2.w,false);")+"$3 r");U("fire",/(\w+)(\s*=\s*(\w+).shift\(\))/,"$1$2;$1=$1 instanceof RightJS.Event?$1:new RightJS.Event($1,Object.merge({target:this._},$3[0]));$1.currentTarget=this");U("fire",/((\w+)\.e\s*===\s*(\w+))([^}]+\2\.f\.apply)[^}]+?\.concat\(\w+\)\)/,
|
54
|
+
'$1.type$4(this,(($2.r&&$1.r!=="stopEvent")?[]:[$3]).concat($2.a))');L.stopEvent=function(a){a.stop()};m.include(L);M.include(L);Q.include(L);O(Q[l],H("blur focus scroll resize load"));ra("click rightclick contextmenu mousedown mouseup mouseover mouseout mousemove keypress keydown keyup");[m,M].each("include",{first:function(a){return j(this._.querySelector(sa(a,this)))},find:function(a){return k(this._.querySelectorAll(sa(a,this))).map(j)}});m.include({match:function(a){var b=this._.tagName==="HTML"?
|
55
|
+
this._.ownerDocument:this.parents().last();a=j(b||ea("p").insert(this)).find(a).include(this);b||this.remove();return a}});[Q,M].each(function(a){a=a[l];var b=a.on;a.on=function(c){if(c=="ready"&&!this._wR){var d=this._,e=this.fire.bind(this,"ready");d=d.nodeType==9?d:d.document;"readyState"in d?function(){["loaded","complete"].includes(d.readyState)?e():arguments.callee.delay(50)}():d.addEventListener("DOMContentLoaded",e,false);this._wR=true}return b.apply(this,arguments)};O(a,["ready"])});u(m[l],
|
56
|
+
{subNodes:"children",sizes:"size",select:"find"});u(M[l],{select:"find"});u(Q[l],{sizes:"size"});var ga=h.Form=D.FORM=new I(m,{initialize:function(a){a=a||{};var b="remote"in a,c=a;if(s(a)){c="form";a=p.without(a,"remote")}this.$super(c,a);b&&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].includes(a._.type)})},input:function(a){return j(this._[a])},focus:function(){var a=
|
57
57
|
this.inputs().first(function(b){return b._.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;this.inputs().each(function(e){d=e._;c=d.name;if(!d.disabled&&c&&(!["checkbox","radio"].includes(d.type)||d.checked)){b=e.getValue();if(c.endsWith("[]"))b=(a[c]||[]).concat([b]);a[c]=b}});return a},
|
58
|
-
serialize:function(){return p.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});
|
59
|
-
insert:function(a,b){cb.call(this,a,b);this._.tagName==="SELECT"&&B(a)&&k(this._.getElementsByTagName("option")).each(function(c){c.selected=!!c.getAttribute("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?k(this._.getElementsByTagName("option")).map(function(a){return a.selected?a.value:null}).compact():this._.value},setValue:function(a){if(this._.type=="select-multiple"){a=
|
60
|
-
a.includes(b.value)})}else this._.value=a;return this},value:function(a){return this[a===undefined?"getValue":"setValue"](a)},focus:function(){this._.focus();this.focused=true;x.IE&&this.fire("focus",{bubbles:false});return this},blur:function(){this._.blur();this.focused=false;x.IE&&this.fire("blur",{bubbles:false});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=true;return this.fire("disable")},enable:function(){this._.disabled=false;return this.fire("enable")}
|
61
|
-
m[
|
62
|
-
"submit"||d==="image"))){b.type="submit";b.target=j(c);e.fire(b)}};
|
63
|
-
"keydown"&&(a.keyCode==13&&d!=="TEXTAREA"||c==="select-multiple"))
|
64
|
-
undelegate:function(){
|
65
|
-
Options:{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript,text/html,application/xml,text/xml,*/*"},method:"post",encoding:"utf-8",
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
(
|
70
|
-
this.
|
71
|
-
|
72
|
-
|
73
|
-
b){(new o(a,p.merge({method:"get"},b))).update(this);return this}});o.Dummy={open:
|
74
|
-
|
75
|
-
"&":"?")+this.param+"&"+a).insertTo(Ra("script").last(),"after")},finish:function(a){this.status=200;this.readyState=4;this.xhr.json=this.xhr.responseJSON=a;this.onreadystatechange()}});
|
76
|
-
8*(a-1))},Log:function(a){return 1-r.pow(2,-8*a)},Lin:function(a){return a}},ch:[],cr:[]},initialize:function(a,b){this.$super(b);if(this.element=a=j(a)){var c=
|
77
|
-
return this.fire("start",this).startTimer()},finish:function(){return this.stopTimer().unreg().fire("finish").next()},cancel:function(){this.ch.clean();return this.stopTimer().unreg().fire("cancel")},
|
78
|
-
this.
|
79
|
-
olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",
|
80
|
-
|
81
|
-
{
|
82
|
-
c);return this}});var
|
83
|
-
b.push(d);c=this._cloneStyle(this.element,b);a=this._endStyle(a,b);b=this.element;d=[];var i;for(i in a)if((i=="width"||i=="height")&&c[i]=="auto")c[i]=b._["offset"+i.capitalize()]+"px";if(a.filter
|
84
|
-
a[i].replace(/"/g,"");c[i]=c[i].replace(/"/g,"")}
|
85
|
-
|
86
|
-
|
87
|
-
a||"toggle";if(this.how=="toggle")this.how=this.element.visible()?"out":"in"}});q.Slide=new w(q.Twin,{extend:{Options:p.merge(q.Options,{direction:"top"})},prepare:function(a){this.setHow(a);
|
88
|
-
|
89
|
-
|
90
|
-
this.before,c;for(c in b)this.element._["scroll"+(c=="x"?"Left":"Top")]=b[c]+(this.after[c]-b[c])*a}});h.Cookie=new w({include:
|
91
|
-
if(b.domain)a+="; domain="+b.domain;if(b.path)a+="; path="+b.path;if(b.duration){var c=new Date;c.setTime(c.getTime()+b.duration*24*60*60*1E3);a+="; expires="+c.toGMTString()}if(b.secure)a+=
|
92
|
-
|
58
|
+
serialize:function(){return p.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});ra("submit reset focus blur disable enable change");u(ga[l],{getElements:"elements"});var cb=m[l].insert,Ia=h.Input=D.INPUT=D.BUTTON=D.SELECT=D.TEXTAREA=D.OPTGROUP=new I(m,{initialize:function(a,b){if(!a||s(a)){b=a||{};if(/textarea|select/.test(b.type||"")){a=b.type;delete b.type}else a="input"}this.$super(a,b)},form:function(){return j(this._.form)},
|
59
|
+
insert:function(a,b){cb.call(this,a,b);this._.tagName==="SELECT"&&B(a)&&k(this._.getElementsByTagName("option")).each(function(c){c.selected=!!c.getAttribute("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?k(this._.getElementsByTagName("option")).map(function(a){return a.selected?a.value:null}).compact():this._.value},setValue:function(a){if(this._.type=="select-multiple"){a=F(a).map(C);k(this._.getElementsByTagName("option")).each(function(b){b.selected=
|
60
|
+
a.includes(b.value)})}else this._.value=a;return this},value:function(a){return this[a===undefined?"getValue":"setValue"](a)},focus:function(){this._.focus();this.focused=true;x.IE&&this.fire("focus",{bubbles:false});return this},blur:function(){this._.blur();this.focused=false;x.IE&&this.fire("blur",{bubbles:false});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=true;return this.fire("disable")},enable:function(){this._.disabled=false;return this.fire("enable")},
|
61
|
+
disabled:function(a){return a===undefined?this._.disabled:this[a?"disable":"enable"]()},checked:function(a){if(a===undefined)a=this._.checked;else{this._.checked=a;a=this}return a}});m[l].fire=eval("["+L.fire.toString().replace(/(\w+)(\s*=\s*\w+\.shift[\s\S]+)(return this)/m,"$1$2var p=!$1.stopped&&this.parent&&this.parent();p&&p.fire&&p.fire($1);$3")+"]")[0];if(x.IE){n.attachEvent("onfocusin",V);n.attachEvent("onfocusout",V)}else{n.addEventListener("focus",V,true);n.addEventListener("blur",V,true)}if(!ua("onsubmit",
|
62
|
+
"form")){u=function(a){var b=j(a),c=b.target._,d=c.type;c=c.form;var e;if(c&&(e=j(c).parent())&&(a.keyCode===13&&(d==="text"||d==="password")||a.type==="click"&&(d==="submit"||d==="image"))){b.type="submit";b.target=j(c);e.fire(b)}};n.attachEvent("onclick",u);n.attachEvent("onkeypress",u)}if(!ua("onchange","input")){var Ja=function(a){var b=a._,c=b.type;return c==="radio"||c==="checkbox"?b.checked:a.getValue()},Ka=function(a,b){var c=b.parent(),d=Ja(b);if(c&&""+b._prev_value!==""+d){b._prev_value=
|
63
|
+
d;a.type="change";c.fire(a)}};u=function(a){a=j(a);var b=a.target,c=b._.type,d=b._.tagName,e=c==="radio"||c==="checkbox";if(a.type==="click"&&(e||d==="SELECT")||a.type==="keydown"&&(a.keyCode==13&&d!=="TEXTAREA"||c==="select-multiple"))Ka(a,b)};n.attachEvent("onclick",u);n.attachEvent("onkeydown",u);n.attachEvent("onfocusout",function(a){a=j(a);var b=a.target;b instanceof Ia&&Ka(a,b)});n.attachEvent("onbeforeactivate",function(a){a=j(a).target;if(a instanceof Ia)a._prev_value=Ja(a)})}[m,M].each("include",
|
64
|
+
{delegate:function(a){var b=va(arguments),c,d,e;for(c in b){d=0;for(e=b[c];d<e.length;d++){this.on(a,Qa(c,e[d],this));y(this.$listeners.last(),{dr:c,dc:e[d][0]})}}return this},undelegate:function(){wa(arguments,this).each(function(a){this.stopObserving(a.n,a.f)},this);return this},delegates:function(){return!!wa(arguments,this).length}});p.each({on:"delegate",stopObserving:"undelegate",observes:"delegates"},function(a,b){C[l][a]=function(){var c=j(n),d=k(arguments);d.splice(1,0,""+this);d=c[b].apply(c,
|
65
|
+
d);return d===c?this:d}});var La=C[l].on;C[l].on=function(a){if(s(a))for(var b in a)La.apply(this,[b].concat([a[b]]));else La.apply(this,arguments);return this};aa.each(function(a){C[l]["on"+a.capitalize()]=function(){return this.on.apply(this,[a].concat(k(arguments)))}});var o=h.Xhr=new w(T,{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",
|
66
|
+
async:true,evalScripts:false,evalResponse:false,evalJS:true,evalJSON:true,secureJSON:true,urlEncoded:true,spinner:null,spinnerFx:"fade",params:null,iframed:false,jsonp:false},load:function(a,b){return(new this(a,p.merge({method:"get"},b))).send()}},initialize:function(a,b){this.initCallbacks();this.url=a;y(this.$super(b),this.options);if(o.Options.spinner&&j(this.spinner)===j(o.Options.spinner))this.spinner=null},setHeader:function(a,b){this.headers[a]=b;return this},getHeader:function(a){var b;try{b=
|
67
|
+
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;if(d=="put"||d=="delete"){b._method=d;d="post"}b=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);if(d=="get"){if(b)c+=(c.includes("?")?"&":"?")+b;b=null}a=this.xhr=
|
68
|
+
this.createXhr();this.fire("create");a.open(d,c,this.async);a.onreadystatechange=this.stateChanged.bind(this);for(f in e)a.setRequestHeader(f,e[f]);a.send(b);this.fire("request");this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(c){a.update(c.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort();a.onreadystatechange=P();a.canceled=true;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},
|
69
|
+
createXhr:function(){if(this.jsonp)return new o.JSONP(this);else if(this.form&&this.form.first("input[type=file]"))return new o.IFramed(this.form);else try{return new XMLHttpRequest}catch(a){return new ActiveXObject("MSXML2.XMLHTTP")}},prepareParams:function(a){if(a&&a instanceof ga){this.form=a;a=a.values()}return a},prepareData:function(){return k(arguments).map(function(a){B(a)||(a=p.toQueryString(a));return a.blank()?null:a}).compact().join("&")},stateChanged:function(){var a=this.xhr;if(!(a.readyState!=
|
70
|
+
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(){var a=this.getHeader("Content-type");if(this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(a))za(this.text);else if(/json/.test(a)&&this.evalJSON)this.json=this.responseJSON=this.sanitizedJSON();else this.evalScripts&&this.text.evalScripts()},sanitizedJSON:function(){try{return JSON.parse(this.text)}catch(a){if(E.JSON||
|
71
|
+
!/^[,:{}\[\]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 eval("("+this.text+")")},initCallbacks:function(){this.on({success:"tryScripts",create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"});o.EVENTS.each(function(a){this.on(a,function(){o.fire(a,this,this.xhr)})},this)},showSpinner:function(){o.showSpinner.call(this,this)},hideSpinner:function(){o.hideSpinner.call(this,
|
72
|
+
this)}});y(z(o),{counter:0,showSpinner:function(a){o.trySpinner(a,"show")},hideSpinner:function(a){o.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||o.Options,d=j(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){o.counter++;o.showSpinner()},countOut:function(){o.counter--;o.counter<1&&o.hideSpinner()}}).on({create:"countIn",complete:"countOut",cancel:"countOut"});ga.include({send:function(a){a=a||{};a.method=a.method||this._.method||"post";(new o(this._.action||n.location.href,
|
73
|
+
a)).onComplete(this.enable.bind(this)).send(this);this.disable.bind(this).delay(1);return this},remotize:function(a){if(!this.observes("submit",ba)){this.on("submit",ba,a);this.remote=true}return this},unremotize:function(){this.stopObserving("submit",ba);this.remote=false;return this}});m.include({load:function(a,b){(new o(a,p.merge({method:"get"},b))).update(this);return this}});o.Dummy={open:P(),abort:P(),setRequestHeader:P(),onreadystatechange:P()};o.IFramed=new w({include:o.Dummy,initialize:function(a){this.form=
|
74
|
+
a;this.id="xhr_"+(new Date).getTime();a.insert('<i><iframe name="'+this.id+'" id="'+this.id+'" width="0" height="0" frameborder="0" src="about:blank"></iframe></i>',"after");j(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;try{this.responseText=E[this.id].document.documentElement.innerHTML}catch(a){}this.onreadystatechange()}});o.JSONP=new w({include:o.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=
|
75
|
+
a;this.name=this.prefix+(new Date).getTime();this.param=(B(a.jsonp)?a.jsonp:"callback")+"="+this.name;this.script=ea("script",{charset:a.encoding,async:a.async})},open:function(a,b){this.url=b;this.method=a},send:function(a){E[this.name]=this.finish.bind(this);this.script.set("src",this.url+(this.url.include("?")?"&":"?")+this.param+"&"+a).insertTo(Ra("script").last(),"after")},finish:function(a){this.status=200;this.readyState=4;this.xhr.json=this.xhr.responseJSON=a;this.onreadystatechange()}});
|
76
|
+
var q=h.Fx=new w(T,{extend:{EVENTS:H("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:x.IE?40:60,duration:"normal",transition:"Sin",queue:true},Transitions:{Sin:function(a){return-(r.cos(r.PI*a)-1)/2},Cos:function(a){return r.asin((a-0.5)*2)/r.PI+0.5},Exp:function(a){return r.pow(2,8*(a-1))},Log:function(a){return 1-r.pow(2,-8*a)},Lin:function(a){return a}},ch:[],cr:[]},initialize:function(a,b){this.$super(b);if(this.element=a=j(a)){var c=Ca(a);this.ch=q.ch[c]=q.ch[c]||
|
77
|
+
[];this.cr=q.cr[c]=q.cr[c]||[]}},start:function(){if(this.queue(arguments))return this;this.prepare.apply(this,arguments);var a=this.options,b=q.Durations[a.duration]||a.duration;this.transition=q.Transitions[a.transition]||a.transition;this.steps=(b/1E3*this.options.fps).ceil();this.number=1;this.cr&&this.cr.push(this);return this.fire("start",this).startTimer()},finish:function(){return this.stopTimer().unreg().fire("finish").next()},cancel:function(){this.ch.clean();return this.stopTimer().unreg().fire("cancel")},
|
78
|
+
pause:function(){return this.stopTimer()},resume:function(){return this.startTimer()},prepare:function(){},render:function(){},step:function(a){if(a.number>a.steps)a.finish();else{if(!a.w){a.w=true;a.render(a.transition(a.number/a.steps));a.w=false}a.number++}},startTimer:function(){this.timer=this.step.periodical((1E3/this.options.fps).round(),this);return this},stopTimer:function(){this.timer&&this.timer.stop();return this},queue:function(a){var b=this.ch,c=this.options.queue;if(!b||this.$ch)return this.$ch=
|
79
|
+
false;c&&b.push([a,this]);return c&&b[0][1]!==this},next:function(){var a=this.ch,b=a.shift();if(b=a[0]){b[1].$ch=true;b[1].start.apply(b[1],b[0])}return this},unreg:function(){var a=this.cr;a&&a.splice(a.indexOf(this),1);return this}});C.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",
|
80
|
+
gray:"#808080",brown:"#a52a2a"};C.include({toHex:function(){var a=/^#(\w)(\w)(\w)$/.exec(this);return a=a?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(this))?"#"+a.slice(1).map(function(b){b=(b-0).toString(16);return b.length==1?"0"+b:b}).join(""):C.COLORS[this]||this},toRgb:function(a){var b=/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(this.toHex()||"");if(b){b=b.slice(1).map("toInt",16);b=a?b:"rgb("+b+")"}return b}});u=m.prototype;var Ma=u.hide,ha=u.show,Na=u.remove,
|
81
|
+
db=u.scrollTo;m.include({stop:function(){(q.cr[Ca(this)]||[]).each("cancel");return this},hide:function(a,b){return a&&this.visible()?this.fx(a,["out",b]):Ma.call(this)},show:function(a,b){return a&&!this.visible()?this.fx(a,["in",b]):ha.call(this)},remove:function(a,b){return a&&this.visible()?this.fx(a,["out",p.merge(b,{onFinish:Na.bind(this)})]):Na.call(this)},morph:function(a,b){return this.fx("morph",[a,b||{}])},highlight:function(){return this.fx("highlight",arguments)},fade:function(){return this.fx("fade",
|
82
|
+
arguments)},slide:function(){return this.fx("slide",arguments)},scroll:function(a,b){return this.fx("scroll",[a,b||{}])},scrollTo:function(a,b){return s(b)?this.scroll(a,b):db.apply(this,arguments)},fx:function(a,b){var c=k(b).compact(),d=s(c.last())?c.pop():{};d=new (q[a.capitalize()])(this,d);d.start.apply(d,c);return this}});var X=H("Top Left Right Bottom");q.Morph=new w(q,{prepare:function(a){var b=[],c=["Style","Color","Width"],d,e,f;for(d in a)if(d.startsWith("border"))for(e=0;e<c.length;e++)for(f=
|
83
|
+
0;f<X.length;f++)b.push("border"+X[f]+c[e]);else if(d=="margin"||d=="padding"){e=b;f=d;for(var g=X,t=0;t<g.length;t++)e.push(f+g[t])}else if(d.startsWith("background")){e=b;f=["Color","Position","PositionX","PositionY"];for(g=0;g<f.length;g++)e.push("background"+f[g])}else d=="opacity"&&x.IE?b.push("filter"):b.push(d);c=this._cloneStyle(this.element,b);a=this._endStyle(a,b);b=this.element;d=[];var i;for(i in a)if((i=="width"||i=="height")&&c[i]=="auto")c[i]=b._["offset"+i.capitalize()]+"px";if(a.filter&&
|
84
|
+
!c.filter)c.filter="alpha(opacity=100)";for(e=0;e<4;e++){t=X[e];f="border"+t+"Style";g="border"+t+"Width";t="border"+t+"Color";if(f in c&&c[f]!=a[f]){var ia=b._.style;if(c[f]=="none")ia[g]="0px";ia[f]=a[f];if(R(c[t]))ia[t]=b.getStyle("Color")}}for(i in a){if(a[i]!==c[i]&&!d.includes(i)&&/color/i.test(i)){if(x.Opera){a[i]=a[i].replace(/"/g,"");c[i]=c[i].replace(/"/g,"")}R(a[i])||(a[i]=a[i].toRgb());R(c[i])||(c[i]=c[i].toRgb());if(!a[i]||!c[i])a[i]=c[i]=""}if(/\d/.test(a[i])&&!/\d/.test(c[i]))c[i]=
|
85
|
+
a[i].replace(/[\d\.\-]+/g,"0");if(a[i]===c[i]||d.includes(i)||!/\d/.test(c[i])||!/\d/.test(a[i])){delete a[i];delete c[i]}}this.before=xa(c);this.after=xa(a)},render:function(a){var b,c,d,e=this.element._.style,f,g,t;for(f in this.after){b=this.before[f];c=this.after[f];g=0;for(t=c.length;g<t;g++){d=b[g]+(c[g]-b[g])*a;if(c.r)d=r.round(d);c.t[g*2+1]=d}e[f]=c.t.join("")}},_endStyle:function(a,b){var c=this.element,d=c.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(c.size().x).setStyle(a);
|
86
|
+
c.parent()&&c.insert(d,"before");c=this._cloneStyle(d,b);d.remove();return c},_cloneStyle:function(a,b){for(var c=0,d=b.length,e=a.computedStyles(),f={},g;c<d;c++){g=b[c];if(g in e)f[g]=""+e[g];if(g==="opacity")f[g]=f[g].replace(",",".")}return f}});q.Highlight=new w(q.Morph,{extend:{Options:p.merge(q.Options,{color:"#FF8",transition:"Exp"})},prepare:function(a,b){var c=this.element,d=c._.style,e=b||c.getStyle("backgroundColor");if(R(e)){this.onFinish(function(){d.backgroundColor="transparent"});
|
87
|
+
e=[c].concat(c.parents()).map(function(f){return(f=f.getStyle("backgroundColor"))&&!R(f)?f:null}).compact().first()||"#FFF"}d.backgroundColor=a||this.options.color;return this.$super({backgroundColor:e})}});q.Twin=new w(q.Morph,{finish:function(){this.how=="out"&&Ma.call(this.element);return this.$super()},setHow:function(a){this.how=a||"toggle";if(this.how=="toggle")this.how=this.element.visible()?"out":"in"}});q.Slide=new w(q.Twin,{extend:{Options:p.merge(q.Options,{direction:"top"})},prepare:function(a){this.setHow(a);
|
88
|
+
var b=ha.call(this.element);this.size=b.size();this.styles={};H("overflow height width marginTop marginLeft").each(function(c){this.styles[c]=b._.style[c]},this);b._.style.overflow="hidden";this.onFinish("_getBack").onCancel("_getBack");return this.$super(this._getStyle(this.options.direction))},_getBack:function(){this.element.setStyle(this.styles)},_getStyle:function(a){var b={},c=this.size,d=this.styles.marginLeft.toFloat()||0,e=this.styles.marginTop.toFloat()||0;if(this.how=="out"){b[["top","bottom"].includes(a)?
|
89
|
+
"height":"width"]="0px";if(a=="right")b.marginLeft=d+c.x+"px";else if(a=="bottom")b.marginTop=e+c.y+"px"}else if(this.how=="in"){var f=this.element._.style;if(["top","bottom"].includes(a)){b.height=c.y+"px";f.height="0px"}else{b.width=c.x+"px";f.width="0px"}if(a=="right"){b.marginLeft=d+"px";f.marginLeft=d+c.x+"px"}else if(a=="bottom"){b.marginTop=e+"px";f.marginTop=e+c.y+"px"}}return b}});q.Fade=new w(q.Twin,{prepare:function(a){this.setHow(a);this.how=="in"&&ha.call(this.element.setStyle({opacity:0}));
|
90
|
+
return this.$super({opacity:Aa(a)?a:this.how=="in"?1:0})}});q.Scroll=new w(q,{initialize:function(a,b){a=j(a);this.$super(a instanceof Q?a._.document[x.WebKit?"body":"documentElement"]:a,b)},prepare:function(a){var b=this.before={},c=this.element._;this.after=a;if("x"in a)b.x=c.scrollLeft;if("y"in a)b.y=c.scrollTop},render:function(a){var b=this.before,c;for(c in b)this.element._["scroll"+(c=="x"?"Left":"Top")]=b[c]+(this.after[c]-b[c])*a}});h.Cookie=new w({include:J,extend:{set:function(a,b,c){return(new this(a,
|
91
|
+
c)).set(b)},get:function(a){return(new this(a)).get()},remove:function(a){return(new this(a)).remove()},enabled:function(){n.cookie="__t=1";return n.cookie.indexOf("__t=1")!=-1},Options:{secure:false,document:n}},initialize:function(a,b){this.name=a;this.setOptions(b)},set:function(a){a=encodeURIComponent(a);var b=this.options;if(b.domain)a+="; domain="+b.domain;if(b.path)a+="; path="+b.path;if(b.duration){var c=new Date;c.setTime(c.getTime()+b.duration*24*60*60*1E3);a+="; expires="+c.toGMTString()}if(b.secure)a+=
|
92
|
+
"; secure";b.document.cookie=this.name+"="+a;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("")}});y(E,p.without(h,"version","modules"));return h}(window,document,Object,Array,String,Function,Number,Math);
|
93
|
+
document.querySelector||document.write('<script src="'+RightJS.$A(document.getElementsByTagName("script")).last().src.replace(/(^|\/)(right)([^\/]+)$/,"$1$2-olds$3")+'"><\/script>');
|
@@ -25,7 +25,7 @@ var R = RightJS,
|
|
25
25
|
Xhr = RightJS.Xhr,
|
26
26
|
RegExp = RightJS.RegExp,
|
27
27
|
isArray = RightJS.isArray;
|
28
|
-
|
28
|
+
|
29
29
|
|
30
30
|
|
31
31
|
|
@@ -39,13 +39,13 @@ var R = RightJS,
|
|
39
39
|
* @param String tag-name or Object methods
|
40
40
|
* @param Object methods
|
41
41
|
* @return Widget wrapper
|
42
|
-
*/
|
42
|
+
*/
|
43
43
|
function Widget(tag_name, methods) {
|
44
44
|
if (!methods) {
|
45
45
|
methods = tag_name;
|
46
46
|
tag_name = 'DIV';
|
47
47
|
}
|
48
|
-
|
48
|
+
|
49
49
|
/**
|
50
50
|
* An Abstract Widget Unit
|
51
51
|
*
|
@@ -62,17 +62,17 @@ function Widget(tag_name, methods) {
|
|
62
62
|
initialize: function(key, options) {
|
63
63
|
this.key = key;
|
64
64
|
var args = [{'class': 'rui-' + key}];
|
65
|
-
|
65
|
+
|
66
66
|
// those two have different constructors
|
67
67
|
if (!(this instanceof RightJS.Input || this instanceof RightJS.Form)) {
|
68
68
|
args.unshift(tag_name);
|
69
69
|
}
|
70
70
|
this.$super.apply(this, args);
|
71
|
-
|
71
|
+
|
72
72
|
if (RightJS.isString(options)) {
|
73
73
|
options = RightJS.$(options);
|
74
74
|
}
|
75
|
-
|
75
|
+
|
76
76
|
// if the options is another element then
|
77
77
|
// try to dynamically rewrap it with our widget
|
78
78
|
if (options instanceof RightJS.Element) {
|
@@ -105,16 +105,16 @@ function Widget(tag_name, methods) {
|
|
105
105
|
return this;
|
106
106
|
}
|
107
107
|
});
|
108
|
-
|
108
|
+
|
109
109
|
/**
|
110
110
|
* Creating the actual widget class
|
111
111
|
*
|
112
112
|
*/
|
113
113
|
var Klass = new RightJS.Wrapper(AbstractWidget, methods);
|
114
|
-
|
114
|
+
|
115
115
|
// creating the widget related shortcuts
|
116
116
|
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
117
|
-
|
117
|
+
|
118
118
|
return Klass;
|
119
119
|
}
|
120
120
|
|
@@ -132,18 +132,18 @@ var Spinner = new RightJS.Wrapper(RightJS.Element, {
|
|
132
132
|
* @return void
|
133
133
|
*/
|
134
134
|
initialize: function(size) {
|
135
|
-
this.$super('div', {'class': 'rui-spinner'});
|
135
|
+
this.$super('div', {'class': 'rui-spinner'});
|
136
136
|
this.dots = [];
|
137
|
-
|
137
|
+
|
138
138
|
for (var i=0; i < (size || 4); i++) {
|
139
139
|
this.dots.push(new RightJS.Element('div'));
|
140
140
|
}
|
141
|
-
|
141
|
+
|
142
142
|
this.dots[0].addClass('glowing');
|
143
143
|
this.insert(this.dots);
|
144
144
|
RightJS(this.shift).bind(this).periodical(300);
|
145
145
|
},
|
146
|
-
|
146
|
+
|
147
147
|
/**
|
148
148
|
* Shifts the spinner elements
|
149
149
|
*
|
@@ -158,6 +158,7 @@ var Spinner = new RightJS.Wrapper(RightJS.Element, {
|
|
158
158
|
}
|
159
159
|
});
|
160
160
|
|
161
|
+
|
161
162
|
/**
|
162
163
|
* A shared module that toggles a widget visibility status
|
163
164
|
* in a uniformed way according to the options settings
|
@@ -181,7 +182,7 @@ function toggler(element, event, fx_name, fx_options) {
|
|
181
182
|
if (RightJS.Fx) {
|
182
183
|
if (fx_name === undefined) {
|
183
184
|
fx_name = this.options.fxName;
|
184
|
-
|
185
|
+
|
185
186
|
if (fx_options === undefined) {
|
186
187
|
fx_options = {
|
187
188
|
duration: this.options.fxDuration,
|
@@ -196,12 +197,12 @@ function toggler(element, event, fx_name, fx_options) {
|
|
196
197
|
}
|
197
198
|
}
|
198
199
|
}
|
199
|
-
|
200
|
+
|
200
201
|
RightJS.Element.prototype[event].call(element, fx_name, fx_options);
|
201
|
-
|
202
|
+
|
202
203
|
// manually trigger the event if no fx were specified
|
203
204
|
if (!RightJS.Fx || !fx_name) { this.fire(event); }
|
204
|
-
|
205
|
+
|
205
206
|
return this;
|
206
207
|
}
|
207
208
|
|
@@ -218,34 +219,34 @@ function toggler(element, event, fx_name, fx_options) {
|
|
218
219
|
* @return void
|
219
220
|
*/
|
220
221
|
function re_position(element, where, resize) {
|
221
|
-
var anchor = this.reAnchor || (this.reAnchor =
|
222
|
+
var anchor = this.reAnchor || (this.reAnchor =
|
222
223
|
new RightJS.Element('div', {'class': 'rui-re-anchor'}))
|
223
224
|
.insert(this),
|
224
|
-
|
225
|
+
|
225
226
|
pos = anchor.insertTo(element, 'after').position(),
|
226
227
|
dims = element.dimensions(), target = this,
|
227
|
-
|
228
|
+
|
228
229
|
border_top = parseInt(element.getStyle('borderTopWidth')),
|
229
230
|
border_left = parseInt(element.getStyle('borderLeftWidth')),
|
230
231
|
border_right = parseInt(element.getStyle('borderRightWidth')),
|
231
232
|
border_bottom = parseInt(element.getStyle('borderBottomWidth')),
|
232
|
-
|
233
|
+
|
233
234
|
top = dims.top - pos.y + border_top,
|
234
235
|
left = dims.left - pos.x + border_left,
|
235
236
|
width = dims.width - border_left - border_right,
|
236
237
|
height = dims.height - border_top - border_bottom;
|
237
|
-
|
238
|
+
|
238
239
|
// making the element to appear so we could read it's sizes
|
239
240
|
target.setStyle('visibility:hidden').show(null);
|
240
|
-
|
241
|
+
|
241
242
|
if (where === 'right') {
|
242
243
|
left += width - target.size().x;
|
243
244
|
} else { // bottom
|
244
245
|
top += height;
|
245
246
|
}
|
246
|
-
|
247
|
+
|
247
248
|
target.moveTo(left, top);
|
248
|
-
|
249
|
+
|
249
250
|
if (resize) {
|
250
251
|
if (['left', 'right'].include(where)) {
|
251
252
|
target.setHeight(height);
|
@@ -253,7 +254,7 @@ function re_position(element, where, resize) {
|
|
253
254
|
target.setWidth(width);
|
254
255
|
}
|
255
256
|
}
|
256
|
-
|
257
|
+
|
257
258
|
// rolling the invisibility back
|
258
259
|
target.setStyle('visibility:visible').hide(null);
|
259
260
|
}
|
@@ -275,7 +276,7 @@ var Toggler = {
|
|
275
276
|
this.constructor.current = this;
|
276
277
|
return toggler.call(this, this, 'show', fx_name, fx_options);
|
277
278
|
},
|
278
|
-
|
279
|
+
|
279
280
|
/**
|
280
281
|
* Hides the element
|
281
282
|
*
|
@@ -287,7 +288,7 @@ var Toggler = {
|
|
287
288
|
this.constructor.current = null;
|
288
289
|
return toggler.call(this, this, 'hide', fx_name, fx_options);
|
289
290
|
},
|
290
|
-
|
291
|
+
|
291
292
|
/**
|
292
293
|
* Toggles the widget at the given element
|
293
294
|
*
|
@@ -298,13 +299,13 @@ var Toggler = {
|
|
298
299
|
*/
|
299
300
|
showAt: function(element, where, resize) {
|
300
301
|
this.hide(null).shownAt = element = RightJS.$(element);
|
301
|
-
|
302
|
+
|
302
303
|
// moves this element at the given one
|
303
304
|
re_position.call(this, element, where, resize);
|
304
|
-
|
305
|
+
|
305
306
|
return this.show();
|
306
307
|
},
|
307
|
-
|
308
|
+
|
308
309
|
/**
|
309
310
|
* Toggles the widget at the given element
|
310
311
|
*
|
@@ -318,6 +319,7 @@ var Toggler = {
|
|
318
319
|
}
|
319
320
|
};
|
320
321
|
|
322
|
+
|
321
323
|
/**
|
322
324
|
* The RightJS UI Autocompleter unit base class
|
323
325
|
*
|
@@ -325,32 +327,32 @@ var Toggler = {
|
|
325
327
|
*/
|
326
328
|
var Autocompleter = new Widget('UL', {
|
327
329
|
include: Toggler,
|
328
|
-
|
330
|
+
|
329
331
|
extend: {
|
330
332
|
version: '2.0.0',
|
331
|
-
|
333
|
+
|
332
334
|
EVENTS: $w('show hide update load select done'),
|
333
|
-
|
335
|
+
|
334
336
|
Options: {
|
335
337
|
url: document.location.href,
|
336
338
|
param: 'search',
|
337
339
|
method: 'get',
|
338
|
-
|
340
|
+
|
339
341
|
minLength: 1, // the minimal length when it starts work
|
340
342
|
threshold: 200, // the typing pause threshold
|
341
|
-
|
343
|
+
|
342
344
|
cache: true, // use the results cache
|
343
345
|
local: null, // an optional local search results list
|
344
|
-
|
346
|
+
|
345
347
|
fxName: 'slide', // list appearance fx name
|
346
348
|
fxDuration: 'short', // list appearance fx duration
|
347
|
-
|
349
|
+
|
348
350
|
spinner: 'native', // spinner element reference
|
349
|
-
|
351
|
+
|
350
352
|
cssRule: 'input[data-autocompleter]' // the auto-initialization css-rule
|
351
353
|
}
|
352
354
|
},
|
353
|
-
|
355
|
+
|
354
356
|
/**
|
355
357
|
* basic constructor
|
356
358
|
*
|
@@ -359,15 +361,15 @@ var Autocompleter = new Widget('UL', {
|
|
359
361
|
*/
|
360
362
|
initialize: function(input, options) {
|
361
363
|
this.input = $(input); // KEEP IT before the super call
|
362
|
-
|
364
|
+
|
363
365
|
this
|
364
366
|
.$super('autocompleter', options)
|
365
367
|
.addClass('rui-dd-menu')
|
366
368
|
.onMousedown(this.clicked);
|
367
|
-
|
369
|
+
|
368
370
|
this.input.autocompleter = this;
|
369
371
|
},
|
370
|
-
|
372
|
+
|
371
373
|
/**
|
372
374
|
* Destructor
|
373
375
|
*
|
@@ -377,7 +379,7 @@ var Autocompleter = new Widget('UL', {
|
|
377
379
|
delete(this.input.autocompleter);
|
378
380
|
return this;
|
379
381
|
},
|
380
|
-
|
382
|
+
|
381
383
|
/**
|
382
384
|
* picks the next item on the list
|
383
385
|
*
|
@@ -386,7 +388,7 @@ var Autocompleter = new Widget('UL', {
|
|
386
388
|
prev: function() {
|
387
389
|
return this.pick('prev');
|
388
390
|
},
|
389
|
-
|
391
|
+
|
390
392
|
/**
|
391
393
|
* picks the next item on the list
|
392
394
|
*
|
@@ -395,7 +397,7 @@ var Autocompleter = new Widget('UL', {
|
|
395
397
|
next: function() {
|
396
398
|
return this.pick('next');
|
397
399
|
},
|
398
|
-
|
400
|
+
|
399
401
|
/**
|
400
402
|
* triggers the done event, sets up the value and closes the list
|
401
403
|
*
|
@@ -403,23 +405,23 @@ var Autocompleter = new Widget('UL', {
|
|
403
405
|
*/
|
404
406
|
done: function(current) {
|
405
407
|
current = current || this.first('li.current');
|
406
|
-
|
408
|
+
|
407
409
|
if (current) {
|
408
410
|
this.input.setValue(R(current.html()).stripTags());
|
409
411
|
this.fire('done');
|
410
412
|
}
|
411
|
-
|
413
|
+
|
412
414
|
return this.hide();
|
413
415
|
},
|
414
|
-
|
416
|
+
|
415
417
|
// protected
|
416
418
|
|
417
419
|
// preprocessing the urls a bit
|
418
420
|
setOptions: function(options) {
|
419
421
|
this.$super(options, this.input);
|
420
|
-
|
422
|
+
|
421
423
|
options = this.options;
|
422
|
-
|
424
|
+
|
423
425
|
// building the correct url template with a placeholder
|
424
426
|
if (!R(options.url).includes('%{search}')) {
|
425
427
|
options.url += (R(options.url).includes('?') ? '&' : '?') + options.param + '=%{search}';
|
@@ -431,22 +433,22 @@ var Autocompleter = new Widget('UL', {
|
|
431
433
|
var items = this.children(),
|
432
434
|
current = items.first('hasClass', 'current'),
|
433
435
|
index = items.indexOf(current);
|
434
|
-
|
436
|
+
|
435
437
|
if (which_one == 'prev') {
|
436
438
|
current = index < 1 ? items.last() : items[index < 0 ? 0 : (index-1)];
|
437
439
|
} else if (which_one == 'next') {
|
438
440
|
current = index < 0 || index == (items.length - 1) ?
|
439
441
|
items.first() : items[index + 1];
|
440
442
|
}
|
441
|
-
|
442
|
-
return this.fire('select', current.radioClass('current'));
|
443
|
+
|
444
|
+
return this.fire('select', {item: current.radioClass('current')});
|
443
445
|
},
|
444
|
-
|
446
|
+
|
445
447
|
// handles mouse clicks on the list element
|
446
448
|
clicked: function(event) {
|
447
449
|
this.done(event.stop().find('li'));
|
448
450
|
},
|
449
|
-
|
451
|
+
|
450
452
|
// handles the key-press events
|
451
453
|
keypressed: function(event) {
|
452
454
|
if (this.input.value().length >= this.options.minLength) {
|
@@ -458,16 +460,16 @@ var Autocompleter = new Widget('UL', {
|
|
458
460
|
return this.hide();
|
459
461
|
}
|
460
462
|
},
|
461
|
-
|
463
|
+
|
462
464
|
// triggers the actual action
|
463
465
|
trigger: function() {
|
464
466
|
this.timeout = null;
|
465
|
-
|
467
|
+
|
466
468
|
this.cache = this.cache || {};
|
467
469
|
var search = this.input.value(), options = this.options;
|
468
|
-
|
470
|
+
|
469
471
|
if (search.length < options.minLength) { return this.hide(); }
|
470
|
-
|
472
|
+
|
471
473
|
if (this.cache[search]) {
|
472
474
|
this.suggest(this.cache[search], search);
|
473
475
|
} else if (isArray(options.local)) {
|
@@ -482,53 +484,54 @@ var Autocompleter = new Widget('UL', {
|
|
482
484
|
});
|
483
485
|
}
|
484
486
|
},
|
485
|
-
|
487
|
+
|
486
488
|
// updates the suggestions list
|
487
489
|
suggest: function(result_text, search) {
|
488
490
|
// saving the result in cache
|
489
491
|
if (this.options.cache) {
|
490
492
|
this.cache[search] = result_text;
|
491
493
|
}
|
492
|
-
|
494
|
+
|
493
495
|
if (!(result_text).blank()) {
|
494
496
|
this.update(result_text.replace(/<ul[^>]*>|<\/ul>/im, ''));
|
495
497
|
this.fire('update').showAt(this.input, 'bottom', 'resize');
|
496
498
|
} else {
|
497
499
|
this.hide();
|
498
500
|
}
|
499
|
-
|
501
|
+
|
500
502
|
return this;
|
501
503
|
},
|
502
|
-
|
504
|
+
|
503
505
|
// performs the locals search
|
504
506
|
findLocal: function(search) {
|
505
507
|
var regexp = new RegExp("("+RegExp.escape(search)+")", 'ig');
|
506
|
-
|
508
|
+
|
507
509
|
return R(this.options.local).map(function(option) {
|
508
510
|
if (option.match(regexp)) {
|
509
511
|
return '<li>'+ option.replace(regexp, '<strong>$1</strong>') +'</li>';
|
510
512
|
}
|
511
513
|
}).compact().join('');
|
512
514
|
},
|
513
|
-
|
515
|
+
|
514
516
|
// builds a native textual spinner if necessary
|
515
517
|
getSpinner: function() {
|
516
518
|
var options = this.options, spinner = options.spinner;
|
517
|
-
|
519
|
+
|
518
520
|
if (spinner == 'native') {
|
519
521
|
spinner = options.spinner = new Spinner(3).insertTo(this);
|
520
522
|
spinner.addClass('rui-autocompleter-spinner');
|
521
523
|
}
|
522
|
-
|
524
|
+
|
523
525
|
// positioning the native spinner
|
524
526
|
if (spinner instanceof Spinner) {
|
525
527
|
re_position.call(spinner, this.input, 'right', 'resize');
|
526
528
|
}
|
527
|
-
|
529
|
+
|
528
530
|
return spinner;
|
529
531
|
}
|
530
532
|
});
|
531
533
|
|
534
|
+
|
532
535
|
/**
|
533
536
|
* The document events hooking
|
534
537
|
*
|
@@ -550,7 +553,7 @@ $(document).on({
|
|
550
553
|
}
|
551
554
|
}
|
552
555
|
},
|
553
|
-
|
556
|
+
|
554
557
|
/**
|
555
558
|
* Hides autocompleters on-blur
|
556
559
|
*
|
@@ -559,12 +562,12 @@ $(document).on({
|
|
559
562
|
*/
|
560
563
|
blur: function(event) {
|
561
564
|
var autocompleter = event.target ? event.target.autocompleter : null;
|
562
|
-
|
565
|
+
|
563
566
|
if (autocompleter && autocompleter.visible()) {
|
564
567
|
autocompleter.hide();
|
565
568
|
}
|
566
569
|
},
|
567
|
-
|
570
|
+
|
568
571
|
/**
|
569
572
|
* Catching the basic keyboard events
|
570
573
|
* to navigate through the autocompletion list
|
@@ -574,7 +577,7 @@ $(document).on({
|
|
574
577
|
*/
|
575
578
|
keydown: function(event) {
|
576
579
|
var autocompleter = event.target ? event.target.autocompleter : null;
|
577
|
-
|
580
|
+
|
578
581
|
if (autocompleter && autocompleter.visible()) {
|
579
582
|
var method_name = ({
|
580
583
|
27: 'hide', // Esc
|
@@ -582,14 +585,14 @@ $(document).on({
|
|
582
585
|
40: 'next', // Down
|
583
586
|
13: 'done' // Enter
|
584
587
|
})[event.keyCode];
|
585
|
-
|
588
|
+
|
586
589
|
if (method_name) {
|
587
590
|
event.stop();
|
588
591
|
autocompleter[method_name]();
|
589
592
|
}
|
590
593
|
}
|
591
594
|
},
|
592
|
-
|
595
|
+
|
593
596
|
/**
|
594
597
|
* Catches the input fields keyup events
|
595
598
|
* and tries to make the autocompleter to show some suggestions
|
@@ -599,14 +602,15 @@ $(document).on({
|
|
599
602
|
*/
|
600
603
|
keyup: function(event) {
|
601
604
|
var autocompleter = event.target ? event.target.autocompleter : null;
|
602
|
-
|
605
|
+
|
603
606
|
if (autocompleter && !R([9, 27, 37, 38, 39, 40, 13]).include(event.keyCode)) {
|
604
607
|
autocompleter.keypressed(event);
|
605
608
|
}
|
606
609
|
}
|
607
610
|
});
|
608
611
|
|
612
|
+
|
609
613
|
document.write("<style type=\"text/css\"> *.rui-dd-menu, *.rui-dd-menu li{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none} *.rui-dd-menu{display:none;position:absolute;z-index:9999;background:white;border:1px solid #BBB;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;box-shadow:#DDD .2em .2em .4em;-moz-box-shadow:#DDD .2em .2em .4em;-webkit-box-shadow:#DDD .2em .2em .4em} *.rui-dd-menu li{padding:.2em .4em;border-top:none;border-bottom:none;cursor:pointer} *.rui-dd-menu li.current{background:#DDD} *.rui-dd-menu li:hover{background:#EEE}dl.rui-dd-menu dt{padding:.3em .5em;cursor:default;font-weight:bold;font-style:italic;color:#444;background:#EEE}dl.rui-dd-menu dd li{padding-left:1.5em}div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}.rui-autocompleter{border-top-color:#DDD !important;border-top-left-radius:0 !important;border-top-rui-radius:0 !important;-moz-border-radius-topleft:0 !important;-moz-border-radius-topright:0 !important;-webkit-border-top-left-radius:0 !important;-webkit-border-top-right-radius:0 !important}.rui-autocompleter-spinner{border:none !important;background:none !important;position:absolute;z-index:9999}.rui-autocompleter-spinner div{margin-top:.2em !important; *margin-top:0.1em !important}</style>");
|
610
614
|
|
611
615
|
return Autocompleter;
|
612
|
-
})(document, RightJS);
|
616
|
+
})(document, RightJS);
|