1 2$(function(){ 3 4 // // Cover photos 5 $('.cover-photo').each(function(){ 6 $(this).css("background-image", "url("+$(this).data('src')+")"); 7 }); 8 9 // // Polls 10 $('.poll-form .vote button').click(function(){ 11 form = $(this).closest('.poll-form'); 12 if( form.serialize() != '' ){ 13 form.submit(); 14 } 15 }); 16 17 // Nav 18 $('.navigation .parent').mouseenter(function(){ 19 $(this).find('.children').show(); 20 }).mouseleave(function(){ 21 $(this).find('.children').hide(); 22 }); 23 24 // Gallery widget 25 $('.box-content-gallery .carousel').on('slide.bs.carousel', function(e){ 26 var target = $(e.relatedTarget); 27 var container = target.closest('.box-content-gallery'); 28 container.find('.thumbnails li').removeClass('active'); 29 container.find('.thumbnails li[data-slide-to='+target.data('item')+']').addClass('active'); 30 }); 31 $('.box-content-gallery .thumbnails li').click(function(){ 32 var container = $(this).closest('.box-content-gallery'); 33 container.find('.carousel').carousel('pause'); 34 }); 35 $('.box-content-gallery .carousel .canvas').mouseenter(function(){ 36 $(this).find('.carousel-caption').fadeIn('fast'); 37 }); 38 $('.box-content-gallery .carousel .canvas').mouseleave(function(){ 39 $(this).find('.carousel-caption').fadeOut('fast'); 40 }); 41 42 // Auto height 43 window.setTimeout(function(){ 44 $('.autoheight-group').each(function(){ 45 $(this).find('.autoheight').height( parseInt($(this).height()) - 40 ); 46 }) 47 }, 48 2000 49 ); 50 51 // Mobile subnav toggle 52 $('.mobile-subnav-icon').click(function(){ 53 if( $(this).data('toggled') ){ 54 $('.mobile-subnav-item-'+$(this).data('navitem')).slideUp('fast'); 55 $(this).removeClass('fa-minus').addClass('fa-plus').data('toggled',false); 56 }else{ 57 $('.mobile-subnav-item-'+$(this).data('navitem')).slideDown('fast'); 58 $(this).removeClass('fa-plus').addClass('fa-minus').data('toggled',true); 59 } 60 }); 61 62 63 // disabling right click on all images on the site to prevent saving images 64 $('img').bind('contextmenu', function(e) { 65 return false; 66 }); 67 68//document.addEventListener('contextmenu', event => event.preventDefault()); 69 70 // Link away 71 // $(function(){ 72 // $('a').each(function(){ 73 // var href = $(this).attr('href'); 74 // if( typeof href != 'string' ){ 75 // return; 76 // } 77 // if( $(this).attr('href').indexOf('http') == 0 ){ 78 // $(this).prop('target','new'); 79 // } 80 // }); 81 // }); 82 83 84 85}); 86 87 88 89function fitSliderArrow(slide) 90{ 91 92 var carousel = slide.closest('.carousel'); 93 var arrow = carousel.find('.right-arrow'); 94 95 /* This just places the arrow on the right */ 96 arrow.css('right','0'); 97 98 /* This fits the arrow to the edge of the image 99 var img = slide.find('img'); 100 if( img.length > 0 ){ 101 var imgRightEdge = img.offset().left + img.outerWidth(); 102 var container = img.closest('.photo'); 103 var containerRightEdge = container.offset().left + container.outerWidth(); 104 var difference = containerRightEdge - imgRightEdge; 105 if( difference > 0 ){ 106 arrow.css('right', difference+'px'); 107 }else{ 108 arrow.css('right','0'); 109 } 110 }else{ 111 arrow.css('right','0'); 112 } */ 113 114 carousel.find('.arrows').show(); 115 116}
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.