Permalink
Browse files

updating download lib refs

  • Loading branch information...
1 parent 462302f commit a12f38273a80d51cc0f310f8d2504002e8e9cef8 @filmaj filmaj committed Nov 18, 2011
@@ -840,7 +840,6 @@ xui.touch = (function () {
xui.ready(function() {
console.log('ready, set, go!');
});
-
*/
xui.ready = function(handler) {
domReady(handler);
@@ -1062,8 +1061,8 @@ xui.extend({
}
if (callback === undefined) {
var styles = [];
- this.each(function(el) {styles.push(s(el, prop))});
- return styles;
+ this.each(function(el) {styles.push(s(el, prop))});
+ return styles;
} else return this.each(function(el) { callback(s(el, prop)); });
},
@@ -1086,10 +1085,13 @@ xui.extend({
x$('.foo').addClass('awesome');
*/
addClass: function(className) {
+ var cs = className.split(' ');
return this.each(function(el) {
- if (hasClass(el, className) === false) {
- el.className = trim(el.className + ' ' + className);
- }
+ cs.forEach(function(clazz) {
+ if (hasClass(el, clazz) === false) {
+ el.className = trim(el.className + ' ' + clazz);
+ }
+ });
});
},
@@ -1131,13 +1133,16 @@ xui.extend({
x$('div').hasClass('foo');
*/
hasClass: function(className, callback) {
- var self = this;
+ var self = this,
+ cs = className.split(' ');
return this.length && (function() {
var hasIt = true;
self.each(function(el) {
- if (hasClass(el, className)) {
+ cs.forEach(function(clazz) {
+ if (hasClass(el, clazz)) {
if (callback) callback(el);
} else hasIt = false;
+ });
});
return hasIt;
})();
@@ -1163,7 +1168,14 @@ xui.extend({
*/
removeClass: function(className) {
if (className === undefined) this.each(function(el) { el.className = ''; });
- else this.each(function(el) { el.className = trim(el.className.replace(getClassRegEx(className), '$1')); });
+ else {
+ var cs = className.split(' ');
+ this.each(function(el) {
+ cs.forEach(function(clazz) {
+ el.className = trim(el.className.replace(getClassRegEx(clazz), '$1'));
+ });
+ });
+ }
return this;
},
@@ -1187,9 +1199,12 @@ xui.extend({
x$('.foo').toggleClass('awesome'); // div above loses its awesome class.
*/
toggleClass: function(className) {
+ var cs = className.split(' ');
return this.each(function(el) {
- if (hasClass(el, className)) el.className = trim(el.className.replace(getClassRegEx(className), '$1'));
- else el.className = trim(el.className + ' ' + className);
+ cs.forEach(function(clazz) {
+ if (hasClass(el, clazz)) el.className = trim(el.className.replace(getClassRegEx(clazz), '$1'));
+ else el.className = trim(el.className + ' ' + clazz);
+ });
});
},
@@ -1246,7 +1261,7 @@ xui.extend({
xhr
---
- The classic `XMLHttpRequest` sometimes also known as the Greek God: _Ajax_. Not to be confused with _AJAX_ the cleaning agent.
+ The classic `XMLHttpRequest` sometimes also known as the Greek hero: _Ajax_. Not to be confused with _AJAX_ the cleaning agent.
### detail ###
@@ -11,11 +11,12 @@ function(b){return function(c){return this.html(b,c)}}(a)});i.events={};var u={}
for(var h in u[d])return;delete u[d]})},fire:function(a,b){return this.each(function(c){if(c==n&&!c.dispatchEvent)c=n.documentElement;var d=n.createEvent("HTMLEvents");d.initEvent(a,true,true);d.data=b||{};d.eventName=a;c.dispatchEvent(d)})}});"click load submit touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend orientationchange".split(" ").forEach(function(a){i.fn[a]=function(b){return function(c){return c?this.on(b,c):this.fire(b)}}(a)});i(l).on("load",function(){"onorientationchange"in
n.body||function(a,b){i(l).on("resize",function(){var c=l.innerWidth<a&&l.innerHeight>b&&l.innerWidth<l.innerHeight,d=l.innerWidth>a&&l.innerHeight<b&&l.innerWidth>l.innerHeight;if(c||d){l.orientation=c?0:90;i("body").fire("orientationchange");a=l.innerWidth;b=l.innerHeight}})}(l.innerWidth,l.innerHeight)});i.touch=function(){try{return!!n.createEvent("TouchEvent").initTouchEvent}catch(a){return false}}();i.ready=function(a){domReady(a)};v.id=1;i.extend({tween:function(a,b){var c=function(){var f=
{};"duration after easing".split(" ").forEach(function(e){if(a[e]){f[e]=a[e];delete a[e]}});return f}(a),d=function(f){var e=[],h;if(typeof f!=z){for(h in f)e.push(E(h)+":"+f[h]);e=e.join(";")}else e=f;return e}(a);return this.each(function(f){emile(f,d,c,b)})}});var Q=/^(\s|\u00A0)+|(\s|\u00A0)+$/g;i.extend({setStyle:function(a,b){a=K(a);return this.each(function(c){c.style[a]=b})},getStyle:function(a,b){var c=function(f,e){return n.defaultView.getComputedStyle(f,"").getPropertyValue(E(e))};if(b===
-w){var d=[];this.each(function(f){d.push(c(f,a))});return d}else return this.each(function(f){b(c(f,a))})},addClass:function(a){return this.each(function(b){if(C(b,a)===false)b.className=A(b.className+" "+a)})},hasClass:function(a,b){var c=this;return this.length&&function(){var d=true;c.each(function(f){if(C(f,a))b&&b(f);else d=false});return d}()},removeClass:function(a){a===w?this.each(function(b){b.className=""}):this.each(function(b){b.className=A(b.className.replace(D(a),"$1"))});return this},
-toggleClass:function(a){return this.each(function(b){b.className=C(b,a)?A(b.className.replace(D(a),"$1")):A(b.className+" "+a)})},css:function(a){for(var b in a)this.setStyle(b,a[b]);return this}});var F={},D=function(a){var b=F[a];if(!b){b=new RegExp("(^|\\s+)"+a+"(?:\\s+|$)");F[a]=b}return b};i.extend({xhr:function(a,b,c){function d(){if(h.readyState==4){delete e.xmlHttpRequest;if(h.status===0||h.status==200)h.handleResp();/^[45]/.test(h.status)&&h.handleError()}}if(!/^(inner|outer|top|bottom|before|after)$/.test(a)){c=
-b;b=a;a="inner"}var f=c?c:{};if(typeof c=="function"){f={};f.callback=c}var e=this,h=new XMLHttpRequest;c=f.method||"get";var k=typeof f.async!="undefined"?f.async:true,r=f.data||null,g;h.queryString=r;h.open(c,b,k);h.setRequestHeader("X-Requested-With","XMLHttpRequest");c.toLowerCase()=="post"&&h.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(g in f.headers)f.headers.hasOwnProperty(g)&&h.setRequestHeader(g,f.headers[g]);h.handleResp=f.callback!=null?f.callback:function(){e.html(a,
-h.responseText)};h.handleError=f.error&&typeof f.error=="function"?f.error:function(){};if(k){h.onreadystatechange=d;this.xmlHttpRequest=h}h.send(r);k||d();return this}});(function(a,b){function c(g,o,m){return(g+(o-g)*m).toFixed(3)}function d(g,o,m){return g.substr(o,m||1)}function f(g,o,m){for(var q=2,p,j,t=[],x=[];p=3,j=arguments[q-1],q--;)if(d(j,0)=="r")for(j=j.match(/\d+/g);p--;)t.push(~~j[p]);else{if(j.length==4)j="#"+d(j,1)+d(j,1)+d(j,2)+d(j,2)+d(j,3)+d(j,3);for(;p--;)t.push(parseInt(d(j,1+
-p*2,2),16))}for(;p--;){q=~~(t[p+3]+(t[p]-t[p+3])*m);x.push(q<0?0:q>255?255:q)}return"rgb("+x.join(",")+")"}function e(g){var o=parseFloat(g);g=g.replace(/^[\-\d\.]+/,"");return isNaN(o)?{v:g,f:f,u:""}:{v:o,f:c,u:g}}function h(g){var o={},m=r.length,q;k.innerHTML='<div style="'+g+'"></div>';for(g=k.childNodes[0].style;m--;)if(q=g[r[m]])o[r[m]]=e(q);return o}var k=n.createElement("div"),r="backgroundColor borderBottomColor borderBottomWidth borderLeftColor borderLeftWidth borderRightColor borderRightWidth borderSpacing borderTopColor borderTopWidth bottom color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex".split(" ");
+w){var d=[];this.each(function(f){d.push(c(f,a))});return d}else return this.each(function(f){b(c(f,a))})},addClass:function(a){var b=a.split(" ");return this.each(function(c){b.forEach(function(d){if(C(c,d)===false)c.className=A(c.className+" "+d)})})},hasClass:function(a,b){var c=this,d=a.split(" ");return this.length&&function(){var f=true;c.each(function(e){d.forEach(function(h){if(C(e,h))b&&b(e);else f=false})});return f}()},removeClass:function(a){if(a===w)this.each(function(c){c.className=
+""});else{var b=a.split(" ");this.each(function(c){b.forEach(function(d){c.className=A(c.className.replace(D(d),"$1"))})})}return this},toggleClass:function(a){var b=a.split(" ");return this.each(function(c){b.forEach(function(d){c.className=C(c,d)?A(c.className.replace(D(d),"$1")):A(c.className+" "+d)})})},css:function(a){for(var b in a)this.setStyle(b,a[b]);return this}});var F={},D=function(a){var b=F[a];if(!b){b=new RegExp("(^|\\s+)"+a+"(?:\\s+|$)");F[a]=b}return b};i.extend({xhr:function(a,b,
+c){function d(){if(h.readyState==4){delete e.xmlHttpRequest;if(h.status===0||h.status==200)h.handleResp();/^[45]/.test(h.status)&&h.handleError()}}if(!/^(inner|outer|top|bottom|before|after)$/.test(a)){c=b;b=a;a="inner"}var f=c?c:{};if(typeof c=="function"){f={};f.callback=c}var e=this,h=new XMLHttpRequest;c=f.method||"get";var k=typeof f.async!="undefined"?f.async:true,r=f.data||null,g;h.queryString=r;h.open(c,b,k);h.setRequestHeader("X-Requested-With","XMLHttpRequest");c.toLowerCase()=="post"&&
+h.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(g in f.headers)f.headers.hasOwnProperty(g)&&h.setRequestHeader(g,f.headers[g]);h.handleResp=f.callback!=null?f.callback:function(){e.html(a,h.responseText)};h.handleError=f.error&&typeof f.error=="function"?f.error:function(){};if(k){h.onreadystatechange=d;this.xmlHttpRequest=h}h.send(r);k||d();return this}});(function(a,b){function c(g,o,m){return(g+(o-g)*m).toFixed(3)}function d(g,o,m){return g.substr(o,m||1)}function f(g,
+o,m){for(var q=2,p,j,t=[],x=[];p=3,j=arguments[q-1],q--;)if(d(j,0)=="r")for(j=j.match(/\d+/g);p--;)t.push(~~j[p]);else{if(j.length==4)j="#"+d(j,1)+d(j,1)+d(j,2)+d(j,2)+d(j,3)+d(j,3);for(;p--;)t.push(parseInt(d(j,1+p*2,2),16))}for(;p--;){q=~~(t[p+3]+(t[p]-t[p+3])*m);x.push(q<0?0:q>255?255:q)}return"rgb("+x.join(",")+")"}function e(g){var o=parseFloat(g);g=g.replace(/^[\-\d\.]+/,"");return isNaN(o)?{v:g,f:f,u:""}:{v:o,f:c,u:g}}function h(g){var o={},m=r.length,q;k.innerHTML='<div style="'+g+'"></div>';
+for(g=k.childNodes[0].style;m--;)if(q=g[r[m]])o[r[m]]=e(q);return o}var k=n.createElement("div"),r="backgroundColor borderBottomColor borderBottomWidth borderLeftColor borderLeftWidth borderRightColor borderRightWidth borderSpacing borderTopColor borderTopWidth bottom color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex".split(" ");
b[a]=function(g,o,m,q){g=typeof g=="string"?n.getElementById(g):g;m=m||{};var p=h(o);o=g.currentStyle?g.currentStyle:getComputedStyle(g,null);var j,t={},x=+new Date,G=m.duration||200,H=x+G,I,U=m.easing||function(y){return-Math.cos(y*Math.PI)/2+0.5};for(j in p)t[j]=e(o[j]);I=setInterval(function(){var y=+new Date,V=y>H?1:(y-x)/G;for(j in p)g.style[j]=p[j].f(t[j].v,p[j].v,U(V))+p[j].u;if(y>H){clearInterval(I);m.after&&m.after();q&&setTimeout(q,1)}},10)}})("emile",this);(function(a,b){function c(g){for(r=
1;g=d.shift();)g()}var d=[],f,e,h=b.documentElement,k=h.doScroll,r=/^loade|c/.test(b.readyState);b.addEventListener&&b.addEventListener("DOMContentLoaded",e=function(){b.removeEventListener("DOMContentLoaded",e,false);c()},false);k&&b.attachEvent("onreadystatechange",f=function(){if(/^c/.test(b.readyState)){b.detachEvent("onreadystatechange",f);c()}});a.domReady=k?function(g){self!=top?r?g():d.push(g):function(){try{h.doScroll("left")}catch(o){return setTimeout(function(){a.domReady(g)},50)}g()}()}:
function(g){r?g():d.push(g)}})(this,n)})();
@@ -840,7 +840,6 @@ xui.touch = (function () {
xui.ready(function() {
console.log('ready, set, go!');
});
-
*/
xui.ready = function(handler) {
domReady(handler);
@@ -1062,8 +1061,8 @@ xui.extend({
}
if (callback === undefined) {
var styles = [];
- this.each(function(el) {styles.push(s(el, prop))});
- return styles;
+ this.each(function(el) {styles.push(s(el, prop))});
+ return styles;
} else return this.each(function(el) { callback(s(el, prop)); });
},
@@ -1086,10 +1085,13 @@ xui.extend({
x$('.foo').addClass('awesome');
*/
addClass: function(className) {
+ var cs = className.split(' ');
return this.each(function(el) {
- if (hasClass(el, className) === false) {
- el.className = trim(el.className + ' ' + className);
- }
+ cs.forEach(function(clazz) {
+ if (hasClass(el, clazz) === false) {
+ el.className = trim(el.className + ' ' + clazz);
+ }
+ });
});
},
@@ -1131,13 +1133,16 @@ xui.extend({
x$('div').hasClass('foo');
*/
hasClass: function(className, callback) {
- var self = this;
+ var self = this,
+ cs = className.split(' ');
return this.length && (function() {
var hasIt = true;
self.each(function(el) {
- if (hasClass(el, className)) {
+ cs.forEach(function(clazz) {
+ if (hasClass(el, clazz)) {
if (callback) callback(el);
} else hasIt = false;
+ });
});
return hasIt;
})();
@@ -1163,7 +1168,14 @@ xui.extend({
*/
removeClass: function(className) {
if (className === undefined) this.each(function(el) { el.className = ''; });
- else this.each(function(el) { el.className = trim(el.className.replace(getClassRegEx(className), '$1')); });
+ else {
+ var cs = className.split(' ');
+ this.each(function(el) {
+ cs.forEach(function(clazz) {
+ el.className = trim(el.className.replace(getClassRegEx(clazz), '$1'));
+ });
+ });
+ }
return this;
},
@@ -1187,9 +1199,12 @@ xui.extend({
x$('.foo').toggleClass('awesome'); // div above loses its awesome class.
*/
toggleClass: function(className) {
+ var cs = className.split(' ');
return this.each(function(el) {
- if (hasClass(el, className)) el.className = trim(el.className.replace(getClassRegEx(className), '$1'));
- else el.className = trim(el.className + ' ' + className);
+ cs.forEach(function(clazz) {
+ if (hasClass(el, clazz)) el.className = trim(el.className.replace(getClassRegEx(clazz), '$1'));
+ else el.className = trim(el.className + ' ' + clazz);
+ });
});
},
@@ -1246,7 +1261,7 @@ xui.extend({
xhr
---
- The classic `XMLHttpRequest` sometimes also known as the Greek God: _Ajax_. Not to be confused with _AJAX_ the cleaning agent.
+ The classic `XMLHttpRequest` sometimes also known as the Greek hero: _Ajax_. Not to be confused with _AJAX_ the cleaning agent.
### detail ###
Oops, something went wrong.

0 comments on commit a12f382

Please sign in to comment.