UNPKG

generator-minxing

Version:
7 lines 20.6 kB
/*! * 云淡然的Yquery * @author ydr.me * @version 1.7 * 2014年7月5日12:53:26 */ !function(t,n){"use strict";function e(n,e){var i=[],r=m(n);if(e=e||Y,b(e)&&(e=e.length?e[0]:Y),"string"==r)n=n.trim(),i=""===n?[e]:an.test(n)?A(n):e.querySelectorAll(n);else if("element"===r||"array"===r||"nodelist"===r||"htmlcollection"===r)i=n;else if(n==t||n==Y)i=n,this.length=1;else{if("function"==r)return void(on?n():rn.push(n));if(b(n))return n}return T(this,i)}function i(){var t=this;t.progressQueue=[],t.doneQueue=[],t.failQueue=[],t.alwaysQueue=[],t.hasCallback=!1,t.state="pending"}function r(){}function o(t,n){var e,i=Y.createElement(t);for(e in n)i[e]=n[e];return i}function a(t,n){return t=t.replace(/-([a-z])/g,function(t,n){return n.toUpperCase()}),n?t.replace(/^[a-z]/,function(t){return t.toUpperCase()}):t}function c(t,e,i,r){e===n&&(e=!0),i===n&&(i=!0);var o=new Event(t,{bubbles:e,cancelable:i,detail:r});return o}function u(t,n){function e(){nn.forEach(function(n){n in i&&(t[n]=i[n])})}var i=n;return e(),i.touches&&i.touches.length?(i=i.touches[0],e()):i.changedTouches&&i.changedTouches.length&&(i=i.changedTouches[0],e()),t}function s(t,n,e,i,r){t.dispatchEvent("string"===m(n)?c(n,e,i,r):n)}function h(t,e,i){function r(t){return t.replace(/^[a-z]/,function(t){return V[o]?t.toUpperCase():t})}var o,a=null,c="";for(o in V){if(c=/^on/.test(e)?e.replace("on","on"+V[o]):V[o]+r(e),(a=t[c])!==n)break;c=""}return i?a:c}function f(t,e,i){if(g(t)){var r,o="",c="",u=i===n,s=n;for(r in V)if(c=V[r],o=a(c?c+"-"+e:e,c),u){if((s=getComputedStyle(t)[o])!==n)break}else if(K.test(e)&&y(i,!0)&&(i+="px"),o in t.style){t.style[o]=i;break}return s||o}}function l(e,i,r){var o,c="content-box",u=r===n||"boolean"===hn.type(r),s=a(i,!0),h=/height/.test(i),l=0,p=0,d=0,m=0,g=0,y=0,b=0,w=!1;return e===t||e===Y?(m=t["inner"+s],g=m,y=t["outer"+s]):("none"===f(e,"display")&&(f(e,"display","block"),w=!0),l=h?v(f(e,"paddingTop"))+v(f(e,"paddingBottom")):v(f(e,"paddingLeft"))+v(f(e,"paddingRight")),p=h?v(f(e,"borderTopWidth"))+v(f(e,"borderBottomWidth")):v(f(e,"borderLeftWidth"))+v(f(e,"borderRightWidth")),d=h?v(f(e,"marginTop"))+v(f(e,"marginBottom")):v(f(e,"marginLeft"))+v(f(e,"marginRight")),c=f(e,"boxSizing"),b=e["client"+s],y=e["offset"+s],u?(g=y-p,m=g-l,r===!0&&(y+=d)):(o=y-p-b,r=v(r),"border-box"===c?(y=r,m=r+l+p,g=r+p,b=r+o+p):"padding-box"===c?(g=r,m=r+l,y=r-p,b=r+o):(m=r,g=r-l,y=r-p-l,b=r+o-l))),w&&f(e,"display",""),[m,g,y,b]}function p(t){var n=m(t);return"string"==n||"number"==n}function d(t){if("object"!==m(t))return!1;var e;for(e in t)return!1;return t.prototype===n}function m(e){if(e===t)return"window";if(e===Y)return"document";if(e===n)return"undefined";if(null===e)return"null";if(Array.isArray(e))return"array";var i=Object.prototype.toString.call(e).match(/\s(.*?)\]/i)[1].toLowerCase();return/element/.test(i)?"element":isNaN(e)&&"number"===i?"nan":i}function g(t){return"element"===m(t)}function v(t){return t=parseFloat(t),"nan"===m(t)?0:t}function y(t,e){var i,r,o,a="array"!==m(t)&&""!==t&&t-v(t)>=0,c="abcdefghijklmnopqrstuvwxyz";return e===!0?G.test(t):e===n?a:(i="^",o=t.toString(e),8===e?i+="0":16===e&&(i+="0x"),i+="[0-",i+=11>e?e-1:"9a-"+c.slice(e-11,e-10),i+="]+$",r=new RegExp(i,"i"),r.test(o))}function b(t){return t!==n&&null!==t&&t.constructor===e}function w(t,n){return n.indexOf(t)}function x(t,n){for(var e in n)n[e]===t&&n.splice(e,1);return n}function E(){return J++}function T(t,e){if(1===t.length||e.length===n||"FORM"===e.nodeName)t[0]=e,e[I]===n&&(e[I]=E()),t.length=1;else{for(var i=0;i<e.length;i++)t[i]=e[i],e[i][I]===n&&(e[i][I]=E());t.length=e.length}return t.splice=[].splice,t}function k(t,n,e){var i,r,o=m(t);if("array"==o)if(e)for(i=t.length-1;i>=0&&n.call(t[i],i,t[i])!==!1;i--);else for(i=0,r=t.length;r>i&&n.call(t[i],i,t[i])!==!1;i++);else if("object"===o)for(i in t)if(t.hasOwnProperty(i)&&n.call(t[i],i,t[i])===!1)break;return t}function _(t,n){return n?t[un](n):t}function C(t,e,i){var r,o="_",a=0,c=Date.now();if(t=t.replace(/#.*$/,""),t+=-1==t.indexOf("?")?"?":"&",e=e||{},e!==n){if(i){for(r=new RegExp("\\?"+o+"=|&"+o+"="),a=r.test(t);a;)r=new RegExp("\\?"+o+"=|&"+o+"="),r.test(t)?o+="_":a=0;e[o]=c}t+=S(e)}return t}function S(t){function n(t,e){var i,r,o,a,c=[];t=t||"";for(r in e)o=e[r],i=hn.type(o),a=(t?t+"[":"")+r+(t?"]":""),p(o)?c.push(a+"="+o):("array"==i||"object"==i)&&c.push(n(a,o));return c.join("&")}return n("",t)}function j(t,n,e,i){hn.isFunction(e)&&(e=e.call(t)),hn.isString(e)?an.test(e)?t.insertAdjacentHTML(n,e):t.insertAdjacentText(n,e):hn.isNumber(e)?t.insertAdjacentText(n,e):hn.isElement(e)?t.insertAdjacentElement(n,i>0?e.cloneNode(!0):e):b(e)&&e.each(function(){j(t,n,this)})}function A(t){var n=o("div");return n.innerHTML=t,n.children}function L(t,n,e){var i,r=t.classList;return g(t)?((n||"").trim().split(/\s+/).forEach(function(n){switch(e){case 0:""!==n&&r.add(n);break;case 1:""===n?t.className="":r.remove(n);break;case 2:return i=""!==n&&r.contains(n)}}),i):i}function R(t,e,i){return g(t)?i===n?t.getAttribute(e):void t.setAttribute(e,i):void 0}function q(t,e,i){return i===n?t[e]:void(t[e]=i)}function N(t,e,i){var r=n;if(i===n){r=W[t[I]]&&W[t[I]][e]||t.dataset[e];try{r=JSON.parse(r)}catch(o){}}else W[t[I]]===n&&(W[t[I]]={}),t.dataset[e]===n?W[t[I]][e]=i:t.dataset[e]=i;return r}function D(t,n,e){t.addEventListener(n,function(n){n.originalEvent=n,e.call(t,n)===!1&&O(n)},!1)}function O(t){t.preventDefault!==n&&t.preventDefault(),t.stopPropagation!==n&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation()}function F(e,i,r){var o="scroll"+i,a=e===t||e===Y||e===P||e===B;return r===n?a?P[o]||Y.body[o]:e[o]:(r=v(r),void(a?B[o]=r:e[o]=r))}function M(t,n,e,i,r){var o=null===n,a=o?"Top":"Left",c=o?F(t,a):F(t,a),u=o?e:n,s=Math.abs(u-c),h=c>u?-1:1,f=s/i,l=0,p=0,d=0;!function m(){l||(l=Date.now()),p>=i||d>=s?(F(t,a,u),r.call(t,!0)):X(function(){var n=Date.now();p=n-l,d=p*f,F(t,a,c+h*d),m()})}()}function Q(t,n,e,i,r,o){var c,u,s=[],h=Object.keys(n),l={};if(1===h.length){if(c=a(h[0]),u=n[h[0]],"scrollTop"===c)return M(t,null,u,e,r);if("scrollLeft"===c)return M(t,u,null,e,r)}return 0===e&&(e=1),k(n,function(n,e){K.test(n)&&y(e,!0)&&(e+="px"),e+="",f(t,n)!==e&&(l[n]=e,s.push(n))}),d(l)||"none"===f(t,"display")||!s?r():(H(t,"animateTo",n),H(t,"animateCallback",r),H(t,"animateDone",0),H(t,"animateLength",s.length),(o||[]).forEach(function(n){H(t,n,f(t,n))}),H(t,"animateHasCallback")||D(t,sn,function(){H(t,"animateHasCallback",!0),H(t,"animateDone",H(t,"animateDone")+1),H(t,"animateDone")===H(t,"animateLength")&&H(t,"animateTo")&&(f(t,"transition-duration",""),f(t,"transition-property",""),f(t,"transition-timing-function",""),H(t,"animateTo",!1),H(t,"animateCallback")())}),f(t,"transition-duration",e+"ms"),f(t,"transition-property",s.join(",")),f(t,"transition-timing-function",i),void setTimeout(function(){for(var e in n)s.push(f(t,e,n[e]))},0))}function H(t,e,i){return $[t[I]]===n&&($[t[I]]={}),i===n?$[t[I]][e]:void($[t[I]][e]=i)}var X,z,Y=t.document,P=Y.documentElement,B=Y.body,U="ontouchend"in Y,I="__yquery__",J=0,W={},$={},V=["","webkit","moz","ms","o","khtml"],G=/^-?([1-9]\d*|0)(\.\d*[1-9])?$/,K=/width|height|top|right|bottom|left/i,Z="blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),tn="tap taphold swipe swipeup swiperight swipedown swipeleft".split(" "),nn="detail which clientX clientY pageX pageY screenX screenY".split(" "),en="blur error focus load unload change scroll submit mouseenter mouseleave".split(" "),rn=[],on=!1,an=/<.*?>/,cn={ajax:{url:"",headers:null,data:null,type:"get",contentType:"application/x-www-form-urlencoded; charset=utf-8",username:null,password:null,dataType:"json",timeout:0,isNoCache:!0,isUpload:!1},getScript:{url:"",data:null},getJSONP:{url:"",data:null},tap:{x:30,y:30,timeout:500},taphold:{x:30,y:30,timeout:750},swipe:{x:30,y:30}},un=h(Y.body,"matchesSelector"),sn=h(t,"ontransitionend").slice(2),hn=function(t,n){return new e(t,n)};hn.VERSION="1.7",hn.AUTHOR="ydr.me",hn.fn=e.prototype={constructor:e,_access:function(t,n){return this.length?t.call(this[0]):2===arguments.length?n:this},_getSet:function(t,e,i){var r,o,a=m(e);return"string"!==a&&"array"!==a||i!==n?(r={},i===n?r=e:r[e]=i,this.each(function(){o=this,k(r,function(n,e){t(o,n,e)})})):this._access(function(){var n={};return o=this,r="array"===a?e:[e],r.forEach(function(e){n[e]=t(o,e)}),r.length>1?n:n[r[0]]})},add:function(t){var n=this,e=[];return n.each(function(){e.push(this)}),hn(t).each(function(){n.has(this).length||e.push(this)}),hn(e)},clone:function(t){var n=[];return this.each(function(){n.push(this.cloneNode(t))}),hn(n)},find:function(t){var n=[],e=m(t);return this.each(function(){var i=this;"string"===e?n=n.concat([].slice.call(i.querySelectorAll(t))):hn(t).each(function(){i.contains(this)&&n.push(this)})}),hn(n)},each:function(t){for(var n,e=0;e<this.length;e++)n=this[e],t.call(n,e,n);return this},eq:function(t){var n=hn.extend([],this);return hn(n.splice(t,1))},last:function(){return this.eq(this.length-1)},append:function(t){return this.each(function(n){j(this,"beforeend",t,n)})},prepend:function(t){return this.each(function(n){j(this,"afterbegin",t,n)})},before:function(t){return this.each(function(n){j(this,"beforebegin",t,n)})},after:function(t){return this.each(function(n){j(this,"afterend",t,n)})},remove:function(){return this.each(function(){this.remove()}),null},empty:function(){return this.each(function(){this.innerHTML=""})},html:function(t){var e="function"===hn.type(t),i=t;return t===n?this._access(function(){return this.innerHTML},n):this.each(function(){e&&(t=i.call(this)),this.innerHTML=t})},text:function(t){return t===n?this._access(function(){return this.textContent},n):this.each(function(){this.textContent=t})},serialize:function(){return this._access(function(){return this.nodeName?new FormData(this):void 0},n)},closest:function(t){return this._access(function(){var n,e=this;if(e===Y)return hn();if(e===P)return"html"===t.toLowerCase()?hn(P):hn();for(;e!==P;){if(_(e,t)){n=e;break}e=e.parentElement}return hn(n)})},prev:function(){return this._access(function(){return hn(this.previousElementSibling)})},next:function(){return this._access(function(){return hn(this.nextElementSibling)})},siblings:function(t){return this._access(function(){var n=this,e=n.parentElement.children,i=[];return hn(e).each(function(){this.isEqualNode(n)||(t?_(this,t)&&i.push(this):i.push(this))}),hn(i)})},index:function(){return this._access(function(){var t,n=this,e=n.parentElement.children,i=-1;for(t in e)if(i++,e[t].isEqualNode(n))break;return i},-1)},has:function(t){var n=[];return this.each(function(){hn(this).find(t).length&&n.push(this)}),hn(n)},not:function(t){var n=this,e=m(t),i=hn(t),r=hn.extend([],this);return"function"===e&&(i=[],this.each(function(){t.call(this)===!0&&i.push(this)}),i=hn(i)),i.each(function(){hn(n).has(this)&&x(this,r)}),hn(r)},filter:function(t){var n=this,e=m(t),i=hn(t),r=[];return"function"==e&&(i=[],this.each(function(){t.call(this)===!0&&i.push(this)}),i=hn(i)),i.each(function(){hn(n).has(this)&&r.push(this)}),hn(r)},attr:function(t,n){return this._getSet(R,t,n)},removeAttr:function(t){return this.each(function(){this.removeAttribute(t)})},prop:function(t,n){return this._getSet(q,t,n)},val:function(t){return this.prop("value",t)},data:function(t,n){return this._getSet(N,t,n)},css:function(t,n){return this._getSet(f,t,n)},wrap:function(t){return this.each(function(){var n=this,e=hn(t).insertAfter(n);e[0].appendChild(n)})},parent:function(t){return this._access(function(){return hn("fixed"===f(this,"position")&&t?Y:t?this.offsetParent:this.parentElement)})},contents:function(){var t=[];return this.each(function(){var n=this;n.contentDocument?t.push(n.contentDocument):t=t.concat([].slice.call(n.childNodes))}),hn(t)},children:function(t){var n=[];return this.each(function(){var e=[].slice.call(this.children);t?e.forEach(function(e){_(e,t)&&n.push(e)}):n=n.concat(e)}),hn(n)},position:function(){return this._access(function(){var t,n,e=this;return g(e)?(t=e.offsetTop-v(f(e,"marginTop")),n=e.offsetLeft-v(f(e,"marginLeft")),{top:t,left:n}):{top:0,left:0}})},offset:function(e){return e?this.each(function(){var t,i,r,o=this,a=hn(o),c=a.position();g(o)&&(t=a.css("left"),i=a.css("top"),"static"===a.css("position")&&a.css("position","relative"),"auto"===t&&a.css("left",c.left),"auto"===i&&a.css("top",c.top),t=v(a.css("left")),i=v(a.css("top")),r=a.offset(),e.left===n&&(e.left=r.left),e.top===n&&(e.top=r.top),e.left!==r.left&&f(o,"left",t+e.left-r.left),e.top!==r.top&&f(o,"top",i+e.top-r.top))}):this._access(function(){var n,e=this;return g(e)?(n=e.getBoundingClientRect(),{top:n.top+t.scrollY,left:n.left+t.scrollX}):{top:0,left:0}},n)},bind:function(t,n){return t=t.split(" "),this.each(function(){var e=this;k(t,function(t,i){D(e,i,n)})})},tapick:function(t){return U?this.tap(t):this.click(t)},on:function(t,e,i){return t=t.split(" "),this.each(function(){var r=this;t.forEach(function(t){function o(t){var o;i===n?e.call(r,t)===!1&&O(t):(o=hn(t.target).closest(e),hn(r).has(o).length&&i.call(o[0],t)===!1&&O(t))}~w(t,en)?hn(e,r).each(function(){D(r,t,i)}):D(r,t,o)})})},trigger:function(t,n,e,i){return this.each(function(){s(this,t,n,e,i)})},_animate:function(t,e,i,r,o,a){var c="ease-in-out",u=hn.noop;if(e===n)e=1,i=c,r=u;else if("function"===m(e))r=e,e=1,i=c;else if("number"===m(e))switch(m(i)){case"undefined":i=c,r=u;break;case"function":r=i,i=c;break;case"string":"function"!==m(r)&&(r=u)}if(t===n)return this.each(function(){"function"===m(a)?a.call(this,r):r.call(this)});var s=0,h=this,f=h.length;return h.each(function(){var n=this;"function"===m(t)&&(t=t.call(n)),Q(n,t,e,i,function(t){s||t||h.css({"transition-duration":"","transition-property":"","transition-timing-function":""}),s++,s===f&&("function"===m(a)?a.call(n,r):r.call(n))},o)})},animate:function(t,n,e,i){return this._animate(t,n,e,i)},stop:function(t){return this.each(function(){var n=this;return H(n,"animateTo")?void(t?(f(n,"transition-duration",""),f(n,"transition-property",""),f(n,"transition-timing-function",""),H(n,"animateTo",!1),H(n,"animateCallback")()):(f(n,"transition-duration",".01ms"),k(H(n,"animateTo"),function(t){f(n,t,f(n,t))}))):!1})}},function(){function n(t){(t.changedTouches&&1===t.changedTouches.length||t.touches&&1===t.touches.length)&&(e&&clearTimeout(e),e=0)}var e,i,r,o,a=cn.tap,h=cn.taphold,l=cn.swipe,p={};tn.forEach(function(t){p[t]=c(t)}),D(Y,"touchstart",function(t){if(t.touches&&1===t.touches.length){var a=t.touches[0],c=a.target,l=f(B,"touch-callout"),d=f(B,"user-select");n(t),f(B,"touch-callout","none"),f(B,"user-select","none"),i=a.pageX,r=a.pageY,o=Date.now(),e=setTimeout(function(){f(B,"touch-callout",l),f(B,"user-select",d),u(p.taphold,t),s(c,p.taphold)},h.timeout)}}),D(Y,"touchmove",function(t){if(t.touches&&1===t.touches.length){var o=t.touches[0],a=o.target,c=Math.abs(o.pageX-i),u=Math.abs(o.pageY-r),s=a.getBoundingClientRect();o.clientX>s.left&&o.clientY>s.top&&o.clientX<s.right&&o.clientY<s.bottom&&e&&(c>h.x||u>h.y)&&n(t)}}),D(Y,"touchend",function(t){n(t);var e=t.changedTouches[0],c=e.pageX,h=e.pageY,f=c-i,d=h-r,m=Math.abs(f),g=Math.abs(d),v=Date.now()-o,y=e.target;m<a.x&&g<a.y&&v<a.timeout&&(u(p.tap,t),s(y,p.tap)),(m>=l.x||g>=l.y)&&setTimeout(function(){var n=m>g?f>0?"right":"left":d>0?"down":"up";u(p.swipe,t),u(p["swipe"+n],t),s(y,p.swipe),s(y,p["swipe"+n])},0)}),D(Y,"touchcancel",n),D(t,"scroll",n)}(),Z.concat(tn).forEach(function(t){hn.fn[t]=function(n){return this.each(function(){return"focus"===t||"blur"===t?this[t]():void D(this,t,n)})}}),k({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after"},function(t,n){hn.fn[t]=function(t){return this.each(function(){hn(t)[n](this)}),this}}),["In","Out"].forEach(function(t,n){hn.fn["fade"+t]=function(t,e,i){var r,o,a={},c=this;return n?(a.opacity=0,r=["display"],o=function(t){"0"===c.css("opacity")&&c.css("display","none"),t.call(this)}):(c.each(function(){"none"===f(this,"display")&&f(this,"display",H(this,"display")||"block")}),a.opacity=1),c._animate(a,t,e,i,r,o)}}),["show","hide"].forEach(function(t,e){hn.fn[t]=function(t,i,r){var o,a,c,u=this;return c=e||"none"===u.css("display")?function(){return{width:e?0:H(this,"width")||"",height:e?0:H(this,"height")||""}}:n,e?(o=["width","height","display"],a=function(t){t.call(this),0===v(u.css("width"))&&0===v(u.css("height"))&&u.css("display","none")}):u.each(function(){"none"===f(this,"display")&&f(this,"display",H(this,"display")||"block")}),u._animate(c,t,i,r,o,a)}}),["","inner","outer","client"].forEach(function(t,e){["width","height"].forEach(function(i){hn.fn[e?a(t+"-"+i):i]=function(t){return t===n?this._access(function(){var t=this;return l(t,i)[e]},n):this.each(function(){this.style[i]=l(this,i,t)[e]+"px"})}})}),["Top","Left"].forEach(function(e){var i="scroll"+e;hn.fn[i]=function(r){return r===n?this._access(function(){return F(this,e)},n):this.each(function(){this===t||this===Y||this===P||this===B?(P[i]=r,Y.body[i]=r):this[i]=r})}}),["add","remove","has"].forEach(function(t,e){hn.fn[t+"Class"]=function(t){return 2==e?this._access(function(){return L(this,t,e)},n):this.each(function(){L(this,t,e)})}}),hn.extend=function(){var t,n=arguments,e=n[0],i=1,r=n.length;if(1!=r){for(;r>i;i++)for(t in n[i])e[t]=n[i][t];return e}for(i in e)hn[i]=e[i]},["Array","Object","Function","String","Element","Number"].forEach(function(t){hn["is"+t]=function(n){return m(n)==t.toLowerCase()}}),hn.extend({type:m,each:k,inArray:w,removeInArray:x,toHumpString:a,param:S,isNumeric:y,isEmptyObject:d,Event:c,noop:function(){},proxy:function(t,n){return t.bind(n)},tapSetup:function(t){hn.extend(cn.tap,t)},tapholdSetup:function(t){hn.extend(cn.taphold,t)},swipeSetup:function(t){hn.extend(cn.swipe,t)},ajaxSetup:function(t){hn.extend(cn.ajax,t)},ajax:function(t){var n=new i,e=new XMLHttpRequest,r=hn.extend({},cn.ajax,t),o=0,a="get"==r.type,c=r.data&&r.data.constructor===FormData;return r.headers||(r.headers={}),r.headers["X-Requested-With"]="XMLHttpRequest",c?r.type="post":a?(r.url=C(r.url,r.data,r.isNoCache),r.data=null):(r.contentType&&(r.headers["content-type"]=r.contentType),r.data=S(r.data)),e.onload=function(){var t=e.responseText,i=e.status,a=e.readyState;if(!o&&4==a)if(o=1,200===i){if("json"===r.dataType)try{t=JSON.parse(t)}catch(c){t=null}n.resolve(e,t,e)}else n.reject(e,e)},e.onerror=function(){n.reject(e,e)},e.onabort=function(){n.reject(e,e)},e.ontimeout=function(){n.reject(e,e)},r.isUpload&&(e.upload.onprogress=function(t){t.lengthComputable&&n.run(e,t)}),e.open(r.type,r.url,!0,r.username,r.password),hn.each(r.headers,function(t,n){e.setRequestHeader(t,n)}),e.send(r.data),n},getScript:function(n){var e=hn.extend({},cn.getScript,n),r=o("script",{src:C(e.url,e.data,!0),onload:function(){a.resolve(t)},onerror:function(){a.reject(t)}}),a=new i;return hn("head").append(r),a},getJSON:function(n){var e,r=hn.extend({},cn.getJSONP,n),a="yquery_"+Date.now(),c=new i;return t[a]=function(){c.resolve(t,arguments[0]),delete t[a],e.remove()},r.url=r.url.replace(/\?$/,a),e=o("script",{src:C(r.url,r.data,!0),onerror:function(){c.reject(t),delete t[a],e.remove()}}),hn("head").append(e),c}}),i.prototype={progress:function(t){return this.progressQueue.push(t),this},done:function(t){return this.doneQueue.push(t),this},fail:function(t){return this.failQueue.push(t),this},always:function(t){return this.alwaysQueue.push(t),this},run:function(t){if(!this.hasCallback){var n=[].slice.call(arguments,1);this.progressQueue.forEach(function(e){e.apply(t,n)})}},resolve:function(t){if(!this.hasCallback){this.state="resolved";var n=[].slice.call(arguments,1);this.hasCallback=!0,this.doneQueue.forEach(function(e){e.apply(t,n)}),this.alwaysQueue.forEach(function(e){e.apply(t,n)})}},reject:function(t){if(!this.hasCallback){this.state="rejected";var n=[].slice.call(arguments,1);this.hasCallback=!0,this.failQueue.forEach(function(e){e.apply(t,n)}),this.alwaysQueue.forEach(function(e){e.apply(t,n)})}}},r.prototype={},D(Y,"DOMContentLoaded",function(){rn.forEach(function(t){t()}),rn=null,on=!0}),X=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(t){return setTimeout(t,1e3/60)}}(),z=function(){return t.cancelRequestAnimationFrame||t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||function(t){clearTimeout(t)}}(),t.$=hn}(this);