PageSourceSearch

https://www.visit-valassko.cz/templates/js/scripts.js?ver=3.5

js visit-valassko.cz collected 2026-10-07 20:43:28 UTC 39,413 bytes, 1,762 lines download raw bytes

1let mymarkers = new Array();
2
3function map() {
4  if ($("#map").length) {
5    const infowindow = new google.maps.InfoWindow();
6    $("#map")
7      .gmap3({
8        center: [49.3865326061934, 18.176542660007723],
9        zoom: 10,
10        mapTypeId: google.maps.MapTypeId.ROADMAP, // to select it directly
11        mapTypeControlOptions: {
12          mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID]
13        }
14      })
15      .then(function(_gmap) {
16        gmap = _gmap;
17      })
18
19      .marker(mymarkers)
20      // .then(function (_cluster) {
21      //       cluster = _cluster;
22      //   })
23      .on('click', function(marker, clusterOverlay, cluster, event) {
24        if (marker) {
25          infowindow.setContent(marker.data);
26          infowindow.open(marker.getMap(), marker);
27        }
28        // console.warn(marker);
29      });
30
31  }
32};
33
34
35$(document).ready(function() {
36  var all = $('.all').text();
37  var numItems = $('.place').length;
38  var allakt = $('.all-akt').text();
39  var numItemsAktuality = $('.akt').length;
40  var allakc = $('.all-akc').text();
41  var numItemsAkce = $('.akce').length;
42  $('.rest').text(all - numItems);
43  $('.rest-akt').text(allakt - numItemsAktuality);
44  $('.rest-akc').text(allakc - numItemsAkce);
45  var x = document.getElementById("gps-error");
46  var lat = document.getElementById("lat");
47  var lng = document.getElementById("lng");
48
49  function getLocation() {
50    if (navigator.geolocation) {
51      navigator.geolocation.getCurrentPosition((position) => {
52
53        var z = document.getElementById("zmapa");
54        if (z.style.display === "none") {
55          z.style.display = "block";
56        }
57
58        lat.value = position.coords.latitude;
59        lng.value = position.coords.longitude;
60
61
62        const pos = {
63          lat: position.coords.latitude,
64          lng: position.coords.longitude,
65        };
66
67        const map = new google.maps.Map(document.getElementById("zmapa"), {
68          zoom: 15,
69          center: pos
70        });
71
72
73        var l = document.getElementById("loader");
74        if (l.style.display === "none") {
75          l.style.display = "inline-block";
76        } else {
77          l.style.display = "none";
78
79
80          var marker = new google.maps.Marker({
81            position: pos,
82            icon: '/templates/img/pin.png',
83            map: map
84          });
85
86
87
88
89        }
90
91      });
92
93    } else {
94      x.innerHTML = "Váš prohlížeč nepodporuje geolokaci";
95    }
96
97
98
99    var l = document.getElementById("loader");
100    if (l.style.display === "none") {
101      l.style.display = "inline-block";
102    }
103
104
105  };
106
107  function getLocationMap() {
108
109    var z = document.getElementById("zmapa");
110    if (z.style.display === "none") {
111      z.style.display = "block";
112    }
113
114
115
116    initMap();
117
118    function initMap() {
119      const myLatlng = { lat: 49.32932040718641, lng: 18.10539780504461 };
120      const map = new google.maps.Map(document.getElementById("zmapa"), {
121        zoom: 11,
122        center: myLatlng,
123      });
124      // Create the initial InfoWindow.
125      let infoWindow = new google.maps.InfoWindow({
126        content: "Klikněte na mapu pro zjištění pozice!",
127        position: myLatlng,
128      });
129      infoWindow.open(map);
130      // Configure the click listener.
131      map.addListener("click", (mapsMouseEvent) => {
132        // Close the current InfoWindow.
133        infoWindow.close();
134
135        /*
136var marker = new google.maps.Marker({
137        position: mapsMouseEvent.latLng,
138        icon: '/templates/img/pin.png',
139        map: map
140    });
141*/
142        // Create a new InfoWindow.
143
144        infoWindow = new google.maps.InfoWindow({
145          position: mapsMouseEvent.latLng
146        });
147
148        //alert(mapsMouseEvent.lat)
149
150        lat.value = mapsMouseEvent.latLng.lat();
151        lng.value = mapsMouseEvent.latLng.lng();
152
153
154        infoWindow.setContent('Vybráno');
155
156        infoWindow.open(map);
157      });
158    }
159
160
161  };
162  $('.odeslat').click(function() {
163
164    if ($("#but_upload").length) {
165
166      $("#but_upload").trigger("click");
167
168    } else {
169
170      $("#rychla").trigger("submit");
171    }
172
173  });
174  var req = 1;
175  $("#but_upload").click(function() {
176    $('#lds-curve-bars').show()
177    var fd = new FormData();
178    var files = $('#file')[0].files[0];
179    fd.append('file', files);
180    $.ajax({
181      url: '/up.php',
182      type: 'post',
183      data: fd,
184      contentType: false,
185      processData: false,
186      success: function(response) {
187        if (response != 0) {
188          $("#soubor").attr("value", "https://www.visit-valassko.cz/" + response);
189          $('#lds-curve-bars').hide();
190          $("#rychla").trigger("submit");
191        } else {
192          $('#lds-curve-bars').hide();
193
194          if (req == 0) {
195            $('.fail').show();
196          } else {
197            $("#rychla").trigger("submit");
198          }
199
200        }
201      },
202    });
203  });
204  $("#rychla").submit(function() {
205    var url = "/form/store"; // the script where you handle the form input.
206    $.ajax({
207      type: "POST",
208      url: url,
209      data: $('#rychla').serialize(), // serializes the form's elements.
210      success: function(data) {
211        $('.ok').show();
212        $('.rychla input[type="submit"]').removeAttr('style');
213
214        //dataLayer.push({'event': 'form_sent'});
215      },
216      error: function(data) {
217        $('.fail').show();
218        $('.rychla input[type="submit"]').removeAttr('style');
219      }
220    });
221    return false; // avoid to execute the actual submit of the form.
222
223  });
224});
225
226$("#prave").submit(function() {
227  var url = "/form/store"; // the script where you handle the form input.
228  $.ajax({
229    type: "POST",
230    url: url,
231    data: $('#prave').serialize(), // serializes the form's elements.
232    success: function(data) {
233      $('.ok').show();
234      $('.rychla input[type="submit"]').removeAttr('style');
235
236      //dataLayer.push({'event': 'form_sent'});
237    },
238    error: function(data) {
239      $('.fail').show();
240      $('.rychla input[type="submit"]').removeAttr('style');
241    }
242  });
243  return false; // avoid to execute the actual submit of the form.
244
245});
246
247var myCookie = readCookie("favespages");
248
249if (myCookie == null) {
250  createCookie('favespages', '[]');
251}
252
253function createCookie(name, value, days) {
254  var expires = '',
255    date = new Date();
256  if (days) {
257    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
258    expires = '; expires=' + date.toGMTString();
259  }
260  document.cookie = name + '=' + value + expires + '; path=/';
261}
262
263function readCookie(name) {
264  var nameEQ = name + '=',
265    allCookies = document.cookie.split(';'),
266    i,
267    cookie;
268  for (i = 0; i < allCookies.length; i += 1) {
269    cookie = allCookies[i];
270    while (cookie.charAt(0) === ' ') {
271      cookie = cookie.substring(1, cookie.length);
272    }
273    if (cookie.indexOf(nameEQ) === 0) {
274      return cookie.substring(nameEQ.length, cookie.length);
275    }
276  }
277  return null;
278}
279
280function eraseCookie(name) {
281  createCookie(name, '', -1);
282}
283
284var faves = new Array();
285
286$(function() {
287
288
289
290  var myfaves = JSON.parse(readCookie('favespages'));
291  faves = myfaves;
292  $.each(myfaves, function(index, value) {
293    var element = '<div class="item ' + index + '" data-markerid="' + index + '" data-lat="' + decodeURIComponent(value.lat) + '" data-lon="' + decodeURIComponent(value.lng) + '"><a href="javascript:void(0);" class="remove" data-id="' + index + '">Odebrat</a>' +
294      '<a class="inner-text" href="' + value.url + '"><div class="text"><h3>' + decodeURIComponent(value.title) + '</h3><h4>' + decodeURIComponent(value.cat) + '</h4></div>' +
295      '<div class="back" style=\'background-image:url("' + value.img + '")\'></div></a></div>';
296    /*
297 var element = '<div class="item '+index+'"><h4>'+value.title+'</h4> <a href="'+value.url+'">Open page</a>  '+
298      '<a href="javascript:void(0);" class="remove" data-id="'+index+'">Remove me</a>';
299*/
300    $('#appendfavs').append(element);
301  });
302
303  var myfaves = JSON.parse(readCookie('favespages'));
304  //      faves = myfaves;
305  $.each(myfaves, function(index, value) {
306    var element = '<span>' + value.url + '</span>';
307
308    $('#favcheck').append(element);
309  });
310
311  function coocheck() {
312
313    $('#favcheck span').each(function() {
314
315      var checkurl = window.location.href;
316
317      var cookcheck = $(this).text();
318
319      // console.log(cookcheck);
320
321      if (checkurl == cookcheck) {
322        $('#addTofav').removeClass('enable');
323      } else {
324        return;
325      }
326
327    });
328  }
329  coocheck()
330
331
332  var numItems = $('#favcheck span').length;
333  if (numItems == 0) {
334    $('.love a').remove(".like");
335  } else {
336    $('.love a').append('<span class="like">' + numItems + '</span>');
337  }
338
339
340});
341var myVals;
342var myVals2;
343var page;
344
345
346$(document).ready(function() {
347
348  function catname() {
349
350    $('.place .text h4').each(function() {
351
352      if ($(this).data('id')) {
353
354        var textId = $(this).data('id');
355
356        var subText = $('.subkat a[data-id="' + textId + '"]').text();
357
358
359        $(this).text(subText);
360
361      }
362
363    });
364
365  }
366
367  function aktmes() {
368
369    $('select.months option').remove()
370
371    var myVals2 = [];
372    $('.akce').map(function() {
373      myVals2.push($(this).data('mesic'));
374    });
375    const names2 = myVals2;
376
377    function removeDups2() {
378      let unique2 = {};
379      myVals2.forEach(function(i) {
380        if (!unique2[i]) {
381          unique2[i] = true;
382        }
383      });
384      return Object.keys(unique2);
385    }
386
387    var arrayVariable2 = removeDups2(names2),
388      arrayLength2 = arrayVariable2.length;
389    for (i = 0; i < arrayLength2; i++) {
390
391      $('<option value="' + arrayVariable2[i] + '"/>').text(arrayVariable2[i]).appendTo('select.months')
392    }
393
394  };
395  aktmes();
396
397  function aktmesta() {
398
399    $('#akce-lokace option').remove()
400
401    var myVals3 = [];
402    $('.akce').map(function() {
403      myVals3.push($(this).data('lokace'));
404    });
405    const names3 = myVals3;
406
407    function removeDups3() {
408      let unique3 = {};
409      myVals3.forEach(function(i) {
410        if (!unique3[i]) {
411          unique3[i] = true;
412        }
413      });
414      return Object.keys(unique3);
415    }
416
417    var arrayVariable3 = removeDups3(names3),
418      arrayLength3 = arrayVariable3.length;
419    for (i = 0; i < arrayLength3; i++) {
420      //$('<div class="subkat2" data-cat="'+ arrayVariable[i]+'" />').text(arrayVariable[i]).appendTo('.filters');
421      $('<option value="' + arrayVariable3[i] + '"/>').text(arrayVariable3[i]).appendTo('#akce-lokace')
422    }
423
424  };
425  aktmesta();
426
427  function akttyp() {
428
429    $('#akce-typ-akce option').remove()
430
431    var myVals4 = [];
432    $('.akce').map(function() {
433      myVals4.push($(this).data('typ'));
434    });
435    const names4 = myVals4;
436
437    function removeDups4() {
438      let unique4 = {};
439      myVals4.forEach(function(i) {
440        if (!unique4[i]) {
441          unique4[i] = true;
442        }
443      });
444      return Object.keys(unique4);
445    }
446
447    var arrayVariable4 = removeDups4(names4),
448      arrayLength4 = arrayVariable4.length;
449    for (i = 0; i < arrayLength4; i++) {
450      //$('<div class="subkat2" data-cat="'+ arrayVariable[i]+'" />').text(arrayVariable[i]).appendTo('.filters');
451      $('<option value="' + arrayVariable4[i] + '"/>').text(arrayVariable4[i]).appendTo('#akce-typ-akce')
452    }
453
454  };
455  akttyp();
456
457  function prodtyp() {
458
459    // $('#prave-typ option').remove()	
460
461    var myValsTyp = [];
462    $('#produkty .item').map(function() {
463      myValsTyp.push($(this).data('typ'));
464    });
465
466    const namesTyp = myValsTyp;
467
468    function removeDupsTyp() {
469      let uniqueTyp = {};
470      myValsTyp.forEach(function(i) {
471        if (!uniqueTyp[i]) {
472          uniqueTyp[i] = true;
473        }
474      });
475      return Object.keys(uniqueTyp);
476    }
477
478    var arrayVariableTyp = removeDupsTyp(namesTyp),
479      arrayLengthTyp = arrayVariableTyp.length;
480    for (i = 0; i < arrayLengthTyp; i++) {
481      $('<option value="' + arrayVariableTyp[i] + '"/>').text(arrayVariableTyp[i]).appendTo('#prave-typ')
482    }
483
484  };
485  prodtyp();
486
487  function prodVyr() {
488
489    // $('#prave-typ option').remove()	
490
491    var myValsVyr = [];
492    $('#produkty .item').map(function() {
493      myValsVyr.push($(this).data('vyr'));
494    });
495
496    const namesVyr = myValsVyr;
497
498    function removeDupsVyr() {
499      let uniqueVyr = {};
500      myValsVyr.forEach(function(i) {
501        if (!uniqueVyr[i]) {
502          uniqueVyr[i] = true;
503        }
504      });
505      return Object.keys(uniqueVyr);
506    }
507
508    var arrayVariableVyr = removeDupsVyr(namesVyr),
509      arrayLengthVyr = arrayVariableVyr.length;
510    for (i = 0; i < arrayLengthVyr; i++) {
511      $('<option value="' + arrayVariableVyr[i] + '"/>').text(arrayVariableVyr[i]).appendTo('#prave-vyrobce')
512    }
513
514  };
515  prodVyr();
516
517
518  $('.places').masonry({
519    // set itemSelector so .grid-sizer is not used in layout
520    itemSelector: '.place',
521    // use element for option
522    //   columnWidth: '.grid-sizer',
523    percentPosition: true
524  });
525
526  Barba.Pjax.start();
527  // Barba.Prefetch.init();
528
529  var HideShowTransition = Barba.BaseTransition.extend({
530    start: function() {
531      this.newContainerLoading.then(this.finish.bind(this));
532    },
533
534    finish: function() {
535      //document.body.scrollTop = 0;
536
537      if ($('hero').hasClass('default')) {
538        $(window).scrollTop(0);
539
540      }
541      if ($('hero').hasClass('sub')) {
542        $(window).scrollTop(0);
543
544      }
545
546      /*
547      if ('scrollRestoration' in history) {
548          history.scrollRestoration = 'manual';
549      }
550      */
551      this.done();
552    }
553  });
554  Barba.Pjax.getTransition = function() {
555    return HideShowTransition;
556  };
557
558  $(document).on('change', 'select#akt-fil', function(e) {
559
560    var filter = this.value;
561
562    if (this.value == 'Kategorie') {
563
564      $('.akt').each(function() {
565        $(this).show()
566      });
567    } else {
568      $('.akt').each(function() {
569        if ($(this).data('filtr') == filter) {
570
571          $(this).show()
572
573        } else {
574          $(this).hide();
575
576
577        }
578      });
579    }
580
581  });
582  $(document).on('change', 'select#akce-typ-akce', function(e) {
583
584    var filter = this.value;
585
586    if (this.value == 'Typ akce') {
587
588      $('.akce').each(function() {
589        $(this).show(200);
590        $(this).removeAttr('typ-hide');
591      });
592    } else {
593
594      $('.akce').each(function() {
595        if ($(this).data('typ') == filter) {
596
597          $(this).show(200);
598          $(this).removeAttr('typ-hide');
599
600
601        } else {
602
603          $(this).hide(200);
604          $(this).attr('typ-hide', 'true');
605
606
607        }
608      });
609    }
610
611  });
612  $(document).on('change', 'select#prave-typ', function(e) {
613    var vyrobce = $('select#prave-vyrobce').val();
614    var filter = this.value;
615    if (vyrobce == 'all') {
616      $('#produkty .item').hide();
617      if (filter == 'all') {
618        $('#produkty .item[data-typ]').each(function() {
619          $(this).show('fade', 200);
620        });
621      } else {
622        $('#produkty .item[data-typ="' + filter + '"]').each(function() {
623          $(this).show('fade', 200);
624        });
625      }
626    } else {
627      // alert(vyrobce +', '+ filter)
628      $('#produkty .item').hide();
629      if (filter == 'all') {
630        $('#produkty .item[data-typ][data-vyr="' + vyrobce + '"]').each(function() {
631          $(this).show('fade', 200);
632        });
633      } else {
634        $('#produkty .item[data-typ="' + filter + '"][data-vyr="' + vyrobce + '"]').each(function() {
635          $(this).show('fade', 200);
636        });
637      }
638    }
639  });
640  $(document).on('change', 'select#prave-vyrobce', function(e) {
641    var typ = $('select#prave-typ').val();
642    var filter = this.value;
643    if (typ == 'all') {
644      $('#produkty .item').hide();
645      if (filter == 'all') {
646        $('#produkty .item[data-vyr]').each(function() {
647          $(this).show('fade', 200);
648        });
649      } else {
650        $('#produkty .item[data-vyr="' + filter + '"]').each(function() {
651          $(this).show('fade', 200);
652        });
653      }
654    } else {
655      // alert(typ +', '+ filter)
656      $('#produkty .item').hide();
657      if (filter == 'all') {
658        $('#produkty .item[data-vyr][data-typ="' + typ + '"]').each(function() {
659          $(this).show('fade', 200);
660        });
661      } else {
662        $('#produkty .item[data-typ="' + typ + '"][data-vyr="' + filter + '"]').each(function() {
663          $(this).show('fade', 200);
664        });
665      }
666    }
667  });
668  $(document).on('change', 'select#akce-lokace', function(e) {
669
670    var filter = this.value;
671
672    if (this.value == 'Lokace') {
673
674      $('.akce').each(function() {
675        $(this).show(200);
676        $(this).removeAttr('lokace-hide');
677      });
678
679    } else {
680      $('.akce').each(function() {
681        if ($(this).data('lokace') == filter) {
682
683          $(this).show(200);
684          $(this).removeAttr('lokace-hide');
685
686        } else {
687          $(this).hide(200);
688          $(this).attr('lokace-hide', 'true');
689
690        }
691      });
692    }
693
694  });
695  $(document).on('change', 'select#akce-mesic', function(e) {
696
697    var filter = this.value;
698
699    if (this.value == 'Měsíc') {
700
701      $('.akce').each(function() {
702        $(this).show(200);
703        $(this).removeAttr('mesic-hide');
704      });
705    } else {
706      $('.akce').each(function() {
707        if ($(this).data('mesic') == filter) {
708
709          $(this).show(200);
710          $(this).removeAttr('mesic-hide');
711
712        } else {
713          $(this).hide(200);
714          $(this).attr('mesic-hide', 'true');
715
716        }
717      });
718    }
719
720  });
721  $(document).on('change', 'select#region', function(e) {
722    var filter = this.value;
723    if (filter == 'all') {
724
725      if ($('.subkat2').hasClass('on')) {
726
727        var subsub = $('.subkat2.on').data('cat');
728
729        // console.log(subsub)
730
731        $('.place[data-cat="' + subsub + '"]').each(function() {
732
733          //$(this).css({outline: '1px solid red'})		
734
735          $(this).show()
736
737        });
738      } else {
739        $('.place').each(function() {
740
741          $(this).show()
742        });
743
744      }
745
746
747    } else {
748      if ($('.subkat2').hasClass('on')) {
749
750        var subsub = $('.subkat2.on').data('cat');
751
752        // console.log(subsub)
753
754        $('.place[data-cat="' + subsub + '"]').each(function() {
755
756          //$(this).css({outline: '1px solid red'})		
757
758          if ($(this).data('lok') == filter) {
759            $(this).show()
760          } else {
761            $(this).hide()
762
763          }
764
765        });
766
767      } else {
768        $('.place').each(function() {
769
770          if ($(this).data('lok') == filter) {
771
772            $(this).show()
773
774          } else {
775            $(this).hide()
776
777          }
778        });
779      }
780    }
781    $('.places').masonry({
782      // set itemSelector so .grid-sizer is not used in layout
783      itemSelector: '.place',
784      // use element for option
785      columnWidth: '.place-sizer',
786      percentPosition: true
787    });
788  });
789
790  function regionSelect() {
791
792    $(document).on('change', 'select#region', function(e) {
793
794      var filter = this.value;
795      if (filter == 'all') {
796
797        if ($('.subkat2').hasClass('on')) {
798
799          var subsub = $('.subkat2.on').data('cat');
800
801          // console.log(subsub)
802
803          $('.place[data-cat="' + subsub + '"]').each(function() {
804
805            //$(this).css({outline: '1px solid red'})		
806
807            $(this).show()
808
809          });
810        } else {
811          $('.place').each(function() {
812
813            $(this).show()
814          });
815
816        }
817
818
819      } else {
820        if ($('.subkat2').hasClass('on')) {
821
822          var subsub = $('.subkat2.on').data('cat');
823
824          // console.log(subsub)
825
826          $('.place[data-cat="' + subsub + '"]').each(function() {
827
828            //$(this).css({outline: '1px solid red'})		
829
830            if ($(this).data('lok') == filter) {
831              $(this).show()
832            } else {
833              $(this).hide()
834
835            }
836
837          });
838
839        } else {
840          $('.place').each(function() {
841
842            if ($(this).data('lok') == filter) {
843
844              $(this).show()
845
846            } else {
847              $(this).hide()
848
849            }
850          });
851        }
852      }
853      $('.places').masonry({
854        // set itemSelector so .grid-sizer is not used in layout
855        itemSelector: '.place',
856        // use element for option
857        columnWidth: '.place-sizer',
858        percentPosition: true
859      });
860    });
861  }
862  regionSelect();
863
864
865
866  $('.buton').click(function(e) {
867    e.preventDefault()
868  });
869  $('.subkat a').click(function(e) {
870    e.preventDefault()
871  });
872  var myVals = [];
873  $('.place').map(function() {
874    myVals.push($(this).data('cat'));
875  });
876
877  const names = myVals;
878
879  function removeDups() {
880    let unique = {};
881    myVals.forEach(function(i) {
882      if (!unique[i]) {
883        unique[i] = true;
884      }
885    });
886    return Object.keys(unique);
887  }
888  var arrayVariable = removeDups(names),
889    arrayLength = arrayVariable.length;
890  for (i = 0; i < arrayLength; i++) {
891    $('<div class="subkat2" data-cat="' + arrayVariable[i] + '" />').text(arrayVariable[i]).appendTo('.filters');
892  }
893
894  Barba.Dispatcher.on('newPageReady', function(currentStatus, oldStatus, container) {
895
896    prodtyp();
897    prodVyr();
898
899    if ($('.menu.on')) {
900
901      $('.menu').hide('fade', 300);
902
903    }
904
905
906
907    var myfaves = JSON.parse(readCookie('favespages'));
908    faves = myfaves;
909    $.each(myfaves, function(index, value) {
910      var element = '<div class="item ' + index + '" data-markerid="' + index + '" data-lat="' + decodeURIComponent(value.lat) + '" data-lon="' + decodeURIComponent(value.lng) + '"><a href="javascript:void(0);" class="remove" data-id="' + index + '">Odebrat</a>' +
911        '<a class="inner-text" href="' + value.url + '"><div class="text"><h3>' + decodeURIComponent(value.title) + '</h3><h4>' + decodeURIComponent(value.cat) + '</h4></div>' +
912        '<div class="back" style=\'background-image:url("' + value.img + '")\'></div></a></div>';
913      /*
914 var element = '<div class="item '+index+'"><h4>'+value.title+'</h4> <a href="'+value.url+'">Open page</a>  '+
915      '<a href="javascript:void(0);" class="remove" data-id="'+index+'">Remove me</a>';
916*/
917      $('#appendfavs').append(element);
918    });
919
920
921
922    // $('body').css({background:'red'});
923    /*
924    alert(page);
925
926    if (page){
927    	
928    	document.body.scrollTop = document.documentElement.scrollTop = 0;
929    	
930    }
931    */
932
933    var myfaves = JSON.parse(readCookie('favespages'));
934    //      faves = myfaves;
935    $.each(myfaves, function(index, value) {
936      var element = '<span>' + value.url + '</span>';
937
938      $('#favcheck').append(element);
939    });
940
941    function coocheck() {
942
943      $('#favcheck span').each(function() {
944
945        var checkurl = window.location.href;
946
947        var cookcheck = $(this).text();
948
949        // 		  console.log(cookcheck);
950
951        if (checkurl == cookcheck) {
952          $('#addTofav').removeClass('enable');
953        } else {
954          return;
955        }
956
957      });
958    }
959    coocheck()
960    /*
961    $(function() {
962       $('body').scrollTop(0);
963    });
964    */
965    // clearOverlays();
966  });
967  Barba.Dispatcher.on('transitionCompleted', function(currentStatus, oldStatus, container) {
968
969    clearOverlays();
970
971    if ($(".mini").length) {
972     
973     mymarkers = []; 
974
975      $('.gps').each(function() {
976        if ($(this).attr('data-lat')) {
977          var htmltxt = $(this).html();
978          var newmarker = {
979            position: new Array($(this).data('lat'), $(this).data('lon')),
980            icon: '/templates/img/pin.png',
981            id: $(this).data('markerid'),
982            data: htmltxt,
983            tag: 'marker'
984          };
985          // console.log(newmarker);
986          mymarkers.push(newmarker);
987        }
988      });
989
990      map();
991
992    };
993
994    var all = $('.all').text();
995    var numItems = $('.place').length;
996    var allakt = $('.all-akt').text();
997    var numItemsAktuality = $('.akt').length;
998    var allakc = $('.all-akc').text();
999    var numItemsAkce = $('.akce').length;
1000
1001    $('.rest').text(all - numItems);
1002    $('.rest-akt').text(allakt - numItemsAktuality);
1003    $('.rest-akc').text(allakc - numItemsAkce);
1004
1005    var x = document.getElementById("gps-error");
1006    var lat = document.getElementById("lat");
1007    var lng = document.getElementById("lng");
1008
1009    function getLocation() {
1010      if (navigator.geolocation) {
1011        navigator.geolocation.getCurrentPosition(showPosition);
1012
1013
1014      } else {
1015        x.innerHTML = "Váš prohlížeč nepodporuje geolokaci";
1016      }
1017
1018
1019      var l = document.getElementById("loader");
1020      if (l.style.display === "none") {
1021        l.style.display = "inline-block";
1022      }
1023
1024
1025    };
1026
1027    function showPosition(position) {
1028
1029      var z = document.getElementById("zmapa");
1030      if (z.style.display === "none") {
1031        z.style.display = "block";
1032      }
1033
1034      lat.value = position.coords.latitude;
1035      lng.value = position.coords.longitude;
1036
1037
1038      const pos = {
1039        lat: position.coords.latitude,
1040        lng: position.coords.longitude,
1041      };
1042
1043      const map = new google.maps.Map(document.getElementById("zmapa"), {
1044        zoom: 15,
1045        center: pos
1046      });
1047
1048
1049      var l = document.getElementById("loader");
1050      if (l.style.display === "none") {
1051        l.style.display = "inline-block";
1052      } else {
1053        l.style.display = "none";
1054
1055
1056        var marker = new google.maps.Marker({
1057          position: pos,
1058          icon: '/templates/img/pin.png',
1059          map: map
1060        });
1061
1062
1063
1064
1065      }
1066
1067    };
1068
1069    function getLocationMap() {
1070
1071      var z = document.getElementById("zmapa");
1072      if (z.style.display === "none") {
1073        z.style.display = "block";
1074      }
1075
1076
1077
1078      initMap();
1079
1080      function initMap() {
1081        const myLatlng = { lat: 49.32932040718641, lng: 18.10539780504461 };
1082        const map = new google.maps.Map(document.getElementById("zmapa"), {
1083          zoom: 11,
1084          center: myLatlng,
1085        });
1086        // Create the initial InfoWindow.
1087        let infoWindow = new google.maps.InfoWindow({
1088          content: "Klikněte na mapu pro zjištění pozice!",
1089          position: myLatlng,
1090        });
1091        infoWindow.open(map);
1092        // Configure the click listener.
1093        map.addListener("click", (mapsMouseEvent) => {
1094          // Close the current InfoWindow.
1095          infoWindow.close();
1096
1097          /*
1098var marker = new google.maps.Marker({
1099        position: mapsMouseEvent.latLng,
1100        icon: '/templates/img/pin.png',
1101        map: map
1102    });
1103*/
1104          // Create a new InfoWindow.
1105
1106          infoWindow = new google.maps.InfoWindow({
1107            position: mapsMouseEvent.latLng
1108          });
1109
1110          //alert(mapsMouseEvent.lat)
1111
1112          lat.value = mapsMouseEvent.latLng.lat();
1113          lng.value = mapsMouseEvent.latLng.lng();
1114
1115
1116          infoWindow.setContent('Vybráno');
1117
1118          infoWindow.open(map);
1119        });
1120      }
1121
1122
1123    };
1124
1125    $(document).ready(function() {
1126      $('.odeslat').click(function() {
1127
1128        if ($("#but_upload").length) {
1129
1130          $("#but_upload").trigger("click");
1131
1132        } else {
1133
1134          $("#rychla").trigger("submit");
1135        }
1136
1137      });
1138
1139      var req = 1;
1140
1141      $("#but_upload").click(function() {
1142        $('#lds-curve-bars').show()
1143        var fd = new FormData();
1144        var files = $('#file')[0].files[0];
1145        fd.append('file', files);
1146        $.ajax({
1147          url: '/up.php',
1148          type: 'post',
1149          data: fd,
1150          contentType: false,
1151          processData: false,
1152          success: function(response) {
1153            if (response != 0) {
1154              $("#soubor").attr("value", "https://www.visit-valassko.cz/" + response);
1155              $('#lds-curve-bars').hide();
1156              $("#rychla").trigger("submit");
1157            } else {
1158              $('#lds-curve-bars').hide();
1159
1160              if (req == 0) {
1161                $('.fail').show();
1162              } else {
1163                $("#rychla").trigger("submit");
1164              }
1165
1166            }
1167          },
1168        });
1169      });
1170      $("#rychla").submit(function() {
1171        var url = "/form/store"; // the script where you handle the form input.
1172        $.ajax({
1173          type: "POST",
1174          url: url,
1175          data: $('#rychla').serialize(), // serializes the form's elements.
1176          success: function(data) {
1177            $('.ok').show();
1178            $('.rychla input[type="submit"]').removeAttr('style');
1179
1180            //dataLayer.push({'event': 'form_sent'});
1181          },
1182          error: function(data) {
1183            $('.fail').show();
1184            $('.rychla input[type="submit"]').removeAttr('style');
1185          }
1186        });
1187        return false; // avoid to execute the actual submit of the form.
1188
1189      });
1190
1191    });
1192
1193    catname();
1194    aktmes();
1195    aktmesta();
1196    akttyp();
1197
1198
1199    $(".places").masonry();
1200    $(".places").masonry("reloadItems");
1201    $('.places').masonry({
1202      itemSelector: '.place',
1203      percentPosition: true
1204    });
1205    $('.buton').click(function(e) {
1206      e.preventDefault()
1207    });
1208    $('.subkat a').click(function(e) {
1209      e.preventDefault()
1210    });
1211
1212    var myVals = [];
1213    $('.place').map(function() {
1214      myVals.push($(this).data('cat'));
1215    });
1216    const names = myVals;
1217
1218    function removeDups() {
1219      let unique = {};
1220      myVals.forEach(function(i) {
1221        if (!unique[i]) {
1222          unique[i] = true;
1223        }
1224      });
1225      return Object.keys(unique);
1226    }
1227    // console.log(myVals)
1228
1229    var arrayVariable = removeDups(names),
1230      arrayLength = arrayVariable.length;
1231    for (i = 0; i < arrayLength; i++) {
1232      $('<div class="subkat2" data-cat="' + arrayVariable[i] + '" />').text(arrayVariable[i]).appendTo('.filters');
1233    }
1234
1235
1236  });
1237
1238
1239
1240
1241  $("#hello").submit(function() {
1242    var url = "/form/store"; // the script where you handle the form input.
1243    $.ajax({
1244      type: "POST",
1245      url: url,
1246      data: $('#hello').serialize(), // serializes the form's elements.
1247      success: function(data) {
1248        $('.ok').show();
1249        $('form#hello')[0].reset();
1250
1251      },
1252      error: function(data) {
1253        $('.fail').show();
1254      }
1255    });
1256    return false; // avoid to execute the actual submit of the form.
1257  });
1258
1259
1260
1261  $('.fancybox').fancybox();
1262  $('#maplinks .nadpis').each(function() {
1263
1264    var idname = $(this).attr('id');
1265
1266    var newStr = idname.replace(/,/g, "");
1267
1268    return $(this).attr('id', newStr);
1269
1270  });
1271  $('a.scrol.link').each(function() {
1272
1273
1274    var idname = $(this).attr('href');
1275
1276    var newStr = idname.replace(/,/g, "");
1277
1278    return $(this).attr('href', newStr);
1279
1280  });
1281
1282  var cluster, gmap;
1283
1284
1285
1286
1287  var markersArray = [];
1288
1289  function clearOverlays() {
1290    for (var i = 0; i < markersArray.length; i++) {
1291      markersArray[i].setMap(null);
1292    }
1293    console.log('clear')
1294  }
1295
1296
1297});
1298
1299$(window).on('load', function() {
1300  // alert('load');
1301  if ($(".mini").length) {
1302
1303    console.log('onload');
1304    $('.gps').each(function() {
1305
1306      if ($(this).attr('data-lat')) {
1307        var htmltxt = $(this).html();
1308        var newmarker = {
1309          position: new Array($(this).data('lat'), $(this).data('lon')),
1310          icon: '/templates/img/pin.png',
1311          id: $(this).data('markerid'),
1312          data: htmltxt,
1313          tag: 'marker'
1314        };
1315
1316        mymarkers.push(newmarker);
1317      }
1318    });
1319    map();
1320  };
1321
1322});
1323
1324
1325$(document).on('click', '.up', function() {
1326
1327
1328  $('body,html').animate({ scrollTop: 0 }, 2000, 'easeInCubic')
1329});
1330$(document).on('click', '.down', function() {
1331
1332
1333  $('body,html').animate({ scrollTop: $('hero').height() }, 2000, 'easeInCubic')
1334});
1335$(document).on('click', '.getlocation', function() {
1336
1337  getLocation()
1338
1339});
1340$(document).on('click', '.getLocationMap', function() {
1341
1342  getLocationMap()
1343
1344});
1345$(document).on('click', '.xko', function() {
1346  $('.message').hide(200);
1347});
1348$(document).on('click', 'a.scroll', function() {
1349  var srcscr = $(this).attr('href');
1350  var pos = $(srcscr).offset().top;
1351  $('body,html').animate({ scrollTop: pos }, 2000, 'easeInCubic')
1352
1353});
1354$(document).on('click', 'button.showplace', function() {
1355
1356  $('.places').show();
1357  $('#map').hide();
1358
1359});
1360$(document).on('click', 'button.showmap', function() {
1361
1362  $('.places').hide();
1363  $('#map').show();
1364
1365
1366
1367  $('.place').each(function() {
1368
1369    if ($(this).attr('data-lat')) {
1370      var htmltxt = $(this).html();
1371      var newmarker = {
1372        position: new Array($(this).data('lat'), $(this).data('lon')),
1373        icon: '/templates/img/pin.png',
1374        id: $(this).data('markerid'),
1375        data: htmltxt,
1376        tag: 'marker'
1377      };
1378      mymarkers.push(newmarker);
1379
1380    }
1381  });
1382
1383  map();
1384
1385});
1386$(document).on('click', 'button.showplace-like', function() {
1387
1388  $('.items').show();
1389  $('#map').hide();
1390
1391});
1392$(document).on('click', 'button.showmap-like', function() {
1393
1394  // 	$('.items').hide();
1395  $('#map').show();
1396
1397  $('.item').each(function() {
1398
1399    if ($(this).attr('data-lat')) {
1400
1401      var htmltxt = $(this).html();
1402      var newmarker = {
1403        position: new Array($(this).data('lat'), $(this).data('lon')),
1404        icon: '/templates/img/pin.png',
1405        id: $(this).data('markerid'),
1406        data: htmltxt,
1407        tag: 'marker'
1408      };
1409      mymarkers.push(newmarker);
1410
1411    }
1412  });
1413
1414  map();
1415
1416});
1417$(document).on('click', '#addTofav.enable', function(e) {
1418  e.preventDefault();
1419
1420  $(this).removeClass('enable');
1421
1422  var url = window.location.href; // current page url
1423  //       alert(url)
1424
1425  var pageTitle = $(document).find("title").text();
1426  var pageTitle = encodeURIComponent(pageTitle);
1427
1428  var cat = $(document).find(".typ.hlavni").text();
1429  var cat = encodeURIComponent(cat);
1430
1431  var lat = $(document).find(".lat").text();
1432  var lat = encodeURIComponent(lat);
1433
1434  var lng = $(document).find(".lng").text();
1435  var lng = encodeURIComponent(lng);
1436
1437  var imgUrl = $(document).find(".obrazek-nad img").attr('src');
1438
1439  var fav = { 'title': pageTitle, 'url': url, 'img': imgUrl, 'cat': cat, 'lat': lat, 'lng': lng };
1440
1441  //       alert(pageTitle+','+imgUrl+','+url)
1442
1443  faves.push(fav);
1444
1445  // console.log(fav)
1446
1447  var stringified = JSON.stringify(faves);
1448  createCookie('favespages', stringified);
1449  location.reload();
1450
1451  /*
1452       var numItems = $('#favcheck span').length;
1453  if(numItems == 0){
1454    $('.love a').remove('<span>');
1455  }else {
1456    $('.love a').append('<span>'+numItems+'</span>');
1457  }
1458  */
1459
1460});
1461$(document).on('click', '.remove', function() {
1462  var id = $(this).data('id');
1463  faves.splice(id, 1);
1464  var stringified = JSON.stringify(faves);
1465  createCookie('favespages', stringified);
1466  location.reload();
1467});
1468$(document).on('click', '#more', function(e) {
1469
1470  e.preventDefault();
1471  var that = this;
1472  var page = $(this).data('page');
1473  var url = '';
1474
1475  /*
1476if(wind.locale != 'cs')
1477   {
1478       url += '/' + wind.locale;
1479   }
1480*/
1481
1482  url += '/places?page=' + page;
1483
1484
1485
1486  $("<div>").load(url, function() {
1487
1488    $('.places').append($(this).html());
1489
1490
1491    $(".places").masonry("reloadItems");
1492    $(".places").masonry();
1493
1494
1495    $(that).data('page', page + 1);
1496
1497    //        console.log(page)
1498
1499    // catname();
1500
1501    var all = $('.all').text();
1502
1503    var numItems = $('.place').length;
1504
1505    $('.rest').text(all - numItems);
1506
1507    // console.log(numItems)
1508
1509
1510  });
1511
1512
1513});
1514$(document).on('click', '#more2', function(e) {
1515
1516  e.preventDefault();
1517  var that = this;
1518  var page = $(this).data('page');
1519  var mainSection = $(this).data('section');
1520  var url = '';
1521
1522
1523  url += '/places_videt?page=' + page + '&mainSection=' + mainSection;
1524
1525
1526
1527  $("<div>").load(url, function() {
1528
1529    $('.places').append($(this).html());
1530
1531
1532    $(".places").masonry("reloadItems");
1533    $(".places").masonry();
1534
1535
1536    $(that).data('page', page + 1);
1537
1538
1539    //        console.log(page)
1540
1541    catname();
1542
1543    var all = $('.all').text();
1544
1545    var numItems = $('.place').length;
1546
1547    $('.rest').text(all - numItems);
1548
1549    // console.log(numItems)
1550
1551    // 	   console.log($( "#region option:selected" ).attr("value"))
1552
1553
1554  });
1555
1556
1557});
1558$(document).on('click', '#more3', function(e) {
1559
1560  e.preventDefault();
1561  var that = this;
1562  var page = $(this).data('page');
1563  var mainSection = $(this).data('section');
1564  var url = '';
1565
1566  //    alert(mainSection)
1567
1568  /*
1569if(wind.locale != 'cs')
1570   {
1571       url += '/' + wind.locale;
1572   }
1573*/
1574
1575  url += '/places_jist?page=' + page + '&mainSection=' + mainSection;
1576
1577
1578
1579  $("<div>").load(url, function() {
1580
1581    $('.places').append($(this).html());
1582
1583
1584    $(".places").masonry("reloadItems");
1585    $(".places").masonry();
1586
1587
1588    $(that).data('page', page + 1);
1589
1590
1591    //        console.log(page)
1592
1593    catname();
1594
1595    var all = $('.all').text();
1596
1597    var numItems = $('.place').length;
1598
1599    $('.rest').text(all - numItems);
1600
1601    // console.log(numItems)
1602
1603
1604  });
1605
1606
1607});
1608$(document).on('click', '#more4', function(e) {
1609
1610  e.preventDefault();
1611  var that = this;
1612  var page = $(this).data('page');
1613  var mainSection = $(this).data('section');
1614  var url = '';
1615
1616  //    alert(mainSection)
1617
1618  /*
1619if(wind.locale != 'cs')
1620   {
1621       url += '/' + wind.locale;
1622   }
1623*/
1624
1625  url += '/places_spat?page=' + page + '&mainSection=' + mainSection;
1626
1627
1628
1629  $("<div>").load(url, function() {
1630
1631    $('.places').append($(this).html());
1632
1633
1634    $(".places").masonry("reloadItems");
1635    $(".places").masonry();
1636
1637
1638    $(that).data('page', page + 1);
1639
1640
1641    //        console.log(page)
1642
1643    catname();
1644
1645    var all = $('.all').text();
1646
1647    var numItems = $('.place').length;
1648
1649    $('.rest').text(all - numItems);
1650
1651    // console.log(numItems)
1652
1653
1654  });
1655
1656});
1657$(document).on('click', '#more-akt', function(e) {
1658
1659  e.preventDefault();
1660  var that = this;
1661  var page = $(this).data('page');
1662  var url = '';
1663
1664  url += '/more-news?page=' + page;
1665
1666  $("<div>").load(url, function() {
1667
1668    $('.akts').append($(this).html());
1669    $(that).data('page', page + 1);
1670
1671    var allakt = $('.all-akt').text();
1672
1673    var numItemsAktuality = $('.akt').length;
1674    $('.rest-akt').text(allakt - numItemsAktuality);
1675
1676  });
1677
1678});
1679$(document).on('click', '#more-akc', function(e) {
1680
1681  e.preventDefault();
1682  var that = this;
1683  var page = $(this).data('page');
1684  var typ = $('#akce-typ-akce').val();
1685  var url = '';
1686
1687  url += '/more-akc?page=' + page + '&typ=' + encodeURIComponent(typ);
1688
1689  // console.log(url);
1690
1691
1692  $("<div>").load(url, function() {
1693
1694    $('.akces').append($(this).html());
1695    $(that).data('page', page + 1);
1696
1697    var allakc = $('.all-akc').text();
1698
1699    var numItemsakc = $('.akce').length;
1700    $('.rest-akc').text(allakc - numItemsakc);
1701
1702
1703    akttyp();
1704    aktmesta();
1705    aktmes();
1706
1707
1708  });
1709
1710
1711});
1712$(document).on('click', '.subkat2', function(e) {
1713  var filter = $(this).data('cat');
1714
1715  $('.subkat2').removeClass('on');
1716  $(this).toggleClass('on');
1717
1718  $('.place').each(function() {
1719    if ($(this).data('cat') == filter) {
1720      $(this).show()
1721    } else {
1722      $(this).hide()
1723    }
1724  });
1725  $('.places').masonry({
1726    // set itemSelector so .grid-sizer is not used in layout
1727    itemSelector: '.place',
1728    // use element for option
1729    //   columnWidth: '.grid-sizer',
1730    percentPosition: true
1731  });
1732});
1733function toggleMenu() {
1734  $('.menu').fadeToggle(300).addClass('on');
1735}
1736
1737$(document).on('click', '.radiator', toggleMenu);
1738
1739$(document).on('keydown', '.radiator', function(e) {
1740  // Key codes: Enter = 13, Space = 32
1741  if (e.key === 'Enter' || e.key === ' ' || e.keyCode === 13 || e.keyCode === 32) {
1742    e.preventDefault(); // Prevent page scroll on space
1743    toggleMenu();
1744  }
1745});
1746$(document).on('click', '.menu', function() {
1747
1748  if ($('.menu.on')) {
1749
1750    $('.menu').hide('fade', 300);
1751
1752  }
1753
1754});
1755$(document).on('click', '.akt', function() {
1756  var src = $(this).find('a').attr('href');
1757  return window.location.href = src;
1758});
1759$(document).on('click', '.akce', function() {
1760  var src = $(this).find('a').attr('href');
1761  return window.location.href = src;
1762});

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.