PageSourceSearch

https://poliisimuseo.fi/o/yja-poliisi-theme/js/main.js?browserId=chrome&languageId=fi_FI&t=1790002316000

js poliisimuseo.fi collected 2026-09-25 00:13:19 UTC 4,876 bytes, 127 lines download raw bytes

1function scrollToTop() {
2    if ("scrollRestoration" in history) {
3        history.scrollRestoration = "manual";
4    }
5    window.scrollTo(0, 0);
6    document.querySelector(".nav-link").focus();
7}
8
9function setAlertStates() {
10    $(".poliisi-alert").each(function () {
11        var aNumber = $(this).data("id");
12        var aTitle = "poliisi-alert-id-" + aNumber;
13
14        if (Cookies.get(aTitle) === "read") {
15            $("." + aTitle).addClass("d-none");
16        }
17    });
18}
19
20function setResponsiveIframe() {
21    $("iframe").each(function () {
22        if ($(this).closest("div").not().hasClass("embed-responsive") == false && $(this).closest("div").not().hasClass("d-ar-16_9") == false && $(this).parent("body") == false) {
23            $(this).parent().addClass("embed-responsive");
24            $(this).parent().addClass("embed-responsive-16by9");
25        }
26    });
27}
28
29function addAnchorToPagingLink() {
30    $(".portlet").each(function () {
31        var portletId = $(this).attr("id");
32        if (typeof portletId !== 'undefined' && portletId !== false) {
33            var portletElement = $('#' + portletId);
34            if (portletElement.length > 0) {
35                var buttonsContainer = portletElement.find('.lfr-pagination-buttons');
36                if (buttonsContainer.length > 0) {
37                    var buttons = buttonsContainer.find('li');
38                    buttons.each(function () {
39                        if (!$(this).hasClass('disabled')) {
40                            var link = $(this).find('a');
41                            if (link.length > 0) {
42                                var href = link.attr('href');
43                                href += '#' + portletId;
44                                link.attr('href', href);
45                            }
46                        }
47                    });
48                }
49            }
50        }
51    });
52}
53
54$(".poliisi-alert .btn-close-alert").on("click tap", function () {
55    var aNumber = $(this).data("id");
56    var aTitle = "poliisi-alert-id-" + aNumber;
57    Cookies.set(aTitle, "read");
58    $("." + aTitle).addClass("d-none");
59});
60
61$(".info-accordion-toggle").on("click tap", function () {
62    $(this).next(".info-accordion-content").toggle();
63    $(this).parent(".info-accordion").toggleClass("opened");
64
65    if ($(this).attr("aria-expanded") ===  "false") {
66        $(this).attr("aria-expanded", "true");
67        $(this).next(".info-accordion-content").attr("aria-hidden", "false");
68    }
69    else if ($(this).attr("aria-expanded") === "true") {
70        $(this).attr("aria-expanded", "false");
71        $(this).next(".info-accordion-content").attr("aria-hidden", "true");
72    }
73});
74
75$(document).ready(function () {
76    setAlertStates();
77    addAnchorToPagingLink();
78    setResponsiveIframe();
79});
80
81$(document).ready(function () {
82    if ($(".navbar-toggler").attr("aria-expanded") === "false") {
83        $("#mainMenubar").attr("aria-hidden", "true");
84    }
85
86    $("#mainMenubar").find(".nav-link, .dropdown-toggle").each(function(){
87        if ($(".navbar-toggler").attr("aria-expanded") === "false") {
88            $("#mainMenubar").find(".nav-link").attr("tabindex",-1);
89            $("#mainMenubar").find(".dropdown-toggle").attr("tabindex",-1);
90        } else {
91            $("#mainMenubar").find(".nav-link").attr("tabindex",0);
92            $("#mainMenubar").find(".dropdown-toggle").attr("tabindex",0);
93        }
94    });
95    $(".navbar-toggler").click(function() {
96        if ($(".navbar-toggler").attr("aria-expanded") === "true") {
97            $("#mainMenubar").attr("aria-hidden", "true");
98            $("#mainMenubar").find(".nav-link").attr("tabindex",-1);
99            $("#mainMenubar").find(".dropdown-toggle").attr("tabindex",-1);
100        } else {
101            $("#mainMenubar").attr("aria-hidden", "false");
102            $("#mainMenubar").find(".nav-link").attr("tabindex",0);
103            $("#mainMenubar").find(".dropdown-toggle").attr("tabindex",0);
104        }
105    });
106
107    // YJAPOL-613
108    let lang = document.getElementsByTagName('html')[0].getAttribute('lang');
109    let itemsToRemoveFi = ['Poliisiammattikorkeakoulu', 'Poliisimuseo', 'Ahvenanmaan poliisilaitos'];
110    let itemsToRemoveSv = ['Polisyrkeshögskolan', 'Polismuseet', 'Ålands polismyndighet'];
111    let itemsToRemoveEn = ['Police University College', 'Police Museum', 'Police Authority of The Åland Islands'];
112
113    $(".web-content-listing-portlet").find("[name*='paramTopic']").find("option").each(function() {
114        if (lang == "fi-FI") {
115            itemsToRemove = itemsToRemoveFi;
116        } else if (lang == "sv-SE") {
117            itemsToRemove = itemsToRemoveSv;
118        } else {
119            itemsToRemove = itemsToRemoveEn;
120        }
121        itemsToRemove.forEach((itemsToRemove) => {
122            if (itemsToRemove === this.innerHTML) {
123                this.remove();
124            }
125        });
126    });
127});

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.