1/** 2 * Custom JS for MM jupiter Blog Filter, added by MIGHTYminnow 3 */ 4 5var $ = jQuery; 6 7var filterCats = function( e ) { 8 var $ = jQuery; 9 var $catName; 10 var $catData; 11 var $container = $( '.mk-blog-container' ); 12 var $blogItems = $( '.mk-blog-container article' ); 13 $this = $( this ); 14 15 e.preventDefault(); 16 $( '.mm-cats-filter .cat-item button' ).removeClass( 'current' ).attr( 'aria-pressed', false ); 17 $catData = $this.data('category'); 18 $this.addClass( 'current' ).attr( 'aria-pressed', true ); 19 20 21 $blogItems.each( function() { 22 $this = $( this ); 23 $catName = $this.attr( 'class' ); 24 25 if( ! $this.hasClass( $catData ) ) { 26 $this.addClass('hidden'); 27 } else { 28 $this.removeClass( 'hidden' ); 29 } 30 31 if( $catData == 'all' ) { 32 $this.removeClass( 'hidden' ); 33 } 34 35 $container.masonry({ 36 itemSelector: '.mk-blog-container article' , 37 percentPosition: true, 38 gutter: 0 39 }); 40 41 }); 42} 43 44var catsInit = function() { 45 $( '.mm-cats-filter .cat-item button' ).on( 'click', filterCats ); 46} 47 48jQuery( document ).ready( function( $ ) { 49 // External Links. 50 var h = window.location.host.toLowerCase(); 51 $( '[href^="http"]' ).not( '[href*="' + h + '"]' ).addClass( 'external-link' ).attr( "target", "_blank" ); 52 53 // Add classes to different types of links. 54 $( 'a[href^="mailto:"]' ).addClass( 'email-link' ); 55 $( 'a[href$=".pdf"]' ).attr({ "target":"_blank" }).addClass( 'pdf-link' ); 56 $( 'a[href$=".doc"]' ).attr({ "target":"_blank" }).addClass( 'doc-link' ); 57 $( 'a[href*="tel:"]' ).attr({ "target":"_blank" }).addClass( 'phone-link' ); 58 $( 'a' ).has( 'img' ).addClass( 'image-link' ); 59 60 catsInit(); 61 62});
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.