1(function ($) { 2 "use strict"; 3 4 jQuery(document).ready(function ($) { 5 6 var windowSize = $(window).width(); 7 l18W(); 8 stm_services_carousel(); 9 $(window).load(function () { 10 l18W(); 11 if ($('html').hasClass('stm-site-preloader')) { 12 $('html').addClass('stm-site-loaded'); 13 14 setTimeout(function () { 15 $('html').removeClass('stm-site-preloader stm-site-loaded'); 16 }, 250); 17 18 $(window).on('onbeforeunload', function (e) { 19 $('html').addClass('stm-site-preloader stm-after-hidden'); 20 }); 21 22 if ($('a[href^=mailto], a[href^=skype], a[href^=tel]').on('click', function (e) { 23 setTimeout(function () { 24 $('html').removeClass('stm-site-preloader stm-site-loaded'); 25 }); 26 })) ; 27 } 28 }); 29 30 $(window).resize(function () { 31 l18W(); 32 stm_stretch_column(); 33 full_height_columns(); 34 }); 35 36 $.fn.is_on_screen = function () { 37 var win = $(window); 38 var viewport = { 39 top: win.scrollTop(), 40 left: win.scrollLeft() 41 }; 42 viewport.right = viewport.left + win.width(); 43 viewport.bottom = viewport.top + win.height(); 44 45 var bounds = this.offset(); 46 bounds.right = bounds.left + this.outerWidth(); 47 bounds.bottom = bounds.top + this.outerHeight(); 48 49 return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); 50 }; 51 52 $(".stm-register-form form").submit(function (e) { 53 e.preventDefault(); 54 $.ajax({ 55 type: "POST", 56 url: ajaxurl, 57 dataType: 'json', 58 context: this, 59 data: $(this).serialize() + '&action=stm_custom_register&security=' + stm_custom_register, 60 beforeSend: function () { 61 $(this).find('input').removeClass('form-error'); 62 $('.stm-validation-message').empty(); 63 }, 64 success: function (data) { 65 66 for (var err in data.errors) { 67 $(this).find('input[name=' + err + ']').addClass('form-error'); 68 } 69 70 if (data.message) { 71 var message = $('<div class="stm-message-ajax-validation heading-font">' + data.message + '</div>').hide(); 72 73 $(this).find('.stm-validation-message').append(message); 74 message.slideDown('fast'); 75 } 76 } 77 }); 78 }); 79 80 $(document).on("click", ".load_more_btn", function (e) { 81 e.preventDefault(); 82 var page = $(this).attr("data-page"); 83 var load_by = $(this).attr("data-load"); 84 var filter = $(this).attr("data-filter"); 85 var category = $(this).attr('data-category'); 86 $.ajax({ 87 url: ajaxurl, 88 type: "POST", 89 dataType: "json", 90 data: "&page=" + page + "&load_by=" + load_by + "&category=" + category + "&filter=" + filter + "&action=stm_ajax_load_events&security=" + stm_ajax_load_events, 91 context: this, 92 beforeSend: function (data) { 93 $(this).parent().addClass("event_posts_loading"); 94 }, 95 success: function (data) { 96 $(this).parent().removeClass("event_posts_loading"); 97 $(".stm_events_modern_list ").append(data.html); 98 $(this).attr("data-page", data.new_page); 99 if (!data.load_more) { 100 $(this).remove(); 101 } 102 } 103 }); 104 }); 105 106 $('.scroll_to_event_form').on('click', function (e) { 107 event.preventDefault(); 108 $('html,body').animate({scrollTop: $(this.hash).offset().top}, 500); 109 }); 110 111 $('.show_popup').on('click', function (e) { 112 $(this).parents().find('#video').addClass('video_popup_box') 113 }); 114 115 stm_stretch_column(); 116 117 function stm_stretch_column() { 118 $('.wpb_column[data-stretch]').each(function () { 119 var stretch = $(this).data('stretch'); 120 var xPos = $(this).offset().left; 121 var wW = $(window).width(); 122 var xW = $(this).width(); 123 124 var value = wW - (xW + xPos); 125 if (stretch == 'left') { 126 value = xPos; 127 } 128 129 $(this).find('.vc_column-inner').css('width', xW + value + 'px'); 130 $(this).find('.vc_column-inner').css('margin-' + stretch, '-' + value + 'px'); 131 }); 132 }; 133 134 //Full height 135 full_height_columns(); 136 137 function full_height_columns() { 138 139 $(".full_height_columns").each(function () { 140 var full_height_columns = $(this).find(".wpb_column:first").height(); 141 $(this).find("iframe").css("height", full_height_columns); 142 }); 143 }; 144 145 stm_ajax_add_event_member(); 146 147 function stm_ajax_add_event_member() { 148 $("#event-members-form").on("submit", function (event) { 149 event.preventDefault(); 150 151 var $this = $(this), 152 eventID = parseInt($($this).find('input[name="event_member_id"]').val()), 153 addedEvents = localStorage.getItem('addedEvents'), 154 eventAdded = false;
155 156 if (addedEvents) { 157 addedEvents = JSON.parse(addedEvents); 158 eventAdded = $.inArray(eventID, addedEvents) > -1; 159 } 160 if (!eventAdded) { 161 $.ajax({ 162 url: ajaxurl, 163 type: "POST", 164 dataType: "json", 165 context: this, 166 data: $(this).serialize() + "&action=stm_ajax_add_event_member&security=" + stm_ajax_add_event_member_sc, 167 beforeSend: function () { 168 $(".alert-modal").remove(); 169 $(this).closest("form").find("input").removeClass("form-error"); 170 $(this).closest("form").find(".stm-ajax-loader").addClass("loading"); 171 }, 172 success: function (data) { 173 $(this).closest("form").find(".stm-ajax-loader").removeClass("loading"); 174 175 $(this).closest("form").find(".event-members-box").append('<div class="alert-modal alert alert-' + data.status + ' text-left">' + data.response + '</div>'); 176 for (var key in data.errors) { 177 $('#event-members-form input[name="' + key + '"]').addClass("form-error"); 178 } 179 if (!$('#event-members-form input[name="' + key + '"]').hasClass('form-error')) { 180 $(".event-members-box-table .event-attended-count").text(parseInt($(".event-members-box-table .event-attended-count").text()) + 1); 181 $(".event-attended-count.event-new-count").text(parseInt($(".event-attended-count.event-new-count").text()) + 1); 182 if (addedEvents) { 183 addedEvents.push(eventID); 184 } else { 185 addedEvents = [eventID]; 186 } 187 localStorage.setItem('addedEvents', JSON.stringify(addedEvents)); 188 $($this).find(".form__notice_success").fadeIn(300); 189 } 190 $("#event-members-form button").addClass("disabled").prop('disabled', true); 191 }, 192 complete: function (data) { 193 $("#event-members-form")[0].reset(); 194 } 195 }); 196 $(this).closest("form").find(".form-error").on("hover", function () { 197 $(this).removeClass("form-error"); 198 }); 199 } else { 200 $($this).find(".form__notice_information").fadeIn(300); 201 } 202 return false; 203 }); 204 } 205 206 $(".event_terms_conditions #event_terms_conditions").on("click", function (e) { 207 if ($(this).is(':checked')) { 208 $("#event-members-form button").removeClass("disabled").prop('disabled', false); 209 } else { 210 $("#event-members-form button").addClass("disabled").prop('disabled', true); 211 } 212 }); 213 214 $(".event_joining .show_event_list_form").on("click", function (e) { 215 var eventItemValId = $(this).parents(".item").find(".event-item-id").val(); 216 $(".stm_events_classic #event-members-form .event_member_id").val(eventItemValId); 217 $(".stm_events_list_form").show(); 218 $(this).parents(".item").find(".event-attended-count").addClass("event-new-count"); 219 }); 220 $(".notice__hide").on("click", function (e) { 221 $(".stm_events_list_form").hide(); 222 $("#event-members-form")[0].reset(); 223 $("#event-members-form .alert-modal").hide(); 224 $("#event-members-form .form__notice_information").hide(); 225 $(".stm_events_classic .item").find(".event-attended-count").removeClass("event-new-count"); 226 }); 227 228 $(".events_lessons_box .event_lesson_tabs:first-child").addClass("active"); 229 $('.events_lessons_box .event_lesson_tabs a').each(function (e) { 230 if ($(this).parent().hasClass("active")) { 231 $($(this).attr('href')).show(); 232 } 233 }); 234 $('.events_lessons_box .event_lesson_tabs a').on('click', function (e) { 235 $(this).parents(".events_lessons_box").find(".event_lesson_info").hide(); 236 $(this).parents(".events_lessons_box").find(".event_lesson_tabs").removeClass("active"); 237 $(this).parent().addClass("active"); 238 $($(this).attr("href")).show(); 239 return false;
240 }); 241 242 $(document).on("click", ".js-open-search-box", function () { 243 $(this).closest(".header_search").toggleClass("active"); 244 return false; 245 }); 246 247 if ($(".wpb_revslider_element").length && $('body').hasClass("header_style_7")) { 248 $(".wpb_revslider_element").closest(".vc_row-no-padding").addClass("stm-revslider-wrapper"); 249 } 250 251 $(document).on("click", "body", function (e) { 252 if (!$(e.target).closest(".header_search").length) { 253 $(".header_search").removeClass("active"); 254 255 } 256 }); 257 258 $("body .wpb_video_widget .wpb_wrapper .wpb_video_wrapper .play_video").on('click', function () { 259 $(this).parent().find('iframe').attr('allow', 'autoplay'); 260 $(this).parent().addClass('active'); 261 $(this).parent().find('iframe').attr('src', $(this).parent().find('iframe').attr('src') + '?autoplay=1').delay(); 262 $(this).hide(); 263 $(this).parent().find('img').hide(); 264 $(this).parent().find('.video').show(); 265 $(this).parent().addClass('show_video'); 266 return false; 267 }); 268 269 $(".staff_read_more").on('click', function () { 270 $(this).closest('.stm_staff_2').find('.full_description').slideToggle(150); 271 return false; 272 }); 273 274 $("select:not(.stm_not_select2)").each(function () { 275 if (!$(this).closest(".gfield").hasClass("stm_not_select2")) { 276 $(this).select2({width: '100%', minimumResultsForSearch: '-1'}); 277 } 278 }); 279 if ($("#rating").length) { 280 $("#rating").select2('destroy'); 281 } 282 283 if ($("#demos_switcher").length) { 284 $("#demos_switcher").select2("destroy"); 285 286 $("#demos_switcher").select2({ 287 templateResult: demosItemTemplate, 288 width: '100%', 289 minimumResultsForSearch: '-1' 290 }); 291 292 } 293 294 if ($('body').hasClass('customizer_page')) { 295 $(".customizer_page .ui-tabs").remove(); 296 } 297 298 $('#menu_toggle').on('click', function () { 299 $(this).toggleClass('open'); 300 $('.mobile_header .top_nav_mobile').slideToggle(300); 301 return false; 302 }); 303 $('#menu_toggle_button').on('click', function () { 304 $(this).toggleClass('open'); 305 $('.header_side').each(function () { 306 if (!$(this).hasClass('show')) { 307 $(this).addClass('show'); 308 if ($('body').hasClass('rtl')) { 309 $(this).animate({right: "0"}, 300); 310 } else { 311 $(this).animate({left: "0"}, 300); 312 } 313 } else { 314 $(this).removeClass('show'); 315 if ($('body').hasClass('rtl')) { 316 $(this).animate({right: "-100%"}, 600); 317 } else { 318 $(this).animate({left: "-100%"}, 600); 319 } 320 } 321 }); 322 323 return false; 324 }); 325 326 $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > a").after('<span class="arrow"><i></i></span>'); 327 $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > .sub-menu > .menu-item-has-children > a").after('<span class="arrow"><i class="fa fa-chevron-down"></i></span>'); 328 329 $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children .arrow").on('click', function () { 330 $(this).toggleClass('active'); 331 $(this).closest('li').find('ul').first().slideToggle(300); 332 }); 333 334 $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > a").on('click', function () { 335 if ($(this).attr('href') == '#') { 336 $(this).closest('li').find('ul').slideToggle(300); 337 $(this).closest('li').find('.arrow').toggleClass('active'); 338 } 339 }); 340 341 // Quantity actions 342 $('body').on('click', '.quantity_actions span', function () { 343 var quantityContainer = $(this).closest('.quantity'), 344 quantityInput = quantityContainer.find('.qty'), 345 quantityVal = quantityInput.attr('value'); 346 347 $('.shop_table.cart .button').removeAttr("disabled") 348 349 if ($(this).hasClass('plus')) { 350 quantityInput.attr('value', parseInt(quantityVal) + 1); 351 } else if ($(this).hasClass('minus')) { 352 if (quantityVal > 1) { 353 quantityInput.attr('value', parseInt(quantityVal) - 1); 354 } 355 } 356 }); 357 358 // Stiky Header 359 var headerHeight = $("#header").height(); 360 var headerTop = $(".header_top").height(); 361 var topBar = $(".top_bar").height(); 362 363 $("#header .top_nav, #header .header_top").affix({ 364 offset: { 365 top: headerHeight 366 } 367 }); 368 369 $("#menu_toggle_button").affix({ 370 offset: { 371 top: topBar 372 } 373 }); 374 375 $(window).scroll(function () { 376 if ($(".sticky_menu .header_top, .sticky_menu .top_nav").hasClass('affix')) { 377 $("#header").css("paddingBottom", headerTop); 378 } else { 379 $("#header").css("paddingBottom", 0); 380 } 381 }); 382 383 $(".top_bar_info_switcher .active").on('click', function () { 384 385 if ($(".top_bar_info_switcher ul").is(':visible')) { 386 $(".top_bar_info_switcher ul").slideUp(100); 387 } else { 388 $(".top_bar_info_switcher ul").slideDown(100); 389 } 390 391 return false;
392 }); 393 394 $(".top_bar_info_switcher a").on('click', function () { 395 var id = $(this).attr('href'); 396 var title = $(this).text(); 397 $(".top_bar_info").hide(); 398 $(id).show(); 399 $(".top_bar_info_switcher .active span").text(title); 400 $(".top_bar_info_switcher ul").slideUp(100); 401 return false; 402 }); 403 404 if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 405 stm_animate_block(); 406 } else { 407 $(".stm_animation").css('opacity', 1); 408 } 409 410 jQuery(window).scroll(function () { 411 if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 412 stm_animate_block(); 413 } else { 414 $(".stm_animation").css('opacity', 1); 415 } 416 }); 417 418 $('.single-product .product-type-variable table.variations select').on("change", function () { 419 $(this).parent().find('.select2-selection__rendered').text($(this).find('option[value="' + $(this).val() + '"]').text()); 420 }); 421 422 /*Adds*/ 423 if (typeof($.fancybox) !== 'undefined') { 424 $('.stm_fancy-iframe').fancybox({ 425 type: 'iframe', 426 padding: 0, 427 maxWidth: '800px', 428 width: '100%', 429 fitToView: false, 430 beforeLoad: function () { 431 var url = $(this.element).data('url'); 432 this.href = url; 433 } 434 }); 435 436 $('.stm_fancybox').fancybox({ 437 fitToView: false, 438 padding: 30, 439 maxWidth: '500px', 440 autoSize: true, 441 closeClick: false, 442 openEffect: 'none', 443 closeEffect: 'none' 444 }); 445 } 446 447 $('[data-scroll-to]').on('click', function (e) { 448 var url = $(this).attr('data-scroll-to'); 449 if (typeof(url) !== 'undefined') { 450 var url_parsed = url.split('#'); 451 if (typeof(url_parsed[1]) !== 'undefined' && $('#' + url_parsed[1]).length > 0) { 452 $('html, body').stop().animate({ 453 scrollTop: $('#' + url_parsed[1]).offset().top 454 }, 700); 455 } else { 456 window.location.href = url; 457 } 458 } 459 }); 460 461 if ($('body').hasClass('site_layout_19')) { 462 $('.top_nav li a').on('click', function (e) { 463 e.preventDefault(); 464 var url = $(this).attr('href'); 465 if (typeof(url) !== 'undefined') { 466 var url_parsed = url.split('#'); 467 if (typeof(url_parsed[1]) !== 'undefined' && $('#' + url_parsed[1]).length > 0) { 468 $('html, body').stop().animate({ 469 scrollTop: $('#' + url_parsed[1]).offset().top - 50 470 }, 700); 471 } else { 472 window.location.href = url; 473 } 474 } 475 }); 476 } 477 478 $('.stm_top_bar_l13-search button').on('click', function (e) { 479 var $wr = $(this).closest('.stm_top_bar_l13-search'); 480 if ($wr.hasClass('active')) { 481 if ($wr.find('input').val() == '') { 482 e.preventDefault(); 483 $wr.removeClass('active active-focus'); 484 } 485 } else { 486 e.preventDefault(); 487 $wr.addClass('active active-focus'); 488 setTimeout(function () { 489 $wr.find('input').focus(); 490 }, 300); 491 } 492 }); 493 494 $('body').on('click', function (e) { 495 if ($(e.target).closest('.stm_top_bar_l13-search').length === 0) { 496 var $wr = $('.stm_top_bar_l13-search'); 497 $wr.find('input').focusout(); 498 $wr.removeClass('active active-focus'); 499 } 500 }); 501 502 }); 503 504 function stm_animate_block() { 505 jQuery('.stm_animation').each(function () { 506 if (jQuery(this).attr('data-animate')) { 507 var animation_blocks = jQuery(this).children('*'); 508 var animationName = jQuery(this).attr('data-animate'), 509 animationDuration = jQuery(this).attr('data-animation-duration') + 's', 510 animationDelay = jQuery(this).attr('data-animation-delay'); 511 var style = 'opacity:1;-webkit-animation-delay:' + animationDelay + 's;-webkit-animation-duration:' + animationDuration + '; -moz-animation-delay:' + animationDelay + 's;-moz-animation-duration:' + animationDuration + '; animation-delay:' + animationDelay + 's;'; 512 var container_style = 'opacity:1;-webkit-transition-delay: ' + (animationDelay) + 's; -moz-transition-delay: ' + (animationDelay) + 's; transition-delay: ' + (animationDelay) + 's;'; 513 if (isAppear(jQuery(this))) { 514 jQuery(this).attr('style', container_style); 515 jQuery.each(animation_blocks, function (index, value) { 516 jQuery(this).attr('style', style); 517 jQuery(this).addClass('animated').addClass(animationName); 518 }); 519 } 520 } 521 }); 522 } 523 524 function isAppear(id) { 525 var window_scroll = jQuery(window).scrollTop(); 526 var window_height = jQuery(window).height(); 527 528 if (jQuery(id).hasClass('stm_viewport')) { 529 var start_effect = jQuery(id).data('viewport_position'); 530 } 531 532 if (typeof(start_effect) === 'undefined' || start_effect == '') { 533 var percentage = 2; 534 } else { 535 var percentage = 100 - start_effect; 536 } 537 var element_top = jQuery(id).offset().top; 538 var position = element_top - window_scroll; 539 540 var cut = window_height - (window_height * (percentage / 100)); 541 if (position <= cut) { 542 return true; 543 } else { 544 return false;
545 } 546 } 547 548 function demosItemTemplate(state) { 549 if (!state.id) { 550 return state.text; 551 } 552 var $state = jQuery( 553 '<span class="' + state.element.value + '"> ' + state.text + '</span>' 554 ); 555 return $state; 556 } 557 558 function l18W() { 559 var $ = jQuery; 560 if ($('body').hasClass('site_layout_18')) { 561 var contentW = $('#fullpage').outerWidth(); 562 var contentArea = $('.content-area').outerWidth(); 563 var fullWleft = contentW / 2; 564 565 var marginArea = (contentW - contentArea) / 2; 566 //$('.stm_bg_right').css('width', contentW + 'px'); 567 $('.stm_fullwidth_left').css({ 568 'width': fullWleft + 'px' 569 }); 570 571 $('.stm_fullwidth_content').css({ 572 'width': contentW + 'px', 573 'margin-right': '-' + marginArea + 'px' 574 }) 575 576 } 577 } 578 579 function stm_services_carousel() { 580 $('.stm_services.style_3').each(function () { 581 var perRow = $(this).attr('data-per-row'); 582 $(this).owlCarousel({ 583 nav: false, 584 dots: true, 585 responsive: { 586 0: { 587 items: 1 588 }, 589 480: { 590 items: 2 591 }, 592 768: { 593 items: 3 594 }, 595 1024: { 596 items: perRow 597 }, 598 1110: { 599 items: perRow 600 } 601 } 602 }); 603 }) 604 } 605})(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.