1'use strict'; 2 3var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 4 5var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 6 7function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8 9var initialize = ''; 10 11(function ($) { 12 "use strict"; 13 14 var _this = this; 15 16 initialize = function initialize() { 17 18 stm_unclickable(); 19 20 stm_switcher(); 21 stm_tabs(); 22 stm_sticky_footer(); 23 js_active_switch(); 24 js_active_trigger(); 25 stm_light_gallery(); 26 stm_share_url(); 27 stm_header_dropdown_mobile(); 28 stm_header_dropdown_vertical_nav(); 29 stm_header_dropdown_post_filter(); 30 stm_header_dropdown_socials(); 31 stm_select_style(); 32 rowExpand(); 33 stm_inputs_style(); 34 titleBoxExpand(); 35 closeMessageBox(); 36 stm_load_posts(); 37 stm_scroll_to(); 38 stm_datepicker(); 39 stm_timepicker(); 40 stm_mobileStickyHeader(); 41 stm_load_scripts(); 42 stm_image_placeholder(); 43 44 stm_scroll_top(); 45 stm_scroll_to_top(); 46 47 stm_post_thumbnail_before_content(); 48 stm_post_archive_sidebars(); 49 stm_post_video_hover(); 50 51 stm_envato_preview_control(); 52 53 set_fullwidth(); 54 stm_audio_modal(); 55 stm_stretch_column(); 56 stm_kenburns(); 57 productTabs(); 58 }; 59 60 $(document).ready(function () { 61 62 initialize(); 63 }); 64 65 $(window).on('load', function () { 66 stm_sticky_footer(); 67 stm_site_prealoder(); 68 titleBoxExpand(); 69 70 set_fullwidth(); 71 stm_hamburger(); 72 }); 73 74 $(window).on('resize', function () { 75 stm_sticky_footer(); 76 titleBoxExpand(); 77 rowExpand(); 78 stm_mobileStickyHeader(); 79 stm_post_thumbnail_before_content(); 80 81 set_fullwidth(); 82 }); 83 84 $(window).on('scroll', function () { 85 if ($(".pearl_arrow_top").length) { 86 var trigger_height = $(window).scrollTop() + $(window).height() + $('.stm-footer').height(); 87 88 if (trigger_height > $(document).height()) { 89 $(".pearl_arrow_top").addClass("arrowShow"); 90 } 91 92 if ($(window).scrollTop() === 0) { 93 $(".pearl_arrow_top").removeClass("arrowShow"); 94 } 95 } 96 }); 97 98 if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 99 stm_animate_block(); 100 } else { 101 $(".stm_animation").css('opacity', 1); 102 } 103 104 jQuery(window).on('scroll', function () { 105 if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 106 stm_animate_block(); 107 } else { 108 $(".stm_animation").css('opacity', 1); 109 } 110 }); 111 112 function stm_animate_block() { 113 jQuery('.stm_animation').each(function () { 114 if (jQuery(this).attr('data-animate')) { 115 var animation_blocks = jQuery(this).children('*'); 116 var animationName = jQuery(this).attr('data-animate'), 117 animationDuration = jQuery(this).attr('data-animation-duration') + 's', 118 animationDelay = jQuery(this).attr('data-animation-delay'); 119 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;'; 120 var container_style = 'opacity:1;-webkit-transition-delay: ' + animationDelay + 's; -moz-transition-delay: ' + animationDelay + 's; transition-delay: ' + animationDelay + 's;'; 121 if (isAppear(jQuery(this))) { 122 jQuery(this).attr('style', container_style); 123 jQuery.each(animation_blocks, function (index, value) { 124 var existing_style = jQuery(this).attr('style'); 125 var updated_style = style + existing_style; 126 jQuery(this).attr('style', updated_style); 127 jQuery(this).addClass('animated').addClass(animationName); 128 }); 129 } 130 } 131 }); 132 } 133 function isAppear(id) { 134 var window_scroll = jQuery(window).scrollTop(); 135 var window_height = jQuery(window).height(); 136 137 if (jQuery(id).hasClass('stm_viewport')) { 138 var start_effect = jQuery(id).data('viewport_position'); 139 } 140 141 if (typeof start_effect === 'undefined' || start_effect == '') { 142 var percentage = 2; 143 } else { 144 var percentage = 100 - start_effect; 145 } 146 var element_top = jQuery(id).offset().top; 147 var position = element_top - window_scroll; 148 149 var cut = window_height - window_height * (percentage / 100); 150 if (position <= cut) { 151 return true; 152 } else { 153 return false;
154 } 155 } 156 157 function set_fullwidth() { 158 var width = $(window).width(); 159 var elements = ['.stm_slider_style_9 .owl-nav']; 160 $.each(elements, function () { 161 var $element = $(this); 162 var stm_site_width_custom = $element.closest('.container').width(); 163 if ($element.length) { 164 var offset = (width - stm_site_width_custom) / 2; 165 $element.css('margin-left', '-' + offset + 'px'); 166 $element.width(width); 167 } 168 }); 169 } 170 171 function stm_unclickable() { 172 $('body').on('click', '.unclickable', function (e) { 173 e.preventDefault(); 174 }); 175 } 176 177 function stm_switcher() { 178 $('.stm-switcher__trigger').on('click', function () { 179 $(this).closest('.stm-switcher').find('.stm-switcher__list').toggleClass('active'); 180 $(this).toggleClass('active'); 181 }); 182 183 $('.stm-switcher__option').on('click', function () { 184 var stm_switch = $(this).data('switch'); 185 186 $(this).closest('.stm-switcher').parent().find('.js-switcher').addClass('js-switcher__hidden'); 187 $(this).closest('.stm-switcher').parent().find('.js-switcher_' + stm_switch).removeClass('js-switcher__hidden'); 188 189 $(this).closest('.stm-switcher').find('.stm-switcher__text').text($(this).text()); 190 191 $(this).closest('.stm-switcher__list').removeClass('active'); 192 $(this).closest('.stm-switcher').find('.stm-switcher__trigger').removeClass('active'); 193 }); 194 } 195 196 function stm_sticky_footer() { 197 var windowH = $(window).height(); 198 var footerH = $('.stm-footer').outerHeight(); 199 200 if ($('#wpadminbar').length) { 201 footerH += $('#wpadminbar').outerHeight(); 202 } 203 204 $('#wrapper').css('min-height', windowH - footerH + 'px'); 205 } 206 207 function stm_tabs() { 208 209 $("ul.nav-tabs > li > a").on("click", function (e) { 210 var id = $(this).attr("href").substr(1); 211 window.location.hash = id; 212 }); 213 214 var hash = window.location.hash; 215 $('#products__tabs a[href="' + hash + '"]').tab('show'); 216 } 217 218 function js_active_switch() { 219 $('.js_active_switcher .js_active_switcher__a').on('click', function (e) { 220 e.preventDefault(); 221 $(this).closest('.js_active_switcher').find('.js_active_switcher__a').removeClass('active'); 222 $(this).addClass('active'); 223 }); 224 } 225 226 function js_active_trigger() { 227 var opened = false; 228 var dataToggle = ''; 229 var $element = ''; 230 var $this = ''; 231 $('.js_trigger__click').on('click', function (e) { 232 e.preventDefault(); 233 e.stopPropagation(); 234 235 $this = $(this); 236 237 dataToggle = $(this).attr('data-toggle'); 238 if (typeof dataToggle == 'undefined') dataToggle = true; 239 240 $element = $(this).closest('.js_trigger').find('.js_trigger__unit'); 241 var element = $(this).attr('data-element'); 242 if (typeof element !== 'undefined') $element = $(element); 243 244 if (dataToggle && dataToggle !== 'false') { 245 $element.slideToggle('fast'); 246 } else { 247 $element.toggleClass('active'); 248 } 249 250 $(this).toggleClass('active'); 251 opened = $(this).hasClass('active') ? true : false; 252 var view_ = $(this).attr('data-text-more'); 253 var close_ = $(this).attr('data-text-close'); 254 if (opened) { 255 $(this).text(close_); 256 } else { 257 $(this).text(view_); 258 } 259 }); 260 } 261 262 function stm_share_url() { 263 $('.stm_js__shareble a').on('click', function (e) { 264 e.preventDefault(); 265 var url = $(this).data('share'); 266 var social = $(this).data('social') + '_share'; 267 window.open(url, social, 'width=580,height=296'); 268 }); 269 } 270 271 function stm_header_dropdown_mobile() { 272 var windowW = $(window).width(); 273 274 $('.stm_mobile__switcher').on('each', function (e) { 275 if ($(this).hasClass('active')) { 276 $(this).parent().addClass('href_empty'); 277 } 278 }); 279 280 $('.stm-header .stm-navigation__default li:not(.menu-item-has-children) a').on('click', function (e) { 281 $('.stm-header__overlay').removeClass('active'); 282 $('.stm_mobile__header').removeClass('active'); 283 $('.stm_mobile__switcher').removeClass('active'); 284 $('.stm-header').removeClass('active'); 285 $('body').removeClass('active'); 286 }); 287 288 $('.stm-navigation li.menu-item-has-children > a').each(function () { 289 var href = $(this).attr("href"); 290 if (href == "#") { 291 $(this).parent().addClass('href_empty'); 292 } 293 294 $(this).append('<span class="stm_mobile__dropdown"></span>'); 295 }); 296 297 $('.stm-navigation_hamburger_full li.menu-item-has-children > a > .stm_mobile__dropdown').each(function () { 298 $(this).remove(); 299 $('body').addClass('hamburger_full'); 300 }); 301 302 $('.stm-navigation_hamburger_full').find('.href_empty>a').on('click', function (e) { 303 e.preventDefault(); 304 e.stopPropagation(); 305 var dd = $(this); 306 dd.closest('li').toggleClass('active'); 307 if (dd.parents('.navigation_hamburger_full').length === 0 || window.innerWidth < 1024) { 308 dd.closest('li').children('.sub-menu').toggle(); 309 } 310 }); 311 312 $('body').find('.stm_mobile__dropdown').on('click', function (e) { 313 e.preventDefault(); 314 e.stopPropagation(); 315 var dd = $(this); 316 dd.closest('li').toggleClass('active'); 317 }); 318 319 if (typeof $.fn.swipe === 'function' && windowW < 992) { 320 $(".stm-header").swipe({ 321 swipe: function swipe(event, direction, distance, duration, fingerCount, fingerData) { 322 if (direction == 'left' && distance > 50) { 323 $('.stm-header').removeClass('active'); 324 $('.stm-header__overlay').removeClass('active'); 325 $('.stm_mobile__header').removeClass('active'); 326 $('.stm_mobile__switcher').removeClass('active'); 327 } 328 }, 329 allowPageScroll: "vertical" 330 }); 331 } 332 333 $('.stm-header__overlay').on('click', function () { 334 $(this).removeClass('active'); 335 $('.stm_mobile__header').removeClass('active'); 336 $('.stm_mobile__switcher').removeClass('active'); 337 $('.stm-header').removeClass('active'); 338 $('body').removeClass('active'); 339 }); 340 } 341 342 function stm_header_dropdown_vertical_nav() { 343 $('.stm-header .stm-navigation__vertical_left li.menu-item-has-children').on('click', function (e) { 344 if (!$(this).hasClass('active')) { 345 $('.stm-header .stm-navigation__vertical_left li.menu-item-has-children.active').removeClass('active'); 346 $(this).addClass('active'); 347 } else { 348 $('.stm-header .stm-navigation__vertical_left li.menu-item-has-children.active').removeClass('active'); 349 } 350 }); 351 $('.stm-header .stm-navigation__vertical_left .stm_mobile__switcher').on('click', function (e) { 352 $('.stm-navigation__vertical').toggleClass('active'); 353 }); 354 } 355 356 function stm_header_dropdown_post_filter() { 357 $('.stm-header .stm-post-filter .stm_mobile__switcher').on('click', function () { 358 $('.stm-header .stm-socials-hidden').removeClass('active'); 359 $(this).parents().find('.post-filter').each(function () { 360 if ($(this).hasClass('active')) { 361 $(this).removeClass('active'); 362 } else { 363 $(this).addClass('active'); 364 } 365 }); 366 }); 367 } 368 369 function stm_header_dropdown_socials() { 370 $('.stm-header .stm-socials-hidden .stm-socials-btn').on('click', function () { 371 $('.stm-header .post-filter').removeClass('active'); 372 $('.stm-header .stm_mobile__switcher').removeClass('active'); 373 $(this).parents().find('.stm-socials-hidden').each(function () { 374 if ($(this).hasClass('active')) { 375 $('.stm-socials-btn').removeClass('active'); 376 $(this).removeClass('active'); 377 } else { 378 $('.stm-socials-btn').addClass('active'); 379 $(this).addClass('active'); 380 } 381 }); 382 }); 383 } 384 385 function stm_site_prealoder() { 386 if ($('html').hasClass('stm-site-loader')) { 387 $('html').addClass('loaded'); 388 389 var prevent = false;
390 $('a[href^=mailto], a[href^=skype], a[href^=tel]').on('click', function (e) { 391 prevent = true; 392 $('html').addClass('loaded'); 393 }); 394 395 $(window).on('beforeunload', function (e, k) { 396 if (!prevent) { 397 $('html').removeClass('loaded'); 398 } else { 399 prevent = false; 400 } 401 }); 402 } 403 } 404 405 function productTabs() { 406 $('#products__tab .mobile_tab a').on('click', function (e) { 407 var target = $(this).attr("href"); 408 $('body, html').css('transition-delay', '0s'); 409 setTimeout(function () { 410 $('body, html').animate({ 411 scrollTop: $(target).offset().top 412 }, 100); 413 }, 10); 414 }); 415 } 416 417 function titleBoxExpand() { 418 var box = $('.stm_titlebox'); 419 var container = box.parents('.container'); 420 421 if (box.length === 0 || container.length === 0) { 422 return; 423 } 424 425 var ww = $(document).width() - stm_site_paddings * 2; 426 var w = container.width(); 427 var offset = (ww - w) * 0.5; 428 429 box.css({ 430 width: ww, 431 'margin-left': '-' + offset + 'px' 432 }); 433 } 434 435 var rowExpand = function rowExpand() { 436 437 var sidebarEnabled = $('.site-content .stm_markup__sidebar').length > 0; 438 var forceContainer = $('.site-content .vc_container-fluid-force').length > 0; 439 440 if (sidebarEnabled && !forceContainer) { 441 return; 442 } 443 444 445 $('.stm_markup__content .vc_container-fluid, .vc_container-fluid-force').each(function () { 446 447 var row = $(this); 448 var container = row.parents('.container'); 449 if (row.length === 0 || container.length === 0) { 450 return; 451 } 452 453 var ww = $(document).width() - stm_site_paddings * 2; 454 var w = container.width(); 455 456 var margin = $(this).attr('data-margin'); 457 if (typeof margin === 'undefined') margin = 0; 458 459 var offset = (ww - w) * 0.5 - margin; 460 461 row.css({ 462 width: ww - margin * 2, 463 'margin-left': '-' + offset + 'px' 464 }); 465 466 var position = $(this).offset().left; 467 if (position != stm_site_paddings && stm_site_paddings > position) { 468 offset = offset - (stm_site_paddings - position); 469 row.css({ 470 'margin-left': '-' + offset + 'px' 471 }); 472 } 473 }); 474 }; 475 476 function closeMessageBox() { 477 $('body').on('click', '.vc_message_box .close', function (e) { 478 e.preventDefault(); 479 var messageBox = $(this).parents('.vc_message_box'); 480 messageBox.fadeOut(300, function () { 481 $(this).remove(); 482 }); 483 }); 484 } 485 486 $.fn.is_on_screen = function () { 487 var win = $(window); 488 var viewport = { 489 top: win.scrollTop(), 490 left: win.scrollLeft() 491 }; 492 viewport.right = viewport.left + win.width(); 493 viewport.bottom = viewport.top + win.height(); 494 495 var bounds = this.offset(); 496 bounds.right = bounds.left + this.outerWidth(); 497 bounds.bottom = bounds.top + this.outerHeight(); 498 499 return !(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom); 500 }; 501 502 var stm_select_style = function stm_select_style() { 503 var select = $('select').not('.no_wrap, [multiple], [data-attribute_name], .woocommerce select, [data-field-id]'); 504 505 select.each(function () { 506 var select = $(this); 507 508 var options = select.find('option'); 509 var values = []; 510 options.each(function (v, k) { 511 values.push($(k).text()); 512 }); 513 var choicesList = '<ul class="stm_select__dropdown">'; 514 values.forEach(function (v) { 515 choicesList += '<li><span>' + v + '</span></li>'; 516 }); 517 choicesList += '</ul>'; 518 var wrapperStructure = '<div class="stm_select"></div>'; 519 var wrapper = select.wrap(wrapperStructure).parent(); 520 var selectVal = $('<span class="stm-select__val"></span>').appendTo(wrapper); 521 choicesList = $(choicesList).appendTo(wrapper); 522 choicesList.find('li').on('click', function (e) { 523 e.stopPropagation(); 524 var choice = $(this).text(); 525 selectVal.text(choice); 526 select.val(choice); 527 select.find('option').remove(); 528 select.append('<option value="' + choice + '" selected>'); 529 select.trigger('change'); 530 wrapper.removeClass('open'); 531 }); 532 533 $('.stm-select__val').on('click', function (el) { 534 el.stopPropagation(); 535 $(this).find('option').remove(); 536 $(this).closest('.stm_select').addClass('open'); 537 }); 538 $('body').on('click', function (e) { 539 wrapper.removeClass('open'); 540 }); 541 selectVal.text(select.find('option:selected').text()); 542 }); 543 }; 544 545 var stm_inputs_style = function stm_inputs_style() { 546 547 var inputs = $('input[type="checkbox"], input[type="radio"]').filter(function () { 548 return !$(_this).hasClass('no_wrap') && $(_this).closest('.ipt_fsqm_form').length == 0 && $(_this).closest('.rpress-section').length != 0; 549 }); 550 inputs.each(function () { 551 var input = $(this); 552 var type = input[0].type; 553 var wrapperStructure = '<div class="stm_input_wrapper ' + 'stm_input_wrapper_' + type + '"></div>'; 554 input.wrapAll(wrapperStructure); 555 }); 556 557 inputs.each(function () { 558 if ($(this).is(':checked')) { 559 $(this).parent().addClass('active'); 560 } 561 }); 562 563 $(document).on('change', inputs, function (e) { 564 var $this = $(e.target); 565 var type = $this[0].type; 566 var $wrapper = $this.closest('.stm_input_wrapper'); 567 if ($this.is(':checked')) { 568 $wrapper.addClass('active'); 569 if (type === 'radio') { 570 $('[name="' + $this[0].name + '"]').not($this).each(function () { 571 $(this).parents('.stm_input_wrapper').removeClass('active'); 572 }); 573 $wrapper.siblings().removeClass('active'); 574 } 575 } else { 576 $wrapper.removeClass('active'); 577 } 578 }); 579 }; 580 581 function stm_stretch_column() { 582 $('.wpb_column[data-stretch]').each(function () { 583 var el = $(this); 584 var stretch = el.data('stretch'); 585 var stretchContent = el.data('stretch-content'); 586 var xPos = el.offset().left; 587 var wW = $(window).width(); 588 var xW = el.width(); 589 var wrapper = el.find('.wpb_wrapper').first(); 590 var container = el.parents('.container, .vc_container'); 591 var col = el.find('.vc_column-inner').first(); 592 var colLeftOffset = el.offset().left; 593 if (stretch === 'left') { 594 wrapper.css({ 595 'margin-left': 'auto' 596 }); 597 col.css({ 598 'width': el.width() + colLeftOffset + 'px', 599 'margin-left': '-' + colLeftOffset + 'px' 600 }); 601 } else { 602 var margin = window.innerWidth - colLeftOffset - el.width(); 603 col.css({ 604 'width': window.innerWidth - colLeftOffset + 'px', 605 'margin-right': '-' + margin + 'px' 606 }); 607 } 608 609 if (stretchContent !== true) { 610 wrapper.css('width', el.width() - 30 + 'px'); 611 } 612 613 if (stm_check_mobile() || window.innerWidth <= 1024) { 614 col.css({ 615 'width': window.innerWidth + 'px', 616 'margin-left': '-' + (window.innerWidth - col.outerWidth()) + 'px' 617 }); 618 } 619 }); 620 } 621 622 function stm_load_posts() { 623 $('body').on('click', '.stm_load_posts', function (e) { 624 e.preventDefault(); 625 626 $.ajax({ 627 url: stm_ajaxurl, 628 dataType: 'json', 629 context: this, 630 data: { 631 'page': $(this).attr('data-page'), 632 'per_page': $(this).attr('data-per_page'), 633 'style': $(this).attr('data-style'), 634 'view': $(this).attr('data-view'), 635 'past': $(this).attr('data-past'), 636 'upcoming': $(this).attr('data-upcoming'), 637 'post_type': $(this).attr('data-post_type'), 638 'action': 'pearl_load_more_posts', 639 'security': pearl_load_more_posts 640 }, 641 beforeSend: function beforeSend() { 642 $(this).addClass('loading'); 643 }, 644 complete: function complete(data) { 645 $(this).removeClass('loading'); 646 var dt = data.responseJSON; 647 var $items = $(dt.content); 648 649 var contentWrapper = $($(this).attr('data-element')); 650 contentWrapper.append($items); 651 652 if (dt.page) { 653 $(this).attr('data-page', dt.page); 654 } else { 655 $(this).remove(); 656 } 657 } 658 }); 659 }); 660 } 661 662 function stm_scroll_to() { 663 var $anchor_selector = $('a[href*="#"]:not(.no_scroll):not(.vc_carousel-control)'); 664 if ($anchor_selector.length) { 665 666 $anchor_selector.on('click', function (e) { 667 var href = $(this).attr('href'); 668 var animationTime = 1000; 669 if ($(this).parent().hasClass('mobile_tab')) { 670 animationTime = 50; 671 } 672 var hash_index = href.indexOf("#"); 673 if (hash_index != -1) { 674 if (href.length === 1) e.preventDefault(); 675 676 var vc = $(this).attr('data-vc-container'); 677 if (!vc) { 678 var hash = href.substring(hash_index + 1); 679 var $element = $('#' + hash); 680 681 if ($(this).hasClass('self_scroll')) { 682 $element = $(this); 683 } 684 685 if ($element.length) { 686 e.preventDefault(); 687 688 var frame_height = 54; 689 var header_height = $('.stm-header').height(); 690 691 var scrollValue = $element.offset().top; 692 693 if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 694 if ($('body').hasClass('envato-preview-visible')) { 695 scrollValue -= frame_height; 696 } else if ($('body').hasClass('stm_header_sticky_center')) { 697 scrollValue -= header_height; 698 } 699 700 if ($('body').hasClass('stm_header_sticky_center') & $('body').hasClass('envato-preview-visible')) { 701 scrollValue -= header_height; 702 } 703 } 704 705 $('html, body').animate({ 706 scrollTop: scrollValue 707 }, animationTime); 708 } 709 } 710 } 711 }); 712 } 713 } 714 715 function stm_datepicker() { 716 var $datepicker = $('.stm_datepicker'); 717 if (typeof $.fn.datepicker === 'function' && $datepicker.length) { 718 $datepicker.datepicker({ 719 dateFormat: stm_date_format, 720 beforeShow: function beforeShow(input, inst) { 721 var inputField = inst.input;
722 var inputWidth = inputField.outerWidth(); 723 var calendar = inst.dpDiv; 724 725 if (inputWidth > 170) { 726 setTimeout(function () { 727 calendar.css({ 'width': inputWidth + 'px' }); 728 }, 10); 729 } 730 } 731 }); 732 } 733 } 734 735 function stm_timepicker() { 736 var $timepicker = $('.stm_timepicker'); 737 if (_typeof($.fn.timepicker) && $timepicker.length) { 738 $timepicker.timepicker({ 739 timeFormat: stm_time_format 740 }); 741 } 742 } 743 744 var stm_mobileStickyHeader = function stm_mobileStickyHeader() { 745 var headerPlaceholder = $('.stm_sticky_header_placeholder'); 746 747 if (headerPlaceholder.length > 0 && window.innerWidth > 550) { 748 headerPlaceholder.remove(); 749 } 750 if (!$('body').hasClass('stm_sticky_header_mobile') || window.innerWidth > 550) { 751 return; 752 } 753 754 var mobileHeader = $('.stm_mobile__header'); 755 var headerHeight = mobileHeader.outerHeight(); 756 757 if (headerPlaceholder.length === 0) { 758 var holder = $('<div class="stm_sticky_header_placeholder"></div>').prependTo('#wrapper').css({ 'height': headerHeight }); 759 } 760 761 762 var to = null; 763 var lastScroll = 0; 764 $(window).on('scroll', function (e) { 765 766 var scroll = $(this).scrollTop(); 767 if (scroll > lastScroll && scroll > headerHeight + 200) { 768 mobileHeader.css({ 769 'transform': 'translateY(-100%)' 770 }); 771 } else { 772 mobileHeader.css({ 773 'transform': 'translateY(0)' 774 }); 775 } 776 777 lastScroll = scroll; 778 }); 779 }; 780 781 function stm_load_scripts() { 782 $('script[data-src]').each(function () { 783 $(this).attr('src', $(this).data('src')); 784 }); 785 } 786 787 function stm_image_placeholder() { 788 var deferImage = function deferImage(element) { 789 var i, len, attr; 790 var img = new Image(); 791 var placehold = element.children[0]; 792 793 element.className += ' is-loading'; 794 795 img.onload = function () { 796 element.className = element.className.replace('is-loading', 'is-loaded'); 797 element.replaceChild(img, placehold); 798 }; 799 800 for (i = 0, len = placehold.attributes.length; i < len; i++) { 801 attr = placehold.attributes[i]; 802 if (attr.name.match(/^data-/)) { 803 img.setAttribute(attr.name.replace('data-', ''), attr.value); 804 } 805 } 806 }; 807 } 808 809 function stm_scroll_top() { 810 $("a[href='#top']").on('click', function () { 811 $("html, body").animate({ scrollTop: 0 }, 300); 812 return false; 813 }); 814 } 815 816 function stm_scroll_to_top() { 817 $(".pearl_arrow_top").on("click", function () { 818 var scroll_pos = 0; 819 $('html, body').animate({ scrollTop: scroll_pos }, '5000', function () { 820 $(".arrow_top").removeClass("arrowShow"); 821 }); 822 }); 823 } 824 825 function stm_post_thumbnail_before_content() { 826 $('.stm_single_post_layout_18').each(function () { 827 var height = $(this).find('.post_thumbnail').height(); 828 $(this).css('padding-top', height); 829 }); 830 } 831 832 function stm_post_archive_sidebars() { 833 $('.stm_layout_viral.blog.stm_post_view_grid .stm_markup_left .stm_markup__sidebar_archive').insertBefore('.stm_layout_viral.blog.stm_post_view_grid .site-content .stm_markup__content'); 834 $('.stm_layout_viral.blog.stm_post_view_grid .stm_markup_right .stm_markup__sidebar_archive').insertBefore('.stm_layout_viral.blog.stm_post_view_grid .site-content .stm_markup__content'); 835 $('.stm_layout_viral.archive.stm_post_view_grid .stm_markup_left .stm_markup__sidebar_archive').insertBefore('.stm_layout_viral.archive.stm_post_view_grid .site-content .stm_markup__content');
836 $('.stm_layout_viral.archive.stm_post_view_grid .stm_markup_right .stm_markup__sidebar_archive').insertBefore('.stm_layout_viral.archive.stm_post_view_grid .site-content .stm_markup__content'); 837 $('.stm_layout_viral.search.stm_post_view_grid .stm_markup_left .stm_markup__sidebar_archive').insertBefore('.stm_layout_viral.search.stm_post_view_grid .site-content .stm_markup__content'); 838 $('.stm_layout_viral.search.stm_post_view_grid .stm_markup_right .stm_markup__sidebar_archive').insertBefore('.stm_layout_viral.search.stm_post_view_grid .site-content .stm_markup__content'); 839 } 840 841 function stm_post_video_hover() { 842 $(".post_video .stc_h").on('mouseenter', function () { 843 $(this).parents('.post_video').find('.stc_h').addClass('stc'); 844 }); 845 $(".post_video .stc_h").on('mouseleave', function () { 846 $(this).parents('.post_video').find('.stc_h').removeClass('stc'); 847 }); 848 } 849 850 function stm_envato_preview_control() { 851 var preview = $('.pearl-envato-preview'); 852 853 $('.preview__action--close').on('click', function () { 854 $('.pearl-envato-preview').slideUp(); 855 $('.pearl-envato-preview-holder').slideUp(); 856 $('body').removeClass('envato-preview-visible'); 857 }); 858 859 if (preview.length) { 860 } 861 } 862 863 function stm_audio_modal() { 864 var modal = $('.stm_audio_modal'); 865 if (modal.length === 0) return; 866 867 modal.each(function () { 868 var modal = moveModal($(this)); 869 var audio = modal.find('audio')[0]; 870 modal.on('show.bs.modal', function () { 871 audio.play(); 872 }); 873 874 modal.on('hide.bs.modal', function () { 875 audio.pause(); 876 }); 877 }); 878 } 879 880 var stm_kenburns = function stm_kenburns() { 881 var rows = $('[data-stm-kenburns]'); 882 883 rows.each(function () { 884 var el = $(this); 885 var kenBurnsHtml = '<div class="stm_kenburns"><div class="stm_kenburns__image"></div></div>'; 886 if (el.data('stm-kenburns') === 'enable') { 887 var parentContainer = el.parents('[class*="vc_container"]'); 888 var bgi = parentContainer.css('background-image'); 889 parentContainer.attr('style', parentContainer.attr('style') + ';' + 'background-image: none !important'); 890 var kenBurnsEl = $(kenBurnsHtml).appendTo(parentContainer); 891 var kenBurnsImage = kenBurnsEl.find('.stm_kenburns__image'); 892 kenBurnsImage.css('background-image', bgi); 893 } 894 }); 895 }; 896 897 var stm_hamburger = function stm_hamburger() { 898 var menu = $('.stm-navigation__hamburger > ul'); 899 var menuItem = menu.find('li.menu-item-has-children'); 900 }; 901})(jQuery); 902 903function initGoogleScripts() { 904 var stmGmap = new CustomEvent("stm_gmap_api_loaded"); 905 document.body.dispatchEvent(stmGmap); 906 if (typeof stm_init_map_barba !== 'undefined') window.stm_init_map_barba(); 907} 908 909function stmOffsetCenter(map, latlng, offsetx, offsety) { 910 911 var scale = Math.pow(2, map.getZoom()); 912 913 var worldCoordinateCenter = map.getProjection().fromLatLngToPoint(latlng); 914 var pixelOffset = new google.maps.Point(offsetx / scale || 0, offsety / scale || 0); 915 916 var worldCoordinateNewCenter = new google.maps.Point(worldCoordinateCenter.x - pixelOffset.x, worldCoordinateCenter.y + pixelOffset.y); 917 918 var newCenter = map.getProjection().fromPointToLatLng(worldCoordinateNewCenter); 919 920 map.setCenter(newCenter); 921} 922 923var uniqid = function uniqid() { 924 return '_' + Math.random().toString(36).substr(2, 9); 925}; 926 927function stm_light_gallery() { 928 var reinit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 929 930 var $ = jQuery; 931 if (typeof $.fn.lightGallery === 'function') { 932 933 var galleries = $('.stm_lightgallery'); 934 935 galleries.each(function () { 936 var gallery = $(this); 937 938 if (reinit) { 939 try { 940 gallery.data('lightGallery').destroy(true); 941 } catch (e) { 942 console.log(e.message); 943 } 944 } 945 gallery.lightGallery({ 946 'selector': '.stm_lightgallery__selector' 947 }); 948 }); 949 950 $('.stm_lightgallery__iframe').lightGallery({ 951 selector: 'this', 952 iframeMaxWidth: '70%' 953 }); 954 } 955} 956 957var StmInfoBox = function () { 958 function StmInfoBox(options, container) { 959 _classCallCheck(this, StmInfoBox); 960 961 var $ = jQuery; 962 963 this.container = $(container); 964 this.box = '.stm_infobox'; 965 966 this.init(options); 967 this.parseStyle(); 968 } 969 970 _createClass(StmInfoBox, [{ 971 key: 'init', 972 value: function init(options) { 973 this.content = options.content || ''; 974 this.maxWidth = options.maxWidth || 200; 975 this.pixelOffset = options.pixelOffset || [0, 0]; 976 this.zIndex = options.zIndex || 0; 977 this.boxStyle = options.boxStyle || {}; 978 this.style = ''; 979 } 980 }, {
981 key: 'parseStyle', 982 value: function parseStyle() { 983 var $ = jQuery; 984 var style = ''; 985 style += 'zindex: ' + this.zIndex + ';'; 986 style += 'left: ' + this.pixelOffset[0] + ';'; 987 style += 'top: ' + this.pixelOffset[1] + ';'; 988 style += 'maxWidth: ' + this.maxWidth + 'px;'; 989 990 if (Object.keys(this.boxStyle).length > 0) { 991 for (var rule in this.boxStyle) { 992 style += rule + ' : ' + this.boxStyle[rule] + ';'; 993 } 994 } 995 996 this.style = style; 997 } 998 }, { 999 key: 'open', 1000 value: function open() { 1001 var html = '<div class="stm_infobox">' + '<div class="stm_infobox__content">' + this.content + '</div>' + '</div>'; 1002 if (this.container.find('.stm_infobox').length === 0 && this.content.length !== 0) { 1003 this.container.append(html); 1004 } 1005 } 1006 }, { 1007 key: 'close', 1008 value: function close() { 1009 if (this.container.find('.stm_infobox').length > 0) { 1010 this.container.find('.stm_infobox').remove(); 1011 } 1012 } 1013 }]); 1014 1015 return StmInfoBox; 1016}(); 1017 1018function stm_check_mobile() { 1019 "use strict"; 1020 1021 var isMobile = false; 1022 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
1022substr(0, 4))) isMobile = true; 1023 return isMobile; 1024} 1025 1026function createCookie(name, value, days) { 1027 var expires = ""; 1028 var date = new Date(); 1029 date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); 1030 document.cookie = name + "=" + value + "; expires=" + date.toUTCString() + "; path=/"; 1031} 1032 1033function moveModal(el) { 1034 var newEl = el.clone(true, true); 1035 el.remove(); 1036 newEl.appendTo('body'); 1037 return newEl; 1038} 1039 1040function isNumeric(value) { 1041 return value == Number(value) ? "number" : "string"; 1042} 1043 1044(function ($) { 1045 var action = ''; 1046 $.ajaxSetup({ 1047 beforeSend: function beforeSend(jqXHR, settings) { 1048 if (settings["data"]) { 1049 if (settings["data"].toString().indexOf("nf_ajax_submit") >= 0) return 0; 1050 } 1051 if (settings.data && $('body').hasClass('rpress') && $("#rpressModal").length) { 1052 var q = JSON.parse('{"' + decodeURI(settings.data.toString().replace(/&/g, "\",\"").replace(/=/g, "\":\"")) + '"}'); 1053 if (q.action && q.action === "rpress_edit_cart_fooditem") { 1054 action = 'rpress_edit_cart_fooditem'; 1055 } 1056 } 1057 }, 1058 complete: function complete(data) { 1059 if (action == 'rpress_edit_cart_fooditem') { 1060 var r = JSON.parse(data.responseText); 1061 1062 var qty = $(document).find('#rpressModal').find('.qty').val(); 1063 if (qty && r.data && r.data.price_raw) { 1064 var price = r.data.price_raw; 1065 var total_price = price * qty; 1066 1067 if (rp_scripts && rp_scripts.currency_sign) { 1068 $(document).find('#rpressModal').find('.cart-item-price').html(rp_scripts.currency_sign + total_price.toFixed(2)); 1069 } 1070 $(document).find('#rpressModal').find('.cart-item-price').attr('data-current', price); 1071 $(document).find('#rpressModal').find('.cart-item-price').attr('data-price', price); 1072 } 1073 } 1074 } 1075 }); 1076})(jQuery); 1077 1078function findTable(widget_id) {
1079 var rid = document.getElementById('rid-' + widget_id).value.replace(/[^0-9]/g, ''); 1080 var restref = document.getElementById('restref-' + widget_id).value.replace(/[^0-9]/g, ''); 1081 var partysize = document.getElementById('partysize-' + widget_id).value.replace(/[^0-9]/g, ''); 1082 var date = document.getElementById('date-' + widget_id).value; 1083 var time = document.getElementById('time-' + widget_id).value.replace(/[^:0-9]/gim, ''); 1084 var newtime = ''; 1085 1086 if (time.replace(/[^a-zа-ÑÑ]/gi, '') == 'pm') { 1087 newtime = Number(time.substr(0, time.indexOf(':'))) + 12; 1088 } else { 1089 if (time.indexOf(':') < 2) { 1090 newtime = '0' + time.substr(0, time.indexOf(':')); 1091 } else { 1092 newtime = time.substr(0, time.indexOf(':')); 1093 } 1094 } 1095 time = newtime + ":" + time.substr(time.indexOf(':') + 1); 1096 1097 var request = '?rid=' + rid + '&restref=' + restref + "&partysize=" + partysize + "&datetime=" + date + "T" + time; 1098 window.open('//opentable.com/restref/client/' + request); 1099} 1100 1101jQuery(window).load(function () { 1102 var $ = jQuery; 1103 if (!stm_check_mobile()) { 1104 $('.stm_markup__sidebar-sticky .sidebar_inner').stick_in_parent({ 1105 parent: '.stm_markup' 1106 }); 1107 } 1108});
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.