mongodb_logger 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -1
- data/lib/mongodb_logger/server/coffee/logs.coffee +41 -7
- data/lib/mongodb_logger/server/model/additional_filter.rb +38 -4
- data/lib/mongodb_logger/server/model/filter.rb +1 -1
- data/lib/mongodb_logger/server/public/javascripts/logs.js +1 -155
- data/lib/mongodb_logger/server/public/javascripts/vendors/jquery-1.7.1.min.js +4 -0
- data/lib/mongodb_logger/server/public/javascripts/vendors/jquery-ui-1.8.16.min.js +791 -0
- data/lib/mongodb_logger/server/public/javascripts/vendors/jquery.pjax.min.js +6 -0
- data/lib/mongodb_logger/server/public/stylesheets/all.css +2 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_flat_75_aaaaaa_40x100.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_glass_100_f5f0e5_1x400.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_glass_25_cb842e_1x400.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_glass_70_ede4d4_1x400.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_highlight-hard_65_fee4bd_1x100.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-bg_inset-soft_100_f4f0ec_1x100.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-icons_c47a23_256x240.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-icons_cb672b_256x240.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-icons_f08000_256x240.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-icons_f35f07_256x240.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-icons_ff7519_256x240.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/images/ui-icons_ffffff_256x240.png +0 -0
- data/lib/mongodb_logger/server/public/stylesheets/humanity/jquery-ui-1.8.16.custom.css +568 -0
- data/lib/mongodb_logger/server/views/layout.erb +8 -7
- data/lib/mongodb_logger/server/views/overview.erb +15 -0
- data/lib/mongodb_logger/server/views/shared/_dynamic_filter.erb +9 -5
- data/lib/mongodb_logger/server.rb +18 -5
- data/lib/mongodb_logger/version.rb +1 -1
- data/mongodb_logger.gemspec +1 -0
- metadata +61 -35
- data/lib/mongodb_logger/server/public/javascripts/vendors/jquery-1.7.min.js +0 -4
- data/lib/mongodb_logger/server/public/javascripts/vendors/jquery-ui-1.8.16.effects.min.js +0 -221
- data/lib/mongodb_logger/server/public/javascripts/vendors/jquery.pjax.js +0 -264
@@ -1,221 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery UI Effects 1.8.16
|
3
|
-
*
|
4
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
* http://jquery.org/license
|
7
|
-
*
|
8
|
-
* http://docs.jquery.com/UI/Effects/
|
9
|
-
*/
|
10
|
-
jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
|
11
|
-
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
|
12
|
-
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
|
13
|
-
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
|
14
|
-
"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
|
15
|
-
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
|
16
|
-
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
|
17
|
-
d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};
|
18
|
-
f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,
|
19
|
-
[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
|
20
|
-
0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),
|
21
|
-
d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement;
|
22
|
-
if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});
|
23
|
-
return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,
|
24
|
-
arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/
|
25
|
-
2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,
|
26
|
-
d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,
|
27
|
-
a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,
|
28
|
-
d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=
|
29
|
-
0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;
|
30
|
-
if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,
|
31
|
-
a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
32
|
-
;/*
|
33
|
-
* jQuery UI Effects Blind 1.8.16
|
34
|
-
*
|
35
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
36
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
37
|
-
* http://jquery.org/license
|
38
|
-
*
|
39
|
-
* http://docs.jquery.com/UI/Effects/Blind
|
40
|
-
*
|
41
|
-
* Depends:
|
42
|
-
* jquery.effects.core.js
|
43
|
-
*/
|
44
|
-
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
|
45
|
-
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
|
46
|
-
;/*
|
47
|
-
* jQuery UI Effects Bounce 1.8.16
|
48
|
-
*
|
49
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
50
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
51
|
-
* http://jquery.org/license
|
52
|
-
*
|
53
|
-
* http://docs.jquery.com/UI/Effects/Bounce
|
54
|
-
*
|
55
|
-
* Depends:
|
56
|
-
* jquery.effects.core.js
|
57
|
-
*/
|
58
|
-
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
|
59
|
-
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
|
60
|
-
b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
|
61
|
-
;/*
|
62
|
-
* jQuery UI Effects Clip 1.8.16
|
63
|
-
*
|
64
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
65
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
66
|
-
* http://jquery.org/license
|
67
|
-
*
|
68
|
-
* http://docs.jquery.com/UI/Effects/Clip
|
69
|
-
*
|
70
|
-
* Depends:
|
71
|
-
* jquery.effects.core.js
|
72
|
-
*/
|
73
|
-
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
|
74
|
-
c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
|
75
|
-
;/*
|
76
|
-
* jQuery UI Effects Drop 1.8.16
|
77
|
-
*
|
78
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
79
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
80
|
-
* http://jquery.org/license
|
81
|
-
*
|
82
|
-
* http://docs.jquery.com/UI/Effects/Drop
|
83
|
-
*
|
84
|
-
* Depends:
|
85
|
-
* jquery.effects.core.js
|
86
|
-
*/
|
87
|
-
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
|
88
|
-
"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
89
|
-
;/*
|
90
|
-
* jQuery UI Effects Explode 1.8.16
|
91
|
-
*
|
92
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
93
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
94
|
-
* http://jquery.org/license
|
95
|
-
*
|
96
|
-
* http://docs.jquery.com/UI/Effects/Explode
|
97
|
-
*
|
98
|
-
* Depends:
|
99
|
-
* jquery.effects.core.js
|
100
|
-
*/
|
101
|
-
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
|
102
|
-
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
|
103
|
-
e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
|
104
|
-
;/*
|
105
|
-
* jQuery UI Effects Fade 1.8.16
|
106
|
-
*
|
107
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
108
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
109
|
-
* http://jquery.org/license
|
110
|
-
*
|
111
|
-
* http://docs.jquery.com/UI/Effects/Fade
|
112
|
-
*
|
113
|
-
* Depends:
|
114
|
-
* jquery.effects.core.js
|
115
|
-
*/
|
116
|
-
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
117
|
-
;/*
|
118
|
-
* jQuery UI Effects Fold 1.8.16
|
119
|
-
*
|
120
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
121
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
122
|
-
* http://jquery.org/license
|
123
|
-
*
|
124
|
-
* http://docs.jquery.com/UI/Effects/Fold
|
125
|
-
*
|
126
|
-
* Depends:
|
127
|
-
* jquery.effects.core.js
|
128
|
-
*/
|
129
|
-
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
|
130
|
-
10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
|
131
|
-
;/*
|
132
|
-
* jQuery UI Effects Highlight 1.8.16
|
133
|
-
*
|
134
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
135
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
136
|
-
* http://jquery.org/license
|
137
|
-
*
|
138
|
-
* http://docs.jquery.com/UI/Effects/Highlight
|
139
|
-
*
|
140
|
-
* Depends:
|
141
|
-
* jquery.effects.core.js
|
142
|
-
*/
|
143
|
-
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
|
144
|
-
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
145
|
-
;/*
|
146
|
-
* jQuery UI Effects Pulsate 1.8.16
|
147
|
-
*
|
148
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
149
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
150
|
-
* http://jquery.org/license
|
151
|
-
*
|
152
|
-
* http://docs.jquery.com/UI/Effects/Pulsate
|
153
|
-
*
|
154
|
-
* Depends:
|
155
|
-
* jquery.effects.core.js
|
156
|
-
*/
|
157
|
-
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
|
158
|
-
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
|
159
|
-
;/*
|
160
|
-
* jQuery UI Effects Scale 1.8.16
|
161
|
-
*
|
162
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
163
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
164
|
-
* http://jquery.org/license
|
165
|
-
*
|
166
|
-
* http://docs.jquery.com/UI/Effects/Scale
|
167
|
-
*
|
168
|
-
* Depends:
|
169
|
-
* jquery.effects.core.js
|
170
|
-
*/
|
171
|
-
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
|
172
|
-
b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
|
173
|
-
1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
|
174
|
-
p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};
|
175
|
-
if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);
|
176
|
-
a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);
|
177
|
-
child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
|
178
|
-
n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
179
|
-
;/*
|
180
|
-
* jQuery UI Effects Shake 1.8.16
|
181
|
-
*
|
182
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
183
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
184
|
-
* http://jquery.org/license
|
185
|
-
*
|
186
|
-
* http://docs.jquery.com/UI/Effects/Shake
|
187
|
-
*
|
188
|
-
* Depends:
|
189
|
-
* jquery.effects.core.js
|
190
|
-
*/
|
191
|
-
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
|
192
|
-
(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
|
193
|
-
;/*
|
194
|
-
* jQuery UI Effects Slide 1.8.16
|
195
|
-
*
|
196
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
197
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
198
|
-
* http://jquery.org/license
|
199
|
-
*
|
200
|
-
* http://docs.jquery.com/UI/Effects/Slide
|
201
|
-
*
|
202
|
-
* Depends:
|
203
|
-
* jquery.effects.core.js
|
204
|
-
*/
|
205
|
-
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
|
206
|
-
var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
207
|
-
;/*
|
208
|
-
* jQuery UI Effects Transfer 1.8.16
|
209
|
-
*
|
210
|
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
211
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
212
|
-
* http://jquery.org/license
|
213
|
-
*
|
214
|
-
* http://docs.jquery.com/UI/Effects/Transfer
|
215
|
-
*
|
216
|
-
* Depends:
|
217
|
-
* jquery.effects.core.js
|
218
|
-
*/
|
219
|
-
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
|
220
|
-
b.dequeue()})})}})(jQuery);
|
221
|
-
;
|
@@ -1,264 +0,0 @@
|
|
1
|
-
// jquery.pjax.js
|
2
|
-
// copyright chris wanstrath
|
3
|
-
// https://github.com/defunkt/jquery-pjax
|
4
|
-
|
5
|
-
(function($){
|
6
|
-
|
7
|
-
// When called on a link, fetches the href with ajax into the
|
8
|
-
// container specified as the first parameter or with the data-pjax
|
9
|
-
// attribute on the link itself.
|
10
|
-
//
|
11
|
-
// Tries to make sure the back button and ctrl+click work the way
|
12
|
-
// you'd expect.
|
13
|
-
//
|
14
|
-
// Accepts a jQuery ajax options object that may include these
|
15
|
-
// pjax specific options:
|
16
|
-
//
|
17
|
-
// container - Where to stick the response body. Usually a String selector.
|
18
|
-
// $(container).html(xhr.responseBody)
|
19
|
-
// push - Whether to pushState the URL. Defaults to true (of course).
|
20
|
-
// replace - Want to use replaceState instead? That's cool.
|
21
|
-
//
|
22
|
-
// For convenience the first parameter can be either the container or
|
23
|
-
// the options object.
|
24
|
-
//
|
25
|
-
// Returns the jQuery object
|
26
|
-
$.fn.pjax = function( container, options ) {
|
27
|
-
if ( options )
|
28
|
-
options.container = container
|
29
|
-
else
|
30
|
-
options = $.isPlainObject(container) ? container : {container:container}
|
31
|
-
|
32
|
-
// We can't persist $objects using the history API so we must use
|
33
|
-
// a String selector. Bail if we got anything else.
|
34
|
-
if ( options.container && typeof options.container !== 'string' ) {
|
35
|
-
throw "pjax container must be a string selector!"
|
36
|
-
return false
|
37
|
-
}
|
38
|
-
|
39
|
-
return this.live('click', function(event){
|
40
|
-
// Middle click, cmd click, and ctrl click should open
|
41
|
-
// links in a new tab as normal.
|
42
|
-
if ( event.which > 1 || event.metaKey )
|
43
|
-
return true
|
44
|
-
|
45
|
-
var defaults = {
|
46
|
-
url: this.href,
|
47
|
-
container: $(this).attr('data-pjax'),
|
48
|
-
clickedElement: $(this),
|
49
|
-
fragment: null
|
50
|
-
}
|
51
|
-
|
52
|
-
$.pjax($.extend({}, defaults, options))
|
53
|
-
|
54
|
-
event.preventDefault()
|
55
|
-
})
|
56
|
-
}
|
57
|
-
|
58
|
-
|
59
|
-
// Loads a URL with ajax, puts the response body inside a container,
|
60
|
-
// then pushState()'s the loaded URL.
|
61
|
-
//
|
62
|
-
// Works just like $.ajax in that it accepts a jQuery ajax
|
63
|
-
// settings object (with keys like url, type, data, etc).
|
64
|
-
//
|
65
|
-
// Accepts these extra keys:
|
66
|
-
//
|
67
|
-
// container - Where to stick the response body. Must be a String.
|
68
|
-
// $(container).html(xhr.responseBody)
|
69
|
-
// push - Whether to pushState the URL. Defaults to true (of course).
|
70
|
-
// replace - Want to use replaceState instead? That's cool.
|
71
|
-
//
|
72
|
-
// Use it just like $.ajax:
|
73
|
-
//
|
74
|
-
// var xhr = $.pjax({ url: this.href, container: '#main' })
|
75
|
-
// console.log( xhr.readyState )
|
76
|
-
//
|
77
|
-
// Returns whatever $.ajax returns.
|
78
|
-
var pjax = $.pjax = function( options ) {
|
79
|
-
var $container = $(options.container),
|
80
|
-
success = options.success || $.noop
|
81
|
-
|
82
|
-
// We don't want to let anyone override our success handler.
|
83
|
-
delete options.success
|
84
|
-
|
85
|
-
// We can't persist $objects using the history API so we must use
|
86
|
-
// a String selector. Bail if we got anything else.
|
87
|
-
if ( typeof options.container !== 'string' )
|
88
|
-
throw "pjax container must be a string selector!"
|
89
|
-
|
90
|
-
options = $.extend(true, {}, pjax.defaults, options)
|
91
|
-
|
92
|
-
if ( $.isFunction(options.url) ) {
|
93
|
-
options.url = options.url()
|
94
|
-
}
|
95
|
-
|
96
|
-
options.context = $container
|
97
|
-
|
98
|
-
options.success = function(data){
|
99
|
-
if ( options.fragment ) {
|
100
|
-
// If they specified a fragment, look for it in the response
|
101
|
-
// and pull it out.
|
102
|
-
var $fragment = $(data).find(options.fragment)
|
103
|
-
if ( $fragment.length )
|
104
|
-
data = $fragment.children()
|
105
|
-
else
|
106
|
-
return window.location = options.url
|
107
|
-
} else {
|
108
|
-
// If we got no data or an entire web page, go directly
|
109
|
-
// to the page and let normal error handling happen.
|
110
|
-
if ( !$.trim(data) || /<html/i.test(data) )
|
111
|
-
return window.location = options.url
|
112
|
-
}
|
113
|
-
|
114
|
-
// Make it happen.
|
115
|
-
this.html(data)
|
116
|
-
|
117
|
-
// If there's a <title> tag in the response, use it as
|
118
|
-
// the page's title.
|
119
|
-
var oldTitle = document.title,
|
120
|
-
title = $.trim( this.find('title').remove().text() )
|
121
|
-
if ( title ) document.title = title
|
122
|
-
|
123
|
-
// No <title>? Fragment? Look for data-title and title attributes.
|
124
|
-
if ( !title && options.fragment ) {
|
125
|
-
title = $fragment.attr('title') || $fragment.data('title')
|
126
|
-
}
|
127
|
-
|
128
|
-
var state = {
|
129
|
-
pjax: options.container,
|
130
|
-
fragment: options.fragment,
|
131
|
-
timeout: options.timeout
|
132
|
-
}
|
133
|
-
|
134
|
-
// If there are extra params, save the complete URL in the state object
|
135
|
-
var query = $.param(options.data)
|
136
|
-
if ( query != "_pjax=true" )
|
137
|
-
state.url = options.url + (/\?/.test(options.url) ? "&" : "?") + query
|
138
|
-
|
139
|
-
if ( options.replace ) {
|
140
|
-
window.history.replaceState(state, document.title, options.url)
|
141
|
-
} else if ( options.push ) {
|
142
|
-
// this extra replaceState before first push ensures good back
|
143
|
-
// button behavior
|
144
|
-
if ( !pjax.active ) {
|
145
|
-
window.history.replaceState($.extend({}, state, {url:null}), oldTitle)
|
146
|
-
pjax.active = true
|
147
|
-
}
|
148
|
-
|
149
|
-
window.history.pushState(state, document.title, options.url)
|
150
|
-
}
|
151
|
-
|
152
|
-
// Google Analytics support
|
153
|
-
if ( (options.replace || options.push) && window._gaq )
|
154
|
-
_gaq.push(['_trackPageview'])
|
155
|
-
|
156
|
-
// If the URL has a hash in it, make sure the browser
|
157
|
-
// knows to navigate to the hash.
|
158
|
-
var hash = window.location.hash.toString()
|
159
|
-
if ( hash !== '' ) {
|
160
|
-
window.location.href = hash
|
161
|
-
}
|
162
|
-
|
163
|
-
// Invoke their success handler if they gave us one.
|
164
|
-
success.apply(this, arguments)
|
165
|
-
}
|
166
|
-
|
167
|
-
// Cancel the current request if we're already pjaxing
|
168
|
-
var xhr = pjax.xhr
|
169
|
-
if ( xhr && xhr.readyState < 4) {
|
170
|
-
xhr.onreadystatechange = $.noop
|
171
|
-
xhr.abort()
|
172
|
-
}
|
173
|
-
|
174
|
-
pjax.options = options
|
175
|
-
pjax.xhr = $.ajax(options)
|
176
|
-
$(document).trigger('pjax', [pjax.xhr, options])
|
177
|
-
|
178
|
-
return pjax.xhr
|
179
|
-
}
|
180
|
-
|
181
|
-
|
182
|
-
pjax.defaults = {
|
183
|
-
timeout: 650,
|
184
|
-
push: true,
|
185
|
-
replace: false,
|
186
|
-
// We want the browser to maintain two separate internal caches: one for
|
187
|
-
// pjax'd partial page loads and one for normal page loads. Without
|
188
|
-
// adding this secret parameter, some browsers will often confuse the two.
|
189
|
-
data: { _pjax: true },
|
190
|
-
type: 'GET',
|
191
|
-
dataType: 'html',
|
192
|
-
beforeSend: function(xhr){
|
193
|
-
this.trigger('pjax:start', [xhr, pjax.options])
|
194
|
-
// start.pjax is deprecated
|
195
|
-
this.trigger('start.pjax', [xhr, pjax.options])
|
196
|
-
xhr.setRequestHeader('X-PJAX', 'true')
|
197
|
-
},
|
198
|
-
error: function(xhr, textStatus, errorThrown){
|
199
|
-
if ( textStatus !== 'abort' )
|
200
|
-
window.location = pjax.options.url
|
201
|
-
},
|
202
|
-
complete: function(xhr){
|
203
|
-
this.trigger('pjax:end', [xhr, pjax.options])
|
204
|
-
// end.pjax is deprecated
|
205
|
-
this.trigger('end.pjax', [xhr, pjax.options])
|
206
|
-
}
|
207
|
-
}
|
208
|
-
|
209
|
-
|
210
|
-
// Used to detect initial (useless) popstate.
|
211
|
-
// If history.state exists, assume browser isn't going to fire initial popstate.
|
212
|
-
var popped = ('state' in window.history), initialURL = location.href
|
213
|
-
|
214
|
-
|
215
|
-
// popstate handler takes care of the back and forward buttons
|
216
|
-
//
|
217
|
-
// You probably shouldn't use pjax on pages with other pushState
|
218
|
-
// stuff yet.
|
219
|
-
$(window).bind('popstate', function(event){
|
220
|
-
// Ignore inital popstate that some browsers fire on page load
|
221
|
-
var initialPop = !popped && location.href == initialURL
|
222
|
-
popped = true
|
223
|
-
if ( initialPop ) return
|
224
|
-
|
225
|
-
var state = event.state
|
226
|
-
|
227
|
-
if ( state && state.pjax ) {
|
228
|
-
var container = state.pjax
|
229
|
-
if ( $(container+'').length )
|
230
|
-
$.pjax({
|
231
|
-
url: state.url || location.href,
|
232
|
-
fragment: state.fragment,
|
233
|
-
container: container,
|
234
|
-
push: false,
|
235
|
-
timeout: state.timeout
|
236
|
-
})
|
237
|
-
else
|
238
|
-
window.location = location.href
|
239
|
-
}
|
240
|
-
})
|
241
|
-
|
242
|
-
|
243
|
-
// Add the state property to jQuery's event object so we can use it in
|
244
|
-
// $(window).bind('popstate')
|
245
|
-
if ( $.inArray('state', $.event.props) < 0 )
|
246
|
-
$.event.props.push('state')
|
247
|
-
|
248
|
-
|
249
|
-
// Is pjax supported by this browser?
|
250
|
-
$.support.pjax =
|
251
|
-
window.history && window.history.pushState && window.history.replaceState
|
252
|
-
// pushState isn't reliable on iOS yet.
|
253
|
-
&& !navigator.userAgent.match(/(iPod|iPhone|iPad|WebApps\/.+CFNetwork)/)
|
254
|
-
|
255
|
-
|
256
|
-
// Fall back to normalcy for older browsers.
|
257
|
-
if ( !$.support.pjax ) {
|
258
|
-
$.pjax = function( options ) {
|
259
|
-
window.location = $.isFunction(options.url) ? options.url() : options.url
|
260
|
-
}
|
261
|
-
$.fn.pjax = function() { return this }
|
262
|
-
}
|
263
|
-
|
264
|
-
})(jQuery);
|