/
jquery.Sexy-slim.min.js
28 lines (28 loc) · 3.7 KB
/
jquery.Sexy-slim.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* jquery.Sexy-slim v0.8.0
* http://sexyjs.com/
*
* Copyright 2010, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://sexyjs.com/license
*/
(function(f,p,k){var g=f.location,s=g.protocol+"//"+g.hostname+(g.port!==""?":"+g.port:""),e="__",a=["html","json","jsonp","script","text","xml"],r,q;function j(i){return i;}function v(n,i){return i;}function m(n,i){return(i||"")+n;}function l(i){if(!(this instanceof l)){return new l(i);}this.cfgs=[];this.setup(i);}l.prototype={setup:function(i){this.cfg=i||{};return this;},sajax:function(C){var A=this.cfgs,B=A.length,x=A[B-1],E=C.dataType,w=C.url.indexOf("http")===0&&C.url.indexOf(s)===-1,z=E==="script",i=B>0?w&&z?true:C.defer:false,F=C.success||(z?v:j),D=C.error||this.cfg.error||k.ajaxSettings.error||k.noop,n=C.complete||this.cfg.complete||k.ajaxSettings.complete||k.noop;A.push(k.extend(true,C,this.cfg,C,{sendAfterSend:[],dataType:!w&&z?"text":E,success:function(H,G){if(!x||e in x){if(z&&!w){k.globalEval(H);}C.status=w?"success":G;C[e]=F.call(C,H,x&&x[e],A[B+1],C.status);if(C.nextSuccess){C.nextSuccess();}else{if(C.sendAfterSuccess){C.sendAfterSuccess();}}}else{x.nextSuccess=k.proxy(function(){C.success(H,G);},C);}},error:function(I,G,H){D.call(C,I,G,H);},complete:function(H,G){n.call(C,H,G);}}));function y(){var G,H;k.ajax(C);if(C.sendAfterSend.length>0){for(G=0,H=C.sendAfterSend.length;G<H;++G){C.sendAfterSend[G]();}}}if(i){x.sendAfterSuccess=y;this.lastDefer=C;}else{if(this.lastDefer){this.lastDefer.sendAfterSend.push(y);}else{y();}}return this;},bundle:function(){var w=arguments,y=k.isFunction(w[w.length-1])?Array.prototype.pop.call(w):v,x,z;for(x=0,z=w.length-1;x<z;++x){this.text(w[x],m);}return this.text(w[x],function(B,A,n,i){var C=m(B,A);k.globalEval(C);return y(C,A,n,i);});}};function o(i){l.prototype[i]=function(n,x,w){if(typeof n==="string"){if(typeof x!=="boolean"){w=x;x=false;}n={url:n,defer:x,success:w};}n.dataType=i;return this.sajax(n);};}for(r=0,q=a.length;r<q;++r){o(a[r]);}l.prototype.js=l.prototype.script;function c(i){l[i]=function(){return l.prototype[i].apply(new l(),arguments);};}for(r in l.prototype){c(r);}f.Sexy=k.sajax=l;
/*
* jQuery.styleEval plugin
* http://github.com/furf/jquery-styleEval
*
* Copyright 2010, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*/
k.styleEval=function(x){var w=/\S/;if(x&&w.test(x)){var i=p.getElementsByTagName("head")[0]||p.documentElement,n=p.createElement("style");n.type="text/css";if(n.styleSheet){n.styleSheet.cssText=x;}else{n.textContent=x;}i.insertBefore(n,i.lastChild);return n;}};
/*
* jQuery.getCSS plugin
* http://github.com/furf/jquery-getCSS
*
* Copyright 2010, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Inspired by Julian Aubourg's Dominoes
* http://code.google.com/p/javascript-dominoes/
*/
var b=p.getElementsByTagName("head")[0],t=/loaded|complete/,u={},d=0,h;k.getCSS=function(n,i,x){if(k.isFunction(i)){x=i;i={};}var w=p.createElement("link");w.rel="stylesheet";w.type="text/css";w.media=i.media||"screen";w.href=n;if(i.charset){w.charset=i.charset;}if(i.title){x=(function(y){return function(){w.title=i.title;y(w,"success");};})(x);}if(w.readyState){w.onreadystatechange=function(){if(t.test(w.readyState)){w.onreadystatechange=null;x(w,"success");}};}else{if(w.onload===null&&w.all){w.onload=function(){w.onload=null;x(w,"success");};}else{u[w.href]=function(){x(w,"success");};if(!(d++)){h=f.setInterval(function(){var D,A,C=p.styleSheets,y,z=C.length;while(z--){A=C[z];if((y=A.href)&&(D=u[y])){try{D.r=A.cssRules;throw"SECURITY";}catch(B){if(/SECURITY/.test(B)){D(w,"success");delete u[y];if(!--d){h=f.clearInterval(h);}}}}}},13);}}}b.appendChild(w);};})(this,this.document,this.jQuery);