1// Hide default search 2// function hideSearch() { 3// document.getElementById('___gcse_0').style.display = 'none'; 4// } 5 6function getHashFilter() { 7 // get filter=filterName 8 var matches = location.hash.match( /filter=([^&]+)/i ); 9 var hashFilter = matches && matches[1]; 10 return hashFilter && decodeURIComponent( hashFilter ); 11 } 12 13// quick search regex 14var qsRegex; 15 16jQuery(document).ready(function($) { 17// jQuery(window).load(function() { 18 19 jQuery( function() { 20 // init Isotope 21 var hashFilter = getHashFilter(); 22 // alert (hashFilter); 23 var $grid1 = jQuery('.page-template-page-events .display-wrapper .recent-posts').isotope({ 24 itemSelector: '.recent-post', 25 // layoutMode: 'fitRows', // Switched back to masonry 2021-01-05 and back 26 layoutMode: 'masonry', 27 filter: hashFilter, 28 onLayout: function() { 29 // jQuery(window).trigger("scroll"); 30 jQuery(window).trigger("ready"); 31 } 32 }); 33 34if ( hashFilter ) { 35 jQuery('.button-group').find('.current').removeClass('current'); 36 jQuery('.button-group').find('[data-filter="' + hashFilter + '"]').addClass('current'); 37 } 38 // filter items on button click 39 jQuery('.filter-button-group').on( 'click', 'button', function() { 40 var filterValue = jQuery(this).attr('data-filter'); 41 $grid1.isotope({ filter: filterValue }); 42 location.hash = 'filter=' + encodeURIComponent( filterValue ); 43 }); 44 45// debounce so filtering doesn't happen every millisecond 46function debounce( fn, threshold ) { 47 var timeout; 48 threshold = threshold || 100; 49 return function debounced() { 50 clearTimeout( timeout ); 51 var args = arguments; 52 var _this = this; 53 function delayed() { 54 fn.apply( _this, args ); 55 } 56 timeout = setTimeout( delayed, threshold ); 57 }; 58} 59 60// init Isotope 61var $grid = jQuery('.pubs').isotope({ 62 itemSelector: '.pub', 63 layoutMode: 'vertical', 64 filter: function() { 65 return qsRegex ? jQuery(this).text().match( qsRegex ) : true; 66 // $(".pubs:empty").prev().hide(); 67 } 68}); 69 70// use value of search field to filter 71var $quicksearch = jQuery('.quicksearch').keyup( debounce( function() { 72 qsRegex = new RegExp( $quicksearch.val(), 'gi' ); 73 $grid.isotope(); 74}, 200 ) ); 75 76}); 77// debounce so filtering doesn't happen every millisecond 78function debounce( fn, threshold ) { 79 var timeout; 80 threshold = threshold || 100; 81 return function debounced() { 82 clearTimeout( timeout ); 83 var args = arguments; 84 var _this = this; 85 function delayed() { 86 fn.apply( _this, args ); 87 } 88 timeout = setTimeout( delayed, threshold ); 89 }; 90} 91jQuery( function() { 92 // init Isotope for recent insights 93 var hashFilter = getHashFilter(); 94 var $grid2 = jQuery('.news-row').isotope({ 95 itemSelector: '.news-col', 96 percentPosition: 'true', 97 layoutMode: 'masonry', 98 // layoutMode: 'fitRows', 99 filter: hashFilter, 100 onLayout: function() { 101 jQuery(window).trigger("scroll"); 102 // jQuery(window).trigger("ready"); 103 } 104 }); 105if ( hashFilter ) { 106 jQuery('.button-group').find('.current').removeClass('current'); 107 jQuery('.button-group').find('[data-filter="' + hashFilter + '"]').addClass('current'); 108 } 109 // filter items on button click 110 jQuery('.filter-button-group-insights').on( 'click', 'button', function() { 111 112 jQuery('.button-group button').removeClass("current"); 113 jQuery(this).addClass("current"); 114 var filterValue = jQuery(this).attr('data-filter'); 115 $grid2.isotope({ filter: filterValue }); 116 location.hash = 'filter=' + encodeURIComponent( filterValue ); 117 }); 118}); 119 120// Hopefully kill the subsetting on mobile 121function facultyLanding() {} 122 123// begin Doctoral Faculty 124jQuery( function() { 125 var hashFilter = getHashFilter(); 126 var $grid4 = jQuery('.faculty-filter-group').isotope({ 127 itemSelector: '.faculty-filter-item', 128 percentPosition: 'true', 129 // layoutMode: 'masonry', 130 layoutMode: 'fitRows', 131 filter: hashFilter, 132 fitRows: { 133 columnWidth: '.faculty-filter-group', 134 gutter: 20 135 }, 136 onLayout: function() { 137 jQuery(window).trigger("scroll"); 138 // jQuery(window).trigger("ready"); 139 } 140 }); 141if ( hashFilter ) { 142 jQuery('.button-group').find('.current').removeClass('current'); 143 jQuery('.button-group').find('[data-filter="' + hashFilter + '"]').addClass('current'); 144 } 145 // filter items on button click 146 jQuery('.filter-button-group-research').on( 'click', 'button', function() { 147 148 jQuery('.button-group button').removeClass("current"); 149 jQuery(this).addClass("current"); 150 var filterValue = jQuery(this).attr('data-filter'); 151 $grid4.isotope({ filter: filterValue }); 152 location.hash = 'filter=' + encodeURIComponent( filterValue ); 153 }); 154}); 155// end Doctoral Faculty 156 157// Doctoral faculty 158// var $grid4 = jQuery('.faculty-filter-group').isotope({ 159 // options 160// itemSelector: '.faculty-filter-item', 161// layoutMode: 'fitRows', 162// fitRows: { 163// columnWidth: '.faculty-filter-group', 164// gutter: 10 165// } 166// }); 167// jQuery('.filter-button-group-research').on( 'click', 'button', function() { 168// var filterValue = jQuery(this).attr('data-filter'); 169// $grid4.isotope({ filter: filterValue, layoutMode: 'fitRows', 170// fitRows: { 171// columnWidth: '.faculty-filter-group', 172// gutter: 10 173// } 174// }); 175// }); 176 177/* 178// graduate faculty 179var $grid4 = jQuery('.faculty-filter-group').isotope({ 180 // options 181 itemSelector: '.faculty-filter-item', 182 layoutMode: 'fitRows', 183 fitRows: { 184 columnWidth: '.faculty-filter-group', 185 gutter: 20 186 } 187}); 188 189 190// filter items on button click - graduate faculty 191jQuery('.filter-button-group-research').on( 'click', 'button', function() { 192 var filterValue = $(this).attr('data-filter'); 193 jQuery(this).addClass("current"); 194 $grid4.isotope({ filter: filterValue }); 195 }); 196*/ 197 198/* 199var box = jQuery('.faculty-filter-item'), 200 boxContainer = jQuery('.faculty-filter-group'), 201 section = jQuery('.faculty-page'), 202 containerHeight = jQuery('.adjustable-height'), 203 boxClassFilter, 204 showThese; 205 206jQuery('button').on('click', function(){ 207 boxClassFilter = jQuery(this).data('filter'); 208 showThese = boxContainer.find('.faculty-filter-item' + '.' + boxClassFilter); 209 var sectionHeight = section.height(); 210 211 jQuery('.filter-button-group-research').find('button.selected').removeClass(); 212 jQuery(this).toggleClass('selected'); 213 214 var tl = new TimelineLite() 215 .to(box, 0.5, {scale:0, opacity:0, ease: Power3.easeOut}) 216 .set(box, {display:'none'}) 217 .set(showThese, {display:'block'}) 218 .to(showThese, 0.8, {scale:1, opacity:1, ease: Power3.easeOut}, '+=0.1') 219 .fromTo(section, 1, {height:'sectionHeight', ease: Power3.easeOut}, {height:'initial', ease: Power3.easeIn}, '-=1'); 220 221 if (boxClassFilter == 'all') { 222 var allTL = new TimelineLite() 223 .set(section, {height:sectionHeight}) 224 .to(box, 0.5, {scale:0, opacity:0, ease: Power3.easeOut}) 225 .set(box, {display:'none'}) 226 .set(box, {display:'block'}) 227 .to(box, 0.8, {scale:1, opacity:1, ease: Power3.easeOut}, '+=0.1') 228 .fromTo(section,1 , {height:'sectionHeight', ease: Power3.easeOut}, {height:'initial', ease: Power3.easeIn}, '-=1'); 229 } 230 231}); 232*/ 233 234// Infinite Scroll 235let $grid1a = jQuery('.news-row').isotope({ 236 // Isotope options... 237 itemSelector: '.news-col', 238 layoutMode: 'masonry', 239}); 240let iso = $grid1a.data('isotope'); 241// let $container = jQuery('.recent-posts').infiniteScroll({ 242$grid1a.infiniteScroll({ 243 path: '.next-posts', 244 append: '.recent-post', 245 // history: false, 246 hideNav: '.nav-links', 247 scrollThreshold: 100, 248 outlayer: iso, 249 /* options... */ }); 250$grid1a.on( 'history.infiniteScroll', function() { 251 ga( 'set', 'page', location.pathname ); 252 ga( 'send', 'pageview' ); 253}); 254 255});
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.