PageSourceSearch

https://studentsdemandaction.org/wp-content/themes/bd/js/actionkit-tracker.js?ver=1.0.12

js studentsdemandaction.org collected 2026-10-04 00:25:29 UTC 2,239 bytes, 81 lines download raw bytes

1(function () {
2  var KEYS = ["akid", "referring_akid", "source", "mailing", "referring_mailing"];
3  var PREFIX = "ak_";
4  var TTL_MS = 24 * 60 * 60 * 1000;
5  var ACTIONKIT_ORIGIN = "https://act.everytown.org/";
6
7  function captureFromUrl() {
8    if (typeof URLSearchParams === "undefined") return;
9    var params = new URLSearchParams(window.location.search);
10    var now = Date.now();
11    KEYS.forEach(function (key) {
12      var value = params.get(key);
13      if (value) {
14        try {
15          localStorage.setItem(PREFIX + key, value);
16          localStorage.setItem(PREFIX + key + "_ts", String(now));
17        } catch (e) {}
18      }
19    });
20  }
21
22  function getParams() {
23    var out = {};
24    var now = Date.now();
25    KEYS.forEach(function (key) {
26      try {
27        var value = localStorage.getItem(PREFIX + key);
28        var ts = parseInt(localStorage.getItem(PREFIX + key + "_ts") || "0", 10);
29        if (value && ts && now - ts < TTL_MS) {
30          out[key] = value;
31        }
32      } catch (e) {}
33    });
34    return out;
35  }
36
37  var SELECTOR = ".bd_event_card, .bd_event_fw_link";
38
39  function decorateLink(link) {
40    var params = getParams();
41    var keys = Object.keys(params);
42    if (!keys.length) return;
43    var href = link.getAttribute("href");
44    if (!href || href.indexOf(ACTIONKIT_ORIGIN) !== 0) return;
45    try {
46      var url = new URL(href);
47      keys.forEach(function (k) {
48        url.searchParams.set(k, params[k]);
49      });
50      link.setAttribute("href", url.toString());
51    } catch (e) {}
52  }
53
54  function applyToLinks() {
55    var links = document.querySelectorAll(SELECTOR);
56    for (var i = 0; i < links.length; i++) {
57      decorateLink(links[i]);
58    }
59  }
60
61  function handleInteraction(e) {
62    var t = e.target;
63    var link = t && t.closest ? t.closest(SELECTOR) : null;
64    if (link) decorateLink(link);
65  }
66
67  function init() {
68    captureFromUrl();
69    applyToLinks();
70    document.addEventListener("pointerdown", handleInteraction, true);
71    document.addEventListener("click", handleInteraction, true);
72  }
73
74  window.WOActionKit = { getParams: getParams };
75
76  if (document.readyState === "loading") {
77    document.addEventListener("DOMContentLoaded", init);
78  } else {
79    init();
80  }
81})();

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.