1/** 2 * Main Site Initialization Scripts 3 */ 4 5 6jQuery.fn.doesExist = function(){ 7 return jQuery(this).length > 0; 8}; 9 10(function ($, window, undefined) { 11 "use strict"; 12 13 /* 14 Isotope Initialization 15 */ 16 if(jQuery().masonry) { 17 var $container = $('.masonry-wrapper .blog-post-items'); 18 19 $container.imagesLoaded( function(){ 20 21 }); 22 23 } 24 25 $(document).ready(function() { 26 $(window).load(function(){ 27 28 if (typeof skrollr != 'undefined') { 29 if (!(/Android|iPhone|iPad|iPod|BlackBerry/i).test(navigator.userAgent || navigator.vendor || window.opera)) { 30 skrollr.init({forceHeight: false}); 31 } else { 32 skrollr.init().destroy(); 33 } 34 } 35 36 $('input,textarea').placeholder(); 37 38 39 /* 40 Sticky Header 41 */ 42 function getCurrentScroll() { 43 return window.pageYOffset || document.documentElement.scrollTop; 44 } 45 46 if ( $('body.sticky').length && $('#header-region').length ) { 47 var positionHeader = 180; 48 $(window).scroll(function () { 49 var scroll = getCurrentScroll(); 50 if (scroll >= positionHeader) { 51 $('#header-region').addClass('shrink-sticky'); 52 } 53 else { 54 $('#header-region').removeClass('shrink-sticky'); 55 } 56 }); 57 58 var shrinkHeader = 280; 59 $(window).scroll(function () { 60 var scroll = getCurrentScroll(); 61 if (scroll >= shrinkHeader) { 62 $('#header-region').addClass('shrink'); 63 $('#banner').addClass('header-shrink'); 64 } 65 else { 66 $('#header-region').removeClass('shrink'); 67 $('#banner').removeClass('header-shrink'); 68 } 69 } ); 70 } 71 72 73 /* 74 Menu 75 */ 76 $('.site_main_menu').smartmenus({ 77 subMenusSubOffsetX: 38, 78 subMenusSubOffsetY: 21 79 80 }); 81 82 $('.menu-button').click(function() { 83 var $this = $(this); 84 if ($this.hasClass('active')) 85 { 86 $('#header-region').addClass('menu-collapsed'); 87 $this.removeClass('active'); 88 } else { 89 $('#header-region').removeClass('menu-collapsed'); 90 $this.addClass('active'); 91 } 92 return false; 93 }); 94 95 96 /* 97 Header Search Bar 98 */ 99 var $bodyContainer = $(document.body); 100 101 /* Search */ 102 $('a[href="#search-header"]').on('click', function(event) { 103 event.preventDefault(); 104 $('#search-header').addClass('open'); 105 $bodyContainer.toggleClass('search-open'); 106 107 setTimeout(function(){ 108 $('#search-overlay-input').focus(); 109 }, 500); 110 }); 111 112 $('#search-header, #search-header button.close').on('click keyup', function(event) { 113 if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { 114 $(this).removeClass('open'); 115 $bodyContainer.toggleClass('search-open'); 116 } 117 }); 118 119 120 /* 121 Flip Cards 122 */ 123 if(jQuery().flip) { 124 $(".card").flip({ 125 axis: 'y', 126 trigger: 'hover' 127 }); 128 } 129 130 131 /* 132 Slider Initialization 133 */ 134 $('.flexslider').each(function() { 135 var has_controls = false, 136 has_pips = false, 137 pause_on_action = false, 138 pause_on_hover = false, 139 randomize = false, 140 speed = 7000, 141 animation = 'fade'; 142 143 if ( $(this).hasClass('has-controls') ) has_controls = true; 144 if ( $(this).hasClass('has-item-navigation') ) has_pips = true; 145 if ( $(this).hasClass('pause-on-action') ) pause_on_action = true; 146 if ( $(this).hasClass('pause-on-hover') ) pause_on_hover = true; 147 if ( $(this).hasClass('randomize') ) randomize = true; 148
149 if ( $(this).hasClass('transition-slide') ) animation = 'slide'; 150 151 if ( $(this).data('speed')) speed = $(this).data('speed'); 152 153 $(this).flexslider( 154 { 155 'animation' : animation, 156 'slideshowSpeed' : speed, 157 'randomize' : randomize, 158 'pauseOnAction' : pause_on_action, 159 'pauseOnHover' : pause_on_hover, 160 'controlNav' : has_pips, 161 'directionNav' : has_controls 162 } 163 ); 164 }); 165 166 $('.flexslider-gallery').flexslider({ 167 randomize: true, 168 controlNav: false, 169 directionNav: true, 170 slideshowSpeed: 3000 171 }); 172 173 /* 174 Gallery Lightbox Initialization 175 */ 176 177 if ( jQuery().featherlight && jQuery().featherlightGallery ) { 178 $.featherlightGallery.prototype.afterContent = function () { 179 var caption = this.$currentTarget.find('img').attr('alt'); 180 this.$instance.find('.featherlight-caption').remove(); 181 $('<p class="featherlight-caption">').text(caption).appendTo(this.$instance.find('.featherlight-content')); 182 }; 183 } 184 185 /* 186 Modal Windows Initialization 187 */ 188 if( jQuery().featherlight ) { 189 $.featherlight.defaults.beforeOpen = function(event){ 190 $('body').addClass('modal-view'); 191 }; 192 193 $.featherlight.defaults.afterClose = function(event){ 194 $('body').removeClass('modal-view'); 195 }; 196 } 197 198 /* 199 Scroll Up Arrow 200 */ 201 $(window).scroll(function () { 202 if ($(this).scrollTop() > 100) { 203 $('.scrollup').fadeIn(); 204 } else { 205 $('.scrollup').fadeOut(); 206 } 207 }); 208 $('.scrollup').click(function () { 209 $("html, body").animate({ scrollTop: 0 }, 600); 210 return false; 211 }); 212 213 /* 214 Maps 215 */ 216 if ( jQuery().initMap ) { 217 $( ".map-widget-canvas" ).each(function() { 218 var id = $( this ).attr( 'id' ); 219 var address = $ (this).data( 'location' ); 220 var type = $ (this).data( 'type' ); 221 var zoom = $ (this).data( 'zoom' ); 222 $('#' + id).initMap( { 223 type: type, 224 controls : { 225 map_type: { 226 type: ['roadmap', 'satellite', 'hybrid'], 227 position: 'top_right', 228 style: 'dropdown_menu' 229 }, 230 overview: {opened: false}, 231 pan: false, 232 rotate: false, 233 scale: false, 234 street_view: {position: 'top_center'}, 235 zoom: { 236 position: 'top_left', 237 style: 'small' 238 } 239 }, 240 center: address, 241 markers : { 242 marker1 : { 243 position: address, 244 info_window : { 245 content : address, 246 showOn: 'mouseover', 247 hideOn: 'mouseout', 248 maxWidth: 150, 249 zIndex: 2 250 } 251 } 252 }, 253 options : 254 { 255 zoom: zoom 256 } 257 } 258 ); 259 }); 260 } 261 262 /* 263 Animations 264 */ 265 if (typeof WOW == 'function') { 266 var is_mobile = false; 267 if ( $('body' ).hasClass( 'has-mobile-anim' ) ) { 268 is_mobile = true; 269 } 270 var wow = new WOW( 271 { 272 boxClass: 'inbound-wow', 273 mobile: is_mobile, 274 live: false 275 } 276 ); 277 wow.init(); 278 } 279 280 /* 281 WooCommerce 282 */ 283 function inbound_added_to_cart(e) { 284 inbound_show_notification(); 285 setTimeout( inbound_hide_notification, 2000); 286 } 287 function inbound_hide_notification() { 288 $('#header-cart-notification').addClass('collapsed'); 289 } 290 function inbound_show_notification() { 291 $('#header-cart-notification').removeClass('collapsed'); 292 } 293 294 295 $('#header-cart') 296 .mouseenter(function(){ 297 $(this).removeClass('collapsed'); 298 $("#header-search").addClass('collapsed'); 299 }) 300 .mouseleave(function(){ 301 $(this).addClass('collapsed'); 302 }); 303 304 305 $('body').bind('added_to_cart', inbound_added_to_cart); 306 307 /* 308 Countdown 309 */ 310 var cur = new Date(), 311 curY = cur.getFullYear(), 312 curM = cur.getMonth()+1, 313 curD = cur.getDate(); 314 315 316 $('.countdown.wd').each(function() { 317 var 318 count_days = $(this).data('days'), 319 count_hours = $(this).data('hours'), 320 count_minutes = $(this).data('minutes'), 321 count_seconds = $(this).data('seconds'); 322 323 $(this).oli_counter({ 324 'times_array': Array(1, 60, 3600, 86400), 325 'group_text': Array( count_seconds, count_minutes, count_hours, count_days), 326 'animation_speed':100 327 }); 328 }); 329 330 331 }); 332 333 $(window).load(function(){ 334 $('.site_main_menu a[href^="#"], .so-panel a[href^="#"]').mPageScroll2id({ 335 offset: 91, 336 highlightClass: "current-menu-item", 337 highlightSelector: ".site_main_menu a", 338 forceSingleHighlight: true, 339 scrollSpeed: 900 340 }); 341 }); 342 343 $(window).resize(function(){ 344 var loc=window.location.hash, 345 to=(loc.indexOf("#/#")!==-1) ? loc.split("/")[1] : loc; 346 $.mPageScroll2id("scrollTo",to); 347 }); 348 349 }); 350 351})(jQuery, this); 352 353 354/* 355 * Smooth Scrolling for One Page Designs 356 */ 357 358(function ($, window, undefined) { 359 "use strict"; 360 361 362})(jQuery, this); 363 364 365 366/*! A fix for the iOS orientationchange zoom bug. 367 Script by @scottjehl, rebound by @wilto. 368 MIT License. 369 */ 370(function(w){ 371 // This fix addresses an iOS bug, so return early if the UA claims it's something else. 372 if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ){ return; } 373 var doc = w.document; 374 if( !doc.querySelector ){ return; } 375 var meta = doc.querySelector( "meta[name=viewport]" ), 376 initialContent = meta && meta.getAttribute( "content" ), 377 disabledZoom = initialContent + ",maximum-scale=1", 378 enabledZoom = initialContent + ",maximum-scale=10", 379 enabled = true, 380 x, y, z, aig; 381 if( !meta ){ return; } 382 function restoreZoom(){ 383 meta.setAttribute( "content", enabledZoom ); 384 enabled = true; } 385 function disableZoom(){ 386 meta.setAttribute( "content", disabledZoom ); 387 enabled = false; } 388 function checkTilt( e ){ 389 aig = e.accelerationIncludingGravity; 390 x = Math.abs( aig.x ); 391 y = Math.abs( aig.y ); 392 z = Math.abs( aig.z ); 393 // If portrait orientation and in one of the danger zones 394 if( !w.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ 395 if( enabled ){ disableZoom(); } } 396 else if( !enabled ){ restoreZoom(); } } 397 w.addEventListener( "orientationchange", restoreZoom, false ); 398 w.addEventListener( "devicemotion", checkTilt, false ); 399})( this );
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.