favorite comment 0
thumb_up0thumb_down

directions_bikeSchladiť sa na Kojšovku

Veľmi sa mi dnes veru nechcelo vymýšľať trasy, ani nič dlhé som nechcel v tom teple a vetre, a ešte poobede aj Formula. Aspoň som trochu otestoval Garmin Fenix 7s Solar.

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ť
56,8 km
schedule Čas
03:33:22
landscape Nastúpané
1 293 m

bar_chartŠtatistiky

Priemer Max
Rýchlosť 16,0 km/h 61,0 km/h
Výkon 185 W -
Tepová frekvencia 142 bpm 175 bpm
Energetický výdaj 1 707 kcal

directions_bike Posledné aktivity bikera

thumb_up0thumb_down

directions_walk Napiť sa zo studničky

trending_up 6,5 km
schedule 01:49:12
landscape 85 m
thumb_up0thumb_down

directions_walk Večerná zdravotná prechádzka

trending_up 7,3 km
schedule 02:04:31
landscape 148 m
thumb_up0thumb_down

directions_walk Konečne v lese

trending_up 7,7 km
schedule 02:13:25
landscape 159 m

place Segmenty

Názov segmentuSegment ČasMôj čas Priemerná rýchlosť Priemerný výkon Priemerný tep Najlepší čas na segmenteNajlepší čas
Formulár sa odosiela
keyboard_arrow_up Rampa","segmentDistance":"D\u013a\u017eka: 5.19 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -8.3 %<\/b>","segmentNameHref":"pamatnik-%3E-rampa"},"geometry":{"type":"LineString","coordinates":[["20.964544","48.777764",1143],["20.964544","48.777764",1143],["20.965406","48.777208",1132.8],["20.968027","48.776285",1109.2],["20.969959","48.775806",1094.8],["20.972697","48.77538",1076.8],["20.97453","48.774802",1064.2],["20.976222","48.774045",1051.6],["20.976805","48.773519",1047.6],["20.976977","48.772957",1042],["20.976539","48.77244",1037.6],["20.976393","48.772042",1032.8],["20.976606","48.771711",1030.6],["20.977341","48.771586",1027.2],["20.97905","48.771639",1013.4],["20.980735","48.771489",1001.2],["20.981491","48.771151",996.2],["20.982743","48.770875",988.2],["20.984013","48.77109",983.8],["20.985322","48.77143",974.8],["20.986492","48.771512",965.2],["20.988295","48.771218",952.2],["20.989756","48.770716",946.2],["20.991601","48.770456",934],["20.992447","48.770114",928.6],["20.993542","48.769285",919.4],["20.994028","48.768406",911.8],["20.994371","48.767583",904.8],["20.994035","48.767045",902.2],["20.993344","48.766428",893.4],["20.994691","48.766243",886],["20.995785","48.766364",878],["20.996482","48.766347",876.4],["20.996905","48.766013",873],["20.997088","48.765597",869],["20.997147","48.764617",858.6],["20.996917","48.763832",849.2],["20.997485","48.762264",836.6],["20.99818","48.761547",826.4],["20.999239","48.760948",821.2],["21.00041","48.760253",811.6],["21.001428","48.759809",807.2],["21.00109","48.759699",806],["20.999538","48.759709",793.6],["20.996675","48.760113",774.2],["20.995942","48.760303",769.6],["20.995388","48.760785",767.6],["20.995095","48.760733",767.4],["20.995275","48.760195",762],["20.99595","48.759211",750.4],["20.996413","48.758319",738.8],["20.997275","48.757783",732.2],["20.998108","48.757076",724.8]]}},{"type":"Feature","properties":{"type":99,"segment":"133714","segmentName":"D","segmentDistance":"D\u013a\u017eka: 2.76 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 7.5 %<\/b>","segmentNameHref":"d"},"geometry":{"type":"LineString","coordinates":[["21.002529","48.754551",688.2],["21.002529","48.754551",688.2],["21.003485","48.755008",683.8],["21.004108","48.754754",681.2],["21.004163","48.754125",680.2],["21.004385","48.753549",684.4],["21.00473","48.753148",688.2],["21.005115","48.752797",689.6],["21.005925","48.752314",685.2],["21.006691","48.751397",672],["21.007149","48.75094",668.4],["21.00754","48.75086",664.2],["21.007945","48.75101",662.8],["21.008548","48.751247",658.4],["21.009332","48.750955",657.8],["21.009805","48.750592",657.8],["21.010438","48.749978",660.8],["21.010686","48.749615",663.8],["21.011326","48.749068",664.6],["21.013113","48.748404",660.6],["21.013763","48.748462",654.6],["21.014012","48.748579",650.2],["21.014819","48.748922",643.6],["21.015648","48.749231",639.6],["21.016055","48.749083",638.8],["21.016307","48.748666",640.4],["21.016458","48.748254",644.8],["21.016601","48.748124",646.6],["21.016694","48.747911",650],["21.016898","48.747718",655.4],["21.017086","48.747656",658.2],["21.017228","48.747658",658.4],["21.017426","48.747666",657.4],["21.018417","48.747765",653.8],["21.020322","48.747388",662.8],["21.021093","48.747395",661.2],["21.022267","48.747789",652.4],["21.02278","48.748151",644.4],["21.023746","48.748238",639.6],["21.024039","48.748009",643.4],["21.024346","48.747819",645],["21.024627","48.747564",643.6],["21.025634","48.747821",634.2],["21.026816","48.748326",626.4],["21.027372","48.748754",620.4],["21.027626","48.748782",618.4],["21.027523","48.748465",615.8],["21.027615","48.748197",613.6],["21.027435","48.747776",613.2],["21.027194","48.747293",609.6],["21.027068","48.746412",602.4],["21.02649","48.745643",596.8],["21.02492","48.744698",583.4],["21.023189","48.744116",568.2],["21.021949","48.743265",560.2],["21.020954","48.742464",554.4],["21.020314","48.741654",553.2],["21.020402","48.741332",552.8],["21.021886","48.740365",545.8],["21.024683","48.738565",541]]}},{"type":"Feature","properties":{"type":99,"segment":"118521","segmentName":"Rieka-Nadrz Bukovec","segmentDistance":"D\u013a\u017eka: 6.73 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -1.2 %<\/b>","segmentNameHref":"rieka-nadrz-bukovec"},"geometry":{"type":"LineString","coordinates":[["21.032544","48.730653",516.4],["21.032544","48.730653",516.4],["21.035353","48.728602",511.6],["21.037176","48.727032",507.6],["21.038321","48.726562",505.2],["21.039287","48.72644",504.2],["21.039874","48.726126",503.4],["21.041213","48.724719",498.6],["21.042278","48.724019",496.6],["21.043908","48.723574",494],["21.046264","48.723769",490.8],["21.047419","48.723587",488],["21.048994","48.723576",484.8],["21.050848","48.723413",483.4],["21.052304","48.723684",482.6],["21.053456","48.724577",479.8],["21.054151","48.724896",478.2],["21.057441","48.72578",473.4],["21.059706","48.726629",469],["21.061517","48.727227",465.6],["21.06321","48.727235",463],["21.065357","48.727324",460.2],["21.066551","48.72711",459.2],["21.068113","48.72598",456.4],["21.068999","48.725411",454.4],["21.070979","48.725356",451.4],["21.07371","48.726097",446.2],["21.074637","48.726389",445.6],["21.075504","48.726281",444.8],["21.077058","48.725778",443],["21.078671","48.725607",436.6],["21.079178","48.725465",436.6],["21.079281","48.725219",437.6],["21.079634","48.724524",436.8],["21.080291","48.72414",440.8],["21.081488","48.723826",443.6],["21.083009","48.723534",449.4],["21.083806","48.723446",451.6],["21.084714","48.72327",455.4],["21.08543","48.723141",454.2],["21.086266","48.723465",460.2],["21.087531","48.723521",464.6],["21.088333","48.723496",469.4],["21.089312","48.723586",474.2],["21.090477","48.723917",477.2],["21.091132","48.723806",477.6],["21.09213","48.723353",472.4],["21.09219","48.72308",470.6],["21.092066","48.722423",465.8],["21.092293","48.722041",463.8],["21.093594","48.721967",455],["21.094052","48.721862",454.6],["21.095464","48.72107",452.6],["21.098323","48.720393",440.6],["21.101362","48.720217",427],["21.103734","48.72004",425.6],["21.104489","48.719832",426.2],["21.105201","48.719511",428],["21.106522","48.719225",434.6],["21.107548","48.718972",429.2],["21.108664","48.718493",432],["21.110192","48.718385",434.4],["21.110688","48.7182",435.2],["21.110819","48.71792",434.8],["21.110549","48.716225",433.6],["21.110624","48.715964",433.8],["21.111152","48.715837",433.8],["21.111564","48.716086",434.8],["21.112283","48.716763",433.2],["21.113431","48.717448",433],["21.11435","48.717748",433],["21.115189","48.717697",433.2],["21.118094","48.717138",432.8],["21.119714","48.717036",432.8]]}},{"type":"Feature","properties":{"type":99,"segment":"3580","segmentName":"Mexiko - Zl. Idka razc","segmentDistance":"D\u013a\u017eka: 4.05 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 1.7 %<\/b>","segmentNameHref":"mexiko-zl-idka-razc"},"geometry":{"type":"LineString","coordinates":[["21.079178","48.725465",436.6],["21.079178","48.725465",436.6],["21.079281","48.725219",437.6],["21.079281","48.725219",437.6],["21.079634","48.724524",436.8],["21.080291","48.72414",440.8],["21.081488","48.723826",443.6],["21.083009","48.723534",449.4],["21.083806","48.723446",451.6],["21.084714","48.72327",455.4],["21.08543","48.723141",454.2],["21.086266","48.723465",460.2],["21.087531","48.723521",464.6],["21.088333","48.723496",469.4],["21.089312","48.723586",474.2],["21.090477","48.723917",477.2],["21.091132","48.723806",477.6],["21.09213","48.723353",472.4],["21.09219","48.72308",470.6],["21.092066","48.722423",465.8],["21.092293","48.722041",463.8],["21.093594","48.721967",455],["21.094052","48.721862",454.6],["21.095464","48.72107",452.6],["21.098323","48.720393",440.6],["21.101362","48.720217",427],["21.103734","48.72004",425.6],["21.104489","48.719832",426.2],["21.105201","48.719511",428],["21.106522","48.719225",434.6],["21.107548","48.718972",429.2],["21.108664","48.718493",432],["21.110192","48.718385",434.4],["21.110688","48.7182",435.2],["21.110819","48.71792",434.8],["21.110549","48.716225",433.6],["21.110624","48.715964",433.8],["21.111152","48.715837",433.8],["21.111564","48.716086",434.8],["21.112283","48.716763",433.2],["21.113431","48.717448",433],["21.11435","48.717748",433],["21.115189","48.717697",433.2],["21.118094","48.717138",432.8],["21.119714","48.717036",432.8],["21.12228","48.716584",432.8],["21.124791","48.715981",432.4],["21.12669","48.715578",431.4],["21.127653","48.715692",425.4],["21.127741","48.715572",427.4],["21.127743","48.715506",431.2],["21.127791","48.715518",432.8],["21.127845","48.715432",435.4],["21.127829","48.715331",438],["21.127885","48.715228",440.8],["21.128007","48.715179",443.8],["21.128084","48.715246",444.2],["21.128028","48.715158",444.2],["21.127944","48.715191",443.8],["21.127969","48.715202",443.8],["21.127992","48.715143",444],["21.128096","48.714748",437.4],["21.12815","48.714451",432.6],["21.128843","48.714126",420.6],["21.128995","48.71424",417.6],["21.129383","48.714274",416.8],["21.130657","48.715196",402.2],["21.130816","48.715567",398.2],["21.130511","48.716345",387],["21.130773","48.717841",374],["21.13112","48.718067",373.2],["21.131996","48.718316",373.2],["21.133232","48.718249",371.8]]}},{"type":"Feature","properties":{"type":99,"segment":"20873","segmentName":"Bukovec pitna","segmentDistance":"D\u013a\u017eka: 1.34 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 3.2 %<\/b>","segmentNameHref":"bukovec-pitna"},"geometry":{"type":"LineString","coordinates":[["21.079178","48.725465",436.6],["21.079178","48.725465",436.6],["21.079281","48.725219",437.6],["21.079281","48.725219",437.6],["21.079634","48.724524",436.8],["21.080291","48.72414",440.8],["21.081488","48.723826",443.6],["21.083009","48.723534",449.4],["21.083806","48.723446",451.6],["21.084714","48.72327",455.4],["21.08543","48.723141",454.2],["21.086266","48.723465",460.2],["21.087531","48.723521",464.6],["21.088333","48.723496",469.4],["21.089312","48.723586",474.2],["21.090477","48.723917",477.2],["21.091132","48.723806",477.6],["21.09213","48.723353",472.4],["21.09219","48.72308",470.6],["21.092066","48.722423",465.8],["21.092293","48.722041",463.8]]}},{"type":"Feature","properties":{"type":99,"segment":"20874","segmentName":"okolo pitnej nadrze za Mexicom vpravo","segmentDistance":"D\u013a\u017eka: 3.86 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 0.2 %<\/b>","segmentNameHref":"okolo-pitnej-nadrze-za-mexicom-vpravo"},"geometry":{"type":"LineString","coordinates":[["21.081488","48.723826",443.6],["21.081488","48.723826",443.6],["21.083009","48.723534",449.4],["21.083806","48.723446",451.6],["21.084714","48.72327",455.4],["21.08543","48.723141",454.2],["21.086266","48.723465",460.2],["21.087531","48.723521",464.6],["21.088333","48.723496",469.4],["21.089312","48.723586",474.2],["21.090477","48.723917",477.2],["21.091132","48.723806",477.6],["21.09213","48.723353",472.4],["21.09219","48.72308",470.6],["21.092066","48.722423",465.8],["21.092293","48.722041",463.8],["21.093594","48.721967",455],["21.094052","48.721862",454.6],["21.095464","48.72107",452.6],["21.098323","48.720393",440.6],["21.101362","48.720217",427],["21.103734","48.72004",425.6],["21.104489","48.719832",426.2],["21.105201","48.719511",428],["21.106522","48.719225",434.6],["21.107548","48.718972",429.2],["21.108664","48.718493",432],["21.110192","48.718385",434.4],["21.110688","48.7182",435.2],["21.110819","48.71792",434.8],["21.110549","48.716225",433.6],["21.110624","48.715964",433.8],["21.111152","48.715837",433.8],["21.111564","48.716086",434.8],["21.112283","48.716763",433.2],["21.113431","48.717448",433],["21.11435","48.717748",433],["21.115189","48.717697",433.2],["21.118094","48.717138",432.8],["21.119714","48.717036",432.8],["21.12228","48.716584",432.8]]}},{"type":"Feature","properties":{"type":99,"segment":"83271","segmentName":"Bukovec hradza-Bukovec kostol","segmentDistance":"D\u013a\u017eka: 2.03 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -1.4 %<\/b>","segmentNameHref":"bukovec-hradza-bukovec-kostol"},"geometry":{"type":"LineString","coordinates":[["21.130511","48.716345",387],["21.130511","48.716345",387],["21.130773","48.717841",374],["21.13112","48.718067",373.2],["21.131996","48.718316",373.2],["21.133232","48.718249",371.8],["21.134418","48.718101",370.4],["21.136169","48.717471",367],["21.137719","48.716459",368.2],["21.138297","48.715927",367.6],["21.139763","48.715018",365.8],["21.140939","48.71416",364.6],["21.142446","48.712856",361],["21.143941","48.711781",358.4],["21.146078","48.711142",356.4],["21.147664","48.710946",354.2],["21.149002","48.710463",358.6]]}},{"type":"Feature","properties":{"type":99,"segment":"54513","segmentName":"climb Bukovec","segmentDistance":"D\u013a\u017eka: 1.40 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -0.8 %<\/b>","segmentNameHref":"climb-bukovec"},"geometry":{"type":"LineString","coordinates":[["21.136169","48.717471",367],["21.136169","48.717471",367],["21.137719","48.716459",368.2],["21.138297","48.715927",367.6],["21.139763","48.715018",365.8],["21.140939","48.71416",364.6],["21.142446","48.712856",361],["21.143941","48.711781",358.4],["21.146078","48.711142",356.4],["21.147664","48.710946",354.2],["21.149002","48.710463",358.6]]}},{"type":"Feature","properties":{"type":99,"segment":"54726","segmentName":"Bukovec-Mala Ida","segmentDistance":"D\u013a\u017eka: 5.76 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -1.1 %<\/b>","segmentNameHref":"bukovec-mala-ida"},"geometry":{"type":"LineString","coordinates":[["21.136169","48.717471",367],["21.136169","48.717471",367],["21.137719","48.716459",368.2],["21.138297","48.715927",367.6],["21.139763","48.715018",365.8],["21.140939","48.71416",364.6],["21.142446","48.712856",361],["21.143941","48.711781",358.4],["21.146078","48.711142",356.4],["21.147664","48.710946",354.2],["21.149002","48.710463",358.6],["21.150526","48.709353",357.6],["21.151117","48.709074",355.2],["21.152737","48.709526",358.8],["21.153271","48.709177",364.2],["21.153889","48.708726",370],["21.154484","48.706919",356.8],["21.154882","48.705913",353.6],["21.155393","48.705331",352.2],["21.156734","48.704358",358.2],["21.158828","48.702822",355.4],["21.160109","48.701686",351.4],["21.16101","48.700499",352.8],["21.162355","48.699235",349.6],["21.162908","48.698139",334.4],["21.163489","48.697495",331.6],["21.164641","48.696706",341.2],["21.165207","48.696037",343.6],["21.165747","48.693997",343.6],["21.166194","48.692896",341.6],["21.16669","48.691749",340],["21.16742","48.691061",337.6],["21.16743","48.690772",337],["21.166959","48.689989",333.8],["21.166739","48.689183",330.6],["21.166853","48.68841",327.6],["21.167216","48.686811",322.6],["21.16748","48.684978",313.6],["21.168045","48.68277",313.4],["21.167764","48.681406",310.8],["21.167709","48.680289",309],["21.167956","48.679535",308],["21.168476","48.678661",307.2],["21.169631","48.677555",306.6]]}},{"type":"Feature","properties":{"type":99,"segment":"12658","segmentName":"Dammberg","segmentDistance":"D\u013a\u017eka: 301.00 metrov<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 3.6 %<\/b>","segmentNameHref":"dammberg"},"geometry":{"type":"LineString","coordinates":[["21.163489","48.697495",331.6],["21.163489","48.697495",331.6],["21.164641","48.696706",341.2],["21.165207","48.696037",343.6]]}},{"type":"Feature","properties":{"type":99,"segment":"242964","segmentName":"Pivovar Herrenwald - Hradza Bukovec","segmentDistance":"D\u013a\u017eka: 2.13 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 1.6 %<\/b>","segmentNameHref":"pivovar-herrenwald-hradza-bukovec"},"geometry":{"type":"LineString","coordinates":[["21.170115","48.674976",304.2],["21.170115","48.674976",304.2],["21.170349","48.674891",304.4],["21.170349","48.674891",304.4],["21.170313","48.675114",306.2],["21.170394","48.67564",305.8],["21.171881","48.67653",311.2],["21.172455","48.67723",315],["21.172465","48.67792",314.2],["21.172433","48.678477",315.4]]}},{"type":"Feature","properties":{"type":99,"segment":"244029","segmentName":"Bukovec","segmentDistance":"D\u013a\u017eka: 2.94 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 0.7 %<\/b>","segmentNameHref":"bukovec"},"geometry":{"type":"LineString","coordinates":[["21.170115","48.674976",304.2],["21.170115","48.674976",304.2],["21.170349","48.674891",304.4],["21.170349","48.674891",304.4],["21.170313","48.675114",306.2],["21.170394","48.67564",305.8],["21.171881","48.67653",311.2],["21.172455","48.67723",315],["21.172465","48.67792",314.2],["21.172433","48.678477",315.4]]}},{"type":"Feature","properties":{"type":99,"segment":"191029","segmentName":"Bukovec-Rieka","segmentDistance":"D\u013a\u017eka: 11.91 km<\/b>","segmentGrade":"Priemern\u00e9 st\u00fapanie: 1.4 %<\/b>","segmentNameHref":"bukovec-rieka"},"geometry":{"type":"LineString","coordinates":[["21.170115","48.674976",304.2],["21.170115","48.674976",304.2],["21.170349","48.674891",304.4],["21.170349","48.674891",304.4],["21.170313","48.675114",306.2],["21.170394","48.67564",305.8],["21.171881","48.67653",311.2],["21.172455","48.67723",315],["21.172465","48.67792",314.2],["21.172433","48.678477",315.4]]}},{"type":"Feature","properties":{"type":99,"segment":"253276","segmentName":"Buky - AlkaIda","segmentDistance":"D\u013a\u017eka: 3.68 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -1.4 %<\/b>","segmentNameHref":"buky-alkaida"},"geometry":{"type":"LineString","coordinates":[["21.170115","48.674976",304.2],["21.170115","48.674976",304.2],["21.170349","48.674891",304.4],["21.170349","48.674891",304.4],["21.170313","48.675114",306.2],["21.170394","48.67564",305.8],["21.171881","48.67653",311.2],["21.172455","48.67723",315],["21.172465","48.67792",314.2],["21.172433","48.678477",315.4]]}},{"type":"Feature","properties":{"type":99,"segment":"251857","segmentName":"Buky - Buky","segmentDistance":"D\u013a\u017eka: 1.11 km<\/b>","segmentGrade":"Priemern\u00e9 klesanie: -1.7 %<\/b>","segmentNameHref":"buky-buky"},"geometry":{"type":"LineString","coordinates":[["21.170115","48.674976",304.2],["21.170115","48.674976",304.2],["21.170349","48.674891",304.4],["21.170349","48.674891",304.4],["21.170313","48.675114",306.2],["21.170394","48.67564",305.8],["21.171881","48.67653",311.2],["21.172455","48.67723",315],["21.172465","48.67792",314.2],["21.172433","48.678477",315.4]]}}] 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.771227099722","lng":"20.988490999722","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-0_668aad1e5edaf.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-0_668aad1e5edaf.jpg"},{"lat":"48.771257499722","lng":"20.9882053","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-1_668aad21c9270.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-1_668aad21c9270.jpg"},{"lat":"48.771257499722","lng":"20.9882053","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-2_668aad25044cf.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-2_668aad25044cf.jpg"},{"lat":"48.7821817","lng":"20.987915199722","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-3_668aad2870813.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-3_668aad2870813.jpg"},{"lat":"48.7820666","lng":"20.9881126","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-4_668aad2b8c0f8.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-4_668aad2b8c0f8.jpg"},{"lat":"48.7820666","lng":"20.9881126","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-5_668aad2ee8f21.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-5_668aad2ee8f21.jpg"},{"lat":"48.782161899722","lng":"20.987915999722","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-6_668aad31a6c71.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-6_668aad31a6c71.jpg"},{"lat":"48.782181299722","lng":"20.987922199722","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-7_668aad35362cb.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-7_668aad35362cb.jpg"},{"lat":"48.782181299722","lng":"20.987922199722","url":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-8_668aad3846b0c.jpg","thumbnail":"https:\/\/images.mtbiker.sk\/vyjazdy\/big\/stravaPhoto1913503-8_668aad3846b0c.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=bW9kdWw9dnlqYXpkeSZleHRlcm5hbElkPTE5MTM1MDMmaXRlbU5hbWU9ViVDMyVCRGphemQrJUM0JThELisxOTEzNTAzJmNvbW1lbnRUeXBlPWNvbW1lbnQmYXV0aG9yVXNlcklkPTMwNjQmd2lkZ2V0SWQ9Y29tbWVudHMmYWxsb3dJbnNlcnQ9MSZhbGxvd1JlcGx5PTEmcmV0dXJuVXJsPWh0dHBzJTNBJTJGJTJGd3d3Lm10aGlrZXIuc2slMkZha3Rpdml0eSUyRjE5MTM1MDMlMkZiaWN5a2VsLXNjaGxhZGl0LXNhLW5hLmh0bWwmcGFyc2VkVXJsJTVCc2NoZW1lJTVEPWh0dHBzJnBhcnNlZFVybCU1Qmhvc3QlNUQ9d3d3Lm10aGlrZXIuc2smcGFyc2VkVXJsJTVCcGF0aCU1RD0lMkZha3Rpdml0eSUyRjE5MTM1MDMlMkZiaWN5a2VsLXNjaGxhZGl0LXNhLW5hLmh0bWwmaW5jbHVkZUNvbW1lbnRJZD0w|" + 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"; }); }); }); -->