1(function($){ 2 "use strict"; 3 4 jQuery(document).ready(function(){ 5 6 jQuery(".owl-single").each(function(){ 7 jQuery(this).slick({ 8 autoplay: true, 9 dots: true, 10 autoplaySpeed: 2000 11 }); 12 }); 13 14 15 jQuery(".article-carousel").each(function(){ 16 var number = jQuery(this).data('number'); 17 var dots = jQuery(this).data('dots'); 18 var arrows = jQuery(this).data('arrows'); 19 var table = jQuery(this).data('table'); 20 var mobile = jQuery(this).data('mobile'); 21 var mobilemin = jQuery(this).data('mobilemin'); 22 jQuery(this).slick({ 23 dots: dots, 24 slidesToShow: number, 25 autoplay: true, 26 arrows: arrows, 27 autoplaySpeed: 5000, 28 responsive: [ 29 { 30 breakpoint: 900, 31 settings: { 32 slidesToShow: table 33 } 34 }, 35 { 36 breakpoint: 600, 37 settings: { 38 slidesToShow: mobile 39 } 40 }, 41 { 42 breakpoint: 440, 43 settings: { 44 slidesToShow: mobilemin 45 } 46 } 47 ] 48 49 }); 50 }); 51 52 53 jQuery(".article-carousel-center").each(function(){ 54 var number = jQuery(this).data('number'); 55 var dots = jQuery(this).data('dots'); 56 var arrows = jQuery(this).data('arrows'); 57 jQuery(this).slick({ 58 dots: dots, 59 slidesToShow: number, 60 arrows: arrows, 61 slidesToScroll: 1, 62 autoplay: true, 63 autoplaySpeed:5000, 64 centerMode: true, 65 variableWidth: true, 66 focusOnSelect: true, 67 responsive: [ 68 { 69 breakpoint: 850, 70 settings: { 71 variableWidth: false 72 } 73 }, 74 { 75 breakpoint: 480, 76 settings: { 77 centerMode: false, 78 variableWidth: false 79 } 80 } 81 ] 82 }); 83 }); 84 85 // Slider top -------------------------------------------------------------------------------------------------/ 86 jQuery(".box-slider").each(function(){ 87 jQuery('.box-large').slick({ 88 slidesToShow: 1, 89 arrows: true, 90 autoplay: true, 91 fade: true, 92 draggable: true, 93 }); 94 }); 95 96 // Menu -------------------------------------------------------------------------------------------------------/ 97 jQuery('.mega-menu').slicknav({ 98 prependTo :'#boal-header', 99 label :'' 100 }); 101 102 var scrollTop = $(document).scrollTop(); 103 var headerHeight = $('.header-fixed').outerHeight(); 104 var contentHeight = $('.site-header').outerHeight(); 105 $(window).scroll(function() { 106 var headerscroll = $(document).scrollTop(); 107 108 if (headerscroll > contentHeight){$('.header-fixed').addClass('fixed');} 109 else {$('.header-fixed').removeClass('fixed');} 110 // 111 if (headerscroll > scrollTop){$('.header-fixed').removeClass('scroll-top');} 112 else {$('.header-fixed').addClass('scroll-top');} 113 114 scrollTop = $(document).scrollTop(); 115 }); 116 117 //sticky sidebar 118 $('.sidebar').theiaStickySidebar({additionalMarginTop: 0, additionalMarginBottom: 0, minWidth: 992}); 119 jQuery('.equal-content').each(function () { 120 var h=jQuery('.equal-content').outerHeight(); 121 jQuery('.equal-sidebar').css('height',h); 122 $('.equal-sidebar').nanoScroller(); 123 }); 124 // Sticky Menu ------------------------------------------------------------------------------------------------/ 125 jQuery(".btn-mini-search").on( 'click', function(){ 126 jQuery(".header-content-right .searchform-wrap").removeClass('boal-hidden'); 127 }); 128 jQuery(".btn-mini-close").on( 'click', function(){ 129 jQuery(".header-content-right .searchform-wrap").addClass('boal-hidden'); 130 }); 131 132 // CANVAS MENU ------------------------------------------------------------------------------------------------/ 133 var menuWrap = jQuery('body').find('.button-offcanvas'),
134 mainWrapper = jQuery('body'), 135 iconClose = jQuery('.canvas-menu .btn-close'), 136 canvasOverlay = jQuery('.canvas-overlay'); 137 138 // Function Canvas Menu 139 function menuCanvas(){ 140 mainWrapper.toggleClass('canvas-open'); 141 } 142 // Call Function Canvas 143 menuWrap.on( 'click', function(){ 144 menuCanvas(); 145 }); 146 147 // Click icon close 148 iconClose.on( 'click', function(){ 149 menuCanvas(); 150 }); 151 152 // Click canvas 153 canvasOverlay.on( 'click', function(){ 154 menuCanvas(); 155 }); 156 157 // parallax ---------------------------------------------------------------------------------------------------/ 158 159 160 // Quantity ---------------------------------------------------------------------------------------------------/ 161 jQuery(".quantity .add-action").live( 'click', function(){ 162 if( jQuery(this).hasClass('qty-plus') ) { 163 jQuery("[name=quantity]",'.quantity').val( parseInt(jQuery("[name=quantity]",'.quantity').val()) + 1 ); 164 } 165 else { 166 if( parseInt(jQuery("[name=quantity]",'.quantity').val()) > 1 ) { 167 jQuery("input",'.quantity').val( parseInt(jQuery("[name=quantity]",'.quantity').val()) - 1 ); 168 } 169 } 170 } ); 171 172 // Accordion Category------------------------------------------------------------------------------------------/ 173 174 if($('.product-categories li.cat-parent')[0]){ 175 $('.product-categories li.cat-parent>a').after('<span class="triggernav"><i class="expand-icon"></i></span>'); 176 toggleMobileNav('.triggernav', '.widget_product_categories .product-categories li ul'); 177 } 178 179 function toggleMobileNav(trigger, target) { 180 jQuery(target).each(function () { 181 jQuery(this).attr('data-h', jQuery(this).outerHeight()); 182 }); 183 jQuery(target).addClass('unvisible'); 184 var h; 185 jQuery(trigger).on("click", function () { 186 h = 0; 187 jQuery(this).prev('a').toggleClass('active'); 188 jQuery(this).toggleClass('active'); 189 jQuery.this = jQuery(this).next(target); 190 if (jQuery.this.hasClass('unvisible')) { 191 //Get height of this item 192 if (jQuery.this.has("ul").length > 0) { 193 h = parseInt(jQuery.this.attr('data-h')) - parseInt(jQuery.this.find(target).attr('data-h')); 194 } 195 else { 196 h = parseInt(jQuery.this.attr('data-h')); 197 } 198 //resize for parent 199 jQuery.this.parents(target).each(function () { 200 jQuery(this).css('height', jQuery(this).outerHeight() + h); 201 }) 202 //set height for this item 203 jQuery.this.css('height', h + "px"); 204 } 205 else { 206 jQuery.this.find(target).not(':has(.unvisible)').addClass('unvisible'); 207 //resize for parent when this item hide 208 h = jQuery.this.outerHeight(); 209 jQuery.this.parents(target).each(function () { 210 jQuery(this).css('height', jQuery(this).outerHeight() - h); 211 }) 212 } 213 jQuery.this.toggleClass('unvisible'); 214 }); 215 } 216 //Facebook Comments ------------------------------------------------------------------------------------------// 217 (function(d, s, id) { 218 var js, fjs = d.getElementsByTagName(s)[0]; 219 if (d.getElementById(id)) return; 220 js = d.createElement(s); js.id = id; 221 js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; 222 fjs.parentNode.insertBefore(js, fjs); 223 }(document, 'script', 'facebook-jssdk')); 224 225 //VIDEO ------------------------------------------------------------------------------------------------------// 226 jQuery(".video-verticals").each(function(){ 227 jQuery('.slider-video').slick({ 228 slidesToShow: 1, 229 slidesToScroll: 1,
230 arrows: false, 231 infinite: false, 232 fade: true, 233 asNavFor: '.slider-nav' 234 }); 235 jQuery('.slider-nav').slick({ 236 slidesToShow: 3, 237 slidesToScroll: 1, 238 asNavFor: '.slider-video', 239 dots: false, 240 arrows: true, 241 centerMode:false, 242 infinite: true, 243 touchMove:true, 244 focusOnSelect: true, 245 vertical:true 246 }); 247 }); 248 249 //slider video horizontal 250 jQuery(".video-horizontal").each(function(){ 251 jQuery('.slider-nav').slick({ 252 slidesToShow: 4, 253 slidesToScroll: 1, 254 infinite: false, 255 dots: false, 256 arrows: true, 257 centerMode:false, 258 focusOnSelect: false, 259 responsive: [ 260 { 261 breakpoint: 480, 262 settings: { 263 slidesToShow: 2 264 } 265 } 266 ] 267 }); 268 }); 269 270 271 // Woo --------------------------------------------------------------------------------------------------------/ 272 //Login 273 jQuery('.myaccount-login').each(function(){ 274 jQuery('.btn-form-login').on('click',function() { 275 $('.login-wrap').slideUp(0); 276 $('.register-wrap').slideDown(250); 277 }); 278 jQuery('.btn-form-register').on('click',function() { 279 $('.register-wrap').slideUp(0); 280 $('.login-wrap').slideDown(250); 281 282 }); 283 284 }); 285 //carousel 286 jQuery(".na-carousel").each(function(){ 287 var number = jQuery(this).data('number'); 288 var auto = jQuery(this).data('auto'); 289 var pagination =jQuery(this).data('pagination'); 290 jQuery(this).slick({ 291 autoplay: true, 292 slidesToShow: number, 293 slidesToScroll: 1, 294 dots:pagination, 295 responsive: [ 296 { 297 breakpoint: 1024, 298 settings: { 299 slidesToShow: 3, 300 slidesToScroll: 3, 301 infinite: true, 302 dots: true 303 } 304 }, 305 { 306 breakpoint: 600, 307 settings: { 308 slidesToShow: 2, 309 slidesToScroll: 2 310 } 311 }, 312 { 313 breakpoint: 480, 314 settings: { 315 slidesToShow: 2, 316 slidesToScroll: 1 317 } 318 } 319 ] 320 }); 321 }); 322 323 324 var initPhotoSwipeFromDOM = function(gallerySelector) { 325 326 // parse slide data (url, title, size ...) from DOM elements 327 // (children of gallerySelector) 328 var parseThumbnailElements = function(el) { 329 var thumbElements = el.childNodes, 330 numNodes = thumbElements.length, 331 items = [], 332 figureEl, 333 linkEl, 334 size, 335 item; 336 337 for(var i = 0; i < numNodes; i++) { 338 339 figureEl = thumbElements[i]; // <figure> element 340 341 // include only element nodes 342 if(figureEl.nodeType !== 1) { 343 continue; 344 } 345 346 linkEl = figureEl.children[0]; // <a> element 347 348 size = linkEl.getAttribute('data-size').split('x'); 349 350 // create slide object 351 item = { 352 src: linkEl.getAttribute('href'), 353 w: parseInt(size[0], 10), 354 h: parseInt(size[1], 10) 355 }; 356 357 358 359 if(figureEl.children.length > 1) { 360 // <figcaption> content 361 item.title = figureEl.children[1].innerHTML; 362 } 363 364 if(linkEl.children.length > 0) { 365 // <img> thumbnail element, retrieving thumbnail url 366 item.msrc = linkEl.children[0].getAttribute('src'); 367 } 368 369 item.el = figureEl; // save link to element for getThumbBoundsFn 370 items.push(item); 371 } 372 373 return items; 374 }; 375 376 // find nearest parent element 377 var closest = function closest(el, fn) { 378 return el && ( fn(el) ? el : closest(el.parentNode, fn) ); 379 }; 380 381 // triggers when user clicks on thumbnail 382 var onThumbnailsClick = function(e) { 383 e = e || window.event; 384 e.preventDefault ? e.preventDefault() : e.returnValue = false;
385 386 var eTarget = e.target || e.srcElement; 387 388 // find root element of slide 389 var clickedListItem = closest(eTarget, function(el) { 390 return (el.tagName && el.tagName.toUpperCase() === 'FIGURE'); 391 }); 392 393 if(!clickedListItem) { 394 return; 395 } 396 397 // find index of clicked item by looping through all child nodes 398 // alternatively, you may define index via data- attribute 399 var clickedGallery = clickedListItem.parentNode, 400 childNodes = clickedListItem.parentNode.childNodes, 401 numChildNodes = childNodes.length, 402 nodeIndex = 0, 403 index; 404 405 for (var i = 0; i < numChildNodes; i++) { 406 if(childNodes[i].nodeType !== 1) { 407 continue; 408 } 409 410 if(childNodes[i] === clickedListItem) { 411 index = nodeIndex; 412 break; 413 } 414 nodeIndex++; 415 } 416 417 418 419 if(index >= 0) { 420 // open PhotoSwipe if valid index found 421 openPhotoSwipe( index, clickedGallery ); 422 } 423 return false; 424 }; 425 426 // parse picture index and gallery index from URL (#&pid=1&gid=2) 427 var photoswipeParseHash = function() { 428 var hash = window.location.hash.substring(1), 429 params = {}; 430 431 if(hash.length < 5) { 432 return params; 433 } 434 435 var vars = hash.split('&'); 436 for (var i = 0; i < vars.length; i++) { 437 if(!vars[i]) { 438 continue; 439 } 440 var pair = vars[i].split('='); 441 if(pair.length < 2) { 442 continue; 443 } 444 params[pair[0]] = pair[1]; 445 } 446 447 if(params.gid) { 448 params.gid = parseInt(params.gid, 10); 449 } 450 451 return params; 452 }; 453 454 var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) { 455 var pswpElement = document.querySelectorAll('.pswp')[0], 456 gallery, 457 options, 458 items; 459 460 items = parseThumbnailElements(galleryElement); 461 462 // define options (if needed) 463 options = { 464 465 // define gallery index (for URL) 466 galleryUID: galleryElement.getAttribute('data-pswp-uid'), 467 468 getThumbBoundsFn: function(index) { 469 // See Options -> getThumbBoundsFn section of documentation for more info 470 var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail 471 pageYScroll = window.pageYOffset || document.documentElement.scrollTop, 472 rect = thumbnail.getBoundingClientRect(); 473 474 return {x:rect.left, y:rect.top + pageYScroll, w:rect.width}; 475 } 476 477 }; 478 479 // PhotoSwipe opened from URL 480 if(fromURL) { 481 if(options.galleryPIDs) { 482 // parse real index when custom PIDs are used 483 // http://photoswipe.com/documentation/faq.html#custom-pid-in-url 484 for(var j = 0; j < items.length; j++) { 485 if(items[j].pid == index) { 486 options.index = j; 487 break; 488 } 489 } 490 } else { 491 // in URL indexes start from 1 492 options.index = parseInt(index, 10) - 1; 493 } 494 } else { 495 options.index = parseInt(index, 10); 496 } 497 498 // exit if index not found 499 if( isNaN(options.index) ) { 500 return; 501 } 502 503 if(disableAnimation) { 504 options.showAnimationDuration = 0; 505 } 506 507 // Pass data to PhotoSwipe and initialize it 508 gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options); 509 gallery.init(); 510 }; 511 512 // loop through all gallery elements and bind events 513 var galleryElements = document.querySelectorAll( gallerySelector ); 514 515 for(var i = 0, l = galleryElements.length; i < l; i++) { 516 galleryElements[i].setAttribute('data-pswp-uid', i+1); 517 galleryElements[i].onclick = onThumbnailsClick; 518 } 519 520 // Parse URL and open gallery if it contains #&pid=3&gid=1 521 var hashData = photoswipeParseHash(); 522 if(hashData.pid && hashData.gid) { 523 openPhotoSwipe( hashData.pid , galleryElements[ hashData.gid - 1 ], true, true ); 524 } 525 }; 526 527// execute above function 528 initPhotoSwipeFromDOM('.gallery-main'); 529 530 531 }); 532 533})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.