PageSourceSearch

https://docs-spectrocloud.netlify.app/scripts/kapa-shortcut.js

js docs-spectrocloud.netlify.app collected 2026-10-03 10:39:38 UTC 1,154 bytes, 41 lines download raw bytes

1(function () {
2  let k = window.Kapa;
3  if (!k) {
4    let i = function () {
5      i.c(arguments);
6    };
7    i.q = [];
8    i.c = function (args) {
9      i.q.push(args);
10    };
11    window.Kapa = i;
12  }
13})();
14
15document.addEventListener("keydown", function (event) {
16  if ((event.ctrlKey || event.metaKey) && event.key === "i") {
17    event.preventDefault();
18
19    // Get the shadow root of the Kapa widget
20    const kapaContainer = document.querySelector("#kapa-widget-container");
21    const shadowRoot = kapaContainer?.shadowRoot;
22
23    if (!shadowRoot) return; // Exit if the shadow root is not found
24
25    // Navigate inside the shadow DOM to find the modal
26    const kapaPortal = shadowRoot.querySelector("#kapa-widget-portal");
27
28    if (!kapaPortal) return; // Exit if the portal is not found
29
30    // Now we can access the actual modal element
31    const modal = kapaPortal.querySelector(".mantine-Modal-root"); // Adjust selector as needed
32
33    if (modal && modal.children.length > 0) {
34      // Modal is open → Close it
35      window.Kapa("close");
36    } else {
37      // Modal is closed or not found → Open it
38      window.Kapa("open");
39    }
40  }
41});

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.