public/javascripts/right-olds.js in right-rails-1.0.6 vs public/javascripts/right-olds.js in right-rails-1.0.8
- old
+ new
@@ -6,13 +6,13 @@
*
* Copyright (C) 2008-2010 Nikolay V. Nemshilov
*/
if(RightJS.Browser.OLD)$=RightJS.$=function(g){return function(n){var k=g(n);if(k&&k instanceof RightJS.Element&&RightJS.isString(n)&&k._.id!==n)k=RightJS.$(document).first("#"+n);return k}}(RightJS.$);RightJS.$E("p").getBoundingClientRect||RightJS.Element.include({position:function(){var g=this._,n=g.offsetTop,k=g.offsetLeft;for(g=g.offsetParent;g;){n+=g.offsetTop;k+=g.offsetLeft;g=g.offsetParent}return{x:k,y:n}}});
document.querySelector||function(g){function n(a){if(!r[a]){var b,d,c,f,l,h,e={};for(c=a;b=c.match(w);){f=f||{};f[b[1]]={o:b[2],v:b[5]||b[6]};c=c.replace(b[0],"")}if(b=c.match(x)){l=b[1];h=b[3]==""?null:b[3];c=c.replace(b[0],"")}b=(c.match(y)||[1,null])[1];d=(c.match(z)||"*").toString().toUpperCase();c=(c.match(A)||[1,""])[1].split(".").without("");e.tag=d;if(b||c.length||f||l){var i="function(y){var e,r=[],z=0,x=y.length;for(;z<x;z++){e=y[z];_f_}return r}",j=function(o){i=i.replace("_f_",o+"_f_")};
-b&&j("if(e.id!=i)continue;");c.length&&j('if(e.className){var n=e.className.split(" ");if(n.length==1&&c.indexOf(n[0])==-1)continue;else{for(var i=0,l=c.length,b=false;i<l;i++)if(n.indexOf(c[i])==-1){b=true;break;}if(b)continue;}}else continue;');f&&j('var p,o,v,k,b=false;for (k in a){p=e.getAttribute(k)||"";o=a[k].o||"";v=a[k].v||"";if((o===""&&e.getAttributeNode(k)===null)||(o==="="&&p!=v)||(o==="*="&&!p.includes(v))||(o==="^="&&!p.startsWith(v))||(o==="$="&&!p.endsWith(v))||(o==="~="&&!p.split(" ").includes(v))||(o==="|="&&!p.split("-").includes(v))){b=true;break;}}if(b){continue;}');
+b&&j("if(e.id!=i)continue;");c.length&&j('if(e.className){var n=e.className.split(" ");if(n.length==1&&c.indexOf(n[0])==-1)continue;else{for(var i=0,l=c.length,b=false;i<l;i++)if(n.indexOf(c[i])==-1){b=true;break;}if(b)continue;}}else continue;');f&&j('var p,o,v,k,b=false;for (k in a){p=e.getAttribute(k)||"";o=a[k].o||"";v=a[k].v||"";if((o===""&&e.getAttributeNode(k)===null)||(o==="="&&p!=v)||(o==="*="&&!p.include(v))||(o==="^="&&!p.startsWith(v))||(o==="$="&&!p.endsWith(v))||(o==="~="&&!p.split(" ").include(v))||(o==="|="&&!p.split("-").include(v))){b=true;break;}}if(b){continue;}');
l in u&&j("if(!S[P].call(e,V,S))continue;");e.filter=eval("[function(i,t,c,a,P,V,S,s){return eval('['+s+']')[0]}]")[0](b,d,c,f,l,h,u,i.replace("_f_","r.push(e)"))}r[a]=e}return r[a]}function k(a){var b=a.join("");if(!s[b]){for(var d=0;d<a.length;d++)a[d][1]=n(a[d][1]);var c=$uid,f=function(h){for(var e=[],i=[],j,o=0,p=h.length;o<p;o++){j=c(h[o]);if(!i[j]){e.push(h[o]);i[j]=true}}return e},l=function(h,e){var i=B[e[0]](h,e[1].tag);return e[1].filter?e[1].filter(i):i};s[b]=function(h){for(var e,i,j=
0,o=a.length;j<o;j++)if(j===0)e=l(h,a[j]);else{if(j>1)e=f(e);for(var p=0;p<e.length;p++){i=l(e[p],a[j]);i.unshift(1);i.unshift(p);e.splice.apply(e,i);p+=i.length-3}}return a.length>1?f(e):e}}return s[b]}var B={" ":function(a,b){return g.$A(a.getElementsByTagName(b))},">":function(a,b){for(var d=[],c=a.firstChild;c;){if(b=="*"||c.tagName==b)d.push(c);c=c.nextSibling}return d},"+":function(a,b){for(;a=a.nextSibling;)if(a.tagName)return b=="*"||a.tagName==b?[a]:[];return[]},"~":function(a,b){for(var d=
[];a=a.nextSibling;)if(b=="*"||a.tagName==b)d.push(a);return d}},u={checked:function(){return this.checked},disabled:function(){return this.disabled},empty:function(){return!(this.innerText||this.innerHTML||this.textContent||"").length},"first-child":function(a){for(var b=this;b=b.previousSibling;)if(b.tagName&&(!a||b.tagName==a))return false;return true},"first-of-type":function(a,b){return b["first-child"].call(this,this.tagName)},"last-child":function(a){for(var b=this;b=b.nextSibling;)if(b.tagName&&
-(!a||b.tagName==a))return false;return true},"last-of-type":function(a,b){return b["last-child"].call(this,this.tagName)},"only-child":function(a,b){return b["first-child"].call(this,a)&&b["last-child"].call(this,a)},"only-of-type":function(a,b){return b["only-child"].call(this,this.tagName,b)},"nth-child":function(a,b,d){if(!this.parentNode)return false;a=a.toLowerCase();if(a=="n")return true;if(a.includes("n")){var c=b=0;if(m=a.match(/^([+\-]?\d*)?n([+\-]?\d*)?$/)){b=m[1]=="-"?-1:parseInt(m[1],
-10)||1;c=parseInt(m[2],10)||0}a=1;for(var f=this;f=f.previousSibling;)if(f.tagName&&(!d||f.tagName==d))a++;return(a-c)%b===0&&(a-c)/b>=0}else return b.index.call(this,a.toInt()-1,b,d)},"nth-of-type":function(a,b){return b["nth-child"].call(this,a,b,this.tagName)},index:function(a,b,d){a=g.isString(a)?a.toInt():a;b=this;for(var c=0;b=b.previousSibling;)if(b.tagName&&(!d||b.tagName==d)&&++c>a)return false;return c==a}},v=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
+(!a||b.tagName==a))return false;return true},"last-of-type":function(a,b){return b["last-child"].call(this,this.tagName)},"only-child":function(a,b){return b["first-child"].call(this,a)&&b["last-child"].call(this,a)},"only-of-type":function(a,b){return b["only-child"].call(this,this.tagName,b)},"nth-child":function(a,b,d){if(!this.parentNode)return false;a=a.toLowerCase();if(a=="n")return true;if(a.include("n")){var c=b=0;if(m=a.match(/^([+\-]?\d*)?n([+\-]?\d*)?$/)){b=m[1]=="-"?-1:parseInt(m[1],10)||
+1;c=parseInt(m[2],10)||0}a=1;for(var f=this;f=f.previousSibling;)if(f.tagName&&(!d||f.tagName==d))a++;return(a-c)%b===0&&(a-c)/b>=0}else return b.index.call(this,a.toInt()-1,b,d)},"nth-of-type":function(a,b){return b["nth-child"].call(this,a,b,this.tagName)},index:function(a,b,d){a=g.isString(a)?a.toInt():a;b=this;for(var c=0;b=b.previousSibling;)if(b.tagName&&(!d||b.tagName==d)&&++c>a)return false;return c==a}},v=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
y=/#([\w\-_]+)/,z=/^[\w\*]+/,A=/\.([\w\-\._]+)/,x=/:([\w\-]+)(\((.+?)\))*$/,w=/\[((?:[\w\-]*:)?[\w\-]+)\s*(?:([!\^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/,r={},s={},t={},q={first:function(a){return this.find(a)[0]},find:function(a){var b=this._;a=a||"*";if(!t[a]){v.lastIndex=0;for(var d=[],c=[],f=" ",l,h;l=v.exec(a);){h=l[1];if(h=="+"||h==">"||h=="~")f=h;else{c.push([f,h]);f=" "}if(l[2]){d.push(k(c));c=[]}}d.push(k(c));t[a]=d}a=t[a];d=[];c=0;for(f=a.length;c<f;c++)d=d.concat(a[c](b));return d.map(g.$)}};
q.select=q.find;g.Element.include(q);g.Document.include(q)}(RightJS);