1/**==================================================================== 2 * 3 * QT Ajax Page Loader main script 4 * @author QantumThemes 5 * 6 ====================================================================**/ 7!function($){"use strict";$("body").append('<div id="qtajaxpreloadericon"><i class="dripicons-loading" ></i></div>');var qtAplSelector="#maincontent",qtAplMaincontent=$(qtAplSelector),atAplPreloader=$("#qtajaxpreloadericon"); 8/** 9 * [Before switching content let's scroll to top] 10 * @return {[bol]} 11 */$.fn.qtAplScrollTop=function(){return $("html, body").animate({scrollTop:0},100,"easeOutExpo"),!0}, 12// WPML exclusion 13$(".wpml-ls-item").on("click","a",function(t){return window.location.replace($(this).attr("href")),t}), 14/** 15 * [Main ajax initialization function] 16 */ 17$.fn.qtAplInitAjaxPageLoad=function(){ 18/** 19 * [ajax call] 20 * @param {[text]} link [url to load] 21 * @return {[bol]} 22 */ 23function qtAplExecuteAjaxLink(link){var docClass,parser;return $.ajax({url:link,success:function(data){ 24/* 25 * Retrive the contents 26 */ 27$.ajaxData=data,parser=new DOMParser,$.qtAplAjaxContents=$($.ajaxData).filter(qtAplSelector).html(),$.qtAplAjaxTitle=$($.ajaxData).filter("title").text(),docClass=$($.ajaxData).filter("body").attr("class"),$.qtAplBodyMatches=data.match(/<body.*class=["']([^"']*)["'].*>/),void 0!==$.qtAplBodyMatches?docClass=$.qtAplBodyMatches[1]:window.location.replace(link); 28// New method better working: 29var modifiedAjaxResult=data.replace(/<body/i,'<div id="re_body"').replace(/<\/body/i,"</div"),bodyClassesNew=$(modifiedAjaxResult).filter("#re_body").attr("class"), 30//20190527 31//Custom css change id 32js_composer_front_css=$(modifiedAjaxResult).filter("#js_composer_front-inline-css").text(); 33// since 2.2 checkbox skip 34if(bodyClassesNew&&(docClass=bodyClassesNew),0<=bodyClassesNew.indexOf("qtapl-skip"))return window.location.replace(link);$.wpadminbar=$($.ajaxData).filter("#wpadminbar").html(),$.visual_composer_styles=$($.ajaxData).filter("style[data-type=vc_shortcodes-custom-css]").text(), 35/** 36 * [if we have WPML plugin language selector] 37 */ 38$("#qwLLT")&&($.langswitcher=$($.ajaxData).find("#qwLLT").html()) 39/* 40 * Start putting the data in the page 41 */,void 0!==docClass&&void 0!==$.qtAplAjaxContents?($.fn.closeModal(),$("body").attr("class",docClass),$("title").text($.qtAplAjaxTitle),$("#wpadminbar").html($.wpadminbar),$("#qwLLT").html($.langswitcher),0<$("style[data-type=vc_shortcodes-custom-css]").length?$("style[data-type=vc_shortcodes-custom-css]").append($.visual_composer_styles):$("head").append('<style type="text/css" data-type="vc_shortcodes-custom-css">'+$.visual_composer_styles+"</style>"), 42// 2019 may 27 js composer update css 43""!=js_composer_front_css&&0!=js_composer_front_css&&null!=js_composer_front_css?0<$("style#js_composer_front-inline-css").length?$("style#js_composer_front-inline-css").html(js_composer_front_css):$("head").append('<style id="js_composer_front-inline-css">'+js_composer_front_css+"</style>"):$("head style#js_composer_front-inline-css").remove(),qtAplMaincontent.html($.qtAplAjaxContents).delay(100).promise().done(function(){var scripts=qtAplMaincontent.find("script");0<scripts.length&&scripts.each(function(){if($(this).hasClass("wp-playlist-script"));else{var code=$(this).html();code="("+code+")";// not really needed 44try{eval($(this).html())}catch(t){console.log(t)}}}),!0===$.fn.initializeAfterAjax()?($.fn.initializeVisualComposerAfterAjax(),$.fn.initializeOnlyAfterAjax(),atAplPreloader.removeClass("qt-visible"),qtAplMaincontent.fadeTo("fast",1).promise().done(function(){ 45// After reloading we scroll till the place of the anchor 46// Since 2019 04 18 + support internal links 47var t=link.split("#"),a=!1;if(1<t.length){var e=$("#"+t[1]);if(0<e.length){var o=e.offset().top;return void $("html, body").animate({scrollTop:o},1500,"swing")}}}), 48/** 49 * @since 2.5 reload playlist 50 */ 51// $( '.wp-playlist' ).each( function() { 52// new WPPlaylistView( { el: this } ); 53// } ); 54/** 55 * @since 2.4 56 * Execute custom javascript 57 */ 58$.getScript($("#qt-ajax-customscript-url").data("customscripturl")).done(function(t,a){}).fail(function(t,a,e){})):window.location.replace(link)})):window.location.replace(link)},error:function(){ 59//Go to the link normally 60window.location.replace(link)}}),!0} 61/** 62 * Manage browser back and forward arrows
63 */$("body").off("click","a"), 64/** 65 * [Bind click function to all the links] 66 */ 67$("body").on("click","a",function(t){var a=$(this),e=$(this).attr("href");if(void 0===e)return t;if(""===e)return t; 68// Since 2019 04 18 + support internal links 69var o,s,n=$(location).attr("href").split("#")[0],i,l;if(e.split("#")[0]===n)return t; 70/** 71 * [exceptions that will skip ajax loading] 72 */var r=/(\/respond|\/wp-admin|mailto:|\/checkout|\.zip|\.jpg|\.gif|\.mp3|\.pdf|\.png|\.rar|\/product|\/shop|\/cart|#noajax|download_file)/;if(a.hasClass("ajax_add_to_cart")||a.parent().hasClass("noajax")||!e.match(document.domain)||"_blank"===a.attr("target")||a.hasClass("noajax")||"submit"===a.attr("type")||"button"===a.attr("type")||e.match(r))return t;if(e.match(document.domain)){t.preventDefault();try{if(window.history.pushState){var c=e;c!==window.location&&window.history.pushState({path:c,state:"new"},"",c)}}catch(t){console.log(t)} 73/** 74 * Close the sidebar and player 75 */$(".button-collapse").sideNav("hide"),$(".button-playlistswitch").sideNav("hide"),$("li.current_page_item").removeClass("current_page_item"),a.closest("li").addClass("current_page_item"),atAplPreloader.addClass("qt-visible"),qtAplMaincontent.fadeTo("fast",0,function(){$.fn.qtAplScrollTop()}).promise().done(function(){qtAplExecuteAjaxLink(e)})}}),$(window).on("popstate",function(t){var a;if(null!==t.originalEvent.state)void 0!==(a=location.href)&&(a.match(document.domain)?qtAplMaincontent.fadeTo("fast",0,function(){$.fn.qtAplScrollTop()}).promise().done(function(){qtAplExecuteAjaxLink(a)}):window.location.replace(a));else if(void 0!==(a=location.href))if(a.match(document.domain)){ 76// Since 2019 04 18 + support internal links 77var e,o,s=$(location).attr("href").split("#")[0],n=a.split("#"),i;if(n[0]===s&&void 0!==n[1]){var l=$("#"+n[1]);if(0<l.length){var r=l.offset().top;return t.preventDefault(),$("html, body").animate({scrollTop:r},1500,"swing"),!1; 78// return e; 79}return t}qtAplMaincontent.fadeTo("fast",0,function(){$.fn.qtAplScrollTop()}).promise().done(function(){qtAplExecuteAjaxLink(a)})}else window.location.replace(a)})},// $.fn.qtAplInitAjaxPageLoad 80/**==================================================================== 81 * 82 * Page Ready Trigger 83 * This needs to call only $.fn.qtInitTheme 84 * 85 ====================================================================*/ 86jQuery(document).ready(function(){$.fn.qtAplInitAjaxPageLoad()})}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.