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 jQuery(this).attr('style', style); 125 jQuery(this).addClass('animated').addClass(animationName); 126 }); 127 } 128 } 129 }); 130 } 131 function isAppear(id) { 132 var window_scroll = jQuery(window).scrollTop(); 133 var window_height = jQuery(window).height(); 134 135 if (jQuery(id).hasClass('stm_viewport')) { 136 var start_effect = jQuery(id).data('viewport_position'); 137 } 138 139 if (typeof start_effect === 'undefined' || start_effect == '') { 140 var percentage = 2; 141 } else { 142 var percentage = 100 - start_effect; 143 } 144 var element_top = jQuery(id).offset().top; 145 var position = element_top - window_scroll; 146 147 var cut = window_height - window_height * (percentage / 100); 148 if (position <= cut) { 149 return true; 150 } else { 151 return false;
152 } 153 } 154 155 function set_fullwidth() { 156 var width = $(window).width(); 157 var elements = ['.stm_slider_style_9 .owl-nav']; 158 $.each(elements, function () { 159 var $element = $(this); 160 var stm_site_width_custom = $element.closest('.container').width(); 161 if ($element.length) { 162 var offset = (width - stm_site_width_custom) / 2; 163 $element.css('margin-left', '-' + offset + 'px'); 164 $element.width(width); 165 } 166 }); 167 } 168 169 function stm_unclickable() { 170 $('body').on('click', '.unclickable', function (e) { 171 e.preventDefault(); 172 }); 173 } 174 175 function stm_switcher() { 176 $('.stm-switcher__trigger').on('click', function () { 177 $(this).closest('.stm-switcher').find('.stm-switcher__list').toggleClass('active'); 178 $(this).toggleClass('active'); 179 }); 180 181 $('.stm-switcher__option').on('click', function () { 182 var stm_switch = $(this).data('switch'); 183 184 $(this).closest('.stm-switcher').parent().find('.js-switcher').addClass('js-switcher__hidden'); 185 $(this).closest('.stm-switcher').parent().find('.js-switcher_' + stm_switch).removeClass('js-switcher__hidden'); 186 187 $(this).closest('.stm-switcher').find('.stm-switcher__text').text($(this).text()); 188 189 $(this).closest('.stm-switcher__list').removeClass('active'); 190 $(this).closest('.stm-switcher').find('.stm-switcher__trigger').removeClass('active'); 191 }); 192 } 193 194 function stm_sticky_footer() { 195 var windowH = $(window).height(); 196 var footerH = $('.stm-footer').outerHeight(); 197 198 if ($('#wpadminbar').length) { 199 footerH += $('#wpadminbar').outerHeight(); 200 } 201 202 $('#wrapper').css('min-height', windowH - footerH + 'px'); 203 } 204 205 function stm_tabs() { 206 207 $("ul.nav-tabs > li > a").on("click", function (e) { 208 var id = $(this).attr("href").substr(1); 209 window.location.hash = id; 210 }); 211 212 var hash = window.location.hash; 213 $('#products__tabs a[href="' + hash + '"]').tab('show'); 214 } 215 216 function js_active_switch() { 217 $('.js_active_switcher .js_active_switcher__a').on('click', function (e) { 218 e.preventDefault(); 219 $(this).closest('.js_active_switcher').find('.js_active_switcher__a').removeClass('active'); 220 $(this).addClass('active'); 221 }); 222 } 223 224 function js_active_trigger() { 225 var opened = false; 226 var dataToggle = ''; 227 var $element = ''; 228 var $this = ''; 229 $('.js_trigger__click').on('click', function (e) { 230 e.preventDefault(); 231 e.stopPropagation(); 232 233 $this = $(this); 234 235 dataToggle = $(this).attr('data-toggle'); 236 if (typeof dataToggle == 'undefined') dataToggle = true; 237 238 $element = $(this).closest('.js_trigger').find('.js_trigger__unit'); 239 var element = $(this).attr('data-element'); 240 if (typeof element !== 'undefined') $element = $(element); 241 242 if (dataToggle && dataToggle !== 'false') { 243 $element.slideToggle('fast'); 244 } else { 245 $element.toggleClass('active'); 246 } 247 248 $(this).toggleClass('active'); 249 opened = $(this).hasClass('active') ? true : false; 250 var view_ = $(this).attr('data-text-more'); 251 var close_ = $(this).attr('data-text-close'); 252 if (opened) { 253 $(this).text(close_); 254 } else { 255 $(this).text(view_); 256 } 257 }); 258 } 259 260 function stm_share_url() { 261 $('.stm_js__shareble a').on('click', function (e) { 262 e.preventDefault(); 263 var url = $(this).data('share'); 264 var social = $(this).data('social') + '_share'; 265 window.open(url, social, 'width=580,height=296'); 266 }); 267 } 268 269 function stm_header_dropdown_mobile() { 270 var windowW = $(window).width(); 271 272 $('.stm_mobile__switcher').on('each', function (e) { 273 if ($(this).hasClass('active')) { 274 $(this).parent().addClass('href_empty'); 275 } 276 }); 277 278 $('.stm-header .stm-navigation__default li:not(.menu-item-has-children) a').on('click', function (e) { 279 $('.stm-header__overlay').removeClass('active'); 280 $('.stm_mobile__header').removeClass('active'); 281 $('.stm_mobile__switcher').removeClass('active'); 282 $('.stm-header').removeClass('active'); 283 $('body').removeClass('active'); 284 }); 285 286 $('.stm-navigation li.menu-item-has-children > a').each(function () { 287 var href = $(this).attr("href"); 288 if (href == "#") { 289 $(this).parent().addClass('href_empty'); 290 } 291 292 $(this).append('<span class="stm_mobile__dropdown"></span>'); 293 }); 294 295 $('.stm-navigation_hamburger_full li.menu-item-has-children > a > .stm_mobile__dropdown').each(function () { 296 $(this).remove(); 297 $('body').addClass('hamburger_full'); 298 }); 299 300 $('.stm-navigation_hamburger_full').find('.href_empty>a').on('click', function (e) { 301 e.preventDefault(); 302 e.stopPropagation(); 303 var dd = $(this); 304 dd.closest('li').toggleClass('active'); 305 if (dd.parents('.navigation_hamburger_full').length === 0 || window.innerWidth < 1024) { 306 dd.closest('li').children('.sub-menu').toggle(); 307 } 308 }); 309 310 $('body').find('.stm_mobile__dropdown').on('click', function (e) { 311 e.preventDefault(); 312 e.stopPropagation(); 313 var dd = $(this); 314 dd.closest('li').toggleClass('active'); 315 }); 316 317 if (typeof $.fn.swipe === 'function' && windowW < 992) { 318 $(".stm-header").swipe({ 319 swipe: function swipe(event, direction, distance, duration, fingerCount, fingerData) { 320 if (direction == 'left' && distance > 50) { 321 $('.stm-header').removeClass('active'); 322 $('.stm-header__overlay').removeClass('active'); 323 $('.stm_mobile__header').removeClass('active'); 324 $('.stm_mobile__switcher').removeClass('active'); 325 } 326 }, 327 allowPageScroll: "vertical" 328 }); 329 } 330 331 $('.stm-header__overlay').on('click', function () { 332 $(this).removeClass('active'); 333 $('.stm_mobile__header').removeClass('active'); 334 $('.stm_mobile__switcher').removeClass('active'); 335 $('.stm-header').removeClass('active'); 336 $('body').removeClass('active'); 337 }); 338 } 339 340 function stm_header_dropdown_vertical_nav() { 341 $('.stm-header .stm-navigation__vertical_left li.menu-item-has-children').on('click', function (e) { 342 if (!$(this).hasClass('active')) { 343 $('.stm-header .stm-navigation__vertical_left li.menu-item-has-children.active').removeClass('active'); 344 $(this).addClass('active'); 345 } else { 346 $('.stm-header .stm-navigation__vertical_left li.menu-item-has-children.active').removeClass('active'); 347 } 348 }); 349 $('.stm-header .stm-navigation__vertical_left .stm_mobile__switcher').on('click', function (e) { 350 $('.stm-navigation__vertical').toggleClass('active'); 351 }); 352 } 353 354 function stm_header_dropdown_post_filter() { 355 $('.stm-header .stm-post-filter .stm_mobile__switcher').on('click', function () { 356 $('.stm-header .stm-socials-hidden').removeClass('active'); 357 $(this).parents().find('.post-filter').each(function () { 358 if ($(this).hasClass('active')) { 359 $(this).removeClass('active'); 360 } else { 361 $(this).addClass('active'); 362 } 363 }); 364 }); 365 } 366 367 function stm_header_dropdown_socials() { 368 $('.stm-header .stm-socials-hidden .stm-socials-btn').on('click', function () { 369 $('.stm-header .post-filter').removeClass('active'); 370 $('.stm-header .stm_mobile__switcher').removeClass('active'); 371 $(this).parents().find('.stm-socials-hidden').each(function () { 372 if ($(this).hasClass('active')) { 373 $('.stm-socials-btn').removeClass('active'); 374 $(this).removeClass('active'); 375 } else { 376 $('.stm-socials-btn').addClass('active'); 377 $(this).addClass('active'); 378 } 379 }); 380 }); 381 } 382 383 function stm_site_prealoder() { 384 if ($('html').hasClass('stm-site-loader')) { 385 $('html').addClass('loaded'); 386 387 var prevent = false;
388 $('a[href^=mailto], a[href^=skype], a[href^=tel]').on('click', function (e) { 389 prevent = true; 390 $('html').addClass('loaded'); 391 }); 392 393 $(window).on('beforeunload', function (e, k) { 394 if (!prevent) { 395 $('html').removeClass('loaded'); 396 } else { 397 prevent = false; 398 } 399 }); 400 } 401 } 402 403 function productTabs() { 404 $('#products__tab .mobile_tab a').on('click', function (e) { 405 var target = $(this).attr("href"); 406 $('body, html').css('transition-delay', '0s'); 407 setTimeout(function () { 408 $('body, html').animate({ 409 scrollTop: $(target).offset().top 410 }, 100); 411 }, 10); 412 }); 413 } 414 415 function titleBoxExpand() { 416 var box = $('.stm_titlebox'); 417 var container = box.parents('.container'); 418 419 if (box.length === 0 || container.length === 0) { 420 return; 421 } 422 423 var ww = $(document).width() - stm_site_paddings * 2; 424 var w = container.width(); 425 var offset = (ww - w) * 0.5; 426 427 box.css({ 428 width: ww, 429 'margin-left': '-' + offset + 'px' 430 }); 431 } 432 433 var rowExpand = function rowExpand() { 434 435 var sidebarEnabled = $('.site-content .stm_markup__sidebar').length > 0; 436 var forceContainer = $('.site-content .vc_container-fluid-force').length > 0; 437 438 if (sidebarEnabled && !forceContainer) { 439 return; 440 } 441 442 443 $('.stm_markup__content .vc_container-fluid, .vc_container-fluid-force').each(function () { 444 445 var row = $(this); 446 var container = row.parents('.container'); 447 if (row.length === 0 || container.length === 0) { 448 return; 449 } 450 451 var ww = $(document).width() - stm_site_paddings * 2; 452 var w = container.width(); 453 454 var margin = $(this).attr('data-margin'); 455 if (typeof margin === 'undefined') margin = 0; 456 457 var offset = (ww - w) * 0.5 - margin; 458 459 row.css({ 460 width: ww - margin * 2, 461 'margin-left': '-' + offset + 'px' 462 }); 463 464 var position = $(this).offset().left; 465 if (position != stm_site_paddings && stm_site_paddings > position) { 466 offset = offset - (stm_site_paddings - position); 467 row.css({ 468 'margin-left': '-' + offset + 'px' 469 }); 470 } 471 }); 472 }; 473 474 function closeMessageBox() { 475 $('body').on('click', '.vc_message_box .close', function (e) { 476 e.preventDefault(); 477 var messageBox = $(this).parents('.vc_message_box'); 478 messageBox.fadeOut(300, function () { 479 $(this).remove(); 480 }); 481 }); 482 } 483 484 $.fn.is_on_screen = function () { 485 var win = $(window); 486 var viewport = { 487 top: win.scrollTop(), 488 left: win.scrollLeft() 489 }; 490 viewport.right = viewport.left + win.width(); 491 viewport.bottom = viewport.top + win.height(); 492 493 var bounds = this.offset(); 494 bounds.right = bounds.left + this.outerWidth(); 495 bounds.bottom = bounds.top + this.outerHeight(); 496 497 return !(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom); 498 }; 499 500 var stm_select_style = function stm_select_style() { 501 var select = $('select').not('.no_wrap, [multiple], [data-attribute_name], .woocommerce select, [data-field-id]'); 502 503 select.each(function () { 504 var select = $(this); 505 506 var options = select.find('option'); 507 var values = []; 508 options.each(function (v, k) { 509 values.push($(k).text()); 510 }); 511 var choicesList = '<ul class="stm_select__dropdown">'; 512 values.forEach(function (v) { 513 choicesList += '<li><span>' + v + '</span></li>'; 514 }); 515 choicesList += '</ul>'; 516 var wrapperStructure = '<div class="stm_select"></div>'; 517 var wrapper = select.wrap(wrapperStructure).parent(); 518 var selectVal = $('<span class="stm-select__val"></span>').appendTo(wrapper); 519 choicesList = $(choicesList).appendTo(wrapper); 520 choicesList.find('li').on('click', function (e) { 521 e.stopPropagation(); 522 var choice = $(this).text(); 523 selectVal.text(choice); 524 select.val(choice); 525 select.find('option').remove(); 526 select.append('<option value="' + choice + '" selected>'); 527 select.trigger('change'); 528 wrapper.removeClass('open'); 529 }); 530 531 $('.stm-select__val').on('click', function (el) { 532 el.stopPropagation(); 533 $(this).find('option').remove(); 534 $(this).closest('.stm_select').addClass('open'); 535 }); 536 $('body').on('click', function (e) { 537 wrapper.removeClass('open'); 538 }); 539 selectVal.text(select.find('option:selected').text()); 540 }); 541 }; 542 543 var stm_inputs_style = function stm_inputs_style() { 544 545 var inputs = $('input[type="checkbox"], input[type="radio"]').filter(function () { 546 return !$(_this).hasClass('no_wrap') && $(_this).closest('.ipt_fsqm_form').length == 0 && $(_this).closest('.rpress-section').length != 0; 547 }); 548 inputs.each(function () { 549 var input = $(this); 550 var type = input[0].type; 551 var wrapperStructure = '<div class="stm_input_wrapper ' + 'stm_input_wrapper_' + type + '"></div>'; 552 input.wrapAll(wrapperStructure); 553 }); 554 555 inputs.each(function () { 556 if ($(this).is(':checked')) { 557 $(this).parent().addClass('active'); 558 } 559 }); 560 561 $(document).on('change', inputs, function (e) { 562 var $this = $(e.target); 563 var type = $this[0].type; 564 var $wrapper = $this.closest('.stm_input_wrapper'); 565 if ($this.is(':checked')) { 566 $wrapper.addClass('active'); 567 if (type === 'radio') { 568 $('[name="' + $this[0].name + '"]').not($this).each(function () { 569 $(this).parents('.stm_input_wrapper').removeClass('active'); 570 }); 571 $wrapper.siblings().removeClass('active'); 572 } 573 } else { 574 $wrapper.removeClass('active'); 575 } 576 }); 577 }; 578 579 function stm_stretch_column() { 580 $('.wpb_column[data-stretch]').each(function () { 581 var el = $(this); 582 var stretch = el.data('stretch'); 583 var stretchContent = el.data('stretch-content'); 584 var xPos = el.offset().left; 585 var wW = $(window).width(); 586 var xW = el.width(); 587 var wrapper = el.find('.wpb_wrapper').first(); 588 var container = el.parents('.container, .vc_container'); 589 var col = el.find('.vc_column-inner').first(); 590 var colLeftOffset = el.offset().left; 591 if (stretch === 'left') { 592 wrapper.css({ 593 'margin-left': 'auto' 594 }); 595 col.css({ 596 'width': el.width() + colLeftOffset + 'px', 597 'margin-left': '-' + colLeftOffset + 'px' 598 }); 599 } else { 600 var margin = window.innerWidth - colLeftOffset - el.width(); 601 col.css({ 602 'width': window.innerWidth - colLeftOffset + 'px', 603 'margin-right': '-' + margin + 'px' 604 }); 605 } 606 607 if (stretchContent !== true) { 608 wrapper.css('width', el.width() - 30 + 'px'); 609 } 610 611 if (stm_check_mobile() || window.innerWidth <= 1024) { 612 col.css({ 613 'width': window.innerWidth + 'px', 614 'margin-left': '-' + (window.innerWidth - col.outerWidth()) + 'px' 615 }); 616 } 617 }); 618 } 619 620 function stm_load_posts() { 621 $('body').on('click', '.stm_load_posts', function (e) { 622 e.preventDefault(); 623 624 $.ajax({ 625 url: stm_ajaxurl, 626 dataType: 'json', 627 context: this, 628 data: { 629 'page': $(this).attr('data-page'), 630 'per_page': $(this).attr('data-per_page'), 631 'style': $(this).attr('data-style'), 632 'view': $(this).attr('data-view'), 633 'past': $(this).attr('data-past'), 634 'upcoming': $(this).attr('data-upcoming'), 635 'post_type': $(this).attr('data-post_type'), 636 'action': 'pearl_load_more_posts', 637 'security': pearl_load_more_posts 638 }, 639 beforeSend: function beforeSend() { 640 $(this).addClass('loading'); 641 }, 642 complete: function complete(data) { 643 $(this).removeClass('loading'); 644 var dt = data.responseJSON; 645 var $items = $(dt.content); 646 647 var contentWrapper = $($(this).attr('data-element')); 648 contentWrapper.append($items); 649 650 if (dt.page) { 651 $(this).attr('data-page', dt.page); 652 } else { 653 $(this).remove(); 654 } 655 } 656 }); 657 }); 658 } 659 660 function stm_scroll_to() { 661 var $anchor_selector = $('a[href*="#"]:not(.no_scroll):not(.vc_carousel-control)'); 662 if ($anchor_selector.length) { 663 664 $anchor_selector.on('click', function (e) { 665 var href = $(this).attr('href'); 666 var animationTime = 1000; 667 if ($(this).parent().hasClass('mobile_tab')) { 668 animationTime = 50; 669 } 670 var hash_index = href.indexOf("#"); 671 if (hash_index != -1) { 672 if (href.length === 1) e.preventDefault(); 673 674 var vc = $(this).attr('data-vc-container'); 675 if (!vc) { 676 var hash = href.substring(hash_index + 1); 677 var $element = $('#' + hash); 678 679 if ($(this).hasClass('self_scroll')) { 680 $element = $(this); 681 } 682 683 if ($element.length) { 684 e.preventDefault(); 685 686 var frame_height = 54; 687 var header_height = $('.stm-header').height(); 688 689 var scrollValue = $element.offset().top; 690 691 if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 692 if ($('body').hasClass('envato-preview-visible')) { 693 scrollValue -= frame_height; 694 } else if ($('body').hasClass('stm_header_sticky_center')) { 695 scrollValue -= header_height; 696 } 697 698 if ($('body').hasClass('stm_header_sticky_center') & $('body').hasClass('envato-preview-visible')) { 699 scrollValue -= header_height; 700 } 701 } 702 703 $('html, body').animate({ 704 scrollTop: scrollValue 705 }, animationTime); 706 } 707 } 708 } 709 }); 710 } 711 } 712 713 function stm_datepicker() { 714 var $datepicker = $('.stm_datepicker'); 715 if (typeof $.fn.datepicker === 'function' && $datepicker.length) { 716 $datepicker.datepicker({ 717 dateFormat: stm_date_format, 718 beforeShow: function beforeShow(input, inst) { 719 var inputField = inst.input;
720 var inputWidth = inputField.outerWidth(); 721 var calendar = inst.dpDiv; 722 723 if (inputWidth > 170) { 724 setTimeout(function () { 725 calendar.css({ 'width': inputWidth + 'px' }); 726 }, 10); 727 } 728 } 729 }); 730 } 731 } 732 733 function stm_timepicker() { 734 var $timepicker = $('.stm_timepicker'); 735 if (_typeof($.fn.timepicker) && $timepicker.length) { 736 $timepicker.timepicker({ 737 timeFormat: stm_time_format 738 }); 739 } 740 } 741 742 var stm_mobileStickyHeader = function stm_mobileStickyHeader() { 743 var headerPlaceholder = $('.stm_sticky_header_placeholder'); 744 745 if (headerPlaceholder.length > 0 && window.innerWidth > 550) { 746 headerPlaceholder.remove(); 747 } 748 if (!$('body').hasClass('stm_sticky_header_mobile') || window.innerWidth > 550) { 749 return; 750 } 751 752 var mobileHeader = $('.stm_mobile__header'); 753 var headerHeight = mobileHeader.outerHeight(); 754 755 if (headerPlaceholder.length === 0) { 756 var holder = $('<div class="stm_sticky_header_placeholder"></div>').prependTo('#wrapper').css({ 'height': headerHeight }); 757 } 758 759 760 var to = null; 761 var lastScroll = 0; 762 $(window).on('scroll', function (e) { 763 764 var scroll = $(this).scrollTop(); 765 if (scroll > lastScroll && scroll > headerHeight + 200) { 766 mobileHeader.css({ 767 'transform': 'translateY(-100%)' 768 }); 769 } else { 770 mobileHeader.css({ 771 'transform': 'translateY(0)' 772 }); 773 } 774 775 lastScroll = scroll; 776 }); 777 }; 778 779 function stm_load_scripts() { 780 $('script[data-src]').each(function () { 781 $(this).attr('src', $(this).data('src')); 782 }); 783 } 784 785 function stm_image_placeholder() { 786 var deferImage = function deferImage(element) { 787 var i, len, attr; 788 var img = new Image(); 789 var placehold = element.children[0]; 790 791 element.className += ' is-loading'; 792 793 img.onload = function () { 794 element.className = element.className.replace('is-loading', 'is-loaded'); 795 element.replaceChild(img, placehold); 796 }; 797 798 for (i = 0, len = placehold.attributes.length; i < len; i++) { 799 attr = placehold.attributes[i]; 800 if (attr.name.match(/^data-/)) { 801 img.setAttribute(attr.name.replace('data-', ''), attr.value); 802 } 803 } 804 }; 805 } 806 807 function stm_scroll_top() { 808 $("a[href='#top']").on('click', function () { 809 $("html, body").animate({ scrollTop: 0 }, 300); 810 return false; 811 }); 812 } 813 814 function stm_scroll_to_top() { 815 $(".pearl_arrow_top").on("click", function () { 816 var scroll_pos = 0; 817 $('html, body').animate({ scrollTop: scroll_pos }, '5000', function () { 818 $(".arrow_top").removeClass("arrowShow"); 819 }); 820 }); 821 } 822 823 function stm_post_thumbnail_before_content() { 824 $('.stm_single_post_layout_18').each(function () { 825 var height = $(this).find('.post_thumbnail').height(); 826 $(this).css('padding-top', height); 827 }); 828 } 829 830 function stm_post_archive_sidebars() { 831 $('.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'); 832 $('.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'); 833 $('.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');
834 $('.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'); 835 $('.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'); 836 $('.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'); 837 } 838 839 function stm_post_video_hover() { 840 $(".post_video .stc_h").on('mouseenter', function () { 841 $(this).parents('.post_video').find('.stc_h').addClass('stc'); 842 }); 843 $(".post_video .stc_h").on('mouseleave', function () { 844 $(this).parents('.post_video').find('.stc_h').removeClass('stc'); 845 }); 846 } 847 848 function stm_envato_preview_control() { 849 var preview = $('.pearl-envato-preview'); 850 851 $('.preview__action--close').on('click', function () { 852 $('.pearl-envato-preview').slideUp(); 853 $('.pearl-envato-preview-holder').slideUp(); 854 $('body').removeClass('envato-preview-visible'); 855 }); 856 857 if (preview.length) { 858 } 859 } 860 861 function stm_audio_modal() { 862 var modal = $('.stm_audio_modal'); 863 if (modal.length === 0) return; 864 865 modal.each(function () { 866 var modal = moveModal($(this)); 867 var audio = modal.find('audio')[0]; 868 modal.on('show.bs.modal', function () { 869 audio.play(); 870 }); 871 872 modal.on('hide.bs.modal', function () { 873 audio.pause(); 874 }); 875 }); 876 } 877 878 var stm_kenburns = function stm_kenburns() { 879 var rows = $('[data-stm-kenburns]'); 880 881 rows.each(function () { 882 var el = $(this); 883 var kenBurnsHtml = '<div class="stm_kenburns"><div class="stm_kenburns__image"></div></div>'; 884 if (el.data('stm-kenburns') === 'enable') { 885 var parentContainer = el.parents('[class*="vc_container"]'); 886 var bgi = parentContainer.css('background-image'); 887 parentContainer.attr('style', parentContainer.attr('style') + ';' + 'background-image: none !important'); 888 var kenBurnsEl = $(kenBurnsHtml).appendTo(parentContainer); 889 var kenBurnsImage = kenBurnsEl.find('.stm_kenburns__image'); 890 kenBurnsImage.css('background-image', bgi); 891 } 892 }); 893 }; 894 895 var stm_hamburger = function stm_hamburger() { 896 var menu = $('.stm-navigation__hamburger > ul'); 897 var menuItem = menu.find('li.menu-item-has-children'); 898 }; 899})(jQuery); 900 901function initGoogleScripts() { 902 var stmGmap = new CustomEvent("stm_gmap_api_loaded"); 903 document.body.dispatchEvent(stmGmap); 904 if (typeof stm_init_map_barba !== 'undefined') window.stm_init_map_barba(); 905} 906 907function stmOffsetCenter(map, latlng, offsetx, offsety) { 908 909 var scale = Math.pow(2, map.getZoom()); 910 911 var worldCoordinateCenter = map.getProjection().fromLatLngToPoint(latlng); 912 var pixelOffset = new google.maps.Point(offsetx / scale || 0, offsety / scale || 0); 913 914 var worldCoordinateNewCenter = new google.maps.Point(worldCoordinateCenter.x - pixelOffset.x, worldCoordinateCenter.y + pixelOffset.y); 915 916 var newCenter = map.getProjection().fromPointToLatLng(worldCoordinateNewCenter); 917 918 map.setCenter(newCenter); 919} 920 921var uniqid = function uniqid() { 922 return '_' + Math.random().toString(36).substr(2, 9); 923}; 924 925function stm_light_gallery() { 926 var reinit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 927 928 var $ = jQuery; 929 if (typeof $.fn.lightGallery === 'function') { 930 931 var galleries = $('.stm_lightgallery'); 932 933 galleries.each(function () { 934 var gallery = $(this); 935 936 if (reinit) { 937 try { 938 gallery.data('lightGallery').destroy(true); 939 } catch (e) { 940 console.log(e.message); 941 } 942 } 943 gallery.lightGallery({ 944 'selector': '.stm_lightgallery__selector' 945 }); 946 }); 947 948 $('.stm_lightgallery__iframe').lightGallery({ 949 selector: 'this', 950 iframeMaxWidth: '70%' 951 }); 952 } 953} 954 955var StmInfoBox = function () { 956 function StmInfoBox(options, container) { 957 _classCallCheck(this, StmInfoBox); 958 959 var $ = jQuery; 960 961 this.container = $(container); 962 this.box = '.stm_infobox'; 963 964 this.init(options); 965 this.parseStyle(); 966 } 967 968 _createClass(StmInfoBox, [{ 969 key: 'init', 970 value: function init(options) { 971 this.content = options.content || ''; 972 this.maxWidth = options.maxWidth || 200; 973 this.pixelOffset = options.pixelOffset || [0, 0]; 974 this.zIndex = options.zIndex || 0; 975 this.boxStyle = options.boxStyle || {}; 976 this.style = ''; 977 } 978 }, {
979 key: 'parseStyle', 980 value: function parseStyle() { 981 var $ = jQuery; 982 var style = ''; 983 style += 'zindex: ' + this.zIndex + ';'; 984 style += 'left: ' + this.pixelOffset[0] + ';'; 985 style += 'top: ' + this.pixelOffset[1] + ';'; 986 style += 'maxWidth: ' + this.maxWidth + 'px;'; 987 988 if (Object.keys(this.boxStyle).length > 0) { 989 for (var rule in this.boxStyle) { 990 style += rule + ' : ' + this.boxStyle[rule] + ';'; 991 } 992 } 993 994 this.style = style; 995 } 996 }, { 997 key: 'open', 998 value: function open() { 999 var html = '<div class="stm_infobox">' + '<div class="stm_infobox__content">' + this.content + '</div>' + '</div>'; 1000 if (this.container.find('.stm_infobox').length === 0 && this.content.length !== 0) { 1001 this.container.append(html); 1002 } 1003 } 1004 }, { 1005 key: 'close', 1006 value: function close() { 1007 if (this.container.find('.stm_infobox').length > 0) { 1008 this.container.find('.stm_infobox').remove(); 1009 } 1010 } 1011 }]); 1012 1013 return StmInfoBox; 1014}(); 1015 1016function stm_check_mobile() { 1017 "use strict"; 1018 1019 var isMobile = false; 1020 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.
1020substr(0, 4))) isMobile = true; 1021 return isMobile; 1022} 1023 1024function createCookie(name, value, days) { 1025 var expires = ""; 1026 var date = new Date(); 1027 date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); 1028 document.cookie = name + "=" + value + "; expires=" + date.toUTCString() + "; path=/"; 1029} 1030 1031function moveModal(el) { 1032 var newEl = el.clone(true, true); 1033 el.remove(); 1034 newEl.appendTo('body'); 1035 return newEl; 1036} 1037 1038function isNumeric(value) { 1039 return value == Number(value) ? "number" : "string"; 1040} 1041 1042(function ($) { 1043 var action = ''; 1044 $.ajaxSetup({ 1045 beforeSend: function beforeSend(jqXHR, settings) { 1046 if (settings["data"]) { 1047 if (settings["data"].toString().indexOf("nf_ajax_submit") >= 0) return 0; 1048 } 1049 if (settings.data && $('body').hasClass('rpress') && $("#rpressModal").length) { 1050 var q = JSON.parse('{"' + decodeURI(settings.data.toString().replace(/&/g, "\",\"").replace(/=/g, "\":\"")) + '"}'); 1051 if (q.action && q.action === "rpress_edit_cart_fooditem") { 1052 action = 'rpress_edit_cart_fooditem'; 1053 } 1054 } 1055 }, 1056 complete: function complete(data) { 1057 if (action == 'rpress_edit_cart_fooditem') { 1058 var r = JSON.parse(data.responseText); 1059 1060 var qty = $(document).find('#rpressModal').find('.qty').val(); 1061 if (qty && r.data && r.data.price_raw) { 1062 var price = r.data.price_raw; 1063 var total_price = price * qty; 1064 1065 if (rp_scripts && rp_scripts.currency_sign) { 1066 $(document).find('#rpressModal').find('.cart-item-price').html(rp_scripts.currency_sign + total_price.toFixed(2)); 1067 } 1068 $(document).find('#rpressModal').find('.cart-item-price').attr('data-current', price); 1069 $(document).find('#rpressModal').find('.cart-item-price').attr('data-price', price); 1070 } 1071 } 1072 } 1073 }); 1074})(jQuery); 1075 1076function findTable(widget_id) {
1077 var rid = document.getElementById('rid-' + widget_id).value.replace(/[^0-9]/g, ''); 1078 var restref = document.getElementById('restref-' + widget_id).value.replace(/[^0-9]/g, ''); 1079 var partysize = document.getElementById('partysize-' + widget_id).value.replace(/[^0-9]/g, ''); 1080 var date = document.getElementById('date-' + widget_id).value; 1081 var time = document.getElementById('time-' + widget_id).value.replace(/[^:0-9]/gim, ''); 1082 var newtime = ''; 1083 1084 if (time.replace(/[^a-zа-ÑÑ]/gi, '') == 'pm') { 1085 newtime = Number(time.substr(0, time.indexOf(':'))) + 12; 1086 } else { 1087 if (time.indexOf(':') < 2) { 1088 newtime = '0' + time.substr(0, time.indexOf(':')); 1089 } else { 1090 newtime = time.substr(0, time.indexOf(':')); 1091 } 1092 } 1093 time = newtime + ":" + time.substr(time.indexOf(':') + 1); 1094 1095 var request = '?rid=' + rid + '&restref=' + restref + "&partysize=" + partysize + "&datetime=" + date + "T" + time; 1096 window.open('//opentable.com/restref/client/' + request); 1097}
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.