favorite comment 0
thumb_up0thumb_down

directions_bike121

Bicykel lock_open

place Graf prevýšenia

comment Komentáre ku aktivite

Momentálne sa tu nenachádzajú žiadne komentáre

Formulár sa odosiela
Pridaj komentár
Formulár sa odosiela
trending_up Vzdialenosť
100,0 km
schedule Čas
03:15:59
landscape Nastúpané
718 m

bar_chartŠtatistiky

Priemer Max
Rýchlosť 30,6 km/h 62,6 km/h
Výkon 183 W -
Kadencia 61 rpm -
Tepová frekvencia 149 bpm 180 bpm
Energetický výdaj 2 811 kcal

cloudPodmienky

Priemerná teplota 28 °C
directions_bike Bicykel: Merida Reacto

directions_bike Posledné aktivity bikera

thumb_up0thumb_down

directions_bike 113

trending_up 62,5 km
schedule 03:03:32
landscape 1 579 m
thumb_up0thumb_down

directions_bike 114

trending_up 71,8 km
schedule 03:17:17
landscape 840 m
thumb_up0thumb_down

directions_bike 112

trending_up 53,0 km
schedule 02:14:58
landscape 947 m

place Segmenty

Názov segmentuSegment ČasMôj čas Priemerná rýchlosť Priemerný výkon Priemerný tep Najlepší čas na segmenteNajlepší čas
16 segmentov
Formulár sa odosiela
keyboard_arrow_up kri\u017eovatka ","segmentDistance":"D\u013a\u017eka: 679.10 metrov<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 6.9 %<\/b>","segmentNameHref":"segment-hrusovo-%3Ekrizovatka"},"geometry":{"type":"LineString","coordinates":[["20.056896","48.492527",241.6],["20.056896","48.492527",241.6],["20.057394","48.491817",245.4],["20.057527","48.491299",249.4],["20.057486","48.490906",252.2],["20.057472","48.490223",257],["20.057646","48.489571",261.2],["20.057854","48.488991",265.4],["20.057798","48.488361",271.4],["20.057703","48.487774",276],["20.057527","48.487144",281.2]]}},{"type":"Feature","properties":{"type":99,"segment":"34309","segmentName":"MSR ITT prv\u00e1 polka ","segmentDistance":"D\u013a\u017eka: 10.27 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -0.4 %<\/b>","segmentNameHref":"msr-itt-prva-polka"},"geometry":{"type":"LineString","coordinates":[["20.094297","48.4688",229.8],["20.094297","48.4688",229.8],["20.096754","48.470001",221.2],["20.097893","48.470139",220.6],["20.100653","48.470154",222.8],["20.101198","48.470123",223],["20.1017","48.469383",224.6],["20.101927","48.468906",228.8],["20.101931","48.468212",230.2],["20.101744","48.46645",226.2],["20.101753","48.465569",221],["20.103159","48.463917",217.6],["20.104729","48.462395",218.6],["20.104967","48.461555",217.6],["20.105101","48.46022",217.6],["20.104778","48.459023",217],["20.104685","48.457874",216.8],["20.104938","48.457275",216.4],["20.105925","48.456032",214.8],["20.108059","48.45335",211.6],["20.109432","48.451588",211.2],["20.111444","48.44952",209.8],["20.112453","48.44865",209],["20.114807","48.447723",209],["20.115627","48.447647",208.8],["20.116259","48.447861",209],["20.11692","48.44743",209],["20.118416","48.446426",209],["20.119207","48.445846",208.8],["20.118916","48.445503",208.8],["20.116535","48.444885",208.2],["20.114479","48.444317",207.8],["20.1143","48.444057",208],["20.114508","48.442928",207.4],["20.114807","48.440906",206],["20.115099","48.439121",206.4],["20.115431","48.436993",206.4],["20.115562","48.434483",205.4],["20.115595","48.433346",205.8],["20.116032","48.431454",205.6],["20.116615","48.429073",205.4],["20.117048","48.427399",205.4],["20.1178","48.426445",204.4],["20.1189","48.425018",205.4],["20.120295","48.423244",203.6],["20.121662","48.421535",203.6],["20.123398","48.41975",202.2],["20.125759","48.417335",201.8],["20.13018","48.414894",202.4],["20.131588","48.413837",200.8],["20.133324","48.411999",199],["20.135319","48.409893",198.4],["20.136852","48.408257",199],["20.139124","48.405827",198.4],["20.140265","48.404819",199.2],["20.143225","48.402611",197.2],["20.146807","48.399986",195.6],["20.149021","48.398369",194.2],["20.151953","48.396183",194.4],["20.153843","48.394699",194.6],["20.154108","48.394207",194.6],["20.153984","48.393944",194.6],["20.152973","48.393124",194.6],["20.152672","48.392738",195.2],["20.152935","48.392506",195.8],["20.154631","48.391346",196.4],["20.157001","48.389076",195.8],["20.158361","48.38781",194]]}},{"type":"Feature","properties":{"type":99,"segment":"35252","segmentName":"B\u00e1tka - Rimavsk\u00e1 Se\u010d","segmentDistance":"D\u013a\u017eka: 7.92 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -0.1 %<\/b>","segmentNameHref":"batka-rimavska-sec"},"geometry":{"type":"LineString","coordinates":[["20.175737","48.370983",189.4],["20.175737","48.370983",189.4],["20.177069","48.369858",189.8],["20.17876","48.368423",189.2],["20.180038","48.367336",188.2],["20.183283","48.364571",187],["20.185251","48.362896",186.4],["20.186094","48.362186",186],["20.188063","48.360512",185.4],["20.189758","48.35907",185.8],["20.193972","48.355492",184.8],["20.195993","48.353783",184.2],["20.197332","48.352665",185],["20.198566","48.35157",185],["20.199484","48.350582",184.8],["20.200615","48.348888",183.8],["20.202131","48.346668",185],["20.202629","48.345932",185.2],["20.203205","48.345074",185.8],["20.203695","48.344349",185.4],["20.20492","48.343037",186],["20.205589","48.342228",185.4],["20.205862","48.341377",185],["20.206465","48.340588",184.4],["20.207273","48.339588",183.8],["20.208204","48.338318",184.6],["20.21011","48.3358",183],["20.211225","48.334324",184.8],["20.212189","48.333015",192.2],["20.213098","48.331779",185.2],["20.214302","48.330063",181.2],["20.215263","48.328751",180.2],["20.216574","48.326981",180.6],["20.217152","48.326237",182.8],["20.217487","48.325733",189.4],["20.217979","48.324997",193.8],["20.218855","48.323788",193.2],["20.219416","48.323009",191],["20.220413","48.321651",193.6],["20.220491","48.321552",194.8],["20.220991","48.320827",196.4],["20.221807","48.319748",196.6],["20.223057","48.318027",193.6],["20.224316","48.316376",193],["20.225651","48.314556",193.8],["20.227236","48.312458",187.2],["20.227928","48.311504",187.6]]}},{"type":"Feature","properties":{"type":99,"segment":"35253","segmentName":"\u010casovka R.Se\u010d-Pavlovce, 10 km","segmentDistance":"D\u013a\u017eka: 9.99 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 0.4 %<\/b>","segmentNameHref":"casovka-rsec-pavlovce-10-km"},"geometry":{"type":"LineString","coordinates":[["20.221729","48.302372",188.2],["20.221729","48.302372",188.2],["20.219048","48.301697",188],["20.215977","48.300911",188.6],["20.213798","48.300365",188.8],["20.210062","48.299767",188],["20.206726","48.299496",187],["20.202801","48.299145",188],["20.200718","48.29895",188.2],["20.19733","48.298862",191.2],["20.191095","48.29882",191],["20.19013","48.298851",191.2],["20.188339","48.299072",186.2],["20.184286","48.299568",185.2],["20.182188","48.299828",185.2],["20.180557","48.299972",186],["20.177961","48.29969",185.6],["20.176712","48.299488",190.2],["20.174908","48.299423",195],["20.170837","48.299305",195.6],["20.16946","48.299694",195],["20.166861","48.300674",195],["20.163786","48.30183",195.2],["20.161726","48.302601",197],["20.158411","48.303829",196.8],["20.154995","48.305138",204.8],["20.152328","48.306076",204.6],["20.151047","48.30658",205],["20.149441","48.307197",208.6],["20.14629","48.308086",213.6],["20.142462","48.309055",213.8],["20.140997","48.309448",214.6],["20.138987","48.309971",214.8],["20.134495","48.311111",214],["20.13212","48.311699",213.8],["20.12755","48.312855",214.2],["20.126219","48.313202",214.6],["20.123426","48.313911",215.6],["20.120617","48.314632",216.6],["20.117481","48.315449",215.8],["20.114954","48.316002",217.2],["20.113352","48.316231",217],["20.110996","48.316574",217],["20.105909","48.317299",217.8],["20.103174","48.317688",219.6],["20.099356","48.318214",220],["20.095087","48.318817",222.6],["20.092781","48.319141",227.2],["20.090015","48.319538",228.2]]}},{"type":"Feature","properties":{"type":99,"segment":"79580","segmentName":"Pavlovce - Rimavsk\u00e1 Sobota","segmentDistance":"D\u013a\u017eka: 6.69 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 0.3 %<\/b>","segmentNameHref":"pavlovce-rimavska-sobota"},"geometry":{"type":"LineString","coordinates":[["20.084469","48.32172",204],["20.084469","48.32172",204],["20.083832","48.323029",202.2],["20.083158","48.323975",202.2],["20.081783","48.325714",202.4],["20.081411","48.32637",202.4],["20.080963","48.327866",202.6],["20.08065","48.328346",203.4],["20.079286","48.328945",204.4],["20.078049","48.329575",211.2],["20.077166","48.330326",213.8],["20.076185","48.331249",212.8],["20.075785","48.332684",210],["20.074686","48.334484",206.8],["20.073814","48.335586",206.6],["20.072975","48.336246",204.4],["20.070349","48.338119",204],["20.069473","48.338474",205],["20.067112","48.338867",206],["20.065788","48.338936",207.6],["20.064949","48.339565",208.8],["20.063749","48.340607",209.6],["20.063131","48.341202",209.2],["20.06188","48.342213",209.6],["20.060919","48.34314",210.6],["20.060066","48.344036",210.6],["20.058371","48.345749",210.6],["20.058203","48.346226",210.2],["20.058521","48.347679",211.8],["20.058369","48.348354",211.6],["20.057653","48.350265",211.6],["20.056446","48.35358",211.8],["20.055473","48.356113",213],["20.054985","48.357418",214.2],["20.054367","48.359051",216.4],["20.053448","48.361546",220.4],["20.052761","48.36256",222],["20.050421","48.365158",219.6],["20.049114","48.365978",220.6],["20.047874","48.366531",220.6],["20.046335","48.367279",218.8],["20.044712","48.368076",221.6],["20.042261","48.369305",216.8]]}},{"type":"Feature","properties":{"type":99,"segment":"79581","segmentName":"R. Janovce - RS","segmentDistance":"D\u013a\u017eka: 2.91 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 0.2 %<\/b>","segmentNameHref":"r-janovce-rs"},"geometry":{"type":"LineString","coordinates":[["20.056446","48.35358",211.8],["20.056446","48.35358",211.8],["20.055473","48.356113",213],["20.054985","48.357418",214.2],["20.054367","48.359051",216.4],["20.053448","48.361546",220.4],["20.052761","48.36256",222],["20.050421","48.365158",219.6],["20.049114","48.365978",220.6],["20.047874","48.366531",220.6],["20.046335","48.367279",218.8],["20.044712","48.368076",221.6],["20.042261","48.369305",216.8],["20.040087","48.370739",218.2],["20.038406","48.371838",218.4],["20.036509","48.3731",217.4],["20.035322","48.373924",217.8]]}},{"type":"Feature","properties":{"type":99,"segment":"26385","segmentName":"RS - Kr\u00e1sna sprint","segmentDistance":"D\u013a\u017eka: 2.73 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 0.4 %<\/b>","segmentNameHref":"rs-krasna-sprint"},"geometry":{"type":"LineString","coordinates":[["19.986923","48.397125",227.4],["19.986923","48.397125",227.4],["19.984859","48.399746",227.6],["19.983143","48.401836",227.4],["19.981672","48.403732",227.8],["19.980335","48.405457",228.8],["19.97916","48.407017",229.2],["19.976723","48.409992",230],["19.975162","48.411732",231.2],["19.971985","48.415318",232.8]]}},{"type":"Feature","properties":{"type":99,"segment":"26386","segmentName":"Ve\u013ek\u00e9 Teriakovce - Hrachovo","segmentDistance":"D\u013a\u017eka: 3.15 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 0.2 %<\/b>","segmentNameHref":"velke-teriakovce-hrachovo"},"geometry":{"type":"LineString","coordinates":[["19.965113","48.436756",242.6],["19.965113","48.436756",242.6],["19.964157","48.438515",243.2],["19.963108","48.440388",243.4],["19.961992","48.442364",244.6],["19.961105","48.444145",244.2],["19.960754","48.445862",243.8],["19.960424","48.447407",244.6],["19.960012","48.448582",244.2],["19.95944","48.450706",244.2],["19.959143","48.451206",244.4],["19.958122","48.451858",245],["19.957243","48.452538",245.8],["19.955811","48.453732",250],["19.954931","48.454422",250.2],["19.954391","48.454906",250.4],["19.95405","48.455872",250.2],["19.953417","48.457993",250.8],["19.953281","48.459358",251.6],["19.953665","48.461887",249.8],["19.953758","48.463078",249]]}}] var layerGroup = L.layerGroup().addTo(map_leaflet); var layerGroupAllSegments = L.layerGroup(); if (gpx_segments != undefined) { gpx_segments_layer = L.geoJson(gpx_segments, { style: function(feature, layer) { return { 'weight': 10, 'color': '#bb6300', 'opacity': 1, }; }, onEachFeature:onEachFeature, }); function onEachFeature(feature, layer) { sn++; var prop = layer.feature.properties; var desc = getDescription(prop.type, prop.trailName, prop.trailId, prop.trailStatus, prop.segmentName, prop.segment, prop.segmentDistance, prop.segmentGrade, prop.segmentNameHref); var sl = feature.geometry.coordinates[0][1]; var sr = feature.geometry.coordinates[0][0]; var el = feature.geometry.coordinates[feature.geometry.coordinates.length - 1][1]; var er = feature.geometry.coordinates[feature.geometry.coordinates.length - 1][0]; if (sl != '' && sr != '' && el != '' && er != '') { var sm = new L.marker(L.latLng(sl, sr), {icon: startIcon}); var em = new L.marker(L.latLng(el, er), {icon: endIcon}); } var layerGroup = L.featureGroup(); layerGroup.addLayer(sm); layerGroup.addLayer(em); sm.bindPopup(desc); em.bindPopup(desc); var popupLayer = L.popup().setLatLng(L.latLng(sl, sr)).setContent(desc); layerGroup.bindPopup(popupLayer).openPopup(); layerGroup.addLayer(layer); segments.push(layerGroup); layer.on("click", function(e) { var desc = getDescription(prop.type, prop.trailName, prop.trailId, prop.trailStatus, prop.segmentName, prop.segment, prop.segmentDistance, prop.segmentGrade, prop.segmentNameHref); if (desc) { var popup = L.popup() .setLatLng(e.latlng) .setContent(desc) .openOn(map_leaflet); } }); //controlLayers.addOverlay(layerGroup, 'Segmenty na trase - ' + feature.properties.segmentName); } var displaySeg = 0; function showSegment(seg) { segments[displaySeg].remove(map_leaflet); segments[displaySeg]._popup.remove(map_leaflet); segments[seg].addTo(map_leaflet); segments[seg]._popup.addTo(map_leaflet); displaySeg = seg; var bounds = segments[seg].getBounds(); map_leaflet.fitBounds(bounds, {padding: [30, 30]}); $.scrollTo( '#map_leaflet', 800, {offset: -120} ); } } // geo location through leaflet plugin var lc = L.control.locate({ drawCircle: false, follow: true, markerStyle: {color: '#000000',fillColor: '#ee7711',fillOpacity: 0.7,weight: 4,opacity: 0.7,radius: 7}, strings: { title: "Ukáž mi, kde sa nachádzam", // title of the locate control popup: "Si v okolí {distance} {unit} od tohto bodu", // text to appear if user clicks on circle outsideMapBoundsMsg: "Nachádzaš sa mimo oblasti tejto mapy" // default message for onLocationOutsideMapBounds } }).addTo(map_leaflet); map_leaflet.on('startfollowing', function() { map_leaflet.on('dragstart', lc.stopFollowing); }).on('stopfollowing', function() { map_leaflet.off('dragstart', lc.stopFollowing); }); $(document).ready(function() { map_leaflet.on('baselayerchange', function(){ var id = event.currentTarget.layerId; var layer = this._layers[id]; $.ajax({ type: "POST", url: "/ajax.php?u=Cyklotrasy&f=saveDefaultMap&a=" + layer.options.name, }); }) }); $('#elevationDiv').html(''); $('.elevation').appendTo('#elevationDiv'); //gallery carousel multiple items - hack $(function(){ // init arrows $('.gallery-carousel').each(function(){ var itemsPerSlide = 3; if ($(this).data('items-per-slide')) itemsPerSlide = $(this).data('items-per-slide'); if ($('.carousel-item', this).length <= itemsPerSlide){ $('.carousel-control-next', this).addClass('disabled'); } }); $('.gallery-carousel').on('slide.bs.carousel', function (e) { if (!window.matchMedia("(min-width: 768px)").matches) return; // default behaviour on mobile /* CC 2.0 License Iatek LLC 2018 - Attribution required */ var $e = $(e.relatedTarget); var idx = $e.index(); var itemsPerSlide = 3; if ($(this).data('items-per-slide')) itemsPerSlide = $(this).data('items-per-slide'); var totalItems = $('.carousel-item', this).length; if ($(this).data('ended')==true && e.direction=='left'){ return false; } if (e.to===0){ $('.carousel-control-prev', this).addClass('disabled'); }else{ $('.carousel-control-prev', this).removeClass('disabled'); } if (e.to>=totalItems - itemsPerSlide){ $('.carousel-control-next', this).addClass('disabled'); $(this).data('ended', true); }else{ $('.carousel-control-next', this).removeClass('disabled'); $(this).data('ended', false); } }); }); function initEkkoLightbox(){ $('[data-toggle="lightbox"]:not(.lightbox-ready)').on('click', function(event) { event.preventDefault(); event.stopImmediatePropagation(); //$(this).removeAttr('href').attr('role', 'button'); var $this = $(this); $this.ekkoLightbox({ alwaysShowClose: true, wrapping: false, //Whether the gallery should loop or not leftArrow: '', rightArrow: '', onNavigate: function(){ $('.ekko-lightbox').removeClass('zoomed'); }, onShow: function(){ if (!$this.hasClass('no-zoom')) { $('.ekko-lightbox .modal-header').prepend('zoom_inzoom_out'); } $('.ekko-lightbox .ekko-lightbox-item').bind('touchstart touchend touchup swipeLeft swipeRight', function(event) { if ($('.ekko-lightbox').hasClass('zoomed') || (window.visualViewport && window.visualViewport.scale > 1.02)){ event.stopPropagation(); } }); $('.ekko-lightbox .ekko-lightbox-nav-overlay').bind('touchstart touchend touchup swipeLeft swipeRight', function(event) { if ($('.ekko-lightbox').hasClass('pinch-zoomed') || (window.visualViewport && window.visualViewport.scale > 1.02)){ $('.ekko-lightbox').addClass('pinch-zoomed'); event.stopPropagation(); } if (window.visualViewport && window.visualViewport.scale <= 1.02){ setTimeout(function(){ if (window.visualViewport && window.visualViewport.scale <= 1.02){ //check again after timeout $('.ekko-lightbox').removeClass('pinch-zoomed'); } },100); } }); if (window.matchMedia("(min-width: 768px)").matches) { $('body').addClass('ekko-modal-open'); } onPopupOpened('ekko-lightbox'); }, onShown: function(){ }, onHidden: function(){ $('body').removeClass('ekko-modal-open'); onPopupClosed(); } }); return false; }); $('[data-toggle="lightbox"]').addClass('lightbox-ready'); } $(function(){ $('.show-alt-in-lightbox[data-toggle="lightbox"]').each(function(){ $(this).data('footer', $(this).find('img').attr('title')); }); $('body').on('click', '.ekko-lightbox-zoom', function(){ $('.ekko-lightbox').toggleClass('zoomed'); }); $('body').on('click', '.ekko-lightbox.zoomed .ekko-lightbox-item.show ', function(){ $('.ekko-lightbox').removeClass('zoomed'); }) initEkkoLightbox(); $(document).ajaxComplete(function(event, xhr, settings) { //if (xhr.responseText.indexOf('lightbox') >= 0){ initEkkoLightbox(); //} }); }); function favoriteRide(ride) { $.ajax({ type: "POST", data: {id : ride, ride : 1}, dataType: "json", url: "/ajax.php?u=cyklotrasy&f=toggleFavourite", success: function(data) { if (data.added === 1) { $('.btn-wishlist.show-add-to-wishlist').hide(); $('.btn-wishlist.show-remove-from-wishlist').show(); //potrebuje dllllho zobrazit showMessageBar('#favoriteSuccess', 60*1000); } else { $('.btn-wishlist.show-remove-from-wishlist').hide(); $('.btn-wishlist.show-add-to-wishlist').show(); showMessageBar('#favoriteSuccessRemove'); } } }); } $(document).ready(function(){ //mobile map popup $('.close-map-widget').click(function(){ $('#map-widget').removeClass('show'); return false; }); $('.show-map-widget').click(function(){ $('#map-widget').addClass('show'); return false; }); $('a[href="#comments"]').on('click', function(e){ e.preventDefault(); commentsScroll('#comments'); return false; }); if ($('#segmenty').length){ if (location.hash.indexOf('#segmenty')>=0){ if (window.innerWidth>=768){ $.scrollTo( '#segmenty', 800, {offset: -100} ); } $('#segmenty-expander').prop('checked', true); } var $pagination = $('#segmentyList table .pagination-wrap'); $pagination.appendTo('#segmentyList'); $('#segmentyList .row-pagination').remove(); } }); var loadedComments_comments = false; function loadComments_comments(){ } // Comments $(function(){ $('.comment-form, .review-form', '#comments').on('submit', function(){ $(this).attr('autocomplete',"off"); // prevent prepopulating fields on backbtn click if (history.state && history.state.popupOpened === 'mobile-expander'){ $('.mobile-expander-content', '#comments').addClass('opened'); history.back(); } }); $('select[name=sort], select[name=filter]', '#comments').on('change', function() { let inputName = $(this).attr('name'); let sort = $('select[name=sort]', '#comments').val(); let filter = $('select[name=filter]', '#comments').length ? $('select[name=filter]', '#comments ').val() : ''; var url = "/ajax.php?m=komentare&f=loadCommentsWidget&a=bW9kdWw9dnlqYXpkeSZleHRlcm5hbElkPTcwODk5MCZpdGVtTmFtZT1WJUMzJUJEamF6ZCslQzQlOEQuKzcwODk5MCZjb21tZW50VHlwZT1jb21tZW50JmF1dGhvclVzZXJJZD05OTM5MCZ3aWRnZXRJZD1jb21tZW50cyZhbGxvd0luc2VydD0xJmFsbG93UmVwbHk9MSZyZXR1cm5Vcmw9aHR0cHMlM0ElMkYlMkZ3d3cubXRoaWtlci5zayUyRmFrdGl2aXR5JTJGNzA4OTkwJTJGYmljeWtlbC0xMjEuaHRtbCZwYXJzZWRVcmwlNUJzY2hlbWUlNUQ9aHR0cHMmcGFyc2VkVXJsJTVCaG9zdCU1RD13d3cubXRoaWtlci5zayZwYXJzZWRVcmwlNUJwYXRoJTVEPSUyRmFrdGl2aXR5JTJGNzA4OTkwJTJGYmljeWtlbC0xMjEuaHRtbCZpbmNsdWRlQ29tbWVudElkPTA|" + sort + "|" + filter; if (inputName === 'filter') { if (parseInt(filter) === 3 && !customScoreDone) { loadScoreSettingsModal(); return false; } } $('#comments .comments-body-content').addClass('show-loading'); $.ajax({ url: url, success: function(data) { $('#comments .comments-body-content').html(data).removeClass('show-loading'); } }); }); }); // Comments function toggleHiddenComment(comment_id) { $("#commentBox" + comment_id + " .comment-hidden").remove(); $("#commentBox" + comment_id + " .comment-content").show(); } function closeScoreFilterBanner() { $('#commentsScoreFilterBanner').fadeOut(150); $.post('/ajax.php?m=komentare&f=closeScoreFilterBanner'); } function commentsScroll(toElement, offset, noAnimation){ // edit/reply from feed link if ((typeof toElement === 'string' || toElement instanceof String) && toElement.indexOf('#commentBox') >= 0) { let commentId = parseInt(toElement.replace('#commentBox', '')); if (!isNaN(commentId) && commentId) { if (parseInt(localStorage.getItem('replyToCommentId')) === commentId) { localStorage.removeItem('replyToCommentId'); if ($('.comment-reply-btn', toElement).length) { history.replaceState(null, null, ' '); setTimeout(function(){ $('.comment-reply-btn', toElement).first().click(); }, 0); return; } } else if(parseInt(localStorage.getItem('editCommentId')) === commentId) { localStorage.removeItem('editCommentId'); if ( $('.comment-edit-btn', toElement).length) { history.replaceState(null, null, ' '); $('.comment-edit-btn', toElement).first().click(); return; } } } } if (!offset) offset = 0; if (!window.matchMedia("(min-width: 768px)").matches && true) { if ($(toElement).length) { $(toElement).closest('.comments-body-content').scrollTo( toElement, 800, {offset: -10 + offset} ); } } else { if ($(toElement).length){ var headerhHeight = 120 + ($('#shop-info-bar').length ? $('#shop-info-bar').outerHeight() : 0); if (!window.matchMedia("(min-width: 768px)").matches){ headerhHeight = $('#header').outerHeight() + $('#shop-detail-nav').outerHeight() + 20; } if (noAnimation){ setTimeout(function(){ $(window).scrollTop($(toElement).offset().top - headerhHeight + offset); }, 100); var dontScrollAgain = false; setTimeout(function(){ dontScrollAgain = true; }, 3000); $(window).on('load', function(){ if (!dontScrollAgain) $(window).scrollTop($(toElement).offset().top - headerhHeight + offset); }); } else { $.scrollTo( toElement, 800, {offset: -headerhHeight + offset} ); } } } } var customScoreDone = false; function loadMoreComments(btn) { let $btn = $(btn); if ($btn.find('.spinner-border:visible').length) { return false; } let nextPage = parseInt($btn.data('page')) + 1; let perPage = parseInt($btn.data('per-page')); $btn.find('.spinner-border').css("display", "inline-block"); $btnWrap = $btn.closest('.comment-load-more-wrap'); $.get("/ajax.php?m=komentare&f=loadMoreComments&a=" + $btn.data('params') + "|" + $btn.data('sort') + '|' + $btn.data('score') + '|' + nextPage, "", function (data) { $data = $('
' + data + '
'); $btnWrap.before($data.html()); $btn.find('.spinner-border').css("display", "none"); $btn.data('page', nextPage); if ($data.find('.comment:not(.comment-reply)').length < perPage) { $btnWrap.hide(); } }); } function scrollAndHighlightComment(commentBoxId, noAnimation){ if ($(commentBoxId).length){ let commentEl = $(commentBoxId); $('.comments .highlighted-animated').removeClass('highlighted-animated'); setTimeout(function(){ commentEl.addClass('highlighted-animated'); commentsScroll( commentBoxId, null, noAnimation); }, 10); } } function resetCommentForm($parent) { $('.comment-form-title-insert', $parent).show(); $('.comment-form-title-reply', $parent).hide(); $("[name=parent]", $parent).val(''); $("textarea", $parent).val(''); let widgetId = $parent.attr('id'); let $legend = $(".comment-form legend", $parent); if ($legend.data('text-original')) { $legend.html($legend.data('text-original')); } let $btn = $(".comment-form button.btn-comment-submit", $parent); if ($btn.data('text-original')) { $btn.html($btn.data('text-original')); } if (typeof window['commentFileUploader' + widgetId] !== 'undefined') { window['commentFileUploader' + widgetId].resetFiles(); } } $(function(){ var scrollToComment = false; function handleCommentBoxHash() { if (location.hash.indexOf('commentBox')>=0 || location.hash.indexOf('#comments-')>=0){ var hash = location.hash; var widgetId = '#comments'; hashParts = hash.split('/'); if (hashParts.length > 1) { widgetId = hashParts[0]; hash = '#' + hashParts[1]; // location.hash = #reviews/commentBox224814 } if (!window.matchMedia("(min-width: 768px)").matches){ var commentId = hash.replace('#commentBox', '').replace('#comments-',''); $('#commentBox' + commentId).parents('.mobile-expander').find('.mobile-expander-check').prop('checked', 'checked').trigger('change'); } if (hash.indexOf('#comments-')>=0 || hash.indexOf('#commentBox')>=0){ // from foreign url - highlight comment hash = hash.replace('#comments-','#commentBox'); scrollAndHighlightComment(hash, true); history.replaceState(null, null, widgetId); scrollToComment = true; } else { commentsScroll( hash, null, true ); //remove hash history.replaceState(null, null, ' '); scrollToComment = false; } } else { scrollToComment = false; } } handleCommentBoxHash(); $(window).on('hashchange', function() { handleCommentBoxHash(); }); if (location.hash.indexOf('#form-')>=0){ var hash = location.hash; commentsScroll( hash, null, true ); //remove hash history.replaceState(null, null, ' '); } if (location.hash == '#questions' || location.hash == '#reviews' || location.hash == '#comments'){ var widgetId = location.hash; if (!$(widgetId).length) widgetId = '#questions'; if ($(widgetId).length && !scrollToComment){ if (!window.matchMedia("(min-width: 768px)").matches){ $(widgetId + '-expander').prop('checked', 'checked').trigger('change'); } if ($('.comment-unread', widgetId).length){ commentsScroll('#'+$('.comment-unread', widgetId).first().attr('id'), null, true); } else { commentsScroll(widgetId, null, true); } } } $('.comments').on('click', '.btn-comment-show-insert-popup', function(){ var $parent = $(this).closest('.comments'); resetCommentForm($parent); }); }); $(function(){ $('textarea', '.comments').on('input', function(){ if ($(this).val().length){ $('.comment-form .btn').addClass('mobile-active'); }else{ $('.comment-form .btn').removeClass('mobile-active'); } $(this).removeClass('is-invalid'); }); function setCommentTextareaPlaceholder(){ if (window.matchMedia("(min-width: 768px)").matches){ $('textarea', '.comments').attr('placeholder', $('textarea', '.comments').data('placeholder-desktop')); }else{ $('textarea', '.comments').attr('placeholder', $('textarea', '.comments').data('placeholder-mobile')); } } setCommentTextareaPlaceholder(); $(window).resize(function(){ setCommentTextareaPlaceholder(); }); }); $(function(){ $('.comment-form button[type=submit]').attr('disabled', 'disabled'); $('.comment-form textarea').click(function(){ $('#loginModal').modal('show'); }); }); // #TODO function hideForumPosts() { $('.forum_post_hidden').each(function(){ target = $(this).data('target'); forum_post = $(this).parent('.post_tools').siblings('.post_message'); $(this).show().insertAfter(forum_post); forum_post.hide(); forum_post.parent('.post_right').parent('.post_container').addClass('hiddenForumPost'); }); } $(function(){ hideForumPosts(); }); // #TODO function hideForumPost(postId) { el = $('#' + postId); message = el.siblings('.post_message'); el.remove(); message.show(); message.parent('.post_right').parent('.post_container').removeClass('hiddenForumPost'); } function close_what_we_can_do(id) { $('#we_can_do_better_' + id).hide(); return false; } function send_what_we_can_do(id, id_user) { var $el = $('#we_can_do_better_' + id); $el.addClass('show-loading'); var selectedOption = $('input:radio[name=input_we_can_do_input_' + id + ']:checked').val() var text = $('#input_we_can_do_textarea_' + id).val(); $.get('/ajax.php?u=misc&f=userVoteDownComment&a=' + selectedOption + '|' + id_user + '|' + text + '|' + id , function(data){ close_what_we_can_do(id); $el.removeClass('show-loading'); showMessage('Tvoja spätná väzba bola úspešne odoslaná.'); } ); } $(function() { $('body').on('click', '.user_votes a.user_votes_link', function(e){ if ($(this).hasClass('inactive')) return false; var fn = $(this).data('rel'); var hash = $(this).attr('hash'); var contentId = $(this).parent().attr('contentid'); var contentType = $(this).parent().attr('contenttype'); var contentUserId = $(this).parent().attr('contentuserid'); var parent = $(this).parent().parent(); var voteTop = 0; if($(this).closest(".metadata-line").length>0) { voteTop = 1; } $(this).tooltip('hide'); $.get('/ajax.php?u=misc&f=userContentVotesAjax&a=' + contentId + '|' + contentType + '|' + contentUserId + '|' + fn + '|' + hash + '|0|1', function(data){ if (data.startsWith('ok')) { data = data.substr(2); } $('.user_votes' + contentType + contentId).replaceWith(data); if (contentType === 'article') { if (fn === 'voteDown') { var position = parent.offset(); var topclick = position.top + 15 - parent.closest('.container.position-relative').offset().top; var leftclick = position.left + 20 - parent.closest('.container.position-relative').offset().left; $('#we_can_do_better_' + contentId).css({top: topclick, left: leftclick}); $('#we_can_do_better_' + contentId).show(); } else { $('#we_can_do_better_' + contentId).hide(); } } } ); return false; }); }); if (!showRideFormModal) { function showRideFormModal(id, asTemplate){ var $rideFormModal = $('#rideFormModal'); if (typeof id === 'undefined') id = ''; asTemplate = asTemplate ? 1 : 0; $.ajax({ url: '/ajax.php?m=Vyjazdy&f=ajaxFormModal&a=' + id + '|0' + '|' + asTemplate, success: function(data){ $rideFormModal.find('.modal-body').html(data); if (asTemplate){ $rideFormModal.find('.ride-form-edit, .ride-form-new').hide(); $rideFormModal.find('.ride-form-duplicate').show(); } else { $rideFormModal.find('.ride-form-duplicate').hide(); $rideFormModal.find('.ride-form-'+(id ? 'new' : 'edit')).hide(); $rideFormModal.find('.ride-form-'+(id ? 'edit' : 'new')).show(); } $rideFormModal.modal({ backdrop: 'static' }); }, error: function(data){ showMessage(data.responseText, 'error', data.responseText.indexOf('= 0 ? 10000 : 3500); } }); return false; } } var emailConsentModalActiveEl; var emailConsentModalActiveSection = false; var emailConsentModalAgreed = false; function emailConsentModal(el, section){ var $el = $(el); if ($el.is(':checked') || !$el.is("input")){ // checked checkbox, or button/link emailConsentModalActiveEl = $(el); var $modal = $('#modalEmailConsent'); emailConsentModalActiveSection = section; if (section){ $('[data-section="general"]', $modal).hide(); $('[data-section="newsletter"]', $modal).hide(); $('[data-section="shop"]', $modal).hide(); $('[data-section="sale"]', $modal).hide(); $('[data-section="' + section + '"]', $modal).show(); } else { $('.mec-title').hide(); $('[data-section="general"]', $modal).show(); } emailConsentModalSubOptions(); emailConsentModalAgreed = false; $('#modalEmailConsent').modal('show'); } } function emailConsentModalSubOptions(){ $('.sub-options-emails').each(function() { var $subOptions = $(this); if ($subOptions.parent().find('.custom-switch input:checked, .custom-checkbox input:checked').length){ $subOptions.show(); if (!$subOptions.find('input:checked').length){ $subOptions.find('input').first().prop('checked', true); } } else { $subOptions.hide(); $subOptions.find('input').prop('checked', false); } }); } function emailConsentModalOnAgreed(){ var $modal = $('#modalEmailConsent'); emailConsentModalAgreed = true; var sectionWrap = emailConsentModalActiveSection ? '[data-section="' + emailConsentModalActiveSection + '"] ' : ''; var inputs = ''; $(sectionWrap + 'input[type=hidden], input:checked', $modal).each(function(){ var $this = $(this); inputs = inputs + ''; }); emailConsentModalActiveEl.prev('.mec-inputs').remove(); $('' + inputs + '').insertBefore(emailConsentModalActiveEl); $('#modalEmailConsent').modal('hide'); } $(function() { $('input[name="agreed_emails"]').on('change', function(){ emailConsentModal(this); }); emailConsentModalSubOptions(); $('#mec_user_newsletter_agreed, #user_newsletter_agreed').on('change', emailConsentModalSubOptions ); $('input:radio, input:checkbox','#modalEmailConsent').on('change', function(){ $modal = $('#modalEmailConsent'); $('.modal-footer .btn', $modal).prop('disabled', !$('input:checked:visible', $modal).length); }); $('#modalEmailConsent').on('hidden.bs.modal', function (e) { $modal = $(this); if (!emailConsentModalAgreed){ if (emailConsentModalActiveEl.val() === 'weekly'){ $('input[value=monthly]', $modal).prop('checked', false); } else if (emailConsentModalActiveEl.val() === 'monthly'){ $('input[value=weekly]', $modal).prop('checked', false); } else { emailConsentModalActiveEl.prop('checked', false); } emailConsentModalActiveEl.prev('.mec-inputs').remove(); } emailConsentModalActiveSection = false; emailConsentModalSubOptions(); if ($('#registrationModal.modal').hasClass('show')) { setTimeout(function(){ $('body').addClass('modal-open'); // registration modal is still opened }, 20); } }); }); $(function(){ $(".js-reject-cookies").attr("role", "button"); $(".js-reject-cookies").click(function(e){ e.preventDefault(); $.ajax({type: "POST",url: "/account/cookie-consent",data: {functional:0,analytical:0,commercial:0} }); $("#biscuitModal").fadeOut(250); return false; }); $(".biscuit-close").click(function(){ $.ajax({type: "POST",url: "/account/cookie-consent",data: {necessary:1,functional:1,analytical:1,commercial:1} }); $("#biscuitModal").fadeOut(250); $(".biscuit-checkboxes .custom-control-input").attr("checked", true); updateGoogleAnalyticsConsent(); updateBingConsent(); sendGoogleAnalyticsPageview(); return false; }); $(".biscuit-settings").click(function(){ $(this).addClass("loading-simple"); $.ajax({type: "POST",url: "/account/cookie-consent",data: {functional:0,analytical:0,commercial:0} }).always(function(){ window.location = "https://www.mthiker.sk/cookies"; }); }); }); -->