Skip to content
Browse files

party like it's v0.6

  • Loading branch information...
1 parent 87cdfce commit ac3b60c797aa41b1da30e4ddcf81c06eb5b2c051 @madrobby committed May 14, 2011
View
BIN downloads/zepto-0.4.zip
Binary file not shown.
View
BIN downloads/zepto-0.5.zip
Binary file not shown.
View
BIN downloads/zepto-0.6.zip
Binary file not shown.
View
40 index.html
@@ -33,12 +33,32 @@
</p>
<p>
- Zepto.js is currently in early beta, and you can help to make it
+ Zepto.js is currently in beta, and you can help to make it
awesome by <b>contributing code, documentation and demos</b>.
</p>
<p>
- <em>New in v0.3</em> bug fix galore, toggleClass, .attr('value'), .last, $ fragments (element creation),
+ <em>New in v0.6</em> .add, .appendTo, .prependTo, .replaceWith,
+ .empty, .submit, text nodes in selectors, function args for
+ .add/.remove/.toggleClass, improvements to events and xhr,
+ cleanups and improved jQuery compatibility.
+ </p>
+
+ <p>
+ <em>New in v0.5</em> .not, .children, .siblings, $.param,
+ better .attr &amp; .html, callback for .anim
+ </p>
+
+ <p>
+ <em>New in v0.4</em> JSONP, better .find, .each, .closest; new
+ .eq, .size, .parent, .parents, .removeAttr, .val (basic),
+ function args to .html, .attr; adjacency methods now take Zepto
+ objects
+ </p>
+
+ <p>
+ <em>New in v0.3</em> bug fix galore, toggleClass, .attr('value'),
+ .last, $ fragments (element creation),
.undelegate, .die, proxied event objects.
</p>
@@ -52,12 +72,12 @@
</p>
<div class="downloads">
- <div class="download" onclick="location.href='/downloads/zepto-0.3.zip'">
- <h1>Download v0.3</h1>
- <a href="/downloads/zepto-0.3.zip">download package</a>
+ <div class="download" onclick="location.href='/downloads/zepto-0.6.zip'">
+ <h1>Download v0.6</h1>
+ <a href="/downloads/zepto-0.6.zip">download package</a>
<p>
- 3.3k min+gzip<br/>
- Dec 17, 2010
+ 4.8k min+gzip<br/>
+ May 14, 2011
</p>
</div>
@@ -141,14 +161,14 @@
<a class="mcb" href="http://html5mobilepro.com/">
- <div class="large">HTML5 Mobile Pro Workshop<br/> January 14, 2010</div>
+ <div class="large">HTML5 Mobile Pro Workshop<br/> June 17, 2011</div>
<div>Learn how to build AWESOME mobile HTML5 apps with Zepto.js creator Thomas Fuchs!</div>
<div>Online Class &mdash; Book Now!</div>
</a></div>
<a class="mcb" href="http://javascriptmasterclass.com/">
<div>JavaScript Master Class Virtual Edition</div>
- <div class="large">January 20/21</div>
+ <div class="large">June 27/28, 2011</div>
<div>Want to see what makes libraries and frameworks tick? With Thomas Fuchs and Amy Hoy!</div>
<div>Online Class &mdash; Book Now!</div>
</a>
@@ -161,6 +181,8 @@
</div>
+
+
<script src="javascripts/zepto.min.js"></script>
<script>
if($.os.ios) $('body').addClass('ios');
View
20 javascripts/zepto.min.js
@@ -1,19 +1 @@
-var Zepto=function(){function f(a){return a.filter(function(c){return c!==g&&c!==null})}function i(a){return a.replace(/-+(.)?/g,function(c,e){return e?e.toUpperCase():""})}function m(a,c){this.dom=a||[];this.selector=c||""}function b(a,c){if(a==d)return new m;else if(c!==g)return b(c).find(a);else if(typeof a==="function")return b(d).ready(a);else{var e;if(a instanceof m)e=a.dom;else{if(a instanceof Array)e=a;else{if(a instanceof Element||a===window)e=[a];else{if(p.test(a)){n.innerHTML=(""+a).trim();
-e=h.call(n.childNodes);n.innerHTML="";e=e}else e=o(d,a);e=e}e=e}e=e}return new m(f(e),a)}}var h=[].slice,j,l,o,p,n,d=window.document,g;if(String.prototype.trim===g)String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")};p=/^\s*<.+>/;n=d.createElement("div");b.extend=function(a,c){for(j in c)a[j]=c[j];return a};b.qsa=o=function(a,c){return h.call(a.querySelectorAll(c))};b.fn={ready:function(a){d.addEventListener("DOMContentLoaded",a,false);return this},compact:function(){this.dom=
-f(this.dom);return this},get:function(a){return a===g?this.dom:this.dom[a]},remove:function(){return this.each(function(a){a.parentNode.removeChild(a)})},each:function(a){this.dom.forEach(a);return this},filter:function(a){return b(this.dom.filter(function(c){return o(c.parentNode,a).indexOf(c)>=0}))},is:function(a){return this.dom.length>0&&b(this.dom[0]).filter(a).dom.length>0},first:function(){this.dom=f([this.dom[0]]);return this},last:function(){this.dom=f([this.dom[this.dom.length-1]]);return this},
-find:function(a){return b(this.dom.map(function(c){return o(c,a)}).reduce(function(c,e){return c.concat(e)},[]))},closest:function(a){var c=this.dom[0].parentNode;for(a=o(d,a);c&&a.indexOf(c)<0;)c=c.parentNode;return b(c&&c!==d?c:[])},pluck:function(a){return this.dom.map(function(c){return c[a]})},show:function(){return this.css("display","block")},hide:function(){return this.css("display","none")},prev:function(){return b(this.pluck("previousElementSibling"))},next:function(){return b(this.pluck("nextElementSibling"))},
-html:function(a){return a===g?this.dom.length>0?this.dom[0].innerHTML:null:this.each(function(c){c.innerHTML=a})},text:function(a){return a===g?this.dom.length>0?this.dom[0].innerText:null:this.each(function(c){c.innerText=a})},attr:function(a,c){return typeof a=="string"&&c===g?this.dom.length>0&&this.dom[0].nodeName==="INPUT"&&this.dom[0].type==="text"&&a==="value"?this.dom[0].value:this.dom.length>0?this.dom[0].getAttribute(a)||g:null:this.each(function(e){if(typeof a=="object")for(j in a)e.setAttribute(j,
-a[j]);else e.setAttribute(a,c)})},offset:function(){var a=this.dom[0].getBoundingClientRect();return{left:a.left+d.body.scrollLeft,top:a.top+d.body.scrollTop,width:a.width,height:a.height}},css:function(a,c){if(c===g&&typeof a=="string")return this.dom[0].style[i(a)];l="";for(j in a)l+=j+":"+a[j]+";";if(typeof a=="string")l=a+":"+c;return this.each(function(e){e.style.cssText+=";"+l})},index:function(a){return this.dom.indexOf(b(a).get(0))},hasClass:function(a){return RegExp("(^|\\s)"+a+"(\\s|$)").test(this.dom[0].className)},
-addClass:function(a){return this.each(function(c){!b(c).hasClass(a)&&(c.className+=(c.className?" ":"")+a)})},removeClass:function(a){return this.each(function(c){c.className=c.className.replace(RegExp("(^|\\s)"+a+"(\\s|$)")," ").trim()})},toggleClass:function(a,c){return this.each(function(e){c!==g&&!c||b(e).hasClass(a)?b(e).removeClass(a):b(e).addClass(a)})}};["width","height"].forEach(function(a){b.fn[a]=function(){return this.offset()[a]}});var k={append:"beforeEnd",prepend:"afterBegin",before:"beforeBegin",
-after:"afterEnd"};for(j in k)b.fn[j]=function(a){return function(c){return this.each(function(e){e["insertAdjacent"+(c instanceof Element?"Element":"HTML")](a,c)})}}(k[j]);m.prototype=b.fn;return b}();"$"in window||(window.$=Zepto);
-(function(f){function i(d,g,k,a){g=m(g);if(g.ns)var c=RegExp("(?:^| )"+g.ns.replace(" "," .* ?")+"(?: |$)");return(o[d._zid||(d._zid=p++)]||[]).filter(function(e){return e&&(!g.e||e.e==g.e)&&(!g.ns||c.test(e.ns))&&(!k||e.fn==k)&&(!a||e.sel==a)})}function m(d){d=(""+d).split(".");return{e:d[0],ns:d.slice(1).sort().join(" ")}}function b(d,g,k,a,c){var e=d._zid||(d._zid=p++),q=o[e]||(o[e]=[]);g.split(/\s/).forEach(function(r){r=f.extend(m(r),{fn:k,sel:a,del:c,i:q.length});q.push(r);d.addEventListener(r.e,
-c||k,false)})}function h(d,g,k,a){var c=d._zid||(d._zid=p++);(g||"").split(/\s/).forEach(function(e){i(d,e,k,a).forEach(function(q){delete o[c][q.i];d.removeEventListener(q.e,q.del||q.fn,false)})})}function j(d){var g=f.extend({originalEvent:d},d);n.forEach(function(k){g[k]=function(){return d[k].apply(d,arguments)}});return g}var l=f.qsa,o={},p=1;f.event={add:function(d,g,k){b(d,g,k)},remove:function(d,g,k){h(d,g,k)}};f.fn.bind=function(d,g){return this.each(function(k){b(k,d,g)})};f.fn.unbind=function(d,
-g){return this.each(function(k){h(k,d,g)})};var n=["preventDefault","stopImmediatePropagation","stopPropagation"];f.fn.delegate=function(d,g,k){return this.each(function(a){b(a,g,k,d,function(c){for(var e=c.target,q=l(a,d);e&&q.indexOf(e)<0;)e=e.parentNode;e&&e!==a&&e!==document&&k.call(e,f.extend(j(c),{currentTarget:e,liveFired:a}))})})};f.fn.undelegate=function(d,g,k){return this.each(function(a){h(a,g,k,d)})};f.fn.live=function(d,g){f(document.body).delegate(this.selector,d,g);return this};f.fn.die=
-function(d,g){f(document.body).undelegate(this.selector,d,g);return this};f.fn.trigger=function(d){return this.each(function(g){var k=document.createEvent("Events");g.dispatchEvent(k,k.initEvent(d,true,false))})}})(Zepto);
-(function(f){function i(b){var h={},j=b.match(/(Android)\s+([\d.]+)/),l=b.match(/(iPhone\sOS)\s([\d_]+)/),o=b.match(/(iPad).*OS\s([\d_]+)/);b=b.match(/(webOS)\/([\d.]+)/);if(j){h.android=true;h.version=j[2]}if(l){h.ios=true;h.version=l[2].replace(/_/g,".");h.iphone=true}if(o){h.ios=true;h.version=o[2].replace(/_/g,".");h.ipad=true}if(b){h.webos=true;h.version=b[2]}return h}f.os=i(navigator.userAgent);f.__detect=i;var m=navigator.userAgent.match(/WebKit\/([\d.]+)/);f.browser=m?{webkit:true,version:m[1]}:
-{webkit:false}})(Zepto);(function(f){f.fn.anim=function(i,m,b){var h=[],j,l;for(l in i)if(l==="opacity")j=i[l];else h.push(l+"("+i[l]+")");return this.css({"-webkit-transition":"all "+(m!==undefined?m:0.5)+"s "+(b||""),"-webkit-transform":h.join(" "),opacity:j})}})(Zepto);
-(function(f){var i={},m;f(document).ready(function(){f(document.body).bind("touchstart",function(b){var h=Date.now(),j=h-(i.last||h);i.target="tagName"in b.touches[0].target?b.touches[0].target:b.touches[0].target.parentNode;m&&clearTimeout(m);i.x1=b.touches[0].pageX;if(j>0&&j<=250)i.isDoubleTap=true;i.last=h}).bind("touchmove",function(b){i.x2=b.touches[0].pageX}).bind("touchend",function(){if(i.isDoubleTap){f(i.target).trigger("doubleTap");i={}}else if(i.x2>0){Math.abs(i.x1-i.x2)>30&&f(i.target).trigger("swipe")&&
-f(i.target).trigger("swipe"+(i.x1-i.x2>0?"Left":"Right"));i.x1=i.x2=i.last=0}else if("last"in i)m=setTimeout(function(){m=null;f(i.target).trigger("tap");i={}},250)}).bind("touchcancel",function(){i={}})});["swipe","swipeLeft","swipeRight","doubleTap","tap"].forEach(function(b){f.fn[b]=function(h){return this.bind(b,h)}})})(Zepto);
-(function(f){function i(){}f.ajax=function(b){b=b||{};var h=b.data,j=b.success||i,l=b.error||i,o=m[b.dataType],p=b.contentType,n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState==4)if(n.status>=200&&n.status<300||n.status==0)if(o=="application/json"){var d,g=false;try{d=JSON.parse(n.responseText)}catch(k){g=k}g?l(n,"parsererror",g):j(d,"success",n)}else j(n.responseText,"success",n);else l(n,"error")};n.open(b.type||"GET",b.url||window.location,true);o&&n.setRequestHeader("Accept",
-o);if(h instanceof Object){h=JSON.stringify(h);p=p||"application/json"}p&&n.setRequestHeader("Content-Type",p);n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.send(h)};var m=f.ajax.mimeTypes={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain"};f.get=function(b,h){f.ajax({url:b,success:h})};f.post=function(b,h,j,l){if(h instanceof Function){l=l||j;j=h;h=null}f.ajax({type:"POST",url:b,data:h,success:j,dataType:l})};f.getJSON=function(b,h){f.ajax({url:b,success:h,
-dataType:"json"})};f.fn.load=function(b,h){if(!this.dom.length)return this;var j=this,l=b.split(/\s/),o;if(l.length>1){b=l[0];o=l[1]}f.get(b,function(p){j.html(o?f(document.createElement("div")).html(p).find(o).html():p);h&&h()});return this}})(Zepto);(function(f){var i=[],m;f.fn.remove=function(){return this.each(function(b){if(b.tagName=="IMG"){i.push(b);b.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";m&&clearTimeout(m);m=setTimeout(function(){i=[]},6E4)}b.parentNode.removeChild(b)})}})(Zepto);
+(function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else for(;;){if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(e<d)e in c&&(f=b.call(a,f,c[e],e,c)),e++;return f})})();var Zepto=function(){function C(a,b,c){var d=!a||a==3?b:b.parentNode;d.insertBefore(c,a?a==1?b.nextSibling:a==2?b:null:d.firstChild)}function A(a,b,c,d){return n(b)?b.call(a,c,d):b}function z(b,c){return c===a?y(b):y(b).filter(c)}function y(b,c){if(!b)return x();if(c!==a)return y(c).find(b);if(n(b))return y(h).ready(b);if(b instanceof x)return b;var e;p(b)?e=q(b):b instanceof Element||b===window||b===h?(e=[b],b=null):l.test(b)?e=w(b):b.nodeType&&b.nodeType==3?e=[b]:e=d(h,b);return x(e,b)}function x(a,b){a=a||f,a.__proto__=x.prototype,a.selector=b||"";return a}function w(a){m.innerHTML=(""+a).trim();return g.call(m.childNodes)}function v(a){var b,c;i[a]||(b=h.createElement(a),h.body.insertAdjacentElement("beforeEnd",b),c=k(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),i[a]=c);return i[a]}function u(a){return a in j?j[a]:j[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function t(a){return a.filter(function(a,b,c){return c.indexOf(a)==b})}function s(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})}function r(a){return[].concat.apply([],a)}function q(b){return b.filter(function(b){return b!==a&&b!==null})}function p(a){return a instanceof Array}function o(a){return a instanceof Object}function n(a){return{}.toString.call(a)=="[object Function]"}var a,b,c,d,e,f=[],g=f.slice,h=window.document,i={},j={},k=h.defaultView.getComputedStyle,l=/^\s*<[^>]+>/,m=h.createElement("div");y.extend=function(a,c){for(b in c)a[b]=c[b];return a},y.qsa=d=function(a,b){return g.call(a.querySelectorAll(b))},y.isFunction=n,y.isObject=o,y.isArray=p,y.fn={forEach:f.forEach,map:f.map,reduce:f.reduce,push:f.push,indexOf:f.indexOf,concat:f.concat,ready:function(a){(h.readyState=="complete"||h.readyState=="loaded")&&a(),h.addEventListener("DOMContentLoaded",a,!1);return this},get:function(b){return b===a?this:this[b]},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode.removeChild(this)})},each:function(a){this.forEach(function(b,c){a.call(b,c,b)});return this},filter:function(a){return y([].filter.call(this,function(b){return d(b.parentNode,a).indexOf(b)>=0}))},add:function(a,b){return y(t(this.concat(y(a,b))))},is:function(a){return this.length>0&&y(this[0]).filter(a).length>0},not:function(b){var c=[];if(n(b)&&b.call!==a)this.each(function(a){b.call(this,a)||c.push(this)});else{var d=g.call(typeof b=="string"?this.filter(b):b instanceof NodeList?b:y(b));g.call(this).forEach(function(a){d.indexOf(a)<0&&c.push(a)})}return y(c)},eq:function(a){return y(this[a])},first:function(){return y(this[0])},last:function(){return y(this[this.length-1])},find:function(a){var b;this.length==1?b=d(this[0],a):b=r(this.map(function(b){return d(b,a)}));return y(b)},closest:function(b,c){var e=this[0],f=d(c!==a?c:h,b);f.length===0&&(e=null);while(e&&e!==h&&f.indexOf(e)<0)e=e.parentNode;return y(e!==h&&e)},parents:function(a){var b=[],c=this;while(c.length>0)c=q(c.map(function(a){if((a=a.parentNode)&&a!==h&&b.indexOf(a)<0){b.push(a);return a}}));return z(b,a)},parent:function(a){return z(t(q(this.pluck("parentNode"))),a)},children:function(a){return z(r(this.map(function(a){return g.call(a.children)})),a)},siblings:function(a){return z(r(this.map(function(a){return g.call(a.parentNode.children).filter(function(b){return b!==a})})),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(b){return b[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),k(this,"").getPropertyValue("display")=="none"&&(this.style.display=v(this.nodeName))})},replaceWith:function(a){return this.each(function(){var b=y(this),c=b.prev();b.remove(),c.after(a)})},hide:function(){return this.css("display","none")},toggle:function(){return this.css("display")=="none"?this.show():this.hide()},prev:function(){return y(this.pluck("previousElementSibling"))},next:function(){return y(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){this.innerHTML=A(this,b,a,this.innerHTML)})},text:function(b){return b===a?this.length>0?this[0].innerText:null:this.each(function(){this.innerText=b})},attr:function(c,d){return typeof c=="string"&&d===a?this.length>0&&this[0].nodeName=="INPUT"&&this[0].type=="text"&&c=="value"?this.val():this.length>0?this[0].getAttribute(c)||(c in this[0]?this[0][c]:a):a:this.each(function(a){if(o(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,A(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.removeAttribute(a)})},data:function(a,b){return this.attr("data-"+a,b)},val:function(b){return b===a?this.length>0?this[0].value:null:this.each(function(){this.value=b})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+h.body.scrollLeft,top:a.top+h.body.scrollTop,width:a.width,height:a.height}},css:function(d,e){if(e===a&&typeof d=="string")return this[0].style[s(d)]||k(this[0],"").getPropertyValue(d);c="";for(b in d)c+=b+":"+d[b]+";";typeof d=="string"&&(c=d+":"+e);return this.each(function(){this.style.cssText+=";"+c})},index:function(a){return this.indexOf(y(a)[0])},hasClass:function(a){return u(a).test(this[0].className)},addClass:function(a){return this.each(function(b){e=[];var c=this.className,d=A(this,a,b,c);d.split(/\s+/g).forEach(function(a){y(this).hasClass(a)||e.push(a)},this),e.length&&(this.className+=(c?" ":"")+e.join(" "))})},removeClass:function(a){return this.each(function(b){e=this.className,A(this,a,b,e).split(/\s+/g).forEach(function(a){e=e.replace(u(a)," ")}),this.className=e.trim()})},toggleClass:function(b,c){return this.each(function(d){var e=this.className,f=A(this,b,d,e);c!==a&&!c||y(this).hasClass(f)?y(this).removeClass(f):y(this).addClass(f)})},submit:function(){return this.each(function(){try{this.submit();return}catch(a){}})}},["width","height"].forEach(function(a){y.fn[a]=function(){var b=this.offset();return b?b[a]:null}});var B=["prepend","after","before","append"];B.forEach(function(a,b){y.fn[a]=function(a){typeof a!="object"&&(a=w(a));return this.each(function(c,d){if(a.length||a instanceof x){dom=a;for(var e=0;e<dom.length;e++){var f=dom[b<2?dom.length-e-1:e];C(b,d,f)}}else C(b,d,a)})}});var D=["append","prepend"];D.forEach(function(a){y.fn[a+"To"]=function(b){typeof b!="object"&&(b=w(b)),b[a](this);return this}}),x.prototype=y.fn;return y}();"$"in window||(window.$=Zepto),function(a){function l(b){var c=a.extend({originalEvent:b},b);k.forEach(function(a){c[a]=function(){return b[a].apply(b,arguments)}});return c}function j(a,b,d,g){var h=e(a);(b||"").split(/\s/).forEach(function(b){f(a,b,d,g).forEach(function(b){delete c[h][b.i],a.removeEventListener(b.e,b.proxy,!1)})})}function i(b,d,f,h,i){var j=e(b),k=c[j]||(c[j]=[]);d.split(/\s/).forEach(function(c){var d=i||f,e=function(a){return d(a,a.data)},j=a.extend(g(c),{fn:f,proxy:e,sel:h,del:i,i:k.length});k.push(j),b.addEventListener(j.e,e,!1)})}function h(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function g(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function f(a,b,d,f){b=g(b);if(b.ns)var i=h(b.ns);return(c[e(a)]||[]).filter(function(a){return a&&(!b.e||a.e==b.e)&&(!b.ns||i.test(a.ns))&&(!d||a.fn==d)&&(!f||a.sel==f)})}function e(a){return a._zid||(a._zid=d++)}var b=a.qsa,c={},d=1;a.event={add:i,remove:j},a.fn.bind=function(a,b){return this.each(function(){i(this,a,b)})},a.fn.unbind=function(a,b){return this.each(function(){j(this,a,b)})},a.fn.one=function(a,b){return this.each(function(){var c=this;i(this,a,function(){b(),j(c,a,arguments.callee)})})};var k=["preventDefault","stopImmediatePropagation","stopPropagation"];a.fn.delegate=function(c,d,e){return this.each(function(f,g){i(g,d,e,c,function(d,f){var h=d.target,i=b(g,c);while(h&&i.indexOf(h)<0)h=h.parentNode;h&&h!==g&&h!==document&&e.call(h,a.extend(l(d),{currentTarget:h,liveFired:g}),f)})})},a.fn.undelegate=function(a,b,c){return this.each(function(){j(this,b,c,a)})},a.fn.live=function(b,c){a(document.body).delegate(this.selector,b,c);return this},a.fn.die=function(b,c){a(document.body).undelegate(this.selector,b,c);return this},a.fn.trigger=function(a,b){return this.each(function(){var c=document.createEvent("Events");c.initEvent(a,!0,!0),c.data=b,this.dispatchEvent(c)})}}(Zepto),function(a){function b(a){var a=a,b={},c=a.match(/(Android)\s+([\d.]+)/),d=a.match(/(iPhone\sOS)\s([\d_]+)/),e=a.match(/(iPad).*OS\s([\d_]+)/),f=a.match(/(webOS)\/([\d.]+)/),g=a.match(/(BlackBerry).*Version\/([\d.]+)/);c&&(b.android=!0,b.version=c[2]),d&&(b.ios=!0,b.version=d[2].replace(/_/g,"."),b.iphone=!0),e&&(b.ios=!0,b.version=e[2].replace(/_/g,"."),b.ipad=!0),f&&(b.webos=!0,b.version=f[2]),g&&(b.blackberry=!0,b.version=g[2]);return b}a.os=b(navigator.userAgent),a.__detect=b;var c=navigator.userAgent.match(/WebKit\/([\d.]+)/);a.browser=c?{webkit:!0,version:c[1]}:{webkit:!1}}(Zepto),function(a,b){a.fn.anim=function(c,d,e,f){var g=[],h,i;for(i in c)i==="opacity"?h=c[i]:g.push(i+"("+c[i]+")");a.isFunction(f)&&this.one("webkitTransitionEnd",f);return this.css({"-webkit-transition":"all "+(d!==b?d:.5)+"s "+(e||""),"-webkit-transform":g.join(" "),opacity:h})}}(Zepto),function(a){function e(){}var b=0,c=a.isObject,d;a.ajaxJSONP=function(c){var d="jsonp"+ ++b,e=document.createElement("script");window[d]=function(a){c.success(a),delete window[d]},e.src=c.url.replace(/=\?/,"="+d),a("head").append(e)},a.ajaxSettings={type:"GET",beforeSend:e,success:e,error:e,complete:e,accepts:{script:"text/javascript, application/javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"}},a.ajax=function(b){b=b||{};var e=a.extend({},b);for(d in a.ajaxSettings)e[d]||(e[d]=a.ajaxSettings[d]);if(/=\?/.test(e.url))return a.ajaxJSONP(e);e.url||(e.url=window.location.toString()),e.data&&!e.contentType&&(e.contentType="application/x-www-form-urlencoded"),c(e.data)&&(e.data=a.param(e.data));if(e.type.match(/get/i)&&e.data){var f=e.data;e.url.match(/\?.*=/)?f="&"+f:f[0]!="?"&&(f="?"+f),e.url+=f}var g=e.accepts[e.dataType],h=new XMLHttpRequest;e.headers=a.extend({"X-Requested-With":"XMLHttpRequest"},e.headers||{}),g&&(e.headers.Accept=g),h.onreadystatechange=function(){if(h.readyState==4){var a,b=!1;if(h.status>=200&&h.status<300||h.status==0){if(g=="application/json")try{a=JSON.parse(h.responseText)}catch(c){b=c}else a=h.responseText;b?e.error(h,"parsererror",b):e.success(a,"success",h)}else b=!0,e.error(h,"error");e.complete(h,b?"error":"success")}},h.open(e.type,e.url,!0);if(e.beforeSend(h,e)===!1){h.abort();return!1}e.contentType&&(e.headers["Content-Type"]=e.contentType);for(name in e.headers)h.setRequestHeader(name,e.headers[name]);h.send(e.data);return h},a.get=function(b,c){a.ajax({url:b,success:c})},a.post=function(b,c,d,e){a.isFunction(c)&&(e=e||d,d=c,c=null),a.ajax({type:"POST",url:b,data:c,success:d,dataType:e})},a.getJSON=function(b,c){a.ajax({url:b,success:c,dataType:"json"})},a.fn.load=function(b,c){if(!this.length)return this;var d=this,e=b.split(/\s/),f;e.length>1&&(b=e[0],f=e[1]),a.get(b,function(b){d.html(f?a(document.createElement("div")).html(b).find(f).html():b),c&&c()});return this},a.param=function(b,e){var f=[],g=function(a,b){f.push(encodeURIComponent(e?e+"["+a+"]":a)+"="+encodeURIComponent(b))},h=a.isArray(b);for(d in b)c(b[d])?f.push(a.param(b[d],e?e+"["+d+"]":d)):g(h?"":d,b[d]);return f.join("&").replace("%20","+")}}(Zepto),function(a){function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function d(a){return"tagName"in a?a:a.parentNode}var b={},c;a(document).ready(function(){a(document.body).bind("touchstart",function(a){var e=Date.now(),f=e-(b.last||e);b.target=d(a.touches[0].target),c&&clearTimeout(c),b.x1=a.touches[0].pageX,b.y1=a.touches[0].pageY,f>0&&f<=250&&(b.isDoubleTap=!0),b.last=e}).bind("touchmove",function(a){b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(d){b.isDoubleTap?(a(b.target).trigger("doubleTap"),b={}):b.x2>0||b.y2>0?((Math.abs(b.x1-b.x2)>30||Math.abs(b.y1-b.y2)>30)&&a(b.target).trigger("swipe")&&a(b.target).trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b.x1=b.x2=b.y1=b.y2=b.last=0):"last"in b&&(c=setTimeout(function(){c=null,a(b.target).trigger("tap"),b={}},250))}).bind("touchcancel",function(){b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto)

0 comments on commit ac3b60c

Please sign in to comment.
Something went wrong with that request. Please try again.