favorite comment 0
thumb_up0thumb_down

directions_bikeoddychovka na Turček

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ť
50,7 km
schedule Čas
03:52:19
landscape Nastúpané
996 m

bar_chartŠtatistiky

Priemer Max
Rýchlosť 13,1 km/h 62,6 km/h
Výkon 233 W -
Energetický výdaj 3 617 kcal

directions_bike Posledné aktivity bikera

thumb_up0thumb_down

directions_bike Morning Mountain Bike Ride

trending_up 29,9 km
schedule 01:34:27
landscape 427 m
thumb_up0thumb_down

directions_bike Afternoon Mountain Bike Ride

trending_up 26,9 km
schedule 01:38:57
landscape 341 m
thumb_up0thumb_down

directions_bike Morning Mountain Bike Ride

trending_up 51,3 km
schedule 02:25:24
landscape 343 m

place Segmenty

Názov segmentuSegment ČasMôj čas Priemerná rýchlosť Priemerný výkon Priemerný tep Najlepší čas na segmenteNajlepší čas
15 segmentov
Formulár sa odosiela
keyboard_arrow_up na kop\u010dek","segmentDistance":"D\u013a\u017eka: 2.73 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 5.5 %<\/b>","segmentNameHref":"181-%3E-na-kopcek"},"geometry":{"type":"LineString","coordinates":[["18.932536","48.755332",716.1],["18.932536","48.755332",716.1],["18.933553","48.755103",718],["18.933553","48.755103",718],["18.934726","48.754813",720.5],["18.935429","48.754843",723.7],["18.936922","48.754914",728.2],["18.937715","48.754971",729.4],["18.938618","48.755041",733.3],["18.93969","48.754902",738.6],["18.940155","48.754904",741.4],["18.940446","48.754907",743.4],["18.940921","48.754822",746.3],["18.941476","48.754743",749.8],["18.94167","48.754826",751.5],["18.94141","48.755083",754.5],["18.941058","48.755126",755.9],["18.940558","48.755413",758.3],["18.939535","48.755682",763.6],["18.937929","48.755895",770.9],["18.937224","48.755956",774.6],["18.936436","48.756003",779.5],["18.935597","48.75628",785.5],["18.935231","48.756602",789.9],["18.935157","48.756969",792.9],["18.93492","48.757321",796.2],["18.934765","48.757502",796.8],["18.934227","48.757823",798.1],["18.933962","48.758105",799],["18.933783","48.758603",800.9],["18.933696","48.759251",804.2],["18.933667","48.75973",806],["18.934193","48.760131",808.5],["18.935039","48.76051",811.6],["18.935692","48.76086",815.1],["18.936562","48.761219",820.4],["18.937123","48.761287",822.8],["18.938105","48.761006",826.3],["18.938604","48.760839",828.7],["18.9389","48.760708",830.4],["18.939176","48.760586",831.9],["18.93977","48.760393",834.7],["18.940453","48.760136",838.2],["18.940694","48.760073",839.4],["18.940979","48.760018",840.8],["18.941607","48.759862",843.5],["18.942277","48.759939",846.1],["18.94302","48.760035",849.4],["18.943178","48.760021",850.9],["18.943642","48.760115",853.4],["18.944161","48.760138",856.2],["18.944866","48.760249",859.9],["18.945466","48.760443",862.8],["18.945646","48.760376",863.7],["18.946003","48.760427",865],["18.946791","48.760585",866.1]]}},{"type":"Feature","properties":{"type":99,"segment":"91119","segmentName":"Do kop\u010deka","segmentDistance":"D\u013a\u017eka: 2.60 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 5 %<\/b>","segmentNameHref":"do-kopceka"},"geometry":{"type":"LineString","coordinates":[["18.945332","48.773222",806.6],["18.945332","48.773222",806.6],["18.94458","48.773156",809.6],["18.94458","48.773156",809.6],["18.943548","48.773201",815.1],["18.942583","48.773211",818.8],["18.941488","48.773301",820.7],["18.940647","48.773602",822.4],["18.939602","48.773828",825.5],["18.938663","48.774023",827.9],["18.937253","48.77467",834.4],["18.936572","48.775151",838.4],["18.936502","48.775635",840.9],["18.936512","48.776007",842.9],["18.936587","48.776512",845.6],["18.936522","48.776745",846.5],["18.936234","48.777197",848.7],["18.935757","48.777425",851.7],["18.935302","48.777716",854.2],["18.934763","48.777916",856.6],["18.934322","48.777811",859.2],["18.933947","48.777472",863.3],["18.933548","48.777148",867.2],["18.933103","48.77691",870.2],["18.932971","48.776824",871.5],["18.932582","48.776559",874.7],["18.93245","48.776404",876.3],["18.932093","48.776163",879.3],["18.931815","48.775979",881.3],["18.931536","48.775824",883.2],["18.931068","48.775572",885.8],["18.930612","48.775431",888],["18.93014","48.775247",890.3],["18.929512","48.775141",893],["18.929093","48.775131",894.3],["18.928669","48.775137",895.6],["18.927845","48.775177",897.9],["18.927061","48.775428",901],["18.925864","48.775777",907],["18.925561","48.776026",910],["18.924646","48.776782",917.4],["18.924441","48.777296",920.7],["18.92436","48.777906",922.4],["18.924294","48.77856",924.8],["18.924333","48.77898",927],["18.924581","48.779658",930.3],["18.924902","48.780288",932],["18.925074","48.780525",932.5],["18.924854","48.780994",933.8],["18.924562","48.781426",934.7],["18.924327","48.78188",935.3]]}},{"type":"Feature","properties":{"type":99,"segment":"31672","segmentName":"Hlavn\u00e1 od Tur\u010deka - Sklen\u00e9 TT","segmentDistance":"D\u013a\u017eka: 2.00 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -1.7 %<\/b>","segmentNameHref":"hlavna-od-turceka-sklene-tt"},"geometry":{"type":"LineString","coordinates":[["18.880519","48.777837",610.1],["18.880519","48.777837",610.1],["18.879051","48.778155",604.3],["18.876739","48.778684",600.2],["18.87554","48.779144",598.3],["18.872976","48.780246",595.1],["18.871102","48.780827",592.4],["18.86928","48.781186",589.4],["18.868002","48.781205",588.1],["18.866788","48.781525",586.3],["18.866098","48.781691",585.7],["18.864978","48.781765",585.2],["18.864199","48.781696",584.7],["18.863441","48.781692",584.3],["18.862234","48.782295",582.7],["18.860468","48.782879",580.2],["18.859894","48.783118",579.9],["18.858427","48.783785",580.3],["18.85736","48.784299",578.6]]}},{"type":"Feature","properties":{"type":99,"segment":"31673","segmentName":"F\u00ednske dom\u010deky - Sklen\u00e9","segmentDistance":"D\u013a\u017eka: 1.28 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -1.1 %<\/b>","segmentNameHref":"finske-domceky-sklene"},"geometry":{"type":"LineString","coordinates":[["18.856232","48.784845",576.1],["18.856232","48.784845",576.1],["18.854904","48.785529",573.3],["18.853141","48.786134",571.4],["18.851552","48.786079",570.6],["18.848794","48.785694",569.8],["18.847569","48.785777",570.1],["18.845599","48.786116",569.2],["18.843719","48.786736",566.4],["18.842143","48.787323",566.3],["18.840952","48.787365",563.7],["18.840156","48.787263",562.4]]}},{"type":"Feature","properties":{"type":99,"segment":"90906","segmentName":"Sklen\u00e9, zjazd celou dedinou","segmentDistance":"D\u013a\u017eka: 2.90 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -2.9 %<\/b>","segmentNameHref":"sklene-zjazd-celou-dedinou"},"geometry":{"type":"LineString","coordinates":[["18.807591","48.777744",643.8],["18.807591","48.777744",643.8],["18.807561","48.77763",645],["18.807378","48.777375",647],["18.807039","48.776865",652.2],["18.806688","48.776434",657.4],["18.806448","48.776116",663.4],["18.806405","48.776065",664.6],["18.806141","48.775695",671.3],["18.805922","48.775405",676.5],["18.805863","48.775304",678],["18.805872","48.775164",678.9],["18.805726","48.774852",679.8],["18.805612","48.774541",678.7],["18.805243","48.774239",675.8],["18.804909","48.774028",672.6],["18.804386","48.773893",667.9],["18.803892","48.773602",664],["18.803209","48.773102",664.4],["18.802982","48.77268",665.4],["18.802874","48.772267",663.8],["18.802763","48.771836",663.5],["18.802642","48.771377",665.4],["18.80232","48.771093",667.2],["18.802062","48.770782",668.4],["18.801948","48.770484",669.3],["18.801869","48.769868",670.4],["18.801778","48.76958",671.2],["18.802185","48.768633",675.8],["18.802385","48.768103",677.6],["18.802873","48.767913",675.5],["18.803506","48.767723",669.8],["18.804001","48.767303",663.5],["18.804148","48.767024",660],["18.804213","48.766668",657.3],["18.804196","48.766535",656.2],["18.80432","48.766346",653],["18.804356","48.766131",648.9],["18.804534","48.765792",642.9],["18.804542","48.765567",639.8],["18.804499","48.765269",636],["18.804679","48.765061",632],["18.804874","48.764806",628.8],["18.80489","48.764594",626.3],["18.804713","48.76433",619.9],["18.804447","48.764098",613.3],["18.804334","48.763992",610.4],["18.803989","48.763481",600],["18.803741","48.763217",595.3],["18.803509","48.76289",592.2],["18.803244","48.762641",589.5],["18.802948","48.762305",585.1],["18.802794","48.761919",579.6],["18.802777","48.76141",574.2],["18.802932","48.761006",571.6],["18.802915","48.760766",569.6],["18.803008","48.760213",561.6],["18.802989","48.759947",557.7],["18.803161","48.759511",553],["18.803336","48.759226",550.1],["18.803642","48.758238",545.5],["18.80365","48.757907",545.1],["18.803657","48.757479",543.9],["18.803528","48.757039",541.8],["18.803444","48.756773",538.8],["18.803341","48.75644",534.3],["18.803237","48.755954",528.4],["18.803182","48.755233",520.5],["18.803286","48.75497",516.5],["18.803326","48.754743",513.6],["18.803302","48.754525",511.5],["18.803141","48.754143",509.3],["18.802802","48.753889",509.1],["18.802053","48.753597",505.6],["18.801192","48.753442",499.1],["18.799736","48.753333",493.7],["18.798983","48.753378",490.7],["18.798265","48.753277",487.4],["18.796675","48.752948",476.7]]}},{"type":"Feature","properties":{"type":99,"segment":"8327","segmentName":"Downhill Remata","segmentDistance":"D\u013a\u017eka: 2.41 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -4.9 %<\/b>","segmentNameHref":"downhill-remata"},"geometry":{"type":"LineString","coordinates":[["18.798983","48.753378",490.7],["18.798983","48.753378",490.7],["18.798265","48.753277",487.4],["18.796675","48.752948",476.7],["18.795555","48.752528",468.4],["18.79416","48.752029",460.1],["18.792612","48.751279",454],["18.791011","48.750845",453.8],["18.790074","48.750959",452.5],["18.789223","48.751488",450.1],["18.787251","48.752522",439.8],["18.78582","48.752963",434.6],["18.784596","48.753564",429.7],["18.783506","48.753972",429.7],["18.783084","48.754253",430.3],["18.782475","48.754352",429.4],["18.781944","48.754455",425.9],["18.7816","48.754951",420.6],["18.78096","48.755384",415.2],["18.780056","48.756048",410.2],["18.778832","48.756458",408.5],["18.777995","48.756731",406.2],["18.777395","48.757191",403.7],["18.776126","48.757783",401],["18.774996","48.757907",398],["18.77424","48.758011",396.2],["18.773135","48.758006",397.3]]}}] 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(); } }); function showPhotoOnMap() { if (typeof L !== "undefined"){ var photos = [{"lat":"48.757227777778","lng":"18.935005555556","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1411295-0_6491729081e3f.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1411295-0_6491729081e3f.jpg"},{"lat":"48.790363888889","lng":"18.922530555556","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1411295-1_6491729403594.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1411295-1_6491729403594.jpg"},{"lat":"48.775302777778","lng":"18.805827777778","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1411295-2_64917297cfa3f.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1411295-2_64917297cfa3f.jpg"}] var photoLayer = L.photo.cluster().on("click", function(evt) { var photo = evt.layer.photo; var template = ""; evt.layer.bindPopup(L.Util.template(template, photo), { className: "leafletresize", minWidth: 100, }).openPopup(); }); var photoOnMapLayer = photoLayer.add(photos); map_leaflet.addLayer(photoOnMapLayer); controlLayers.addOverlay(photoOnMapLayer, "Fotky na mape") } } $(function() { showPhotoOnMap(); }); 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=bW9kdWw9dnlqYXpkeSZleHRlcm5hbElkPTE0MTEyOTUmaXRlbU5hbWU9ViVDMyVCRGphemQrJUM0JThELisxNDExMjk1JmNvbW1lbnRUeXBlPWNvbW1lbnQmYXV0aG9yVXNlcklkPTE2MTk0MCZ3aWRnZXRJZD1jb21tZW50cyZhbGxvd0luc2VydD0xJmFsbG93UmVwbHk9MSZyZXR1cm5Vcmw9aHR0cHMlM0ElMkYlMkZ3d3cubXRoaWtlci5zayUyRmFrdGl2aXR5JTJGMTQxMTI5NSUyRmJpY3lrZWwtb2RkeWNob3ZrYS1uYS5odG1sJnBhcnNlZFVybCU1QnNjaGVtZSU1RD1odHRwcyZwYXJzZWRVcmwlNUJob3N0JTVEPXd3dy5tdGhpa2VyLnNrJnBhcnNlZFVybCU1QnBhdGglNUQ9JTJGYWt0aXZpdHklMkYxNDExMjk1JTJGYmljeWtlbC1vZGR5Y2hvdmthLW5hLmh0bWwmaW5jbHVkZUNvbW1lbnRJZD0w|" + 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"; }); }); }); -->