1/** 2 * @file 3 * Attaches several event listener to a web page. 4 */ 5 6(function ($, drupalSettings) { 7 8 "use strict"; 9 10 $(document).ready(function () { 11 12 // Attach mousedown, keyup, touchstart events to document only and catch 13 // clicks on all elements. 14 $(document.body).bind("mousedown keyup touchstart", function (event) { 15 16 // Catch the closest surrounding link of a clicked element. 17 $(event.target).closest("a,area").each(function () { 18 19 if (drupalSettings.matomo.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 20 // Mailto link clicked. 21 _paq.push(["trackEvent", "Mails", "Click", this.href.substring(7)]); 22 } 23 24 }); 25 }); 26 27 // Colorbox: This event triggers when the transition has completed and the 28 // newly loaded content has been revealed. 29 if (drupalSettings.matomo.trackColorbox) { 30 $(document).bind("cbox_complete", function () { 31 var href = $.colorbox.element().attr("href"); 32 if (href) { 33 _paq.push(["setCustomUrl", href]); 34 if (drupalSettings.matomo.disableCookies) { 35 _paq.push(["disableCookies"]); 36 } 37 _paq.push(["trackPageView"]); 38 } 39 }); 40 } 41 42 }); 43 44})(jQuery, drupalSettings); 45;
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.