1/** 2 * @file 3 * A JavaScript file for the theme. 4 */ 5 6(function ($, Drupal) { 7 8 /** 9 * Open external links in a new window. 10 */ 11 Drupal.behaviors.deExternalLinks = { 12 attach: function (context, settings) { 13 $('a', context).filter(function () { 14 // Ignore non-HTTP (e.g. mailto:) link. 15 return this.href.indexOf('http') === 0; 16 }).filter(function () { 17 // Filter out links to the same domain. 18 return this.hostname && this.hostname !== location.hostname; 19 }).each(function () { 20 // Open others in their own windows. 21 $(this).attr({ 22 target: "_blank", 23 rel: "no openner", 24 'aria-label': "opens a new window", 25 'aria-describedby': "new-window-0" 26 }); 27 }); 28 } 29 }; 30 31 32 $(function() { 33 34 // Add any media helpers wrappers to help with responsive video 35 // $('.node-page iframe').each(function() {$(this).wrap('<div class="media-embed">');}); 36 // $('.node-page object').each(function() {$(this).wrap('<div class="media-embed">');}); 37 // $('.node-page embed').each(function() {$(this).wrap('<div class="media-embed">');}); 38 39 $(window).resize(); // Fake a resize event to fire above listener for table overflow 40 41 // If it's external link, open a new tab. 42 // $('a[href^="http"]:not([href*="de.staging.autismontario.com"], [href*="autismontario.com"], [href*="staging.autismontario.com"], [href*="autism.localhost"])').attr('target','_blank'); 43 44 $(document).ready(function() { 45 $('map').imageMapResize(); 46 }); 47 48 $('.view-homepage-slider .view-content').slick({ 49 dots: true, 50 arrows: false, 51 autoplay: true, 52 autoplaySpeed: 5000, 53 appendDots: $('.view-homepage-slider .view-content') 54 }); 55 // @ui variables =================== 56 // var $btnMainNav = $('.btn-menu'); 57 // var $btnSearch = $('.btn-search'); 58 59 // @breakpoint legend ============================================== 60 // breakpoint variables located in /sass/_settings/_breakpoints.scss 61 62 // $small-screen: 464px 63 // $small-screen-max: 607px 64 65 // $narrow-screen: 608px 66 // $narrow-screen-max: 767px 67 68 // $weird-screen: 768px 69 // $weird-screen-max: 895px 70 71 // $medium-screen: 896px 72 // $medium-screen-max: 991px 73 74 // $standard-screen: 992px 75 // $standard-screen-max: 1187px 76 77 // $wide-screen: 1188px 78 // $wide-screen-max: 1407px 79 80 // $super-wide-screen: 1408px 81 82 // simple state manager functions 83 84 ssm.addState({ 85 id: 'small-screen', 86 query: '(min-width: 464px)', 87 onEnter: function() { 88 // console.log('enter breakpoint'); 89 }, 90 onLeave: function() { 91 // console.log('exit breakpoint'); 92 } 93 }); 94 }); 95 96 // Select and loop the container element of the elements you want to equalise 97 $('.block-views-block-homepage-slider-block-1').each(function(){ 98 // Cache the highest 99 var highestBox = 0; 100 // Select and loop the elements you want to equalise 101 $('.slider-info', this).each(function(){ 102 // If this box is higher than the cached highest then store it 103 if($(this).height() > highestBox) { 104 highestBox = $(this).height(); 105 } 106 }); 107 // Set the height of all those children to whichever was highest 108 $('.slider-info',this).height(highestBox); 109 }); 110 111 // Force a resize event cuz Ian says so 112 $(window).resize(function() { 113 // wrap each table in a div so we can do overflow scroll on the div. Should be improved to check for table width and parent container width. 114 $('.field--name-body table').each(function() { 115 var $tableWidth = $(this).outerWidth(); 116 var $bodyWidth = $(this).closest('.field--name-body').width(); 117 118 if ($tableWidth > $bodyWidth) { 119 if (!$(this).closest('.table-responsive').length) { 120 $(this).wrap('<div class="table-responsive">'); 121 } 122 if (!$(this).closest('.table-responsive').find('.table-controls').length) { 123 $(this).before('<div class="table-controls"><span class="instruction"><span class="material-icons">swap_horiz</span> Scroll/Swipe to see more</span></div>'); 124 } 125 } else { 126 if ($(this).closest('.table-responsive').length) { 127 $(this).closest('.table-responsive').find('.table-control
127s').remove(); 128 $(this).unwrap(); 129 } 130 } 131 }); 132 }); 133 134 //creates a first word selector 135 $(".block-views-blocknews-homepage-news-block > h2, .block-views-blocknews-chapter-news > h2, .block-views-blockevents-block-1 > h2, .block-views-blockevents-event-chapters > h2").html(function(){ 136 var text= $(this).text().trim().split(" "); 137 var first = text.shift(); 138 return (text.length > 0 ? "<span class='textLight'>"+ first + "</span> " : first) + text.join(" "); 139 }); 140 141 $(function() { 142 $('.paragraph--type--accordion-item .field--name-field-title, .paragraph--type--accordion .field--name-field-items.field--name-field-title').on('click', function() { 143 $(this).toggleClass('active-accordion'); 144 $(this).next().toggle(); 145 }); 146 }); 147 148})(jQuery, Drupal);
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.