File "pjax.min.js"

Full Path: /home/ycoalition/public_html/blog/wp-content/themes/woodmart/js/libs/pjax.min.js
File size: 8.05 KB
MIME-type: text/plain
Charset: utf-8

!function(f){function t(t,e,n){return n=u(e,n),this.on("click.pjax",t,function(t){var e=n;e.container||((e=f.extend({},n)).container=f(this).attr("data-pjax")),a(t,e)})}function a(t,e,n){n=u(e,n);var e=t.currentTarget,a=f(e);if("A"!==e.tagName.toUpperCase())throw"$.fn.pjax or $.pjax.click requires an anchor element";1<t.which||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||location.protocol!==e.protocol||location.hostname!==e.hostname||-1<e.href.indexOf("#")&&s(e)==s(location)||t.isDefaultPrevented()||(e={url:e.href,container:a.attr("data-pjax"),target:e},e=f.extend({},e,n),n=f.Event("pjax:click"),a.trigger(n,[e]),n.isDefaultPrevented()||(h(e),t.preventDefault(),a.trigger("pjax:clicked",[e])))}function e(t,e,n){n=u(e,n);var e=t.currentTarget,a=f(e);if("FORM"!==e.tagName.toUpperCase())throw"$.pjax.submit requires a form element";var r={type:(a.attr("method")||"GET").toUpperCase(),url:a.attr("action"),container:a.attr("data-pjax"),target:e};if("GET"!==r.type&&void 0!==window.FormData)r.data=new FormData(e),r.processData=!1,r.contentType=!1;else{if(a.find(":file").length)return;r.data=a.serializeArray()}h(f.extend({},r,n)),t.preventDefault()}function h(u){"function"==typeof(u=f.extend(!0,{},f.ajaxSettings,h.defaults,u)).url&&(u.url=u.url());var l=j(u.url).hash,t=typeof u.container;if("string"!=t)throw"expected string value for 'container' option; got "+t;var n,p=u.context=f(u.container);if(!p.length)throw"the container selector '"+u.container+"' did not match anything";function d(t,e,n){(n=n||{}).relatedTarget=u.target;t=f.Event(t,n);return p.trigger(t,e),!t.isDefaultPrevented()}u.data||(u.data={}),Array.isArray(u.data)?u.data.push({name:"_pjax",value:u.container}):u.data._pjax=u.container,u.beforeSend=function(t,e){if("GET"!==e.type&&(e.timeout=0),t.setRequestHeader("X-PJAX","true"),t.setRequestHeader("X-PJAX-Container",u.container),!d("pjax:beforeSend",[t,e]))return!1;0<e.timeout&&(n=setTimeout(function(){d("pjax:timeout",[t,u])&&t.abort("timeout")},e.timeout),e.timeout=0);e=j(e.url);l&&(e.hash=l),u.requestUrl=c(e)},u.complete=function(t,e){n&&clearTimeout(n),d("pjax:complete",[t,e,u]),d("pjax:end",[t,u])},u.error=function(t,e,n){var a=w("",t,u),t=d("pjax:error",[t,e,n,u]);"GET"==u.type&&"abort"!==e&&t&&m(a.url)},u.success=function(n,r,o){var t=h.state,e="function"==typeof f.pjax.defaults.version?f.pjax.defaults.version():f.pjax.defaults.version,a=o.getResponseHeader("X-PJAX-Version"),i=w(n,o,u),c=j(i.url);if(l&&(c.hash=l,i.url=c.href),e&&a&&e!==a)m(i.url);else if(i.contents){if(h.state={id:u.id||g(),url:i.url,title:i.title,container:u.container,fragment:u.fragment,timeout:u.timeout},(u.push||u.replace)&&window.history.replaceState(h.state,i.title,i.url),f.contains(p,document.activeElement))try{document.activeElement.blur()}catch(t){}i.title&&(document.title=i.title),d("pjax:beforeReplace",[i.contents,u],{state:h.state,previousState:t}),"function"==typeof u.renderCallback?u.renderCallback(p,i.contents,s):(p.html(i.contents),s())}else m(i.url);function s(){var a,t,e=p.find("input[autofocus], textarea[autofocus]").last()[0],e=(e&&document.activeElement!==e&&e.trigger("focus"),(e=i.scripts)&&(a=f("script[src]"),e.each(function(){var t,e,n=this.src;a.filter(function(){return this.src===n}).length||(t=document.createElement("script"),(e=f(this).attr("type"))&&(t.type=e),t.src=f(this).attr("src"),document.head.appendChild(t))})),u.scrollTo);l&&(t=decodeURIComponent(l.slice(1)),(t=document.getElementById(t)||document.getElementsByName(t)[0])&&(e=f(t).offset().top)),"number"==typeof e&&f(window).scrollTop(e),d("pjax:success",[n,r,o,u])}},h.state||(h.state={id:g(),url:window.location.href,title:document.title,container:u.container,fragment:u.fragment,timeout:u.timeout},window.history.replaceState(h.state,document.title)),x(h.xhr),h.options=u;var e,a,t=h.xhr=f.ajax(u);return 0<t.readyState&&(u.push&&!u.replace&&(e=h.state.id,a=[u.container,y(p)],b[e]=a,E.push(e),S(T,0),S(E,h.defaults.maxCacheLength),window.history.pushState(null,"",u.requestUrl)),d("pjax:start",[t,u]),d("pjax:send",[t,u])),h.xhr}function n(t,e){var n={url:window.location.href,push:!1,replace:!0,scrollTo:!1};return h(f.extend(n,u(t,e)))}function m(t){window.history.replaceState(null,"",h.state.url),window.location.replace(t)}var l=!0,p=window.location.href,r=window.history.state;function o(t){l||x(h.xhr);var e,n=h.state,t=t.state;if(t&&t.container){if(l&&p==t.url)return;if(n){if(n.id===t.id)return;e=n.id<t.id?"forward":"back"}var a,r,o,i,c=b[t.id]||[],s=c[0]||t.container,u=f(s),c=c[1];u.length?(n&&(r=e,i=n.id,o=[s,y(u)],b[i]=o,o="forward"===r?(a=E,T):(a=T,E),a.push(i),(i=o.pop())&&delete b[i],S(a,h.defaults.maxCacheLength)),r=f.Event("pjax:popstate",{state:t,direction:e}),u.trigger(r),o={id:t.id,url:t.url,container:s,push:!1,fragment:t.fragment,timeout:t.timeout,scrollTo:!1},c?(u.trigger("pjax:start",[null,o]),(h.state=t).title&&(document.title=t.title),i=f.Event("pjax:beforeReplace",{state:t,previousState:n}),u.trigger(i,[c,o]),u.html(c),u.trigger("pjax:end",[null,o])):h(o),u[0].offsetHeight):m(location.href)}l=!1}function i(t){var e,n="function"==typeof t.url?t.url():t.url,a=t.type?t.type.toUpperCase():"GET",r=f("<form>",{method:"GET"===a?"GET":"POST",action:n,style:"display:none"}),o=("GET"!==a&&"POST"!==a&&r.append(f("<input>",{type:"hidden",name:"_method",value:a.toLowerCase()})),t.data);if("string"==typeof o)f.each(o.split("&"),function(t,e){e=e.split("=");r.append(f("<input>",{type:"hidden",name:e[0],value:e[1]}))});else if(Array.isArray(o))f.each(o,function(t,e){r.append(f("<input>",{type:"hidden",name:e.name,value:e.value}))});else if("object"==typeof o)for(e in o)r.append(f("<input>",{type:"hidden",name:e,value:o[e]}));f(document.body).append(r),r.submit()}function x(t){t&&t.readyState<4&&(t.onreadystatechange=f.noop,t.abort())}function g(){return(new Date).getTime()}function y(t){t=t.clone();return t.find("script").each(function(){this.src||jQuery._data(this,"globalEval",!1)}),t.contents()}function c(t){return t.search=t.search.replace(/([?&])(_pjax|_)=[^&]*/g,"").replace(/^&/,""),t.href.replace(/\?($|#)/,"$1")}function j(t){var e=document.createElement("a");return e.href=t,e}function s(t){return t.href.replace(/#.*/,"")}function u(t,e){return t&&e?((e=f.extend({},e)).container=t,e):f.isPlainObject(t)?t:{container:t}}function d(t,e){return t.filter(e).add(t.find(e))}function v(t){return f.parseHTML(t,document,!0)}function w(t,e,n){var a,r={},o=/<html/i.test(t),e=e.getResponseHeader("X-PJAX-URL");return r.url=e?c(j(e)):n.requestUrl,e=o?(a=f(v(t.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0])),null!=(e=t.match(/<head[^>]*>([\s\S.]*)<\/head>/i))?f(v(e[0])):a):a=f(v(t)),0===a.length||(r.title=d(e,"title").last().text(),n.fragment?(t=a,(t="body"!==n.fragment?d(t,n.fragment).first():t).length&&(r.contents="body"===n.fragment?t:t.contents(),r.title||(r.title=t.attr("title")||t.data("title")))):o||(r.contents=a),r.contents&&(r.contents=r.contents.not(function(){return f(this).is("title")}),r.contents.find("title").remove(),r.scripts=d(r.contents,"script[src]").remove(),r.contents=r.contents.not(r.scripts)),r.title&&(r.title=null==(e=r.title)?"":"string"==typeof e?e.trim():(e+"").replace("/^[\\s\ufeff ]+|[\\s\ufeff ]+$/g",""))),r}r&&r.container&&(h.state=r),"state"in window.history&&(l=!1);var b={},T=[],E=[];function S(t,e){for(;t.length>e;)delete b[t.shift()]}function C(){return f("meta").filter(function(){var t=f(this).attr("http-equiv");return t&&"X-PJAX-VERSION"===t.toUpperCase()}).attr("content")}function P(){f.fn.pjax=t,f.pjax=h,f.pjax.enable=f.noop,f.pjax.disable=A,f.pjax.click=a,f.pjax.submit=e,f.pjax.reload=n,f.pjax.defaults={timeout:650,push:!0,replace:!1,type:"GET",dataType:"html",scrollTo:0,maxCacheLength:20,version:C},f(window).on("popstate.pjax",o)}function A(){f.fn.pjax=function(){return this},f.pjax=i,f.pjax.enable=P,f.pjax.disable=f.noop,f.pjax.click=f.noop,f.pjax.submit=f.noop,f.pjax.reload=function(){window.location.reload()},f(window).off("popstate.pjax",o)}"state"in f.Event.prototype||f.event.addProp("state"),f.support.pjax=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),(f.support.pjax?P:A)()}(jQuery);