1function apsa_can_run_ads() { 2 3 jQuery('body').append('<div class="afs_ads ad-top ad-banner google-sponsored google-ad apsa-can-run-ads" style="position:fixed !important; top:-9999px !important;left:-9999px !important;visibility:hidden !important;width:1px !important;height:1px !important;"></div>'); 4 var canRunAds = !(jQuery('.apsa-can-run-ads').css('display') == 'none'); 5 jQuery('.apsa-can-run-ads').remove(); 6 return canRunAds; 7} 8 9/* 10 * when add-blocker active show warning message 11 */ 12 13function apsa_show_warning(warText, warEnabled) { 14 if (apsa_can_run_ads() == false && warEnabled == 'true' && apsa_get_cookie('apsa_adblock_warning') != 'no') { 15 jQuery('.apsa-warning-message').remove(); 16 if (warText == '') { 17 warText = apsa_warning_default; 18 } 19 var warningDiv = '<div class="apsa-warning-message"><div class="apsa-warning-content">' + warText + '</div><div class="apsa-war-close"><span class="apsa-warning-close"></span></div></div>'; 20 jQuery('body').append(warningDiv); 21 } 22 //close warning message 23 jQuery('.apsa-warning-close').on('click', function () { 24 jQuery('.apsa-warning-message').remove();
25 apsa_set_cookie('apsa_adblock_warning', 'no'); 26 jQuery(window).trigger('resize'); 27 }); 28} 29 30/** Document ready actions */ 31jQuery(document).ready(function ($) { 32 33 if (typeof apsa_extra_options === 'object' && apsa_extra_options.apsa_cache_enabled == 'true') { //===========Custom=============== 34 /* 35 * ajax for get extra options 36 */ 37 $.ajax({ 38 type: "POST", 39 url: apsa_ajax_url, 40 dataType: "json", 41 data: { 42 action: "apsa_ajax_get_options", 43 type: "view", 44 }, 45 success: function (res) { 46 if (res) { 47 // add warning message 48 apsa_show_warning(res.apsa_warning_text, res.apsa_warning_text_enabled); 49 } 50 }, 51 }); 52 } else { 53 if (typeof apsa_options === 'object' && apsa_options.apsa_warning_text) {//===========Custom=============== 54 apsa_show_warning(apsa_options.apsa_warning_text, apsa_options.apsa_warning_text_enabled); 55 } 56 } 57 58 /** element links redirect */ 59 $(document).on('click', ".apsa-element-link", function (e) { 60 61 if (e.target == this || $(e.target).closest('.apsa-element-link').length) { 62 63 var link_to = $(this).attr("data-apsa-link"); 64 var link_type = $(this).attr("data-apsa-link-target"); 65 66 if (link_type === '_window') { 67 link_type = '_blank'; 68 var location = 'scrollbars=yes'; 69 } 70 if (link_to !== "") { 71 window.open(link_to, link_type, location); 72 } else { 73 return; 74 } 75 76 /** Request for save visit into Db */ 77 var element_id = $(this).closest("[data-apsa-element-id]").attr("data-apsa-element-id"); 78 79 apsa_add_event(element_id, 'visit'); 80 } 81 82 e.stopPropagation(); 83 }); 84 85 86 87}); 88 89/** 90 * *======= Hook before element show ====== 91 * @param {obj} that 92 * @param {obj} options 93 * @returns {obj} 94 */ 95function apsa_before_element_show(that, options) { 96 if (options.camp_type === "embed" && jQuery(that).attr('data-apsa-animation-name') === "animation-none") { 97 98 setTimeout(function () { 99 /** 100 * caling resize functions 101 */ 102 var slug = that.find('.apsa-custom-popup-wrap,.apsa-custom-embed-wrap,.apsa-custom-sticky-wrap').attr('data-slug') 103 var element = that.find('.apsa-custom-popup-wrap,.apsa-custom-embed-wrap,.apsa-custom-sticky-wrap'); 104 105 if (typeof window["apsa_" + slug + "_resize"] == 'function') { 106 window["apsa_" + slug + "_resize"](element, true); 107 } 108 109 }, 300) 110 } 111 return options; 112} 113// actions when element show 114function apsa_element_show(that, options) { 115 //===========Custom=============== 116 117 setTimeout(function () { 118 /** 119 * caling resize functions 120 */ 121 var slug = that.find('.apsa-custom-popup-wrap,.apsa-custom-embed-wrap,.apsa-custom-sticky-wrap').attr('data-slug') 122 var element = that.find('.apsa-custom-popup-wrap,.apsa-custom-embed-wrap,.apsa-custom-sticky-wrap'); 123 124 if (typeof window["apsa_" + slug + "_resize"] == 'function') { 125 window["apsa_" + slug + "_resize"](element, true); 126 } 127 128 }, 300) 129 130//===========Custom=============== 131 // for background campaigns element 132 if (options["camp_type"] == 'background') { 133 if (typeof options["bg_link_to"] == "string" && options["bg_link_to"] !== "") { 134 that.addClass("apsa-element-link"); 135 that.attr("data-apsa-link", options["bg_link_to"]); 136 that.attr("data-apsa-link-target", options["bg_link_type"]); 137 } 138 } 139} 140 141 142//===========Custom=============== 143 144/** 145 *======= Calling template hook on window resize ===== 146 * 147 */ 148(function () { 149 var apsa_clear_setTimeout; 150 jQuery(window).on('resize', function () { 151 clearTimeout(apsa_clear_setTimeout); 152 apsa_clear_setTimeout = setTimeout(function () { 153 if (jQuery('.apsa-custom-popup-wrap,.apsa-custom-embed-wrap,.apsa-custom-sticky-wrap').length) { 154 jQuery('.apsa-custom-popup-wrap,.apsa-custom-embed-wrap,.apsa-custom-sticky-wrap').each(function () { 155 156 var slug = jQuery(this).attr('data-slug'); 157 if (typeof window["apsa_" + slug + "_resize"] == 'function') { 158 window["apsa_" + slug + "_resize"](this); 159 160 } 161 }) 162 } 163 }, 200) 164 165 }); 166})()
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.