1jQuery(function( $ ) { 2 'use strict'; 3 4 var $window = $(window); 5 6 /* ----------------------------------------- 7 Responsive Menus Init with mmenu 8 ----------------------------------------- */ 9 var $mainNav = $('.site-bar .navigation'); 10 var $mobileNav = $( '#mobilemenu' ); 11 12 $mainNav.clone().removeAttr( 'id' ).removeClass().appendTo( $mobileNav ); 13 $mobileNav.find( 'li' ).removeAttr( 'id' ); 14 15 $mobileNav.mmenu({ 16 offCanvas: { 17 position: 'top', 18 zposition: 'front' 19 }, 20 "autoHeight": true, 21 "navbars": [ 22 { 23 "position": "top", 24 "content": [ 25 "prev", 26 "title", 27 "close" 28 ] 29 } 30 ], 31 "extensions": [ 32 "theme-black" 33 ] 34 }); 35 36 /* ----------------------------------------- 37 Main Navigation Init 38 ----------------------------------------- */ 39 $mainNav.superfish({ 40 delay: 300, 41 animation: { opacity: 'show', height: 'show' }, 42 speed: 'fast', 43 dropShadows: false 44 }); 45 46 /* ----------------------------------------- 47 Responsive Videos with fitVids 48 ----------------------------------------- */ 49 $( 'body' ).fitVids(); 50 51 52 /* ----------------------------------------- 53 Image Lightbox 54 ----------------------------------------- */ 55 $( ".untoldstories-lightbox, a[data-lightbox^='gal']" ).magnificPopup({ 56 type: 'image', 57 mainClass: 'mfp-with-zoom', 58 gallery: { 59 enabled: true 60 }, 61 zoom: { 62 enabled: true 63 } 64 } ); 65 66 67 /* ----------------------------------------- 68 Instagram Widget 69 ----------------------------------------- */ 70 var $instagramWrap = $('.footer-widget-area'); 71 var $instagramWidget = $instagramWrap.find('.instagram-pics'); 72 73 if ( $instagramWidget.length ) { 74 var auto = $instagramWrap.data('auto'), 75 speed = $instagramWrap.data('speed'); 76 77 $instagramWidget.slick({ 78 slidesToShow: 8, 79 slidesToScroll: 3, 80 arrows: false, 81 autoplay: auto == 1, 82 speed: speed, 83 responsive: [ 84 { 85 breakpoint: 767, 86 settings: { 87 slidesToShow: 4 88 } 89 } 90 ] 91 }); 92 } 93 94 95 /* ----------------------------------------- 96 Justfied Galleries 97 ----------------------------------------- */ 98 var $entryJustified = $('.entry-justified'); 99 if ( $entryJustified.length ) { 100 $entryJustified.each(function() { 101 var rowHeight = $(this).data('height'); 102 $(this).justifiedGallery({ 103 rowHeight : rowHeight, 104 margins : 5, 105 captions: false 106 }); 107 }) 108 } 109 110 111 /* ----------------------------------------- 112 Main Carousel 113 ----------------------------------------- */ 114 function positionSliderButtons() { 115 var $currentSlide = $fullwidthSlider.find('.slick-current'); 116 $fullwidthSlider.find('.slick-prev').css({ 117 'right': $currentSlide.offset().left + 80 118 }); 119 120 $fullwidthSlider.find('.slick-next').css({ 121 'right': $currentSlide.offset().left + 30 122 }); 123 } 124 125 var homeSlider = $( '.feature-slider'), 126 $fullwidthSlider = $( '.slider-fullwidth' ); 127 128 if ( homeSlider.length ) { 129 var autoplay = homeSlider.data( 'autoplay' ), 130 autoplayspeed = homeSlider.data( 'autoplayspeed' ), 131 fade = homeSlider.data( 'fade' ); 132 133 if ( homeSlider.hasClass( 'slider-fullwidth' ) ) { 134 $fullwidthSlider.on('beforeChange', function(event, slick, currentSlide) { 135 $(this).find('.slick-slide').eq(currentSlide+2).find('.slide-content').fadeOut(); 136 }); 137 138 $fullwidthSlider.on('afterChange', function(event, slick, currentSlide) { 139 $(this).find('.slick-slide').eq(currentSlide+2).find('.slide-content').fadeIn('fast'); 140 }); 141 142 $fullwidthSlider.on('init', function(slick) { 143 var $currentSlide = $fullwidthSlider.find('.slick-current'); 144 $currentSlide.find('.slide-content').fadeIn(); 145 positionSliderButtons(); 146 }); 147 148 $window.on('resize', function() { 149 if ( $window.width() > 767 ) { 150 positionSliderButtons(); 151 } 152 }); 153 154 homeSlider.slick({ 155 autoplay: autoplay == 1, 156 autoplaySpeed: autoplayspeed, 157 centerMode: true, 158 centerPadding: '30px', 159 slidesToShow: 1, 160 variableWidth: true, 161 responsive: [ 162 { 163 breakpoint: 1200, 164 settings: { 165 variableWidth: false 166 } 167 }, 168 { 169 breakpoint: 768, 170 settings: { 171 centerMode: false, 172 variableWidth: false, 173 centerPadding: '5px' 174 } 175 } 176 ] 177 }); 178 179 180 } else { 181 homeSlider.slick({ 182 autoplay: autoplay == 1,
183 autoplaySpeed: autoplayspeed, 184 fade: fade == 1 185 }); 186 } 187 } 188 189 190 $( window ).load(function() { 191 192 /* ----------------------------------------- 193 Reveal Footer 194 ----------------------------------------- */ 195 var $footer = $('#footer'); 196 197 if ( $footer.hasClass('footer-fixed') ) { 198 var $mainWrap = $('#main-wrap'); 199 var $footerHeight = $footer.outerHeight(); 200 $mainWrap.css('margin-bottom', $footerHeight); 201 } 202 203 /* ----------------------------------------- 204 Masonry Layout 205 ----------------------------------------- */ 206 var $masonry = $('.entries-masonry'); 207 if ( $masonry.length ) { 208 $('.entries-masonry').masonry({ 209 itemSelector: '.entry-masonry' 210 }); 211 } 212 }); 213 214 /* ----------------------------------------- 215 Media Query Check 216 ----------------------------------------- */ 217 function ciResize() { 218 var $entriesList = $('.entries-list'); 219 if ( $entriesList.length ) { 220 if ( Modernizr.mq('only screen and (max-width: 768px)') ) { 221 $('.entries-list .entry:not(:first)').each(function(){ 222 $(this).removeClass('entry-list'); 223 }); 224 } 225 else { 226 $('.entries-list .entry:not(:first)').each(function(){ 227 $(this).addClass('entry-list'); 228 }); 229 } 230 } 231 } 232 233 $(window).resize(function() { 234 ciResize(); 235 }).resize(); 236 237});
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.