PageSourceSearch

https://www.gotrum.com/api/design-724d70f76c1e98207bd9cce9b84ced2e/option.js

js gotrum.com collected 2026-10-03 20:05:42 UTC 3,194 bytes, 112 lines download raw bytes

1(() => {
2
3  const moveChickletsToFooter = () => {
4    const chicklets = document.querySelector("#logo .chicklets");
5    const copyright = document.querySelector('#copyright');
6    if (chicklets && copyright) {
7      copyright.parentNode.insertBefore(chicklets, copyright);
8    }
9  };
10
11  const addMoveListener = () => {
12    moveChickletsToFooter();
13  };
14
15  const winLoad = callback => {
16    if (document.readyState === "complete") {
17      callback();
18    } else {
19      window.addEventListener("load", callback);
20    }
21  };
22
23  winLoad(addMoveListener);
24})();
25(() => {
26  const registerFixedNav = () => {
27    const nav = document.querySelector('#topnav');
28    const topOfNav = nav.offsetTop;
29    const mobileLogoLink = document.createElement('a');
30    const logoToCopy = document.querySelector('link[rel="shortcut icon"]');
31
32    const stickyLogo = document.createElement('img');
33    stickyLogo.setAttribute('alt', 'Home');
34    if (logoToCopy) {
35      stickyLogo.setAttribute('src', logoToCopy.href);
36      stickyLogo.setAttribute('width', 50);
37      stickyLogo.setAttribute('height', 50);
38      mobileLogoLink.append(stickyLogo);
39    }
40    mobileLogoLink.setAttribute('href', document.querySelector('#logo a[rel="home"]').href);
41    mobileLogoLink.classList.add('mp-sticky-logo');
42    // remove existing sticky logo
43    const oldStickyLogo = nav.querySelector('a.mp-sticky-logo');
44    if (oldStickyLogo) nav.removeChild(oldStickyLogo);
45    nav.insertBefore(mobileLogoLink, nav.firstChild);
46
47    const fixNav = () => {
48      if (window.scrollY >= topOfNav) {
49        nav.classList.add('fixed');
50      } else {
51        nav.classList.remove('fixed');
52      }
53    };
54    window.addEventListener('scroll', fixNav);
55  };
56
57  const winLoad = (callback) => {
58    if (document.readyState === 'complete') {
59      callback();
60    } else {
61      window.addEventListener('load', callback);
62    }
63  };
64
65  winLoad(registerFixedNav);
66})();
67(() => {
68  const moveSearchBarToMainNav = () => {
69    const mainNav = document.querySelector('#topnav .mainnav');
70    const searchBar = document.getElementById('mp-search-bar')
71      ? document.getElementById('mp-search-bar')
72      : document.getElementById('CSE');
73
74    // only move it if it's not there already
75    if (searchBar && searchBar.parentElement !== mainNav) {
76      mainNav.insertBefore(searchBar, mainNav.lastChild);
77    }
78  };
79
80  const moveSearchBarBack = () => {
81    const logo = document.querySelector('#logo');
82    const searchBar = document.getElementById('mp-search-bar')
83      ? document.getElementById('mp-search-bar')
84      : document.getElementById('CSE');
85    if (searchBar) {
86      logo.insertBefore(searchBar, logo.firstChild);
87    }
88  };
89
90  const checkMove = () => {
91    const mql = window.matchMedia('(max-width: 48em)');
92    if (mql.matches) {
93      moveSearchBarToMainNav();
94    } else {
95      moveSearchBarBack();
96    }
97  };
98
99  const foldSearchIntoNav = () => {
100    window.addEventListener('resize', checkMove);
101    checkMove();
102  };
103
104  const winLoad = (callback) => {
105    if (document.readyState === 'complete') {
106      callback();
107    } else {
108      window.addEventListener('load', callback);
109    }
110  };
111  winLoad(foldSearchIntoNav);
112})();

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.