1var popup_delay_enable = wpb_frontend_js.popup_delay_enable; 2var popup_delay = wpb_frontend_js.popup_delay; 3var popup_close_countdown = wpb_frontend_js.popup_close_countdown; 4var show_popup_cookie = wpb_frontend_js.show_popup_cookie; 5var show_countdown_message = wpb_frontend_js.show_countdown_message; 6var transition = wpb_frontend_js.popup_type; 7var autoclose_enable = wpb_frontend_js.autoclose_enable; 8 9(function ($) { 10 $(function () { 11 $(".wpb-text-popup").niceScroll(); 12 // alert(popup_delay); 13 // alert(popup_delay_enable) 14 // alert(transition); 15 // alert(popup_close_countdown); 16 // alert(show_countdown_message); 17 18 $('.wpb_close_btn, #wpb_overlay, .wpb_overlay').click(function () { 19 hide(transition); 20 $('body').css('overflow', 'inherit'); 21 }); 22 23 var popupdelay_sec = (popup_delay_enable == 'yes' && popup_delay != '') ? popup_delay * 1000 : 100; 24 25 26 Timeout = setTimeout(function () { 27 show(transition); 28 29 }, popupdelay_sec); 30 31 32 33 function show(transition) { 34 $('.wpb-preview-title').show(); 35 $('#wpb_overlay').css('display', 'block'); 36 if (transition == 'fade') { 37 $('.wpb-main-wrapper').fadeIn({queue: false, duration: 'slow'});//fadein 38 $('.wpb-main-wrapper').animate({top: '0'}, 'slow');//from top 39 40 } else if (transition == 'slide-from-top') { 41 $('.wpb-main-wrapper').css('top', '-50%');//from top 42 $('.wpb-main-wrapper').fadeIn({queue: false, duration: 'slow'});//from top 43 $('.wpb-main-wrapper').animate({top: '0'}, 'slow');//from top 44 45 } else if (transition == 'slide-from-top2') { 46 $('.wpb-main-wrapper').css('top', '-50%');//from top 47 $('.wpb-main-wrapper').fadeIn({queue: false, duration: 'fast'});//from top 48 $('.wpb-main-wrapper').animate({top: '0'}, 'fast');//from top 49 50 } else if (transition == 'zoom') { 51 $('.wpb-main-wrapper').css('width', '0%');//from top 52 $('.wpb-main-wrapper').css('height', '0%');//from top 53 $('.wpb-main-wrapper').fadeIn({queue: false, duration: 50}).css({top: 0, left: 0}); 54 $('.wpb-main-wrapper').animate({ 55 top: '0', 56 left: '0', 57 height: '100%', 58 width: '100%', 59 opacity: 1, 60 display: 'block' 61 },1000); 62 63 64 } else if (transition == 'slide-fix') { 65 $('.wpb-main-wrapper').css('top', '0'); 66 $('.wpb-main-wrapper').slideDown("slow"); 67 $('.wpb-main-wrapper').animate({ display: 'block' }); 68 69 } else 70 { 71 72 } 73 74 if (autoclose_enable == 'yes' && popup_close_countdown != '') { 75 if (show_countdown_message == 'yes' && popup_close_countdown != '') { 76 countdown(popup_close_countdown); 77 } 78 79 Timeout1 = setTimeout(function () { 80 hide(transition); 81 }, popup_close_countdown * 1000); 82 } 83 84 if (show_popup_cookie != '' && show_popup_cookie == 1) { 85 delete_cookie('wp_popup_once');//delete cookie 86 } 87 88 }// end of show 89 90 function hide(transition) { 91 $('.wpb-preview-title').hide(); 92 if (transition == 'normal') { 93 94 } else if (transition == 'fade') { 95 $('.wpb-main-wrapper').fadeOut({queue: false, duration: 'slow'}); 96 97 } else if (transition == 'slide-from-top') { 98 $('.wpb-main-wrapper').fadeOut({queue: false, duration: 'slow'}); 99 $('.wpb-main-wrapper').animate({top: '90%'}, 'slow'); 100 101 } else if (transition == 'slide-from-top2') { 102 $('.wpb-main-wrapper').fadeOut({queue: false, duration: 'slow'}); 103 $('.wpb-main-wrapper').animate({top: 90}, 'slow'); 104 105 } else if (transition == 'slide-from-button') { 106 $('.wpb-main-wrapper').fadeOut({queue: false, duration: 'slow'}); 107 $('.wpb-main-wrapper').animate({top: '55%'}, 'slow'); 108 109 } else if (transition == 'zoom') { 110 $('.wpb-main-wrapper').fadeOut({queue: false, duration: 'slow'}); 111 $('.wpb-main-wrapper').animate({ 112 top: 0, 113 left: 0, 114 height: 0, 115 width: 0, 116 opacity: 0.5 117 }); 118 119 } else if (transition == 'slide-fix') { 120 $('.wpb-main-wrapper').slideUp("slow"); 121 122 } else { 123 $('.wpb-main-wrapper, #wpb_overlay').css('display', 'none');//normal 124 125 } 126 127 $('#wpb_overlay').fadeOut({queue: false, duration: 'slow'}); 128 129 if (show_popup_cookie != '' && show_popup_cookie == 2) { 130 checkCookie();//check and set the cookie 131 } 132 133 }//end of hide 134 135 function setCookie(cname, cvalue, exdays) { 136 var d = new Date(); 137 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 138 var expires = "expires=" + d.toGMTString(); 139 document.cookie = cname + "=" + cvalue + "; " + expires; 140 } 141 142 function getCookie(cname) { 143 var name = cname + "="; 144 var ca = document.cookie.split(';'); 145 for (var i = 0; i < ca.length; i++) { 146 var c = ca[i];
147 while (c.charAt(0) == ' ') 148 c = c.substring(1); 149 if (c.indexOf(name) == 0) { 150 return c.substring(name.length, c.length); 151 } 152 } 153 return ""; 154 } 155 156 function checkCookie() { 157 var popup_cookie = getCookie("wp_popup_once"); 158 if (popup_cookie != "") { 159 //cookie is set 160 } else { 161 popup_cookie = 'popup_show_once'; 162 if (popup_cookie != "" && popup_cookie != null) { 163 setCookie("wp_popup_once", popup_cookie, 1); 164 } 165 } 166 } 167 168 function delete_cookie(name) { 169 document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 170 } 171 172 function countdown(counter) { 173 interval = setInterval(function () { 174 $('.wpb_countdown').text(counter); 175 if (counter == 0) { 176 // Display a login box 177 clearInterval(interval); 178 hide(); 179 } 180 counter--; 181 }, 1000); 182 } 183 184 185 186 }); 187}(jQuery));//main function end 188
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.