1$(document).ready(function () { 2 'use strict'; 3 4 var c, 5 currentScrollTop = 0, 6 navbar = $('.navbar'); 7 8 $(window).scroll(function () { 9 var a = $(window).scrollTop(); 10 var b = navbar.height(); 11 12 currentScrollTop = a; 13 14 if (c < currentScrollTop && a > b + b) { 15 navbar.addClass('scrollUp'); 16 } else if (c > currentScrollTop && !(a <= b)) { 17 navbar.removeClass('scrollUp'); 18 } 19 c = currentScrollTop; 20 }); 21 22 $(document.links) 23 .filter(function () { 24 return this.hostname != window.location.hostname; 25 }) 26 .attr('target', '_blank'); 27 28 // Find all iframes 29 var $iframes = $('iframe'); 30 31 // Find & save the aspect ratio for all iframes 32 $iframes.each(function () { 33 $(this) 34 .data('ratio', this.height / this.width) 35 // Remove the hardcoded width & height attributes 36 .removeAttr('width') 37 .removeAttr('height'); 38 }); 39 40 // Resize the iframes when the window is resized 41 $(window) 42 .resize(function () { 43 $iframes.each(function () { 44 // Get the parent container's width 45 var width = $(this).parent().width(); 46 $(this) 47 .width(width) 48 .height(width * $(this).data('ratio')); 49 }); 50 // Resize to fix all iframes on page load. 51 }) 52 .resize(); 53 54 55 56 57 tableOfContents('.toc-content', '.toc-data', { 58 //levels: 'h2, h3, h4, h5, h6', // The heading levels to generate a table of contents from 59 levels: 'h2', // The heading levels to generate a table of contents from 60 heading: 'Table of Contents', // The heading text for the table of contents list 61 headingLevel: 'h6', // The level to use for the heading for the table of contents list 62 listType: 'ul' // The list type to use for the table of contents 63 }); 64 65 66 $('.show-filter').click( function() { 67 $(".sidebar-filter").toggleClass("show"); 68 } ); 69 70 /* 71 $('.sf-input-checkbox').change(function(){ 72 if (!($(this).is(':checked'))) { 73 $('.children input').attr('checked', false); 74 } 75 }); 76 */ 77 78 79 $('.galerija').magnificPopup({ 80 delegate: 'a', 81 type: 'image', 82 closeOnContentClick: false, 83 closeBtnInside: false, 84 mainClass: 'mfp-with-zoom mfp-img-mobile', 85 gallery: { 86 enabled: true 87 }, 88 zoom: { 89 enabled: true, 90 duration: 300, // don't foget to change the duration also in CSS 91 opener: function (element) { 92 return element.find('img'); 93 } 94 } 95 96 }); 97 98 99 $('.gallery').magnificPopup({ 100 delegate: 'dl dt a', 101 type: 'image', 102 closeOnContentClick: false, 103 closeBtnInside: false, 104 mainClass: 'mfp-with-zoom mfp-img-mobile', 105 gallery: { 106 enabled: true 107 }, 108 zoom: { 109 enabled: true, 110 duration: 300, // don't foget to change the duration also in CSS 111 opener: function (element) { 112 return element.find('img'); 113 } 114 } 115 116 }); 117 118 119 $('.foto').magnificPopup({ 120 type: 'image', 121 zoom: { 122 enabled: true, 123 duration: 300, // don't foget to change the duration also in CSS 124 opener: function (element) { 125 return element.find('img'); 126 } 127 } 128 // other options 129 }); 130 131 132 $('.wp-caption a').magnificPopup({ 133 type: 'image', 134 zoom: { 135 enabled: true, 136 duration: 300, // don't foget to change the duration also in CSS 137 opener: function (element) { 138 return element.find('img'); 139 } 140 } 141 // other options 142 }); 143 144 145}); 146 147 148$(document).on('change', '.sf-input-checkbox', function() { 149 if (!($(this).is(':checked'))) { 150 $(this).siblings('ul').find('input').attr('checked', false).trigger('change'); 151 } 152}); 153 154 155 156$(window).scroll(function(){ 157 var scrollTop = $(document).scrollTop(); 158 var anchors = $('body').find('article h2'); 159 160 for (var i = 0; i < anchors.length; i++){ 161 //if (scrollTop > $(anchors[i]).offset().top - 50 && scrollTop < $(anchors[i]).offset().top + $(anchors[i]).height() - 50) { 162 if (scrollTop > $(anchors[i]).offset().top - 50 ) { 163 $('.toc-data ul li a').removeClass('active'); 164 $('.toc-data ul li a[href="#' + $(anchors[i]).attr('id') + '"]').addClass('active'); 165 } else { 166 $('.toc-data ul li a[href="#' + $(anchors[i]).attr('id') + '"]').removeClass('active'); 167 } 168 } 169}); 170 171 172
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.