1jQuery(function($) { 2"use strict"; 3 4 5 6 $(window).on('load', function(){ 7 let url = new URL(window.location.href); 8 let local_popup = url.searchParams.get('trigger-pp'); // is the string "of popup name" 9 10 if ( local_popup) { 11 $(document).find('.'+local_popup).first().trigger('click'); 12 } 13 }); 14 15 $('.pupup-add-license').on('click', function(e){ 16 e.preventDefault(); 17 show_popup_content('#pupup-add-license', 'add-license'); 18 }); 19 20 $('#temps-use-but').on('click', function(e){ 21 e.preventDefault(); 22 $('html').addClass('overflow-hidden'); 23 show_popup_content('#temps-use', 'terms'); 24 }); 25 26 27 $('.login-popup').on('click', function (e) { 28 show_popup_content('#login-popup', 'login'); 29 }); 30 31 32 $(document).on('click', '.et_sing-up-holder', function(e){ 33 e.preventDefault(); 34 show_popup_content('#subscription-account-popup', 'subscription-account'); 35 }); 36 37 $('.et-deregister-domain').on('click', function(e){ 38 e.preventDefault(); 39 show_popup_content('#popup-deregister-domain', 'deregister-domain', $(this).attr('data-args')); 40 }); 41 42 43 $('.open-user-licences-block').on('click', function(e){ 44 e.preventDefault(); 45 show_popup_content('#popup-licenses', 'licenses', $(this).attr('data-args')); 46 }); 47 48 $('.open-user-active-domains-block').on('click', function(e){ 49 e.preventDefault(); 50 show_popup_content('#popup-active-domains', 'active-domains', $(this).attr('data-args')); 51 }); 52 53 $('.open-topic-plugins-block').on('click', function(e){ 54 e.preventDefault(); 55 show_popup_content('#popup-topic-plugins-block', 'topic-plugins-block', $(this).attr('data-args')); 56 }); 57 58 $('.open-lecense-info-block').on('click', function(e){ 59 e.preventDefault(); 60 show_popup_content('#popup-lecense-info-block', 'lecense-info-block', $(this).attr('data-args')); 61 }); 62 63 64 $('.solved-simular-topics').on('click', function(e){ 65 e.preventDefault(); 66 show_popup_content('#popup-solved-simular-topics', 'solved-simular-topics', $(this).attr('data-args')); 67 }); 68 69 70 $('.et_envato-search-popup').on('click', function(e){ 71 show_popup_content('#et_envato-search-popup', 'envato-search'); 72 }); 73 74 $(document).on('click', '.et_sing-up-holder', function(e){ 75 e.preventDefault(); 76 show_popup_content('#subscription-account-popup', 'subscription-account'); 77 }); 78 79 $('.manage-subscription-domains').on('click', function(e){ 80 e.preventDefault(); 81 console.log('sdfsf'); 82 show_popup_content('#popup-subscription-domains', 'subscription-domains', $(this).attr('data-args')); 83 }); 84 85 86 $('.bbp-user-submit-topic-link a').on('click', function(e){ 87 e.preventDefault() 88 if ( $('.topic-popup-button').length ) { 89 $('.topic-popup-button').first().trigger('click'); // use first because there are 2 button in header and mobile header menu at once 90 let has_href = $('.topic-popup-button').first().attr('href'); 91 if ( !!has_href ) 92 window.location.href = has_href; 93 } 94 else if ($('.header-new-topic-btn').length ) 95 $('.header-new-topic-btn').first().trigger('click'); 96 else 97 $('.open-new-popup').first().trigger('click'); 98 }); 99 100 101 $('.topic-popup-button').on('click', function(e){ 102 $(this).addClass('loading'); 103 $(this).find('.spinner').addClass('loading'); 104 }); 105 106 $('.popup-no-license').on('click', function(e){ 107 e.preventDefault(); 108 $(this).addClass('loading'); 109 $(this).find('.spinner').addClass('loading'); 110 setTimeout( function() { 111 $('.topic-popup-button').removeClass('loading'); 112 $('.topic-popup-button').find('.spinner').removeClass('loading'); 113 }, 250 ); 114 show_popup_content('#popup-no-license', 'no-license'); 115 }); 116 117 $(document).on('click', '.page-template-account #popup-no-license .button-new', function(e) { 118 e.preventDefault(); 119 window.location.href = $(this).attr('href'); 120 $(this).parents('.popup-content').find('.button-close').trigger('click'); 121 });
122 123 124 $(document).on('popup-deactivation-support-expaired', function(e){ 125 e.preventDefault(); 126 $(this).addClass('loading'); 127 $(this).find('.spinner').addClass('loading'); 128 setTimeout( function() { 129 $('.topic-popup-button').removeClass('loading'); 130 $('.topic-popup-button').find('.spinner').removeClass('loading'); 131 }, 250 ); 132 show_popup_content('#popup-deactivation-support-expaired', 'deactivation-support-expaired'); 133 }); 134 135 136 $('.popup-available-forums').on('click', function(e){ 137 e.preventDefault(); 138 $(this).addClass('loading'); 139 $(this).find('.spinner').addClass('loading'); 140 show_popup_content('#popup-available-forums', 'available-forums', $(this).attr('data-args')); 141 }); 142 143 $('.popup-daily-block').on('click', function(e){ 144 e.preventDefault(); 145 $(this).addClass('loading'); 146 $(this).find('.spinner').addClass('loading'); 147 show_popup_content('#popup-daily-block', 'daily-block', $(this).attr('data-args')); 148 }); 149 150 151 152 $('.popup-expiared-license').on('click', function(e){ 153 e.preventDefault(); 154 $(this).addClass('loading'); 155 $(this).find('.spinner').addClass('loading'); 156 show_popup_content('#popup-expiared-license', 'expiared-license', $(this).attr('data-args')); 157 }); 158 159 $(document).on('click', '.popup-expiared-license-xstore', function(e){ 160 e.preventDefault(); 161 $(this).addClass('loading'); 162 $(this).find('.spinner').addClass('loading'); 163 show_popup_content('#popup-expiared-license-xstore', 'expiared-license-xstore', $(this).attr('data-args')); 164 165 // $(document).on('select2:select', '#et_topic_purchase_code', function (e) { 166 $(document).find('#et_topic_purchase_code').select2('close'); 167 // }); 168 }); 169 170 $('.popup-expiared-subscription').on('click', function(e){ 171 e.preventDefault(); 172 $(this).addClass('loading'); 173 $(this).find('.spinner').addClass('loading'); 174 show_popup_content('#popup-expiared-subscription', 'expiared-subscription'); 175 }); 176 177 $(document).on('click', '.open-subscriptions-popup', function(e){ 178 e.preventDefault(); 179 $(this).addClass('loading'); 180 $(this).find('.spinner').addClass('loading'); 181 show_popup_content('#open-subscriptions-popup', 'subscriptions'); 182 }); 183 184 185 $('.et_footer-sibwp .sib-default-btn, .et_footer-sibwp').on('click', function(e){ 186 e.preventDefault(); 187 show_popup_content('#popup-sibwp', 'sibwp'); 188 }); 189 190 191 192 $(document).on('click', '#popup-sibwp .popup-mail-subscription.active', function(e){ 193 $('#popup-sibwp .sib_signup_form').trigger('submit'); 194 $(document).find('#popup-sibwp').find('.button-close').trigger('click'); 195 $(document).find('#popup-sibwp').remove(); 196 197 // $(document).find('#popup-sibwp .sib-default-btn').trigger('click'); 198 }); 199 200 201 // $(document).on('click', '#popup-sibwp .sib-default-btn', function(e){ 202 // //$(this).removeClass('active'); 203 // $(document).find('#popup-sibwp').find('.button-close').trigger('click'); 204 205 // $(document).find('#popup-sibwp').remove(); 206 207 // //grecaptcha.reset(); 208 // }); 209 210 // $(document).on('click', '#popup-sibwp .sib-default-btn:not(.active)', function(e){ 211 // e.preventDefault(); 212 // var _this = $(this); 213 // $.ajax({
214 // method: "POST", 215 // url: ajaxurl, 216 // data: { 217 // action: 'et_check_grecaptcha', 218 // greresponse: grecaptcha.getResponse(), 219 // }, 220 // success: function (response) { 221 // if (response.success) { 222 // $(document).find('popup-mail-subscription').addClass('active'); 223 // _this.addClass('active'); 224 // _this.trigger('click'); 225 // } 226 // }, 227 // error: function(){ 228 // }, 229 // complete: function () { 230 // } 231 // }); 232 // }); 233 234 235 236 237 238 239 240 241 242 $('.rating .entry').on('click', function (e) { 243 $(this).removeClass('disabled').addClass('active').siblings().removeClass('active').addClass('disabled'); 244 var rating = $(this).data('rating'); 245 var title = $('.theme-support-preview h4.h4.regular').text(); 246 var forum_id = $(this).closest('.rating').data('forum_id'); 247 $(this).closest('.rating').css('opacity', '0.5'); 248 // $.ajax({ 249 // type: 'POST', 250 // url: ajaxurl, 251 // dataType: 'json', 252 // data: { 253 // 'action': 'etheme_raiting', 254 // 'title': title, 255 // 'rating': rating, 256 // 'forum_id': forum_id 257 // } 258 // }) 259 // .done(function (response) { 260 // $('.rating').css('opacity', '1'); 261 show_popup_content('#info-popup', 'info'); 262 // }); 263 264 return false; 265 }); 266 267 268 269 // **********************************************************************// 270 // rate theme now 271 // **********************************************************************// 272 $(document).find('#rate-theme-now').on('click', function(e) { 273 274 const forumUrl = $(document).find('.open-five-starts-popup').data('forum_url'); 275 276 // Remember the link href 277 const href = 'https://themeforest.net/item/xstore-responsive-woocommerce-theme/reviews/15780546'; 278 279 // Don't follow the link 280 event.preventDefault(); 281 282 // Do the async thing 283 setTimeout(function() { 284 // This is the completion callback for the asynchronous thing; 285 // go to the link 286 $(document).find('.popup-wrapper').removeClass('active'); 287 $(document).find('#five-stars-popup').removeClass('active'); 288 window.open(href); 289 290 if (forumUrl) { 291 window.location.href = forumUrl; 292 } 293 }, 100); 294 }); 295 296 $(document).find('#five-stars-popup .button-close, #five-stars-popup .layer-close').on('click', function(e) { 297 const forumUrl = $(document).find('.open-five-starts-popup').data('forum_url'); 298 if (forumUrl) { 299 window.location.href = forumUrl; 300 } 301 }); 302 303 304 // **********************************************************************// 305 // open five starts popup and close topic confirm 306 // **********************************************************************// 307 $('.open-five-starts-popup').on('click', function(e) { 308 const topicId = $(this).data('topic_id'); 309 let topic_url = $(this).data('topic_url'); 310 $(document).find('.ajax-load').fadeIn(); 311 312 $.ajax({
313 url: ajaxurl, 314 method: 'POST', 315 data: { 316 'action': 'et_ajax_close_recent_topic', 317 'topicId': topicId, 318 }, 319 dataType: 'json', 320 success: function (response) { 321 322 $(document).find('.etheme-single-user-topic').find("[data-topic_id='" + topicId + "']") 323 .closest('li') 324 .remove(); 325 326 if ($(document).find('.bbp-user-section').children().length === 0) { 327 $(document).find('.bbp-user-section').html('<p class="sa size-14 grey-semi">No topics have been created.</p><div class="empty-space col-xs-b10"></div>'); 328 } 329 330 $(document).find('.ajax-load').fadeOut(); 331 332 show_popup_content('#five-stars-popup', 'five-stars'); 333 334 if ( !!topic_url ) { 335 window.open(topic_url); 336 } 337 }, 338 error: function (error) { 339 console.log('error: ', error); 340 } 341 }); 342 343 e.preventDefault(); 344 }); 345 346 347 348 349 $(document).on('click', '.popup-wrapper .button-close, .popup-wrapper .layer-close', function(e){ 350 e.preventDefault(); 351 if ( $(this).parent().parent().attr('id') == 'black-friday-sale-popup' || $(this).parent().parent().attr('id') == 'mouse-leave-popup' || $(this).parent().parent().attr('id') == 'mouse-leave-popup-success') { 352 let mouse_leave = $(this).parent().parent().attr('id') == 'mouse-leave-popup' || $(this).parent().parent().attr('id') == 'mouse-leave-popup-success'; 353 let sale_popup = $(this).parent().parent().attr('id') == 'black-friday-sale-popup'; 354 let cookie_name = false; 355 let cookie_time = 7; 356 if ( mouse_leave ) 357 cookie_name = 'mouse_leave_popup_shown'; 358 if ( sale_popup ) { 359 cookie_name = 'black_friday_sale_popup_shown'; 360 cookie_time = 0; 361 } 362 363 if ( !cookie_name ) return; 364 setCookiePopups(cookie_name, 'false', 7); 365 366 function setCookiePopups (cname, cvalue, exdays) { 367 var d = new Date(); 368 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 369 var expires = "expires=" + d.toUTCString(); 370 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 371 }; 372 } 373 // _functions.closePopup(); 374 hide_popup(); 375 376 remove_popup(); 377 378 }); 379 380 381 jQuery(document).ready(function($){ 382 $(document).on('click', '.close-top-bar', function (){ 383 $(document).find('#top-bar, .top-bar-depended').slideUp( 'slow'); 384 setCookie('top_bar_shown', 'false', 7); 385 386 function setCookie (cname, cvalue, exdays) { 387 var d = new Date(); 388 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 389 var expires = "expires=" + d.toUTCString(); 390 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 391 }; 392 393 }); 394 395 $(document).on('click', '.check-out-now-popup', function (){ 396 $(document).find('.popup-wrapper').removeClass('active'); 397 $(document).find('#mouse-leave-popup').removeClass('active'); 398 }); 399 400 function getCookiePopup (cname) { 401 var name = cname + "="; 402 var ca = document.cookie.split(';'); 403 for (var i = 0; i < ca.length; i++) { 404 var c = ca[i]; 405 while (c.charAt(0) == ' ') { 406 c = c.substring(1); 407 } 408 if (c.indexOf(name) == 0) { 409 return c.substring(name.length, c.length); 410 } 411 } 412 return ""; 413 }; 414 415 416 // if ( getCookiePopup('black_friday_sale_popup_shown') !== 'false' ) { 417 // if ($(document).find('.popup-wrapper').hasClass('active')) return; 418 // show_popup_content('#black-friday-sale-popup', 'black-friday-sale'); 419 // } 420 421 if ( false ) { 422 // temporary commented popup mouseleave
423 // if ( getCookiePopup('mouse_leave_popup_shown') !== 'false' && !$('body').hasClass('logged-in') ) { 424 // if ( ($('body').hasClass('page-template-home') || $('body').hasClass('post-type-archive-product') ) && getCookiePopup('mouse_leave_popup_shown') !== 'false' ) { 425 setTimeout(function (){ 426 $(document).on('mouseleave', function (event) { 427 // double check because if user close the popup and mouseout then it will shows again 428 if ( getCookiePopup('mouse_leave_popup_shown') !== 'false' ) { 429 if ($(document).find('.popup-wrapper').hasClass('active')) return; 430 show_popup_content('#mouse-leave-popup', 'mouse-leave'); 431 } 432 }); 433 }, 1000 * 90); // 1min 30sec timeout 434 $(document).find('#mouse-leave-popup').find('#sib_captcha').slideUp(); 435 $(document).on('change input', '#mouse-leave-popup form, #mouse-leave-popup form input', function() { 436 $(document).find('#mouse-leave-popup').find('#sib_captcha').slideDown(); 437 }) 438 $(document).on('submit', '#mouse-leave-popup form', function () { 439 // removed captcha because registration is not working ok 440 // if (isEmail($(this).find('input[type=email]').val()) && $(this).find('input[type=checkbox]').is(':checked') && isGrecapchaValid()) { 441 if (isEmail($(this).find('input[type=email]').val()) && $(this).find('input[type=checkbox]').is(':checked') ) { 442 setTimeout(function () { 443 $(document).find('.popup-wrapper').addClass('active'); 444 $(document).find('#mouse-leave-popup').removeClass('active'); 445 // window.location.href = 'https://www.8theme.com?et-open-cc=yes/#price-section'; // coupon code 446 447 show_popup_content('#mouse-leave-popup-success', 'mouse-leave-success'); 448 449 setCookiePopups2('mouse_leave_popup_shown', 'false', 7); 450 }, 1000); 451 } 452 453 function isEmail(email) { 454 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 455 return regex.test(email); 456 } 457 458 function setCookiePopups2 (cname, cvalue, exdays) { 459 var d = new Date(); 460 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 461 var expires = "expires=" + d.toUTCString(); 462 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 463 }; 464 465 function isGrecapchaValid() { 466 if ( $(document).find('#g-recaptcha-response').length ) { 467 var recaptcha = $("#g-recaptcha-response").val(); 468 if (recaptcha === "") { 469 event.preventDefault(); 470 return false; 471 } 472 else { 473 return true; 474 } 475 } 476 else { 477 return true; 478 } 479 } 480 }); 481 } 482 483 }); 484 485
486 function show_popup_content(selector, template, args) { 487 if ( $(selector).length ){ 488 $('.popup-wrapper').addClass('active'); 489 $(selector).addClass('active'); 490 $('.topic-popup-button, .open-subscriptions-popup').removeClass('loading'); 491 $('.topic-popup-button').find('.spinner').removeClass('loading'); 492 } else { 493 load_content(template, args); 494 } 495 } 496 497 function hide_popup() { 498 $('.popup-wrapper, .popup-content').removeClass('active'); 499 $('html').removeClass('overflow-hidden'); 500 $('#video-popup iframe').remove(); 501 } 502 503 function remove_popup() { 504 $('.popup-content.remove-popup').remove(); 505 } 506 507 function load_content(template, args) { 508 var popup_wrapper = $('.popup-wrapper'); 509 $.ajax({ 510 method: "POST", 511 url: ajaxurl, 512 data: { 513 action: 'et_ajax_panel_popup', 514 template: template, 515 args: args 516 }, 517 success: function (response) { 518 if (response.content) { 519 popup_wrapper.append(response.content); 520 521 if (template == 'sibwp') { 522 $(document).find('#popup-sibwp').find('.sib-email-area').after('<span class="button style-1 size-4 blockb popup-mail-subscription" rel="nofollow">Subscribe</span>'); 523 } 524 } 525 526 527 528 $('.popup-wrapper').addClass('active'); 529 }, 530 complete: function () { 531 $('.topic-popup-button, .open-subscriptions-popup').removeClass('loading'); 532 $('.topic-popup-button').find('.spinner').removeClass('loading'); 533 //_this.removeClass('et-no-events'); 534 } 535 }); 536 } 537 538});
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.