PageSourceSearch

https://www.tore-garden.no/users/toregarden_mystore_no/templates/custom_javascript.js?v=1790504797

js tore-garden.no collected 2026-09-27 10:26:44 UTC 1,345 bytes, 31 lines download raw bytes

1'use strict'
2window.addEventListener('load', (event) => {
3	moveClosestParentBefore('.megamenu a[href="/new_products"]', '.list-inline-item', '.megamenu .list-inline-item:first-of-type');
4	moveClosestParentBefore('.megamenu a[href="/specials"]', '.list-inline-item', '.megamenu .list-inline-item:nth-of-type(3)');
5});
6
7function moveClosestParentBefore(firstSelector, secondSelector, thirdSelector) {
8  const firstElement = document.querySelector(firstSelector);
9  const thirdElement = document.querySelector(thirdSelector);
10
11  if (firstElement && thirdElement) {
12    const secondElement = firstElement.closest(secondSelector);
13    if (secondElement) {
14      thirdElement.before(secondElement);
15    }
16  }
17}
18
19$(window).on('load', function() {
20  const element = document.querySelector('#footer .klarna img[src*="vipps"]');
21  if (!element) {
22    insertHtmlAfterSelector('.klarna_footer_wrapper', customHtml);
23  }
24});
25const customHtml = '<div class="vipps_cont" style="margin: 0 auto; width: 100px;"><img src="/users/themeamerica_mystore_no/images/vipps-rgb-oransje.png" class="vipps-logo" style="width: 100px !important;"></div>';
26function insertHtmlAfterSelector(selector, customHtml) {
27  const element = document.querySelector(selector);
28  if (element) {
29    element.insertAdjacentHTML('afterend', customHtml);
30  }
31}

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.