PageSourceSearch

https://luonnonperintosaatio.fi/wp-content/plugins/st-compensation-forest/js/scripts.js?ver=1691586252

js luonnonperintosaatio.fi collected 2026-10-02 08:44:28 UTC 2,880 bytes, 90 lines download raw bytes

1jQuery(document).ready(function($){
2
3  $description = $(".st-description");
4  $maparea = $(".maparea");
5  var width = $(window).width();
6
7  $('.maparea').hover(function() {
8    var tooltip = $(this).attr('data-tooltip');
9    if($('html').attr('lang') === 'en-GB' && $(this).attr('data-tooltip-en')){
10      tooltip = $(this).attr('data-tooltip-en');
11    }
12    $(this).addClass("areahover");
13    $description.addClass('active');
14    $description.html(tooltip);
15  }, function() {
16    $description.removeClass('active');
17    $maparea.removeClass('areahover');
18  });
19
20  if (width > 600) {
21    $(document).on('mousemove', function(e){
22      $description.css({
23        left:  e.pageX + 5,
24        top:   e.pageY - 1650
25      });
26    });
27  };
28});
29
30
31let mapArea = document.getElementById('salla-forest__map');
32if (mapArea) {
33  mapArea.addEventListener('click', (e) => {
34    let e1 = document.getElementById("varttuva_mantymetsa");
35    let e2 = document.getElementById("varttuva_sekametsa")
36    let e3 = document.getElementById("avosuo")
37    let e4 = document.getElementById("vanha_metsa")
38    let e5 = document.getElementById("pelto")
39    let e6 = document.getElementById("tulvametsa_ja_korpi")
40    let e7 = document.getElementById("ennallistettava_rame")
41
42    if (e1.contains(e.target)) {
43      showInfo('.salla-varttuva-mantymetsa');
44    } else if (e2.contains(e.target)) {
45      showInfo('.salla-varttuva-sekametsa');
46    } else if (e3.contains(e.target)) {
47      showInfo('.salla-avosuo');
48    } else if (e4.contains(e.target)) {
49      showInfo('.salla-vanha-metsa');
50    } else if (e5.contains(e.target)) {
51      showInfo('.salla-suopelto');
52    } else if (e6.contains(e.target)) {
53      showInfo('.salla-tulvametsa-ja-korpi');
54    } else if (e7.contains(e.target)) {
55      showInfo('.salla-ennallistettava-rame');
56    }
57  });
58}
59
60function showInfo(cardClass) {
61  let allContainers = document.querySelectorAll('.accordion-content');
62  accContainer = document.querySelector(cardClass);
63  let childNode = accContainer.querySelectorAll('.accordion-content');
64  
65  for (let i = 0; i < allContainers.length; i++) {
66      allContainers[i].style.display = 'none'; 
67 }
68
69  for (let i = 0; i < childNode.length; i++) {
70    if (childNode[i].style.display != 'none') {
71      childNode[i].style.display = 'none';
72    } else {
73      childNode[i].style.display = 'flex';
74    }   
75}
76}
77
78jQuery(document).ready(function($) {
79  $('.product-accordion .accordion-header').on('click', function() {
80
81      var isActive = $(this).hasClass('active');
82      $('.product-accordion .accordion-content').slideUp();
83      $('.product-accordion .accordion-header').removeClass('active');
84
85      if (!isActive) {
86          $(this).next('.accordion-content').slideDown();
87          $(this).addClass('active');
88      }
89  });
90});

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.