right-rails 1.0.6 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Sizzle engine support for RightJS
3
+ *
4
+ * Copyright (C) 2010 Nikolay Nemshilov
5
+ */
6
+ (function(){function o(a,b,d,c,e,f){e=0;for(var g=c.length;e<g;e++){var h=c[e];if(h){h=h[a];for(var k=false;h;){if(h.sizcache===d){k=c[h.sizset];break}if(h.nodeType===1&&!f){h.sizcache=d;h.sizset=e}if(h.nodeName.toLowerCase()===b){k=h;break}h=h[a]}c[e]=k}}}function z(a,b,d,c,e,f){e=0;for(var g=c.length;e<g;e++){var h=c[e];if(h){h=h[a];for(var k=false;h;){if(h.sizcache===d){k=c[h.sizset];break}if(h.nodeType===1){if(!f){h.sizcache=d;h.sizset=e}if(typeof b!=="string"){if(h===b){k=true;break}}else if(j.filter(b,
7
+ [h]).length>0){k=h;break}}h=h[a]}c[e]=k}}}var x=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,y=0,A=Object.prototype.toString,t=false,B=true;[0,0].sort(function(){B=false;return 0});var j=function(a,b,d,c){d=d||[];var e=b=b||document;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!=="string")return d;var f=[],g,h,k,q,m=true,p=j.isXML(b),n=a,l;do{x.exec("");if(g=x.exec(n)){n=g[3];f.push(g[1]);if(g[2]){q=
8
+ g[3];break}}}while(g);if(f.length>1&&E.exec(a))if(f.length===2&&i.relative[f[0]])h=C(f[0]+f[1],b);else for(h=i.relative[f[0]]?[b]:j(f.shift(),b);f.length;){a=f.shift();if(i.relative[a])a+=f.shift();h=C(a,h)}else{if(!c&&f.length>1&&b.nodeType===9&&!p&&i.match.ID.test(f[0])&&!i.match.ID.test(f[f.length-1])){g=j.find(f.shift(),b,p);b=g.expr?j.filter(g.expr,g.set)[0]:g.set[0]}if(b){g=c?{expr:f.pop(),set:r(c)}:j.find(f.pop(),f.length===1&&(f[0]==="~"||f[0]==="+")&&b.parentNode?b.parentNode:b,p);h=g.expr?
9
+ j.filter(g.expr,g.set):g.set;if(f.length>0)k=r(h);else m=false;for(;f.length;){g=l=f.pop();if(i.relative[l])g=f.pop();else l="";if(g==null)g=b;i.relative[l](k,g,p)}}else k=[]}k||(k=h);k||j.error(l||a);if(A.call(k)==="[object Array]")if(m)if(b&&b.nodeType===1)for(a=0;k[a]!=null;a++){if(k[a]&&(k[a]===true||k[a].nodeType===1&&j.contains(b,k[a])))d.push(h[a])}else for(a=0;k[a]!=null;a++)k[a]&&k[a].nodeType===1&&d.push(h[a]);else d.push.apply(d,k);else r(k,d);if(q){j(q,e,d,c);j.uniqueSort(d)}return d};
10
+ j.uniqueSort=function(a){if(u){t=B;a.sort(u);if(t)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a};j.matches=function(a,b){return j(a,null,null,b)};j.find=function(a,b,d){var c;if(!a)return[];for(var e=0,f=i.order.length;e<f;e++){var g=i.order[e],h;if(h=i.leftMatch[g].exec(a)){var k=h[1];h.splice(1,1);if(k.substr(k.length-1)!=="\\"){h[1]=(h[1]||"").replace(/\\/g,"");c=i.find[g](h,b,d);if(c!=null){a=a.replace(i.match[g],"");break}}}}c||(c=b.getElementsByTagName("*"));return{set:c,
11
+ expr:a}};j.filter=function(a,b,d,c){for(var e=a,f=[],g=b,h,k,q=b&&b[0]&&j.isXML(b[0]);a&&b.length;){for(var m in i.filter)if((h=i.leftMatch[m].exec(a))!=null&&h[2]){var p=i.filter[m],n,l;l=h[1];k=false;h.splice(1,1);if(l.substr(l.length-1)!=="\\"){if(g===f)f=[];if(i.preFilter[m])if(h=i.preFilter[m](h,g,d,f,c,q)){if(h===true)continue}else k=n=true;if(h)for(var v=0;(l=g[v])!=null;v++)if(l){n=p(l,h,v,g);var D=c^!!n;if(d&&n!=null)if(D)k=true;else g[v]=false;else if(D){f.push(l);k=true}}if(n!==undefined){d||
12
+ (g=f);a=a.replace(i.match[m],"");if(!k)return[];break}}}if(a===e)if(k==null)j.error(a);else break;e=a}return g};j.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var i=j.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
13
+ POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var d=typeof b==="string",c=d&&!/\W/.test(b);d=d&&!c;if(c)b=b.toLowerCase();c=0;for(var e=a.length,f;c<e;c++)if(f=a[c]){for(;(f=f.previousSibling)&&f.nodeType!==1;);a[c]=d||f&&f.nodeName.toLowerCase()===
14
+ b?f||false:f===b}d&&j.filter(b,a,true)},">":function(a,b){var d=typeof b==="string",c,e=0,f=a.length;if(d&&!/\W/.test(b))for(b=b.toLowerCase();e<f;e++){if(c=a[e]){d=c.parentNode;a[e]=d.nodeName.toLowerCase()===b?d:false}}else{for(;e<f;e++)if(c=a[e])a[e]=d?c.parentNode:c.parentNode===b;d&&j.filter(b,a,true)}},"":function(a,b,d){var c=y++,e=z,f;if(typeof b==="string"&&!/\W/.test(b)){f=b=b.toLowerCase();e=o}e("parentNode",b,c,a,f,d)},"~":function(a,b,d){var c=y++,e=z,f;if(typeof b==="string"&&!/\W/.test(b)){f=
15
+ b=b.toLowerCase();e=o}e("previousSibling",b,c,a,f,d)}},find:{ID:function(a,b,d){if(typeof b.getElementById!=="undefined"&&!d)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){for(var d=[],c=b.getElementsByName(a[1]),e=0,f=c.length;e<f;e++)c[e].getAttribute("name")===a[1]&&d.push(c[e]);return d.length===0?null:d}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,d,c,e,f){a=" "+a[1].replace(/\\/g,
16
+ "")+" ";if(f)return a;f=0;for(var g;(g=b[f])!=null;f++)if(g)if(e^(g.className&&(" "+g.className+" ").replace(/[\t\n]/g," ").indexOf(a)>=0))d||c.push(g);else if(d)b[f]=false;return false},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}a[0]=y++;return a},ATTR:function(a,b,d,
17
+ c,e,f){b=a[1].replace(/\\/g,"");if(!f&&i.attrMap[b])a[1]=i.attrMap[b];if(a[2]==="~=")a[4]=" "+a[4]+" ";return a},PSEUDO:function(a,b,d,c,e){if(a[1]==="not")if((x.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=j(a[3],null,null,b);else{a=j.filter(a[3],b,d,true^e);d||c.push.apply(c,a);return false}else if(i.match.POS.test(a[0])||i.match.CHILD.test(a[0]))return true;return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===
18
+ true},checked:function(a){return a.checked===true},selected:function(a){return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,d){return!!j(d[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===
19
+ a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,d,c){return b===c.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,d){return b<d[3]-0},gt:function(a,b,d){return b>d[3]-0},nth:function(a,b,d){return d[3]-
20
+ 0===b},eq:function(a,b,d){return d[3]-0===b}},filter:{PSEUDO:function(a,b,d,c){var e=b[1],f=i.filters[e];if(f)return f(a,d,b,c);else if(e==="contains")return(a.textContent||a.innerText||j.getText([a])||"").indexOf(b[3])>=0;else if(e==="not"){b=b[3];d=0;for(c=b.length;d<c;d++)if(b[d]===a)return false;return true}else j.error("Syntax error, unrecognized expression: "+e)},CHILD:function(a,b){var d=b[1],c=a;switch(d){case "only":case "first":for(;c=c.previousSibling;)if(c.nodeType===1)return false;if(d===
21
+ "first")return true;c=a;case "last":for(;c=c.nextSibling;)if(c.nodeType===1)return false;return true;case "nth":d=b[2];var e=b[3];if(d===1&&e===0)return true;var f=b[0],g=a.parentNode;if(g&&(g.sizcache!==f||!a.nodeIndex)){var h=0;for(c=g.firstChild;c;c=c.nextSibling)if(c.nodeType===1)c.nodeIndex=++h;g.sizcache=f}c=a.nodeIndex-e;return d===0?c===0:c%d===0&&c/d>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===
22
+ b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var d=b[1];d=i.attrHandle[d]?i.attrHandle[d](a):a[d]!=null?a[d]:a.getAttribute(d);var c=d+"",e=b[2],f=b[4];return d==null?e==="!=":e==="="?c===f:e==="*="?c.indexOf(f)>=0:e==="~="?(" "+c+" ").indexOf(f)>=0:!f?c&&d!==false:e==="!="?c!==f:e==="^="?c.indexOf(f)===0:e==="$="?c.substr(c.length-f.length)===f:e==="|="?c===f||c.substr(0,f.length+1)===f+"-":false},POS:function(a,b,d,c){var e=i.setFilters[b[2]];
23
+ if(e)return e(a,d,b,c)}}},E=i.match.POS,F=function(a,b){return"\\"+(b-0+1)};for(var w in i.match){i.match[w]=RegExp(i.match[w].source+/(?![^\[]*\])(?![^\(]*\))/.source);i.leftMatch[w]=RegExp(/(^(?:.|\r|\n)*?)/.source+i.match[w].source.replace(/\\(\d+)/g,F))}var r=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(G){r=function(a,b){var d=b||[],c=0;if(A.call(a)==="[object Array]")Array.prototype.push.apply(d,
24
+ a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,s;if(document.documentElement.compareDocumentPosition)u=function(a,b){if(a===b){t=true;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1};else{u=function(a,b){var d=[],c=[],e=a.parentNode,f=b.parentNode,g=e;if(a===b){t=true;return 0}else if(e===f)return s(a,b);else if(e){if(!f)return 1}else return-1;
25
+ for(;g;){d.unshift(g);g=g.parentNode}for(g=f;g;){c.unshift(g);g=g.parentNode}e=d.length;f=c.length;for(g=0;g<e&&g<f;g++)if(d[g]!==c[g])return s(d[g],c[g]);return g===e?s(a,c[g],-1):s(d[g],b,1)};s=function(a,b,d){if(a===b)return d;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1}}j.getText=function(a){for(var b="",d,c=0;a[c];c++){d=a[c];if(d.nodeType===3||d.nodeType===4)b+=d.nodeValue;else if(d.nodeType!==8)b+=j.getText(d.childNodes)}return b};(function(){var a=document.createElement("div"),
26
+ b="script"+(new Date).getTime();a.innerHTML="<a name='"+b+"'/>";var d=document.documentElement;d.insertBefore(a,d.firstChild);if(document.getElementById(b)){i.find.ID=function(c,e,f){if(typeof e.getElementById!=="undefined"&&!f)return(e=e.getElementById(c[1]))?e.id===c[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===c[1]?[e]:undefined:[]};i.filter.ID=function(c,e){var f=typeof c.getAttributeNode!=="undefined"&&c.getAttributeNode("id");return c.nodeType===1&&f&&f.nodeValue===
27
+ e}}d.removeChild(a);d=a=null})();(function(){var a=document.createElement("div");a.appendChild(document.createComment(""));if(a.getElementsByTagName("*").length>0)i.find.TAG=function(b,d){var c=d.getElementsByTagName(b[1]);if(b[1]==="*"){for(var e=[],f=0;c[f];f++)c[f].nodeType===1&&e.push(c[f]);c=e}return c};a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#")i.attrHandle.href=function(b){return b.getAttribute("href",
28
+ 2)};a=null})();document.querySelectorAll&&function(){var a=j,b=document.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!(b.querySelectorAll&&b.querySelectorAll(".TEST").length===0)){j=function(c,e,f,g){e=e||document;if(!g&&e.nodeType===9&&!j.isXML(e))try{return r(e.querySelectorAll(c),f)}catch(h){}return a(c,e,f,g)};for(var d in a)j[d]=a[d];b=null}}();(function(){var a=document.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!a.getElementsByClassName||
29
+ a.getElementsByClassName("e").length===0)){a.lastChild.className="e";if(a.getElementsByClassName("e").length!==1){i.order.splice(1,0,"CLASS");i.find.CLASS=function(b,d,c){if(typeof d.getElementsByClassName!=="undefined"&&!c)return d.getElementsByClassName(b[1])};a=null}}})();j.contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};j.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?
30
+ a.nodeName!=="HTML":false};var C=function(a,b){for(var d=[],c="",e,f=b.nodeType?[b]:b;e=i.match.PSEUDO.exec(a);){c+=e[0];a=a.replace(i.match.PSEUDO,"")}a=i.relative[a]?a+"*":a;e=0;for(var g=f.length;e<g;e++)j(a,f[e],d);return j.filter(c,d)};window.Sizzle=j})();RightJS([RightJS.Document,RightJS.Element]).each("include",{first:function(o){return this.find(o)[0]},find:function(o){return RightJS(Sizzle(o,this._)).map(RightJS.$)}});
@@ -357,7 +357,7 @@ var Sortable = new Widget('UL', {
357
357
  */
358
358
  $(document).on({
359
359
  mousedown: function(event) {
360
- var element = event.find(Sortable.Options.cssRule);
360
+ var element = event.find(Sortable.Options.cssRule+",*.rui-sortable");
361
361
 
362
362
  if (element) {
363
363
  if (!(element instanceof Sortable)) {
@@ -12,5 +12,5 @@ this._tryXhr).on("selectstart","stopEvent")},setOptions:function(a,b){this.$supe
12
12
  g=d+this.cloneHeight;b.top=a.y-this.yDiff+"px";b.left=a.x-this.xDiff+"px";if(a=this.suspects.first(function(i){return(d>i.top&&d<i.topHalf||g<i.bottom&&g>i.topHalf)&&(e>i.left&&e<i.leftHalf||c<i.right&&c>i.leftHalf)})){b=a.item;b.insert(this.item,b.prevSiblings().include(this.item)?"after":"before");this._findSuspects();a=b.parent();a instanceof h||(a=new h(a));this.fire("change",{list:a,item:this.item,index:a.children().indexOf(this.item)})}},finishDrag:function(){if(this.itemClone){this.itemClone.remove();
13
13
  this.item.setStyle("visibility:visible")}h.current=false},_initDrag:function(a,b){this.dimensions();var d=a.dimensions(),e=a.clone().setStyle({margin:0,zIndex:9999,position:"absolute",top:"0px",left:"0px"}).addClass(this.options.dragClass).insertTo(this).setHeight(this.cloneHeight=d.height).setWidth(this.cloneWidth=d.width),c=e.position(),g=d.left-c.x;d=d.top-c.y;e.moveTo(g,d);this.item=a.setStyle("visibility:hidden");this.itemClone=e;this.xDiff=b.x-g;this.yDiff=b.y-d;this.xRDiff=b.x-e.position().x;
14
14
  this.yRDiff=b.y-e.position().y;this._findSuspects()},_findSuspects:function(){var a=this.suspects=f([]),b=this.item,d=this.itemClone;this.options.accept.each(function(e){e.children().each(function(c){if(c!==b&&c!==d){var g=c.dimensions();a.push({item:c,top:g.top,left:g.left,right:g.left+g.width,bottom:g.top+g.height,topHalf:g.top+g.height/2,leftHalf:g.left+g.width/2})}})})},_tryXhr:function(a){if(this.options.url){var b=f(this.options.url),d={},e=a.item;a=a.index+1;var c=k.merge({method:this.options.method,
15
- params:{}},this.options.Xhr);e=e.get("id")||"";if(this.options.parseId&&e)e=(e.match(/\d+/)||[""])[0];if(b.include("%{id}"))b=b.replace("%{id}",e);else d[this.options.idParam]=e;d[this.options.posParam]=a;if(n(c.params))c.params+="&"+k.toQueryString(d);else c.params=k.merge(c.params,d);f.Xhr.load(b,c)}}});j(l).on({mousedown:function(a){var b=a.find(h.Options.cssRule);if(b){b instanceof h||(b=new h(b));b.startDrag(a)}},mousemove:function(a){h.current&&h.current.moveItem(a)},mouseup:function(){h.current&&
15
+ params:{}},this.options.Xhr);e=e.get("id")||"";if(this.options.parseId&&e)e=(e.match(/\d+/)||[""])[0];if(b.include("%{id}"))b=b.replace("%{id}",e);else d[this.options.idParam]=e;d[this.options.posParam]=a;if(n(c.params))c.params+="&"+k.toQueryString(d);else c.params=k.merge(c.params,d);f.Xhr.load(b,c)}}});j(l).on({mousedown:function(a){var b=a.find(h.Options.cssRule+",*.rui-sortable");if(b){b instanceof h||(b=new h(b));b.startDrag(a)}},mousemove:function(a){h.current&&h.current.moveItem(a)},mouseup:function(){h.current&&
16
16
  h.current.finishDrag()}});j(window).onBlur(function(){h.current&&h.current.finishDrag()});l.write('<style type="text/css">.rui-sortable{user-select:none;-moz-user-select:none;-webkit-user-select:none}</style>');return h}(document,RightJS);
@@ -170,7 +170,7 @@ var Spinner = new RightJS.Wrapper(RightJS.Element, {
170
170
  */
171
171
  var Tabs = new Widget('UL', {
172
172
  extend: {
173
- version: '2.0.0',
173
+ version: '2.0.1',
174
174
 
175
175
  EVENTS: $w('select hide load disable enable add remove move'),
176
176
 
@@ -833,13 +833,13 @@ Tabs.include({
833
833
 
834
834
  // searches and activates the current tab
835
835
  findCurrent: function() {
836
- var current;
837
- if (this.options.selected !== null) {
838
- current = this.options.selected;
839
- } else {
840
- var enabled = this.enabled();
841
- current = enabled[this.urlIndex()] || enabled[this.cookieIndex()] || enabled.first('current') || enabled[0];
842
- }
836
+ var enabled = this.enabled(), current = (
837
+ this.tabs[this.options.selected] ||
838
+ this.tabs[this.urlIndex()] ||
839
+ this.tabs[this.cookieIndex()] ||
840
+ enabled.first('current') ||
841
+ enabled[0]
842
+ );
843
843
 
844
844
  if (current) {
845
845
  current.select();
@@ -5,7 +5,7 @@
5
5
  */
6
6
  var Tabs=RightJS.Tabs=function(q,t,e){function u(){return h(e.Cookie?(v.get("right-tabs-indexes")||"").split(","):[])}function z(a,b,c){if(e.Cookie){var f=u();f=f.without.apply(f,b.map("id"));f.push(c.target.id);v.set("right-tabs-indexes",f.uniq().join(","),a)}}var h=e,r=e.$,A=e.$w,g=e.$E,B=e.Fx,C=e.Object,D=e.Browser,E=e.isArray,F=e.isNumber,w=e.Wrapper,s=e.Element,v=e.Cookie,G=new e.Wrapper(e.Element,{initialize:function(a){this.$super("div",{"class":"rui-spinner"});this.dots=[];for(var b=0;b<(a||
7
7
  4);b++)this.dots.push(new e.Element("div"));this.dots[0].addClass("glowing");this.insert(this.dots);e(this.shift).bind(this).periodical(300)},shift:function(){if(this.visible()){var a=this.dots.pop();this.dots.unshift(a);this.insert(a,"top")}}}),j=new (function(a,b){if(!b){b=a;a="DIV"}var c=new e.Wrapper(e.Element.Wrappers[a]||e.Element,{initialize:function(f,d){this.key=f;var i=[{"class":"rui-"+f}];this instanceof e.Input||this instanceof e.Form||i.unshift(a);this.$super.apply(this,i);if(e.isString(d))d=
8
- e.$(d);if(d instanceof e.Element){this._=d._;if("$listeners"in d)d.$listeners=d.$listeners;d={}}this.setOptions(d,this);return this},setOptions:function(f,d){d=d||this;e.Options.setOptions.call(this,e.Object.merge(f,eval("("+(d.get("data-"+this.key)||"{}")+")")));return this}});c=new e.Wrapper(c,b);e.Observer.createShortcuts(c.prototype,c.EVENTS||[]);return c})("UL",{extend:{version:"2.0.0",EVENTS:A("select hide load disable enable add remove move"),Options:{idPrefix:"",tabsElement:null,resizeFx:"both",
8
+ e.$(d);if(d instanceof e.Element){this._=d._;if("$listeners"in d)d.$listeners=d.$listeners;d={}}this.setOptions(d,this);return this},setOptions:function(f,d){d=d||this;e.Options.setOptions.call(this,e.Object.merge(f,eval("("+(d.get("data-"+this.key)||"{}")+")")));return this}});c=new e.Wrapper(c,b);e.Observer.createShortcuts(c.prototype,c.EVENTS||[]);return c})("UL",{extend:{version:"2.0.1",EVENTS:A("select hide load disable enable add remove move"),Options:{idPrefix:"",tabsElement:null,resizeFx:"both",
9
9
  resizeDuration:400,scrollTabs:false,scrollDuration:400,selected:null,disabled:null,closable:false,loop:false,loopPause:true,url:false,cache:false,Xhr:null,Cookie:null},rescan:function(a){r(a||q).find(".rui-tabs,*[data-tabs]").each(function(b){b instanceof j||new j(b)})}},initialize:function(a,b){this.$super("tabs",a).setOptions(b).addClass("rui-tabs");this.isHarmonica=this._.tagName==="DL";this.isCarousel=this.hasClass("rui-tabs-carousel");this.isSimple=!this.isHarmonica&&!this.isCarousel;this.findTabs().initScrolls().findCurrent().setStyle("visibility:visible");
10
10
  this.options.disabled&&this.disable(this.options.disabled);this.options.loop&&this.startLoop()},select:function(a){return this.callTab(a,"select")},disable:function(a){return this.callTab(a,"disable")},enable:function(a){return this.callTab(a,"enable")},current:function(){return this.tabs.first("current")},enabled:function(){return this.tabs.filter("enabled")},callTab:function(a,b){h(E(a)?a:[a]).each(function(c){if(F(c))c=this.tabs[c];c&&c instanceof n&&c[b]()},this);return this},findTabs:function(){this.tabsList=
11
11
  this.isHarmonica?this:r(this.options.tabsElement)||this.first(".rui-tabs-list")||(this.first("UL")||g("UL").insertTo(this)).addClass("rui-tabs-list");this.tabs=h([]);this.tabsList.children(this.isHarmonica?"dt":null).map(function(c){this.tabs.push(new n(c,this))},this);for(var a=0,b=this.tabsList.get("childNodes");a<b.length;a++)b[a].nodeType==3&&this.tabsList._.removeChild(b[a]);return this}}),n=j.Tab=new w(s,{extend:{autoId:0},initialize:function(a,b){this.$super(a._);this.addClass("rui-tabs-tab");
@@ -20,7 +20,7 @@ onFinish:x});l&&l.morph({height:a+"px"},{duration:c,onFinish:i});m!=="slide"&&d.
20
20
  this.nextButton=g("div",{"class":"rui-tabs-scroller-next",html:"&raquo;"});g("div").insertTo(this.tabsList,"before").replace(g("div",{"class":"rui-tabs-scroller"}).insert([this.prevButton,this.nextButton,this.scroller=g("div",{"class":"rui-tabs-scroller-body"}).insert(this.tabsList)])).remove()}this.prevButton.onClick(h(this.scrollLeft).bind(this));this.nextButton.onClick(h(this.scrollRight).bind(this))},pickTab:function(a){var b=this.current();if(b&&b.enabled()){var c=this.enabled();(a=c[c.indexOf(b)+
21
21
  a])&&a.select()}},scrollToTab:function(a){if(this.scroller){for(var b=0,c=0;c<this.tabs.length;c++){b+=this.tabs[c].width();if(this.tabs[c]===a)break}c=this.scroller.size().x;var f=(this.isCarousel?c/2+a.width()/2:c)-b;if(!this.isCarousel){var d=t(this.tabsList.getStyle("left")||0,10);if(f>=d&&f<d+c-a.width())f=d;else if(d>-b&&d<=a.width()-b)f=a.width()-b}this.scrollTo(f)}},justScroll:function(a){if(!this.scroller)return this;var b=t(this.tabsList.getStyle("left")||0,10),c=this.scroller.size().x;
22
22
  this.scrollTo(b+c*a)},scrollTo:function(a){var b=this.scroller.size().x,c=this.tabs.map("width").sum();if(a<b-c)a=b-c;if(a>0)a=0;this.tabsList.morph({left:a+"px"},{duration:this.options.scrollDuration});this.checkScrollButtons(c,b,a)},checkScrollButtons:function(a,b,c){var f=false,d=false;if(this.isCarousel){a=this.enabled();if(b=a.first("current")){d=a.indexOf(b);f=d>0;d=d<a.length-1}}else{f=c!==0;d=c>b-a}this.prevButton[f?"removeClass":"addClass"]("rui-tabs-scroller-disabled");this.nextButton[d?
23
- "removeClass":"addClass"]("rui-tabs-scroller-disabled")}});j.include({findCurrent:function(){var a;if(this.options.selected!==null)a=this.options.selected;else{a=this.enabled();a=a[this.urlIndex()]||a[this.cookieIndex()]||a.first("current")||a[0]}a&&a.select();this.options.Cookie&&this.onSelect(h(z).curry(this.options.Cookie,this.tabs));return this},urlIndex:function(){var a=-1,b=q.location.href.split("#")[1];if(b)for(var c=0;c<this.tabs.length;c++)if(this.tabs[c].id==b){a=c;break}return a},cookieIndex:function(){var a=
23
+ "removeClass":"addClass"]("rui-tabs-scroller-disabled")}});j.include({findCurrent:function(){var a=this.enabled();(a=this.tabs[this.options.selected]||this.tabs[this.urlIndex()]||this.tabs[this.cookieIndex()]||a.first("current")||a[0])&&a.select();this.options.Cookie&&this.onSelect(h(z).curry(this.options.Cookie,this.tabs));return this},urlIndex:function(){var a=-1,b=q.location.href.split("#")[1];if(b)for(var c=0;c<this.tabs.length;c++)if(this.tabs[c].id==b){a=c;break}return a},cookieIndex:function(){var a=
24
24
  -1;if(this.options.Cookie)for(var b=u(),c=0;c<this.tabs.length;c++)if(b.include(this.tabs[c].id)){a=c;break}return a}});j.include({add:function(a,b,c){c=c||{};a=g(this.isHarmonica?"dt":"li").insert(g("a",{html:a,href:c.url||"#"+(c.id||"")})).insertTo(this.tabsList);a=new n(a,this);a.panel.update(b||"");this.tabs.push(a);a.fire("add");"position"in c&&this.move(a,c.position);return this},move:function(a,b){a=this.tabs[a]||a;if(this.tabs[b]&&this.tabs[b]!==a){this.tabs[b].insert(a,b===this.tabs.length-
25
25
  1?"after":"before");this.isHarmonica&&a.insert(a.panel,"after");this.tabs.splice(this.tabs.indexOf(a),1);this.tabs.splice(b,0,a);a.fire("move",{index:b})}return this},remove:function(a){return this.callTab(a,"remove")}});var I=n.prototype.select;n.include({select:function(){if(this.dogPiling(arguments))return this;var a=I.apply(this,arguments),b=h(this.link.get("href")),c=this.main.options;if(b.includes("#"))b=c.url?c.url.replace("%{id}",b.split("#")[1]):null;if(b&&!this.request&&!(c.cache||this.cache)){this.panel.lock();
26
26
  try{this.request=(new e.Xhr(b,C.merge({method:"get"},c.Xhr))).onComplete(h(function(d){if(this.main.__working)return arguments.callee.bind(this,d).delay(100);this.panel.update(d.text);this.request=null;if(c.cache)this.cache=true;this.fire("load")}).bind(this)).send()}catch(f){if(!D.OLD)throw f;}}return a},dogPiling:function(a){if(this.main.__working){this.main.__timeout&&this.main.__timeout.cancel();this.main.__timeout=h(function(b){this.select.apply(this,b)}).bind(this,a).delay(100);return true}return this.main.__timeout=
@@ -175,7 +175,7 @@ if (!document.querySelector) {
175
175
 
176
176
  if (number == 'n') { return true; }
177
177
 
178
- if (number.includes('n')) {
178
+ if (number.include('n')) {
179
179
  // parsing out the matching expression
180
180
  var a = 0, b = 0;
181
181
  if ((m = number.match(/^([+\-]?\d*)?n([+\-]?\d*)?$/))) {
@@ -300,11 +300,11 @@ if (!document.querySelector) {
300
300
  'if('+
301
301
  '(o===""&&e.getAttributeNode(k)===null)||'+
302
302
  '(o==="="&&p!=v)||'+
303
- '(o==="*="&&!p.includes(v))||'+
303
+ '(o==="*="&&!p.include(v))||'+
304
304
  '(o==="^="&&!p.startsWith(v))||'+
305
305
  '(o==="$="&&!p.endsWith(v))||'+
306
- '(o==="~="&&!p.split(" ").includes(v))||'+
307
- '(o==="|="&&!p.split("-").includes(v))'+
306
+ '(o==="~="&&!p.split(" ").include(v))||'+
307
+ '(o==="|="&&!p.split("-").include(v))'+
308
308
  '){b=true;break;}'+
309
309
  '}if(b){continue;}'
310
310
  ); }
@@ -8,11 +8,11 @@
8
8
  */
9
9
  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}}});
10
10
  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_")};
11
- 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;}');
11
+ 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;}');
12
12
  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=
13
13
  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=
14
14
  [];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&&
15
- (!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],
16
- 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,
15
+ (!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)||
16
+ 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,
17
17
  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.$)}};
18
18
  q.select=q.find;g.Element.include(q);g.Document.include(q)}(RightJS);