// source --> http://www.tutorialspanel.com/wp-content/plugins/popup-by-supsystic/modules/popup/js/frontend.popup.min.js
var g_ppsWindowLoaded=!1,g_ppsIsPageCached=!1,g_ppsIsPageCachedChecked=!1,g_ppsShowCallbacks={},g_ppsClks={};function _ppsAddPopUpClick(p,e){g_ppsClks[p]=e}function _ppsGetPopUpClick(p){return g_ppsClks[p]}function _ppsCheckPopupOnFollowClk(p){var e=p.href,s=p.hash,o=window.location.href,i=window.location.hash;s&&(s&&""!=s&&(e=str_replace(e,s,"")),i&&""!=i&&(o=str_replace(o,i,"")),!1!==strpos(e,"/",e.length-1)&&(e=e.substr(0,e.length-1)),!1!==strpos(o,"/",o.length-1)&&(o=o.substr(0,o.length-1)),o==e&&setTimeout(function(){toeReload()},100))}function _ppsBindOnElementClickPopups(){var p=jQuery('[href*="#ppsShowPopUp_"]:not(.ppsClickBinded)');p&&p.length&&p.each(function(){jQuery(this).click(function(){var p=jQuery(this).attr("href");if(p&&""!=p){if(!(p=(p=p.split("_"))[1]?parseInt(p[1]):0))return _ppsCheckPopupOnFollowClk(this),!0;var e=ppsGetPopupById(p);if(e&&"link_follow"==e.params.main.show_on)return _ppsCheckPopupOnFollowClk(this),!0;_ppsAddPopUpClick(p,this),_ppsPopupBindDelay(p,"show_on_click_on_el_delay","show_on_click_on_el_enb_delay")||ppsShowPopup(p)}return!1})}).addClass("ppsClickBinded");var e=jQuery('[title*="#ppsShowPopUp_"]:not(.ppsClickBinded)');e&&e.length&&e.each(function(){var p=jQuery(this).attr("title"),e=p.match(/#ppsShowPopUp_(\d+)/);if(e&&2==e.length){var s=parseInt(e[1]);s&&jQuery(this).data("popup-id",s).attr("title",str_replace(p,e[0],"")).click(function(){var p=jQuery(this).data("popup-id");return _ppsAddPopUpClick(p,this),_ppsPopupBindDelay(p,"show_on_click_on_el_delay","show_on_click_on_el_enb_delay")||ppsShowPopup(p),!1})}}).addClass("ppsClickBinded")}function ppsMovePopupStyles(p){var e=jQuery(''),s=jQuery("#ppsPopupStylesHidden_"+p.view_id);e.appendTo("body").html(s.html()),s.remove()}function ppsBindPopupLove(p){parseInt(toeOptionPps("add_love_link"))&&ppsGetPopupShell(p).append(toeOptionPps("love_link_html"))}function ppsBindPopupLoad(p){var e=jQuery(".ppsPopupPreloadImg_"+p.view_id);(p._imgsCount=e.length,p._imgsCount)?(p._imgsLoaded=!1,p._imgsLoadedCount=0,e.bind("load error",function(){(p._imgsLoadedCount++,p._imgsLoadedCount>=p._imgsCount)&&(p._imgsLoaded=!0,ppsGetPopupShell(p).trigger("ppsShowPopupAfterAllImgs",p))})):toeInArrayPps(p.type,["iframe","pdf"])?(p._imgsLoaded=!1,(s=ppsGetPopupShell(p)).find(".ppsMainFrame").bind("load error",function(){var e=p._imgsLoaded;p._imgsLoaded=!0,e||setTimeout(function(){s.trigger("ppsShowPopupAfterAllImgs",p)},1e3)})):p._imgsLoaded=!0;var s,o=(s=ppsGetPopupShell(p)).find("img"),i=o?o.length:0;if(i){if(p._imgsCount){var t=!1;e.each(function(){var p=jQuery(this).attr("src");o.each(function(){if(jQuery(this).attr("src")==p)return o=o.filter(this),t=!0,!1})}),t&&(i=o.length)}i&&o.bind("load error",function(){--i<=0&&p.is_visible&&_ppsPositionPopup({shell:s,popup:p,recalc:!0})})}}function ppsBindPopupShow(p){switch(_ppsCheckBindVideo({popup:p}),p.params.main.show_on){case"page_load":_ppsPopupBindDelay(p,"show_on_page_load_delay","show_on_page_load_enb_delay")||("fb_like"==p.type?p.render_with_fb_load=!0:ppsCheckShowPopup(p));break;case"click_on_page":jQuery(document).click(function(){p.click_on_page_displayed||(ppsCheckShowPopup(p),p.click_on_page_displayed=!0)});break;case"click_on_element":break;case"scroll_window":jQuery(window).scroll(function(){if(parseInt(p.params.main.show_on_scroll_window_enb_perc_scroll)){var e=parseInt(p.params.main.show_on_scroll_window_perc_scroll);if(e){var s=jQuery(document).height(),o=jQuery(window).height(),i=jQuery(window).scrollTop(),t=s-o;if(t>0&&100*i/t-1&&!(navigator.userAgent.indexOf("Chrome")>-1)){var i=e.get(0).getElementsByTagName("form");if(i&&i.length)for(var t=0;t=l){if("hour"==p.params.main.count_times_mes&&u<3600||"day"==p.params.main.count_times_mes&&u<86400||"week"==p.params.main.count_times_mes&&u<604800||"month"==p.params.main.count_times_mes&&u<2592e3)return;a>=l&&(a=0)}}}if(!o||i){var c=parseInt(p.params.main.show_to_first_time_visit_days);(c=isNaN(c)||i?30:c)||(c=null);var d=i?(new Date).toString():"1";setCookiePps("pps_show_"+p.id,d,c),i&&setCookiePps(t,a?a+1:1,30)}var _=_ppsPopupGetActionDone(p);if(!("until_make_action"==p.params.main.show_to&&_||_ppsCheckDisplayTime(p)||"until_email_confirm"==p.params.main.show_to&&"function"==typeof ppsCheckEmailConfirmed&&ppsCheckEmailConfirmed(p)))return(e=e||{}).isUnique=o?0:1,ppsShowPopup(p,e),!1}}function _ppsCheckDisplayTime(p){if(isNumericPps(p)&&(p=ppsGetPopupById(p)),p.params.main.enb_show_time&&p.params.main.show_time_from&&p.params.main.show_time_to&&p.params.main.show_time_from!=p.params.main.show_time_to){var e=function(p){var e=!1!==strpos(p,"pm")?12:0,s=parseFloat(str_replace(str_replace(str_replace(p,"am",""),"pm",""),":","."));return-1===toeInArray(s,[12,12.3])?s+=e:e||(s-=12),s},s=e(p.params.main.show_time_from),o=e(p.params.main.show_time_to),i=new Date,t=i.getHours()+i.getMinutes()/100;if(to)return!0}return!1}function _ppsPopupGetActionDone(p){isNumericPps(p)&&(p=ppsGetPopupById(p));var e="pps_actions_"+p.id,s=getCookiePps(e);if(s){if("age_verify"==p.type&&s.age_verify&&p.params.opts_attrs.btns_number){for(var o=!1,i=0;i0&&setTimeout(function(){_ppsPositionPopup(p)},500)}function __ppsHideShell(p){p.shell.hide()}function ppsShowPopup(p,e){if(ppsCorrectJqueryUsed()){e=e||{},isNumericPps(p)&&(p=ppsGetPopupById(p));var s=ppsGetPopupShell(p);if(p._imgsLoaded){if(s.data("view-id",p.view_id),_ppsCheckIsPageCached()&&_ppsUpdatePopupNonces(p),_ppsPopupAddStat(p,"show",0,e.isUnique),e.ignoreBgOverlay||ppsShowBgOverlay(p),g_ppsWindowLoaded&&!e.ignorePosition&&_ppsPositionPopup({shell:s,popup:p}),p.params.tpl.anim&&!p.resized_for_wnd?_ppsHandlePopupAnimationShow(p,s):__ppsDisplayShell({shell:s,popup:p}),toeInArrayPps(p.type,["iframe"])){var o=s.find(".ppsMainFrame");o&&o.length&&(o.css("width","auto"),o.css("width","100%"))}_ppsCheckPlayVideo({popup:p,shell:s}),_ppsIframesForReload({popup:p,shell:s}),_ppsCheckInnerScripts({popup:p,shell:s}),setTimeout(function(){_ppsCheckMap({popup:p,shell:s}),_ppsSocialIcons({popup:p,shell:s}),_ppsCheckContactForm({popup:p,shell:s}),_ppsCheckVideos({popup:p,shell:s})},100),_ppsCheckPublication({popup:p,shell:s}),p.params.tpl.dsbl_wnd_scroll&&(disableScrollPps("html"),disableScrollPps("body")),p.is_visible=!0,p.is_rendered=!0,jQuery(document).trigger("ppsAfterPopupsActionShow",p),runShowClb(p,s),toeInArrayPps(p.type,["iframe"])&&p.params.tpl.iframe_display_only&&""!=p.params.tpl.iframe_display_only&&"function"==typeof _ppsIFrameDisplayOnly&&!p.params.tpl._iframeDisplayOnlyBinded&&_ppsIFrameDisplayOnly(p)}else s.bind("ppsShowPopupAfterAllImgs",function(){ppsShowPopup(p,e)})}else ppsReloadCoreJs(ppsShowPopup,[p,e])}function _ppsCheckVideos(p){if("video"==p.popup.type&&"youtube"==p.popup.params.tpl.video_type&&p.popup.params.tpl.video_autoplay){var e=p.shell.find("iframe:first");e.attr("src",e.attr("src")+"&autoplay=1")}}function _ppsHandlePopupAnimationShow(p,e){var s=p.params.tpl.anim.old?"magictime":"animated";e.animationDuration(p.params.tpl.anim_duration,!0);var o=p.params.tpl.anim_close?p.params.tpl.anim_close.hide_class:p.params.tpl.anim.hide_class;e.removeClass(o),e.addClass(s+" "+p.params.tpl.anim.show_class),__ppsDisplayShell({shell:e,popup:p}),setTimeout(function(){e.removeClass(s+" "+p.params.tpl.anim.show_class)},parseInt(p.params.tpl.anim_duration))}function _ppsHandlePopupAnimationHide(p,e){var s=p.params.tpl.anim.old?"magictime":"animated",o=p.params.tpl.anim_close?p.params.tpl.anim_close.hide_class:p.params.tpl.anim.hide_class,i=p.params.tpl.anim_close_duration;i&&i>0?e.animationDuration(i,!0):i=p.params.tpl.anim_duration,e.removeClass(p.params.tpl.anim.show_class).addClass(o),setTimeout(function(){e.removeClass(s),__ppsHideShell({shell:e,popup:p}),ppsHideBgOverlay(p)},i)}function _ppsIframesForReload(p){var e=p.popup,s=p.shell?p.shell:ppsGetPopupShell(e);s.find("iframe")&&s.find("iframe").each(function(){var p=jQuery(this).attr("src");p&&-1!==p.indexOf("www.google.com/maps/embed")&&(this.src=this.src)})}function _ppsIsIframeForHide(p){if("video"==(p=p||{}).popup.type)return!0;var e=p.shell?p.shell:ppsGetPopupShell(p.popup),s=!!e&&e.find("iframe"),o=!1;if(s&&s.length){var i=["youtube","vimeo","dtbaker"];s.each(function(){var p=jQuery(this).data("original-src"),e=jQuery(this).attr("src");if(e||p)for(var s=0;s=_&&!m&&(!p.popup||!p.popup._notResizeHeight)){var g=!p.recalc&&parseInt(e.data("init-height"));g||(g=r,e.data("init-height",g)),h=_/g,u=c=!0}if(n>=d&&!m){(v=!p.recalc&&parseInt(e.data("init-width")))||(v=n,e.data("init-width",v));var P=d/v;P=t,e.css({width:"calc(100% - "+(y+20)+"px)"})}else{(v=parseInt(e.data("init-width")))&&v'),jQuery("#ppsPopupBgOverlay").click(function(){if(ppsPopups&&ppsPopups.length)for(var p=0;p0&&(o-=i)<0&&(o=0)}return setTimeout(function(){ppsCheckShowPopup(p)},o),!0}return!1}function _ppsPopupBindUnloadDelay(p,e){jQuery(window).unload(function(){var s=e.is_rendered?0:(new Date).getTime()-e.start_time;setCookiePps("pps_un_"+p+"_"+e.id,s)})}function ppsBindPopupForceShow(p){if("link_follow"!=p.params.main.show_on){var e=toeGetHashParams();e&&e.length&&-1!==toeInArray("ppsShowPopUp_"+p.id,e)&&ppsCheckShowPopup(p)}}function ppsCheckPopupGetNotices(p){var e={errors:getDataLcs("ppsErrors"),messages:getDataLcs("ppsMsgs")};if(e.errors&&(e.error=!0),e.errors||e.messages){var s=ppsGetPopupShell(p);toeProcessAjaxResponsePps(e,s.find(".ppsSubMsg"))}}function _ppsCheckIsPageCached(){return g_ppsIsPageCachedChecked?g_ppsIsPageCached:(jQuery("*:not(iframe,video,object)").contents().filter(function(){return 8==this.nodeType}).each(function(p,e){if(e.nodeValue&&(-1!==e.nodeValue.indexOf("Performance optimized by W3 Total Cache")||-1!==e.nodeValue.indexOf("Cached page generated by WP-Super-Cache")))return g_ppsIsPageCached=!0,!1}),g_ppsIsPageCachedChecked=!0,g_ppsIsPageCached)}function _ppsUpdatePopupNonces(p){if(!p._nonces_updated){var e=ppsGetPopupShell(p).find("form"),s=[],o=["ppsSubscribeForm","ppsLoginForm","ppsRegForm"];e&&e.length&&e.each(function(){for(var p=0;p http://www.tutorialspanel.com/wp-content/plugins/social-pug/assets/js/front-end.js
jQuery( function($) {
/**
* Pull share counts
*
*/
$(document).ready( function() {
if( typeof dpsp_ajax_url != 'undefined' && typeof dpsp_ajax_pull_post_share_counts_data != 'undefined' ) {
$.post( dpsp_ajax_url, dpsp_ajax_pull_post_share_counts_data, function( response ) { });
}
});
/*
* Position sidebar icons vertically
*
*/
$(document).ready( function() {
$('#dpsp-floating-sidebar').css('top', ( window.innerHeight - $('#dpsp-floating-sidebar').height() ) / 2 );
});
$(window).on( 'resize', function() {
$('#dpsp-floating-sidebar').css('top', ( window.innerHeight - $('#dpsp-floating-sidebar').height() ) / 2 );
});
/*
* Open Pinterest overlay to select which image to pin when
* clicking on a Pin button without media attached
*
*/
$(document).ready( function() {
$('.dpsp-network-btn.dpsp-pinterest').click( function(e) {
if( $(this).attr('href') != '#' )
return false;
e.preventDefault();
var elem = document.createElement('script');
elem.setAttribute('type', 'text/javascript');
elem.setAttribute('charset', 'UTF-8');
elem.setAttribute('src', 'https://assets.pinterest.com/js/pinmarklet.js');
document.body.appendChild(elem);
});
});
/*
* Open share links in a pop-up window
*
*/
$(document).on( 'click', '.dpsp-network-btn', function(e) {
if( $(this).hasClass('dpsp-twitter') && typeof window.twttr != 'undefined' )
return;
e.preventDefault();
if( $(this).attr('href') == '#' )
return false;
$(this).blur();
window.open( $(this).attr('href'),'targetWindow', "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=700,height=300,top=200,left=" + ($(window).innerWidth() - 700)/2 );
});
});