1jQuery(document).ready(function ($) { 2 "use strict"; 3 4 l18W(); 5 6 $(window).load(function() { 7 l18W(); 8 }); 9 10 $(window).resize(function(){ 11 l18W(); 12 }) 13 14 $.fn.is_on_screen = function(){ 15 var win = $(window); 16 var viewport = { 17 top : win.scrollTop(), 18 left : win.scrollLeft() 19 }; 20 viewport.right = viewport.left + win.width(); 21 viewport.bottom = viewport.top + win.height(); 22 23 var bounds = this.offset(); 24 bounds.right = bounds.left + this.outerWidth(); 25 bounds.bottom = bounds.top + this.outerHeight(); 26 27 return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); 28 }; 29 30 $(document).on("click", ".js-open-search-box", function() { 31 $(this).closest(".header_search").toggleClass("active"); 32 return false; 33 }); 34 35 if( $(".wpb_revslider_element").length && $('body').hasClass("header_style_7") ) { 36 $(".wpb_revslider_element").closest(".vc_row-no-padding").addClass("stm-revslider-wrapper"); 37 } 38 39 $(document).on("click", "body", function(e) { 40 if( ! $(e.target).closest(".header_search").length ) { 41 $(".header_search").removeClass("active"); 42 43 } 44 }); 45 46 $("body .wpb_video_widget .wpb_wrapper .wpb_video_wrapper .play_video").live('click', function () { 47 $(this).parent().find('iframe').attr( 'src', $(this).parent().find('iframe').attr( 'src' ) + '?autoplay=1').delay(); 48 $(this).hide(); 49 $(this).parent().find('img').hide(); 50 $(this).parent().find('.video').show(); 51 return false; 52 }); 53 54 $(".staff_read_more").live('click', function () { 55 $(this).closest('.stm_staff_2').find('.full_description').slideToggle(150); 56 return false; 57 }); 58 59 $("select:not(.stm_not_select2)").each(function() { 60 if( ! $(this).closest(".gfield").hasClass("stm_not_select2") ) { 61 $(this).select2({width: '100%', minimumResultsForSearch: '-1'}); 62 } 63 }); 64 if( $("#rating").length ){ 65 $("#rating").select2( 'destroy' ); 66 } 67 68 if( $("#demos_switcher").length ) { 69 $("#demos_switcher").select2("destroy"); 70 71 $("#demos_switcher").select2({ 72 templateResult: demosItemTemplate, 73 width: '100%', 74 minimumResultsForSearch: '-1' 75 }); 76 77 } 78 79 if( $('body').hasClass('customizer_page') ) { 80 $(".customizer_page .ui-tabs").remove(); 81 } 82 83 $('#menu_toggle').live('click', function () { 84 $(this).toggleClass('open'); 85 $('.mobile_header .top_nav_mobile').slideToggle(300); 86 return false; 87 }); 88 89 $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > a").after('<span class="arrow"><i></i></span>'); 90 $(".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>'); 91 92 $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children .arrow").live('click', function () { 93 $(this).toggleClass('active'); 94 $(this).closest('li').find('> ul').slideToggle(300); 95 }); 96 97 $(".mobile_header .top_nav_mobile .main_menu_nav > li.menu-item-has-children > a").live('click', function () { 98 if( $(this).attr('href') == '#' ){ 99 $(this).closest('li').find('ul').slideToggle(300); 100 $(this).closest('li').find('.arrow').toggleClass('active'); 101 } 102 }); 103 104 // Quantity actions 105 $('.quantity_actions span').on('click', function() { 106 var quantityContainer = $(this).closest('.quantity'), 107 quantityInput = quantityContainer.find('.qty'), 108 quantityVal = quantityInput.attr('value'); 109 110 if( $(this).hasClass('plus') ) { 111 quantityInput.attr('value', parseInt(quantityVal) + 1); 112 } else if( $(this).hasClass('minus') ) { 113 if( quantityVal > 1 ) { 114 quantityInput.attr('value', parseInt(quantityVal) - 1); 115 } 116 } 117 }); 118 119 $("#header .top_nav, .header_style_2 #header .header_top").affix({ 120 offset: { 121 top: 200 122 } 123 }); 124 125 $(".top_bar_info_switcher .active").on('click', function () { 126 127 if( $(".top_bar_info_switcher ul").is(':visible') ){ 128 $(".top_bar_info_switcher ul").slideUp(100); 129 }else{ 130 $(".top_bar_info_switcher ul").slideDown(100); 131 } 132 133 return false;
134 }); 135 136 $(".top_bar_info_switcher a").on('click', function () { 137 var id = $(this).attr('href'); 138 var title = $(this).text(); 139 $(".top_bar_info").hide(); 140 $(id).show(); 141 $(".top_bar_info_switcher .active span").text(title); 142 $(".top_bar_info_switcher ul").slideUp(100); 143 return false; 144 }); 145 146 if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){ 147 stm_animate_block(); 148 }else{ 149 $(".stm_animation").css('opacity', 1); 150 } 151 152 jQuery(window).scroll(function(){ 153 if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){ 154 stm_animate_block(); 155 }else{ 156 $(".stm_animation").css('opacity', 1); 157 } 158 }); 159 160 $('.single-product .product-type-variable table.variations select').live("change", function() { 161 $(this).parent().find('.select2-selection__rendered').text($(this).find('option[value="'+ $(this).val() +'"]').text()); 162 }); 163 164 /*Adds*/ 165 if(typeof($.fancybox) !== 'undefined') { 166 $('.stm_fancy-iframe').fancybox({ 167 type: 'iframe', 168 padding: 0, 169 maxWidth: '800px', 170 width: '100%', 171 fitToView: false, 172 beforeLoad: function () { 173 var url = $(this.element).data('url'); 174 this.href = url; 175 } 176 }); 177 178 $('.stm_fancybox').fancybox({ 179 fitToView : false, 180 padding : 30, 181 maxWidth : '500px', 182 autoSize : true, 183 closeClick : false, 184 openEffect : 'none', 185 closeEffect : 'none', 186 }); 187 } 188 189 $('[data-scroll-to]').on('click', function(e){ 190 var url = $(this).attr('data-scroll-to'); 191 if(typeof(url) !== 'undefined') { 192 var url_parsed = url.split('#'); 193 if(typeof(url_parsed[1]) !== 'undefined' && $('#' + url_parsed[1]).length > 0) { 194 $('html, body').stop().animate({ 195 scrollTop: $('#' + url_parsed[1]).offset().top 196 }, 700); 197 } else { 198 window.location.href = url; 199 } 200 } 201 }); 202 203 $('.stm_top_bar_l13-search button').click(function(e){ 204 var $wr = $(this).closest('.stm_top_bar_l13-search'); 205 if($wr.hasClass('active')) { 206 if($wr.find('input').val() == '') { 207 e.preventDefault(); 208 $wr.removeClass('active active-focus'); 209 } 210 } else { 211 e.preventDefault(); 212 $wr.addClass('active active-focus'); 213 setTimeout(function(){ 214 $wr.find('input').focus(); 215 }, 300); 216 } 217 }) 218 219 $('body').click(function(e) { 220 if ($(e.target).closest('.stm_top_bar_l13-search').length === 0) { 221 var $wr = $('.stm_top_bar_l13-search'); 222 $wr.find('input').focusout(); 223 $wr.removeClass('active active-focus'); 224 } 225 }); 226 227}); 228 229function stm_animate_block(){ 230 jQuery('.stm_animation').each(function(){ 231 if(jQuery(this).attr('data-animate')) { 232 var animation_blocks = jQuery(this).children('*'); 233 var animationName = jQuery(this).attr('data-animate'), 234 animationDuration = jQuery(this).attr('data-animation-duration') + 's', 235 animationDelay = jQuery(this).attr('data-animation-delay'); 236 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;'; 237 var container_style = 'opacity:1;-webkit-transition-delay: '+(animationDelay)+'s; -moz-transition-delay: '+(animationDelay)+'s; transition-delay: '+(animationDelay)+'s;'; 238 if (isAppear(jQuery(this))) { 239 jQuery(this).attr( 'style', container_style ); 240 jQuery.each( animation_blocks, function(index,value){ 241 jQuery(this).attr('style', style); 242 jQuery(this).addClass('animated').addClass(animationName); 243 }); 244 } 245 } 246 }); 247} 248 249function isAppear(id) { 250 var window_scroll = jQuery(window).scrollTop(); 251 var window_height = jQuery(window).height(); 252 253 if (jQuery(id).hasClass('stm_viewport')) { 254 var start_effect = jQuery(id).data('viewport_position'); 255 } 256 257 if (typeof(start_effect) === 'undefined' || start_effect == '') { 258 var percentage = 2; 259 }else { 260 var percentage = 100 - start_effect; 261 } 262 var element_top = jQuery(id).offset().top; 263 var position = element_top - window_scroll; 264 265 var cut = window_height - (window_height * (percentage / 100)); 266 if (position <= cut) { 267 return true; 268 }else { 269 return false;
270 } 271} 272 273function demosItemTemplate(state) { 274 if (!state.id) { return state.text; } 275 var $state = jQuery( 276 '<span class="'+ state.element.value +'"> ' + state.text + '</span>' 277 ); 278 return $state; 279} 280 281function l18W() { 282 var $ = jQuery; 283 if($('body').hasClass('site_layout_18')) { 284 var contentW = $('#fullpage').outerWidth(); 285 var contentArea = $('.content-area').outerWidth(); 286 var fullWleft = contentW/2; 287 288 var marginArea = (contentW - contentArea) / 2; 289 //$('.stm_bg_right').css('width', contentW + 'px'); 290 $('.stm_fullwidth_left').css({ 291 'width' : fullWleft + 'px' 292 }); 293 294 $('.stm_fullwidth_content').css({ 295 'width' : contentW + 'px', 296 'margin-right' : '-' + marginArea + 'px' 297 }) 298 299 } 300}
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.