PageSourceSearch

https://otpecq.edu.au/libraries/uq/js/collapsible-analytics.index.js?tlusaa

js otpecq.edu.au collected 2026-10-06 12:15:05 UTC 1,453 bytes, 36 lines download raw bytes

1import { C as CUSTOM_CLICK } from './chunks/analytics.es6-CAkIlpd_.js';
2
3Drupal.behaviors["uqCollapsibleAnalytics"] = {
4  attach(context) {
5    if (!window?.dataLayer) {
6      return;
7    }
8    const elements = once("uq-collapsible-analytics", ".collapsible__toggle", context);
9    elements.forEach(element => {
10      const type = element.closest(".collapsible--list") ? "list" : "text";
11      const heading = element.closest(".collapsible, .collapsible--list")?.parentNode.querySelector("h2, h3")?.textContent ?? "No heading";
12      const handleOpenClick = event => {
13        dataLayer.push({
14          event: CUSTOM_CLICK,
15          click_category: `Collapsible ${type}`,
16          click_action: `${heading} | Open`,
17          click_label: event.currentTarget.textContent,
18          click_class: event.currentTarget.getAttribute("class")
19        });
20      };
21      const open = element.querySelector(".collapsible__open");
22      open.addEventListener("click", handleOpenClick);
23      const handleCloseClick = event => {
24        dataLayer.push({
25          event: CUSTOM_CLICK,
26          click_category: `Collapsible ${type}`,
27          click_action: `${heading} | Close`,
28          click_label: event.currentTarget.textContent,
29          click_class: event.currentTarget.getAttribute("class")
30        });
31      };
32      const close = element.querySelector(".collapsible__close");
33      close.addEventListener("click", handleCloseClick);
34    });
35  }
36};

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.