1(function($) { 2 3 function gifFullScreen() { 4 var windowHeight = $(window).height(); 5 var windowWidth = $(window).width(); 6 var contentHeight = $('.gif-content').height(); 7 var compareHeight = windowHeight - 250; 8 if(contentHeight >= compareHeight) { 9 var height = contentHeight + 250; 10 $('.hero-gif, .gif-bg-image').height(height).width(windowWidth); 11 } else { 12 $('.hero-gif, .gif-bg-image').height(windowHeight).width(windowWidth); 13 } 14 15 //console.log('contentHeight: '+contentHeight); 16 //console.log('compareHeight: '+compareHeight); 17 //console.log('windowHeight: '+windowHeight); 18 } 19 20 gifFullScreen(); 21 22 $(window).resize(function() { 23 gifFullScreen(); 24 }); 25 26 $(window).load(function() { 27 var body = $('body'); 28 29 body.removeClass("preload").addClass('loaded'); 30 31/* 32 $('.menu-item-has-children > a').click(function(event) { 33 var $this = $(this); 34 event.preventDefault(); 35 $this.parents('.menu-item-has-children').toggleClass('active'); 36 }); 37*/ 38 $('.menu-item-has-children').append('<span class="dropdown"></span>'); 39 $('.menu-item-has-children .dropdown').click(function(){ 40 $(this).parent('.menu-item-has-children').toggleClass('open'); 41 }); 42 43 // Nav Open 44 $('.open-nav, .close-nav').click(function(){ 45 body.toggleClass('nav-open body-locked'); 46 body.removeClass('social-open'); 47 body.removeClass('search-open'); 48 body.removeClass('phone-open'); 49 //menuMoreGraphic(); 50 }); 51 52 $('.open-search, .close-search').click(function(){ 53 body.toggleClass('search-open'); 54 body.removeClass('nav-open body-locked'); 55 body.removeClass('social-open'); 56 body.removeClass('phone-open'); 57 }); 58 59 $('.open-social, .close-social').click(function(){ 60 body.toggleClass('social-open'); 61 body.removeClass('nav-open body-locked'); 62 body.removeClass('search-open'); 63 body.removeClass('phone-open'); 64 }); 65 66 $('.open-phone, .close-phone').click(function(){ 67 body.toggleClass('phone-open'); 68 body.removeClass('nav-open body-locked'); 69 body.removeClass('search-open'); 70 body.removeClass('social-open'); 71 }); 72 73 $('.open-filter, .close-filter').click(function(){ 74 $('.archive-filter').slideToggle('slow'); 75 body.toggleClass('filter-open'); 76 }); 77 78 $('body').on('click', '.tap', function(){ 79 body.toggleClass('sidebar-open'); 80 body.toggleClass('body-locked'); 81 }); 82 83 84 $('.toggle-audio, .toggle-video').click(function(){ 85 $('body').toggleClass('audio-on video-on'); 86 }); 87 88 $('.toggle-more-info').click(function(){ 89 $('#more-info').slideToggle(); 90 $('#open-subscribe').slideUp(); 91 $('#open-share').slideUp(); 92 }); 93 94 $('.toggle-share').click(function(){ 95 $('#open-share').slideToggle(); 96 $('#more-info').slideUp(); 97 $('#open-subscribe').slideUp(); 98 }); 99 100 $('.toggle-subscribe').click(function(){ 101 $('#open-subscribe').slideToggle(); 102 $('#more-info').slideUp(); 103 $('#open-share').slideUp(); 104 }); 105 106 $('.sermons-sorter .sorter li').click(function(){ 107 var id = $(this).attr('id'); 108 $('.sermons-sorter ul.'+id).toggle(); 109 $('.sermons-sorter ul.'+id).siblings('.sub-list').hide(); 110 $(this).toggleClass('active').siblings('li').removeClass('active'); 111 }); 112 113 $('.accordion__title').click(function(){ 114 $(this).siblings('.accordion__content').slideToggle(); 115 $(this).parent('.accordion__item').toggleClass('active'); 116 }); 117 118 119 $('.social-share-image').click(function(){ 120 var id = $(this).data('share'); 121 $('#'+id).slideToggle().siblings('.open-share').slideUp(); 122 123 }); 124 125 // Lazy Load those images. 126 $("img.lazy").lazyload(); 127 128 129 // DROPDISTANCE! this function will set a body class at a certain percentage down the page. 130 $(document).scroll(function() { 131 var dropdist = 10; 132 var docscroll = $(document).scrollTop(); 133 var docheight = $(document).height(); 134 135 var percent = docscroll*100/docheight; 136 137 if(percent > dropdist){ 138 body.addClass('dropdistance'); 139 } else if(percent < dropdist){ 140 body.removeClass('dropdistance'); 141 } 142 143 //console.log('Scroll Distance: '+docscroll+'<br> Doc Height: '+docheight+'<br>Percent: '+percent); 144 }); 145 146 147 // Lazy Load Sermons 148 var $sermonsToLoad = 12; 149 150 $('.sermons-grid .sermon.visible').find('img.lazy').lazyload({ 151 effect: 'fadeIn' 152 }); 153 154 $('.more-sermons').click(function() { 155 var $hiddenSermons = $('.sermons-grid .hidden'); 156 var $this = $(this); 157 //var $poststotal = $(this).find('.poststotal').html(); 158 var $viewing = $(this).find('.viewing').html(); 159 160 $hiddenSermons.each(function(i, el) { 161 if( i < $sermonsToLoad ) { 162 $(this).removeClass('hidden').addClass('show').find('img.lazy'); 163 } 164 }); 165 $('.sermons-grid .sermon.show').find('img.lazy').lazyload({ 166 effect: 'fadeIn' 167 }); 168 $('.sermons-grid .show').removeClass('show'); 169 170 //$(this).find('.poststotal').html(parseInt($poststotal - $sermonsToLoad)); 171 $(this).find('.viewing').html(parseInt($viewing) + parseInt($sermonsToLoad)); 172 173 if( $('.sermons-grid .sermon.hidden').length == 0 ) { 174 $this.remove(); 175 $('.more-sermons-wrap').remove(); 176 } 177 }); 178 179 180 var clipboard = new Clipboard( '.clipboard-copy' ); 181 // $('#ec-share-link').hide(); 182 183 $('.clipboard-copy').click(function(e) { 184 e.preventDefault(); 185 }); 186 187 clipboard.on( 'success', function(e) { 188 $(e.trigger).text( 'Copied' ); 189 }); 190 191 clipboard.on( 'error', function(e) { 192 var $this = $(e.trigger); 193 $this.text( $this.attr( 'aria-label' ) ); 194 }); 195 196 $(".oregon-trail").fitVids({ customSelector: "iframe[src^='https://archive.org']"}); 197 198 if($('.wallpapers').length > 0) { 199 var wallpapersSwiper = new Swiper('.wallpapers .swiper-container', { 200 slidesPerView: 'auto', 201 spaceBetween: 20, 202 navigation: { 203 nextEl: '.wallpapers .swiper-button-next', 204 prevEl: '.wallpapers .swiper-button-prev', 205 }, 206 207 }); 208 209 210 $('.showcase').click(function() { 211 var $this = $('.showcase'), 212 $parent = $this.parents('.swiper-slide'), 213 $download = $this.siblings('.download-section'), 214 index = wallpapersSwiper.clickedIndex; 215 216 //alert('hi'); 217 $this.addClass('col-12 col-md-4'); 218 $download.addClass('col-12 col-md-8').removeClass('d-none'); 219 $parent.addClass('w-100'); 220 221 wallpapersSwiper.slideTo(index, 100, true);
222 wallpapersSwiper.update(); 223 }); 224 } 225 226 }); 227 228 var communitySwiper = new Swiper('.community-care .swiper-container', { 229 speed: 400, 230 spaceBetween: 100, 231 navigation: { 232 nextEl: '.community-care .swiper-button-next', 233 prevEl: '.community-care .swiper-button-prev', 234 }, 235 autoHeight: true, 236 }); 237 238 $('[data-slide]').click(function(){ 239 var slide = $(this).attr('data-slide'); 240 communitySwiper.slideTo(slide); 241 }); 242 243 $('.help-section .collapse').on('show.bs.collapse', function () { 244 $(this).siblings('.collapse').collapse('hide'); 245 console.log($(this).attr('id')+' collapsed'); 246 setTimeout(function(){ 247 communitySwiper.updateAutoHeight(500); 248 },500); 249 250 }); 251 252 253 254 var theSermonsSwiper = new Swiper('.the__sermons .swiper-container', { 255 direction: 'vertical', 256 slidesPerView: 'auto', 257 freeMode: true, 258 scrollbar: { 259 el: '.the__sermons .swiper-scrollbar', 260 }, 261 mousewheel: true, 262 keyboard: { 263 enabled: true, 264 onlyInViewport: false, 265 }, 266 }); 267 var sermonsFilterSwiper = new Swiper('.the__filter .swiper-container', { 268 direction: 'vertical', 269 slidesPerView: 'auto', 270 freeMode: true, 271 scrollbar: { 272 el: '.the__filter .swiper-scrollbar', 273 }, 274 mousewheel: true, 275 }); 276 277 278 279 function reloadSwiper(theSermonsSwiper) { 280 if(!theSermonsSwiper || theSermonsSwiper.slides.length === 0 ) return; 281 282 setTimeout(function() { 283 theSermonsSwiper.update(); 284 }, 100); 285 286 } 287 288 reloadSwiper(theSermonsSwiper); 289 290 setTimeout(function() { 291 reloadSwiper(theSermonsSwiper); 292 }, 1000); 293 294 window.almComplete = function() { 295 reloadSwiper(theSermonsSwiper); 296 console.log('reset'); 297 } 298 window.almFilterComplete = function() { 299 reloadSwiper(theSermonsSwiper); 300 console.log('reset'); 301 } 302 window.almOnLoad = function() { 303 reloadSwiper(theSermonsSwiper); 304 console.log('reset'); 305 } 306 307 308 var tagsActive = [], 309 sermons = $('.the__sermons .sermon'); 310 311 $('.the__filter input[type="checkbox"]').on('change', function(){ 312 var tag = $(this).attr('data-filter'); 313 if($(this).prop('checked') == true) { 314 tagsActive.push(tag); 315 $(this).parents('li').addClass('active'); 316 } else { 317 for( var i = 0; i < tagsActive.length; i++){ 318 if ( tagsActive[i] === tag) { 319 tagsActive.splice(i, 1); 320 $(this).parents('li').removeClass('active'); 321 } 322 } 323 } 324 if(tagsActive.length == 0) { 325 sermons.addClass('active').show(); 326 } else { 327 sermons.addClass('inactive').hide(); 328 } 329 for( var i = 0; i < tagsActive.length; i++){ 330 $('.sermon'+tagsActive[i]).addClass('active').removeClass('inactive').show(); 331 $('.sermon'+tagsActive[i]).each(function(){ 332 theSermonsSwiper.lazy.loadInSlide($(this).attr('data-index')); 333 }); 334 } 335 theSermonsSwiper.update(); 336 theSermonsSwiper.updateSlides(); 337 338 }); 339 340 341 342 343 344})(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.