PageSourceSearch

https://www.citylit.ac.uk/static/version1790861234/frontend/Willia…/Dotdigitalgroup_Email/js/dotdigital-tag.js

js citylit.ac.uk collected 2026-10-02 05:01:22 UTC 2,758 bytes, 81 lines download raw bytes

1var queuedMethodCalls = [];
2var initializeDotdigital = function initializeDotdigital(regionPrefix, profileId) {
3  if (!regionPrefix || !profileId) {
4    console.warn('Dotdigital initialization failed: regionId and profileId are required');
5    return;
6  }
7  if (document.querySelector("script[src*=\"" + profileId + "/ddgtag.js\"]")) {
8    triggerReadyEvent();
9    return;
10  }
11  var script = document.createElement('script');
12  script.src = "//" + regionPrefix + ".ddlnk.net/" + profileId + "/ddgtag.js";
13  script.async = true;
14  script.onerror = function () {
15    return console.error('Failed to load Dotdigital script');
16  };
17  document.head.appendChild(script);
18};
19var triggerReadyEvent = function triggerReadyEvent() {
20  if ('isProxy' in window.ddg) return;
21  window.dispatchEvent(new CustomEvent('DotdigitalTagLoaded', {
22    detail: {
23      timestamp: Date.now()
24    }
25  }));
26  processQueuedMethodCalls();
27};
28var processQueuedMethodCalls = function processQueuedMethodCalls() {
29  while (queuedMethodCalls.length > 0) {
30    var _queuedMethodCalls$sh = queuedMethodCalls.shift(),
31      methodName = _queuedMethodCalls$sh.methodName,
32      methodArguments = _queuedMethodCalls$sh.methodArguments,
33      promiseResolve = _queuedMethodCalls$sh.promiseResolve;
34    if (window.ddg && typeof window.ddg[methodName] === 'function') {
35      try {
36        var _window$ddg;
37        var result = (_window$ddg = window.ddg)[methodName].apply(_window$ddg, methodArguments);
38        promiseResolve == null || promiseResolve(result);
39      } catch (error) {
40        console.error("Error calling Dotdigital " + methodName + ":", error);
41        promiseResolve == null || promiseResolve(false);
42      }
43    } else {
44      console.log("Dotdigital " + methodName + ":", methodArguments);
45      promiseResolve == null || promiseResolve(true);
46    }
47  }
48};
49var createDotdigitalProxy = function createDotdigitalProxy() {
50  return new Proxy({
51    init: initializeDotdigital,
52    isProxy: true
53  }, {
54    get: function get(target, methodName) {
55      if (methodName in target) {
56        return target[methodName];
57      }
58      return function () {
59        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
60          args[_key] = arguments[_key];
61        }
62        return new Promise(function (resolve) {
63          queuedMethodCalls.push({
64            methodName: methodName,
65            methodArguments: args,
66            promiseResolve: resolve
67          });
68        });
69      };
70    }
71  });
72};
73Object.defineProperty(window, 'ddg', {
74  get: function get() {
75    return window._ddgCurrent;
76  },
77  set: function set(value) {
78    return window._ddgCurrent = value, triggerReadyEvent();
79  }
80});
81window._ddgCurrent = createDotdigitalProxy();

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.