PageSourceSearch

https://www.sodir.no/Content/js/site.js?v=o7mAmyesH7Rlzj-b6O42O-UgUfNxMWoL9460KdMe-IU

js sodir.no collected 2026-09-24 18:03:14 UTC 8,697 bytes, 253 lines download raw bytes

1$(document).ready(function () {
2    $(".exploration-models__table").show();
3    $(".exploration-models__table").DataTable(
4        {
5            "searching": false,
6            "paging": false,
7            "responsive": true,
8            "bInfo": false
9        }
10    );
11
12    // toggle sub tree in exploration model sub menu for mobile screens
13    document.body.addEventListener("click", function (click) {
14        if (click.target.className === "exploration-model__sub-menu__parent-page") {
15            $(click.target).next("ul").toggle();
16        }
17    });
18
19    // add table stripes
20    var article = document.getElementsByClassName("article");
21    $(article).each(function() {
22        $("table").each(function() {
23            $("tr:odd").each(function() {
24                $(this).addClass("odd");
25            });
26        });
27    });
28
29    // custom datatables set in TinyMCE table properties
30    $(".custom-datatable").DataTable(
31        {
32            "searching": false,
33            "paging": false,
34            "responsive": true,
35            "bInfo": false
36        }
37    );
38    $(".custom-datatable").show();
39
40    // responsive tables set in TinyMCE table properties
41    var stackTables = document.getElementsByClassName("stacktable");
42    $(stackTables).each(function() {
43        $(this).stacktable(/*{headIndex:0}*/);
44    });
45
46    // dynamically add class to article image
47    $(".article figure img").first().addClass("article__img");
48
49    // Remove language changer for Force & Diskos (they should be available only in English)
50    var fHeader = document.getElementsByClassName("f_header");
51    var dHeader = document.getElementsByClassName("d_header");
52    if (fHeader.length > 0 || dHeader.length > 0) {
53        $("#lang-changer").remove();
54    }
55
56    // remove font size changer for iPad specifically
57    var isIpad = navigator.userAgent.match(/iPad/i) !== null;
58    if (isIpad) {
59        document.getElementById("font-changer").remove();
60    }
61
62    // pagination for ArticleListPage and SearchPage
63    $(".btn-next").on("click",
64        function() {
65            $(".pagination .active").next().trigger("click");
66        });
67
68    $(".btn-next-mobile").on("click",
69        function() {
70            $(".pagination .active").next().trigger("click");
71        });
72
73    $(".btn-prev").on("click",
74        function() {
75            $(".pagination .active").prev().trigger("click");
76        });
77
78    var simulateClick = function (elem) {
79        // Create our event (with options)
80        var evt = new MouseEvent('click', {
81            bubbles: true,
82            cancelable: true,
83            view: window
84        });
85        // If cancelled, don't dispatch our event
86        var canceled = !elem.dispatchEvent(evt);
87    };
88
89    
90
91    // lightbox functionality for images added in TinyMCE
92    lightbox.option({
93        "fadeDuration": 0,
94        "resizeDuration": 0,
95        "imageFadeDuration": 0,
96        "wrapAround": true,
97        "albumLabel": "%1/%2",
98        disableScrolling: true
99    });
100
101    $("img.lightbox-img").each(
102        function() {
103            var link = document.createElement("a");
104            $(link).attr("href", this.src);
105            $(link).attr("target", "_blank");
106            $(link).attr("data-lightbox", "lightbox-img");
107            $(link).attr("data-title", $(this).attr("alt"));
108            $(link).addClass("lightbox-link");
109            $(link).append($(this).clone());
110            $(this).replaceWith(link);
111        });
112
113    $("body").on("click", "#lb-download",
114        function() {
115            $("#lb-download-link").attr("href", $(".lb-image").first().attr("src"));
116            $("#lb-download-link").attr("download", "");
117        });
118
119    
120
121    $("body").on("click", ".lightbox-img",
122        function () {
123            if ($(".lightbox-img").length < 2) {
124                $(".lb-prev .fas").hide();
125                $(".lb-next .fas").hide();
126                
127            }
128            var lightboxOverlayEle = document.querySelector('#lightboxOverlay');
129            
130            lightboxOverlayEle.click();
131            lightboxOverlayEle.setAttribute('tabIndex', '-1');
132            simulateClick(lightboxOverlayEle);
133            lightboxOverlayEle.focus();
134            var setFocus = setInterval(function () {
135                try {
136                    var lightboxOverlayEle = document.querySelector('#lightboxOverlay');
137                    if (lightboxOverlayEle !== null) {
138                        clearInterval(setFocus);
139                        lightboxOverlayEle.focus();
140                    } else {
141                        console.log('Lightbox config still pending...');
142                    }
143                } catch (error) {
144                    console.error(error);
145                    clearInterval(setFocus);
146                }
147            }, 100);
148
149        });
150
151    var removeTabIndex = setInterval(function () {
152        try {
153            var lightboxOverlayEle = document.querySelector('#lightboxOverlay');
154            if (lightboxOverlayEle !== null) {
155                clearInterval(removeTabIndex);
156                lightboxOverlayEle.removeAttribute('tabIndex');
157            } else {
158                console.log('Lightbox config still pending...');
159            }
160        } catch (error) {
161            console.error(error);
162            clearInterval(removeTabIndex);
163        }
164    }, 100);
165    //
166    //
167    //Set values on hidden form values
168    var f = document.querySelector('input[value="hiddenURLvalue"]');
169    if (f != null) { f.value = location.href }
170    f = document.querySelector('input[value="hiddenSITEvalue"]');
171    if (f != null) { f.value = document.querySelector('meta[name="layout"]').content }
172    f = document.querySelector('input[value="hiddenTITLEvalue"]');
173    if (f != null) { f.value = document.querySelector('meta[property="og:title"]').content }
174    $(document).on('click', '.dropdown-menu', function (e) {
175        e.stopPropagation();
176    });
177
178});
179
180let showContent = (id) => {
181    let elm = document.getElementsByName(id);
182    let b = document.getElementsByName('b_' + id);
183    for (let i = 0; i < elm.length; i++)
184    {
185        if (elm[i].style.maxHeight) {
186            elm[i].style.maxHeight = null;
187            //elm[i].classList.remove("sh-content-faded-show");
188            elm[i].classList.remove("sh-content-nofade-show");
189            b[i].parentElement.title = b[i].parentElement.getAttribute('data-exp');
190            b[i].classList.remove("arrowup");
191            b[i].classList.add("arrowdown");
192        } else {
193            elm[i].style.maxHeight = elm[i].scrollHeight + "px";
194            //elm[i].classList.add("sh-content-faded-show");
195            elm[i].classList.add("sh-content-nofade-show");
196            b[i].parentElement.title = b[i].parentElement.getAttribute('data-min');
197            b[i].classList.remove("arrowdown");
198            b[i].classList.add("arrowup");
199        }
200    }
201
202}
203
204function loadDeferredIframes(overlays = true) {
205    document.querySelectorAll('[data-iframe]').forEach(el => {
206        if ((el.tagName === 'IFRAME' || el.tagName === 'TABLEAU-VIZ') && el.dataset.src) {
207            el.src = el.dataset.src;
208            el.removeAttribute('data-src');
209        }
210    });
211    if (overlays) removeIframeOverlays();
212}
213
214function applyIframeOverlays() {
215    // Sjekk om consent løsning er aktiv
216    if (!document.getElementById('cookie-consent-modal')) return;
217    document.querySelectorAll('[data-iframe]').forEach(el => {
218        const overlayClass = 'iframe-consent-overlay';
219
220        // Ikke gjør noe hvis overlay allerede finnes
221        if (el.previousElementSibling?.classList.contains(overlayClass)) return;
222
223        // Lag overlay-elementet
224        const overlay = document.createElement('div');
225        overlay.className = overlayClass;
226        //overlay.innerText = document.getElementById('cookieOverlay').value;
227        const overlayText = document.createElement('span');
228        overlayText.innerText = document.getElementById('cookieOverlay').value;
229
230        const link = document.createElement('a');
231        link.href = '#';
232        link.innerText = document.getElementById('cookieOverlay').value;
233        link.onclick = function (e) {
234            e.preventDefault();
235            new CustomModal('cookie-consent-modal').open();
236        };
237
238        //overlay.appendChild(overlayText);
239        overlay.appendChild(link);
240
241
242        // Sett inn overlay før iframe
243        el.parentNode.insertBefore(overlay, el);
244    });
245}
246
247function removeIframeOverlays() {
248    document.querySelectorAll('[data-iframe]').forEach(el => {
249        if (el.previousElementSibling?.classList.contains('iframe-consent-overlay')) {
250            el.previousElementSibling.remove();
251        }
252    });
253}

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.