1(function($){'use strict';$.fn.isExternal=function(){var host=window.location.hostname;var link=$('<a>',{href:this.attr('href')})[0].hostname;return(link!==host)};function popupOpen(){return $('#modal-content').html().length} 2function basename(path,suffix){var b=path;var lastChar=b.charAt(b.length-1);if(lastChar==='/'||lastChar==='\\'){b=b.slice(0,-1)} 3b=b.replace(/^.*[/\\]/g,'');if(typeof suffix==='string'&&b.substr(b.length-suffix.length)===suffix){b=b.substr(0,b.length-suffix.length)} 4return b} 5var getUrlParameter=function getUrlParameter(sParam){var sPageURL=decodeURIComponent(window.location.search.substring(1)),sURLVariables=sPageURL.split('&'),sParameterName,i;for(i=0;i<sURLVariables.length;i++){sParameterName=sURLVariables[i].split('=');if(sParameterName[0]===sParam){return sParameterName[1]===undefined?!0:sParameterName[1]}}};function modalCustomizer(){if(typeof wp.customize!=='undefined'){var body=$('body');body.off('click.preview');body.on('click.preview','a[href]:not(.modal-link)',function(e){var link=$(this);e.preventDefault();wp.customize.preview.send('scroll',0);wp.customize.preview.send('url',link.prop('href'))})}} 6$(function(){var $window=$(window),$document=$(document),scrollPos,currentURL=window.location.pathname;function showModal(postLink,external){scrollPos=window.pageYOffset;$('body, html').addClass('no-scroll');$('.modal-wrapper').addClass('show');$('.modal').addClass('show');if(postLink){if(postLink.length>0&&!external){history.replaceState('','',postLink)}}} 7function hideModal(currentURL){var body=$('body');if(body.hasClass('no-scroll')){body.removeClass('no-scroll');$('html').removeClass('no-scroll');$('.modal-wrapper').removeClass('show').hide();$('.modal').removeClass('show');$('#modal-content').empty();window.scroll(0,scrollPos);if(window.location.pathname!==currentURL){history.replaceState('','',currentURL)}}} 8$document.keyup(function(e){if(e.keyCode===27&&$('.modal-wrapper').hasClass('show')) 9hideModal(currentURL)}).on('click','.close-modal',function(){hideModal(currentURL)}).on('click','.modal',function(e){e.stopPropagation()});$(window).on('click',function(){if(popupOpen())hideModal(currentURL)});function initModal(){if($window.width()>=fromPHP.breakpoint){var modalUrl=getUrlParameter('modal-link');if(modalUrl){if(fromPHP.loader){$('#modal-content').html('<img class="loading" src="'+fromPHP.pluginUrl+'/images/loading.gif" />')} 10$.get(modalUrl,function(html){$('#modal-content').html($(html).find(fromPHP.containerID).html())});$('.modal-wrapper').fadeIn('fast',showModal)} 11$('body').on('click','.modal-link',function(e){var modalContent=$('#modal-content');var $this=($(this).attr('href')!=null)?$(this):$(this).children('a').first();var postLink=$this.attr('href');var postSlug=postLink.lastIndexOf('/#')>-1?basename(postLink.substring(0,postLink.lastIndexOf('/#')))+basename(postLink):basename(postLink);var postAnchor=postSlug.lastIndexOf('#')!==-1?postSlug.substring(postSlug.lastIndexOf('#')):!1;var dataDivID=' #'+$this.attr('data-div');var dataBuddypress=$this.attr('data-buddypress');var loader='<img class="loading" src="'+fromPHP.pluginUrl+'/images/loading.gif" />';e.preventDefault();if(fromPHP.loader){modalContent.html(loader)} 12if($this.isExternal()){if($(this).hasClass('iframe')||fromPHP.iframe){var iframeCode='<iframe src="'+$(this).attr('href')+'" width="100%"'+' height="600px" frameborder="0"></iframe>';modalContent.html(iframeCode)}else{$.ajaxPrefilter(function(options){if(options.crossDomain&&jQuery.support.cors){var http=(window.location.protocol==='http:'?'http:':'https:');options.url=http+'//cors-anywhere.herokuapp.com/'+options.url}});$.get(postLink,function(html){modalContent.html($(html).find(dataDivID).html())})}}else{if(dataBuddypress){modalContent.load(postLink+' #buddypress')}else if($(this).hasClass('iframe')){var iframeCode='<iframe src="'+$(this).attr('href')+'" width="100%"'+' height="600px" frameborder="0"></iframe>';modalContent.html(iframeCode)}else{if(fromPHP.restMethod||$(this).hasClass('rest')){$.get(fromPHP.siteUrl+'/wp-json/wp-post-modal/v1/any-post-type?slug='+postSlug,function(response){$.when(modalContent.html(response.post_content)).done(function(){setTimeout(function(){if(postAnchor){$('.modal-wrapper').animate({scrollTop:($('#modal
12-content '+postAnchor).offset().top)},300)}},200)})})}else{$.get(postLink,function(html){var content=$(html).find(fromPHP.containerID);if(content[0]){$.when(modalContent.html($(html).find(fromPHP.containerID).html())).done(function(){setTimeout(function(){if(postAnchor){$('.modal-wrapper').animate({scrollTop:($('#modal-content '+postAnchor).offset().top)},300)}},200)})}else{modalContent.load(postLink,function(){modalContent.html($(modalContent.html()).find(fromPHP.containerID).html());setTimeout(function(){if(postAnchor){$('.modal-wrapper').animate({scrollTop:($('#modal-content '+postAnchor).offset().top)},300)}},200)})}})}}} 13$('.modal-wrapper').fadeIn('fast',function(){showModal(fromPHP.urlState?postLink:'',$this.isExternal())})})}} 14initModal();$(window).resize(initModal)});$(window).on('load',function(){modalCustomizer()})})(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.