1/*Banner element in the single match template*/ 2 3const matchWrapper = document.querySelector(".match.match__inner"); 4 5const liveMatch = document.querySelector(".single-anwp_match .match-status__fixture .match-report__live"); 6 7const gamesNavItem = document.querySelector(".menu-item-2429"); 8 9const resultsPage = document.querySelector(".page-id-2598"); 10 11const tabelsPage = document.querySelector(".page-id-2742"); 12 13let matchBanner = document.createElement("div"); 14matchBanner.className = "match-banner__top"; 15matchBanner.innerHTML = "<span>Rijeka</span>"; 16 17if (matchWrapper) { 18 matchWrapper.parentNode.insertBefore(matchBanner, matchWrapper); 19} 20 21if (liveMatch) { 22 const metaRefresh = document.createElement("meta"); 23 metaRefresh.setAttribute("http-equiv", "refresh"); 24 metaRefresh.content = "60"; 25 document.getElementsByTagName("head")[0].appendChild(metaRefresh); 26 console.log("active-refresh"); 27} 28 29if (resultsPage || tabelsPage) { 30 gamesNavItem.classList.add("current-menu-item"); 31} 32 33const teamsPage = document.querySelector(".page-id-2242"); 34 35const vratari = document.querySelector(".vratari"); 36const branici = document.querySelector(".branici"); 37const vezni = document.querySelector(".vezni"); 38const napadaci = document.querySelector(".napadaci"); 39const stozer = document.querySelector(".stozer"); 40const posudba = document.querySelector(".posudba"); 41const svi = document.querySelector(".menu-item-2374"); 42const svi_a_tag = document.querySelector(".menu-item-2374 a"); 43 44if (teamsPage) { 45 vratari.addEventListener("click", function () { 46 jQuery("#g").show(); 47 jQuery("#d").hide(); 48 jQuery("#m").hide(); 49 jQuery("#f").hide(); 50 jQuery(".staff-list").hide(); 51 jQuery("#posudba").hide(); 52 53 vratari.id = "white_b"; 54 branici.removeAttribute("id"); 55 vezni.removeAttribute("id"); 56 napadaci.removeAttribute("id"); 57 stozer.removeAttribute("id"); 58 posudba.removeAttribute("id"); 59 60 svi.style.setProperty("background-color", "#58B6E7", "important"); 61 svi_a_tag.style.setProperty("background-color", "#58B6E7", "important"); 62 svi_a_tag.style.setProperty("color", "#fff", "important"); 63 }); 64 branici.addEventListener("click", function () { 65 jQuery("#g").hide(); 66 jQuery("#d").show(); 67 jQuery("#m").hide(); 68 jQuery("#f").hide(); 69 jQuery(".staff-list").hide(); 70 jQuery("#posudba").hide(); 71 72 vratari.removeAttribute("id"); 73 branici.id = "white_b"; 74 vezni.removeAttribute("id"); 75 napadaci.removeAttribute("id"); 76 stozer.removeAttribute("id"); 77 posudba.removeAttribute("id"); 78 79 svi.style.setProperty("background-color", "#58B6E7", "important"); 80 svi_a_tag.style.setProperty("background-color", "#58B6E7", "important"); 81 svi_a_tag.style.setProperty("color", "#fff", "important"); 82 }); 83 vezni.addEventListener("click", function () { 84 jQuery("#g").hide(); 85 jQuery("#d").hide(); 86 jQuery("#m").show(); 87 jQuery("#f").hide(); 88 jQuery(".staff-list").hide(); 89 jQuery("#posudba").hide(); 90 91 vratari.removeAttribute("id"); 92 branici.removeAttribute("id"); 93 vezni.id = "white_b"; 94 napadaci.removeAttribute("id"); 95 stozer.removeAttribute("id"); 96 posudba.removeAttribute("id"); 97 98 svi.style.setProperty("background-color", "#58B6E7", "important"); 99 svi_a_tag.style.setProperty("background-color", "#58B6E7", "important"); 100 svi_a_tag.style.setProperty("color", "#fff", "important"); 101 }); 102 napadaci.addEventListener("click", function () { 103 jQuery("#g").hide(); 104 jQuery("#d").hide(); 105 jQuery("#m").hide(); 106 jQuery("#f").show(); 107 jQuery(".staff-list").hide(); 108 jQuery("#posudba").hide(); 109 110 vratari.removeAttribute("id"); 111 branici.removeAttribute("id"); 112 napadaci.id = "white_b"; 113 vezni.removeAttribute("id"); 114 stozer.removeAttribute("id"); 115 posudba.removeAttribute("id"); 116 117 svi.style.setProperty("background-color", "#58B6E7", "important"); 118 svi_a_tag.style.setProperty("background-color", "#58B6E7", "important"); 119 svi_a_tag.style.setProperty("color", "#fff", "important"); 120 }); 121 stozer.addEventListener("click", function () { 122 jQuery("#g").hide(); 123 jQuery("#d").hide(); 124 jQuery("#m").hide(); 125 jQuery("#f").hide(); 126 jQuery(".staff-list").show(); 127 jQuery("#posudba").hide(); 128 129 stozer.id = "white_b"; 130 vratari.removeAttribute("id"); 131 branici.removeAttribute("id"); 132 vezni.removeAttribute("id"); 133 napadaci.removeAttribute("id"); 134 posudba.removeAttribute("id"); 135 136 svi.style.setProperty("background-color", "#58B6E7", "important"); 137 svi_a_tag.style.setProperty("background-color", "#58B6E7", "important"); 138 svi_a_tag.style.setProperty("color", "#fff", "important"); 139 }); 140 posudba.addEventListener("click", function () { 141 jQuery("#g").hide(); 142 jQuery("#d").hide(); 143 jQuery("#m").hide(); 144 jQuery("#f").hide(); 145 jQuery(".staff-list").hide(); 146 jQuery("#posudba").show(); 147 148 posudba.id = "white_b"; 149 vratari.removeAttribute("id"); 150 branici.removeAttribute("id"); 151 vezni.removeAttribute("id"); 152 napadaci.removeAttribute("id"); 153 stozer.removeAttribute("id"); 154 155 svi.style.setProperty("background-color", "#58B6E7", "important"); 156 svi_a_tag.style.setProperty("background-color", "#58B6E7", "important"); 157 svi_a_tag.style.setProperty("color", "#fff", "important"); 158 }); 159} 160 161// Slick Post 162jQuery(document).ready(function ($) { 163 $(".galerija_post").slick({ 164 slidesToShow: 3, 165 slidesToScroll: 1, 166 autoplay: true, 167 autoplaySpeed: 2000,
168 nextArrow: $(".next"), 169 prevArrow: $(".prev"), 170 dots: false, 171 responsive: [ 172 { 173 breakpoint: 1024, 174 settings: { 175 slidesToShow: 3, 176 slidesToScroll: 3 177 } 178 }, 179 { 180 breakpoint: 700, 181 settings: { 182 slidesToShow: 1, 183 slidesToScroll: 2 184 } 185 }, 186 { 187 breakpoint: 500, 188 settings: { 189 slidesToShow: 1, 190 slidesToScroll: 1 191 } 192 } 193 ] 194 }); 195 196 // Full screen 197 $(".image").click(function () { 198 $(".full").addClass("full_screen"); 199 200 $(".full_screen").slick("slickSetOption", "slidesToShow", 2); 201 $(".full_screen").slick("slickSetOption", "prevArrow", true); 202 $(".full_screen").slick("slickSetOption", "nextArrow", true); 203 $(".full_screen").slick({ 204 responsive: [ 205 { 206 breakpoint: 500, 207 settings: { 208 slidesToShow: 1, 209 slidesToScroll: 1 210 } 211 } 212 ] 213 }); 214 }); 215 216 $(".close").click(function () { 217 $(".full").removeClass("full_screen"); 218 }); 219}); 220 221 222 223 224jQuery(document).ready(function ($) { 225 226 $(".anwp-season-dropdown").on('change', function(e) { 227 var changeUrl = $(this).find(":selected").attr('data-href'); 228 var url = window.location.origin; 229 230 window.location = url + changeUrl; 231 }); 232 233}); 234 235/* ------------------------------------------------------------------------- 236 * Odbrojavanje do sljedece utakmice (banner / widget "sljedeca utakmica"). 237 * 238 * Do anwp Football Leagues 0.15.x ovo je radio jQuery.countdown iz plugina 239 * (vendor/jquery.countdown) pokretan iz public/js/anwp-fl-public.js, koji smo 240 * bili patchali za hrvatske oznake. U 0.18.x je plugin izbacio i vendor i taj 241 * JS file, pa je brojac nestao. Ovdje je isti prikaz reimplementiran vanilla 242 * JS-om u child temi, da vise ne ovisi o pluginu i prezivi update. 243 * 244 * Markup i klase namjerno ostaju identicni starima - style.css se ne dira. 245 * Ciljno vrijeme se racuna iz data-kickoff-diff (razlika u ms koju je izracunao 246 * PHP), a ne iz data-kickoff, pa kriv sat na korisnikovom racunalu ne utjece. 247 * ---------------------------------------------------------------------- */ 248(function () { 249 var LABELS = { 250 days: 'd', 251 hours: 's', 252 minutes: 'm', 253 seconds: 's' 254 }; 255 256 function pad(value) { 257 return value < 10 ? '0' + value : String(value); 258 } 259 260 function render(el, remaining) { 261 var totalSeconds = Math.floor(remaining / 1000); 262 263 var days = Math.floor(totalSeconds / 86400); 264 var hours = Math.floor((totalSeconds % 86400) / 3600); 265 var minutes = Math.floor((totalSeconds % 3600) / 60); 266 var seconds = totalSeconds % 60; 267 268 el.innerHTML = 269 pad(days) + ' <span class="anwp-countdown-simple-label-days">' + LABELS.days + '</span> ' + 270 pad(hours) + ' <span class="anwp-countdown-simple-label-hours">' + LABELS.hours + '</span> ' + 271 pad(minutes) + ' <span class="anwp-countdown-simple-label-minutes">' + LABELS.minutes + '</span> ' + 272 pad(seconds) + ' <span class="anwp-countdown-simple-label-seconds">' + LABELS.seconds + '</span>'; 273 } 274 275 function init() { 276 var nodes = document.querySelectorAll('.anwp-countdown-simple'); 277 278 if (!nodes.length) { 279 return; 280 } 281 282 var counters = []; 283 284 Array.prototype.forEach.call(nodes, function (el) { 285 var diff = parseInt(el.getAttribute('data-kickoff-diff'), 10); 286 287 if (isNaN(diff) || diff <= 0) { 288 render(el, 0); 289 return; 290 } 291 292 var target = Date.now() + diff; 293 294 render(el, diff); 295 counters.push({ el: el, target: target }); 296 }); 297 298 if (!counters.length) { 299 return; 300 } 301 302 var timer = setInterval(function () { 303 var now = Date.now(); 304 305 counters = counters.filter(function (counter) { 306 var remaining = counter.target - now; 307 308 if (remaining <= 0) { 309 render(counter.el, 0); 310 return false; 311 } 312 313 render(counter.el, remaining); 314 return true; 315 }); 316 317 if (!counters.length) { 318 clearInterval(timer); 319 } 320 }, 1000); 321 } 322 323 if (document.readyState === 'loading') { 324 document.addEventListener('DOMContentLoaded', init); 325 } else { 326 init(); 327 } 328})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.