PageSourceSearch

https://derivative.ca/sites/default/files/advagg_js/js__OOBeaxfDBl…pF0XZBfK20DpQR-usK1PKLzYFEHTRU3F7doNzOxY.js

js derivative.ca collected 2026-09-24 08:47:07 UTC 7,349 bytes, 204 lines download raw bytes

1(function(c,q){var m="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";c.fn.imagesLoaded=function(f){function n(){var b=c(j),a=c(h);d&&(h.length?d.reject(e,b,a):d.resolve(e));c.isFunction(f)&&f.call(g,e,b,a)}function p(b){k(b.target,"error"===b.type)}function k(b,a){b.src===m||-1!==c.inArray(b,l)||(l.push(b),a?h.push(b):j.push(b),c.data(b,"imagesLoaded",{isBroken:a,src:b.src}),r&&d.notifyWith(c(b),[a,e,c(j),c(h)]),e.length===l.length&&(setTimeout(n),e.unbind(".imagesLoaded",
2p)))}var g=this,d=c.isFunction(c.Deferred)?c.Deferred():0,r=c.isFunction(d.notify),e=g.find("img").add(g.filter("img")),l=[],j=[],h=[];c.isPlainObject(f)&&c.each(f,function(b,a){if("callback"===b)f=a;else if(d)d[b](a)});e.length?e.bind("load.imagesLoaded error.imagesLoaded",p).each(function(b,a){var d=a.src,e=c.data(a,"imagesLoaded");if(e&&e.src===d)k(a,e.isBroken);else if(a.complete&&a.naturalWidth!==q)k(a,0===a.naturalWidth||0===a.naturalHeight);else if(a.readyState||a.complete)a.src=m,a.src=d}):
3n();return d?d.promise(g):g}})(jQuery);
4
5;/*})'"*/
6;/*})'"*/
7(function ($) {
8
9Drupal.googleanalytics = {};
10
11$(document).ready(function() {
12
13  // Attach mousedown, keyup, touchstart events to document only and catch
14  // clicks on all elements.
15  $(document.body).bind("mousedown keyup touchstart", function(event) {
16
17    // Catch the closest surrounding link of a clicked element.
18    $(event.target).closest("a,area").each(function() {
19
20      // Is the clicked URL internal?
21      if (Drupal.googleanalytics.isInternal(this.href)) {
22        // Skip 'click' tracking, if custom tracking events are bound.
23        if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) {
24          // Do nothing here. The custom event will handle all tracking.
25          //console.info("Click on .colorbox item has been detected.");
26        }
27        // Is download tracking activated and the file extension configured for download tracking?
28        else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) {
29          // Download link clicked.
30          ga("send", {
31            "hitType": "event",
32            "eventCategory": "Downloads",
33            "eventAction": Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(),
34            "eventLabel": Drupal.googleanalytics.getPageUrl(this.href),
35            "transport": "beacon"
36          });
37        }
38        else if (Drupal.googleanalytics.isInternalSpecial(this.href)) {
39          // Keep the internal URL for Google Analytics website overlay intact.
40          ga("send", {
41            "hitType": "pageview",
42            "page": Drupal.googleanalytics.getPageUrl(this.href),
43            "transport": "beacon"
44          });
45        }
46      }
47      else {
48        if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
49          // Mailto link clicked.
50          ga("send", {
51            "hitType": "event",
52            "eventCategory": "Mails",
53            "eventAction": "Click",
54            "eventLabel": this.href.substring(7),
55            "transport": "beacon"
56          });
57        }
58        else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) {
59          if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) {
60            // External link clicked / No top-level cross domain clicked.
61            ga("send", {
62              "hitType": "event",
63              "eventCategory": "Outbound links",
64              "eventAction": "Click",
65              "eventLabel": this.href,
66              "transport": "beacon"
67            });
68          }
69        }
70      }
71    });
72  });
73
74  // Track hash changes as unique pageviews, if this option has been enabled.
75  if (Drupal.settings.googleanalytics.trackUrlFragments) {
76    window.onhashchange = function() {
77      ga("send", {
78        "hitType": "pageview",
79        "page": location.pathname + location.search + location.hash
80      });
81    };
82  }
83
84  // Colorbox: This event triggers when the transition has completed and the
85  // newly loaded content has been revealed.
86  if (Drupal.settings.googleanalytics.trackColorbox) {
87    $(document).bind("cbox_complete", function () {
88      var href = $.colorbox.element().attr("href");
89      if (href) {
90        ga("send", {
91          "hitType": "pageview",
92          "page": Drupal.googleanalytics.getPageUrl(href)
93        });
94      }
95    });
96  }
97
98});
99
100/**
101 * Check whether the hostname is part of the cross domains or not.
102 *
103 * @param string hostname
104 *   The hostname of the clicked URL.
105 * @param array crossDomains
106 *   All cross domain hostnames as JS array.
107 *
108 * @return boolean
109 */
110Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) {
111  /**
112   * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is
113   * `null` or `undefined`, https://bugs.jquery.com/ticket/10076,
114   * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174
115   *
116   * @todo: Remove/Refactor in D8
117   */
118  if (!crossDomains) {
119    return false;
120  }
121  else {
122    return $.inArray(hostname, crossDomains) > -1 ? true : false;
123  }
124};
125
126/**
127 * Check whether this is a download URL or not.
128 *
129 * @param string url
130 *   The web url to check.
131 *
132 * @return boolean
133 */
134Drupal.googleanalytics.isDownload = function (url) {
135  var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
136  return isDownload.test(url);
137};
138
139/**
140 * Check whether this is an absolute internal URL or not.
141 *
142 * @param string url
143 *   The web url to check.
144 *
145 * @return boolean
146 */
147Drupal.googleanalytics.isInternal = function (url) {
148  var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
149  return isInternal.test(url);
150};
151
152/**
153 * Check whether this is a special URL or not.
154 *
155 * URL types:
156 *  - gotwo.module /go/* links.
157 *
158 * @param string url
159 *   The web url to check.
160 *
161 * @return boolean
162 */
163Drupal.googleanalytics.isInternalSpecial = function (url) {
164  var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
165  return isInternalSpecial.test(url);
166};
167
168/**
169 * Extract the relative internal URL from an absolute internal URL.
170 *
171 * Examples:
172 * - https://mydomain.com/node/1 -> /node/1
173 * - https://example.com/foo/bar -> https://example.com/foo/bar
174 *
175 * @param string url
176 *   The web url to check.
177 *
178 * @return string
179 *   Internal website URL
180 */
181Drupal.googleanalytics.getPageUrl = function (url) {
182  var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i");
183  return url.replace(extractInternalUrl, '');
184};
185
186/**
187 * Extract the download file extension from the URL.
188 *
189 * @param string url
190 *   The web url to check.
191 *
192 * @return string
193 *   The file extension of the passed url. e.g. "zip", "txt"
194 */
195Drupal.googleanalytics.getDownloadExtension = function (url) {
196  var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
197  var extension = extractDownloadextension.exec(url);
198  return (extension === null) ? '' : extension[1];
199};
200
201})(jQuery);
202
203;/*})'"*/
204;/*})'"*/

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.