1 2$(document).ready(function() { 3 4 // ICON ANIMATION - VAND 5 function vandmouseoutHandler() { 6 //console.log('vand mouseleave '); 7 // svg that animates from frame2 to frame1 8 $(this).find('.icon-container-water .safari').html('<svg class="vand" version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;">' + 9 '<path class="vandtop"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M51.2,17.9c9.7,0,24.1,1.9,23.9,4.4c-3.1,22.4-8.6,63.8-9.2,67c-0.4,2.3-15,2.6-16.7,2.5c-2,0-14.8-0.4-15.3-2.4c-1.6-12.8-6.5-46.6-9-67.3C24.6,19.2,44.4,17.9,51.2,17.9z;M50,5.3c2,0,4.2,4.8,14.9,21.4C76.1,44,81.8,50,81.8,61.7c0,16.9-11.9,33.1-31.8,33.1c-20.3,0-32.2-16.2-32.1-33.1C18,50,24.1,44,35,26.9C45.7,10,47.9,5.3,50,5.3z;"></animate></path>' + 10 '<path class="vandvand"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M50.3,26.8c2,0,12.3,0.2,24.7-4.1c-1.7,13-2.2,16.5-3.7,27.4c0,0.1-11-4-21.6-1.5c-10.7,2.5-21.3-0.7-21.4-0.9c-1.7-12-3.1-23.8-3.2-25.3C33.4,25.7,45.6,26.8,50.3,26.8z;M50,5.3c2,0,4.2,4.8,14.9,21.4C76.1,44,81.8,50,81.8,61.7c0,16.9-11.9,33.1-31.8,33.1c-20.3,0-32.2-16.2-32.1-33.1C18,50,24.1,44,35,26.9C45.7,10,47.9,5.3,50,5.3z;"></animate></path>' + 11 '</svg>'); 12 // Reattach the mouseenter event handler 13 $(".icon-animate-water").one("mouseenter", vandmouseenterHandler); 14 } 15 function vandmouseenterHandler() { 16 //console.log('vand mouseenter '); 17 // svg that animates from frame1 to frame2 18 $(this).find('.icon-container-water .safari').html('<svg class="vand" version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;">' + 19 '<path class="vandtop"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M50,5.3c2,0,4.2,4.8,14.9,21.4C76.1,44,81.8,50,81.8,61.7c0,16.9-11.9,33.1-31.8,33.1c-20.3,0-32.2-16.2-32.1-33.1C18,50,24.1,44,35,26.9C45.7,10,47.9,5.3,50,5.3z;M51.2,17.9c9.7,0,24.1,1.9,23.9,4.4c-3.1,22.4-8.6,63.8-9.2,67c-0.4,2.3-15,2.6-16.7,2.5c-2,0-14.8-0.4-15.3-2.4c-1.6-12.8-6.5-46.6-9-67.3C24.6,19.2,44.4,17.9,51.2,17.9z;"></animate></path>' + 20 '<path class="vandvand"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M50,5.3c2,0,4.2,4.8,14.9,21.4C76.1,44,81.8,50,81.8,61.7c0,16.9-11.9,33.1-31.8,33.1c-20.3,0-32.2-16.2-32.1-33.1C18,50,24.1,44,35,26.9C45.7,10,47.9,5.3,50,5.3z;M50.3,26.8c2,0,12.3,0.2,24.7-4.1c-1.7,13-2.2,16.5-3.7,27.4c0,0.1-11-4-21.6-1.5c-10.7,2.5-21.3-0.7-21.4-0.9c-1.7-12-3.1-23.8-3.2-25.3C33.4,25.7,45.6,26.8,50.3,26.8z;"></animate></path>' + 21 '</svg>'); 22 // Attach the mouseout event handler only once 23 $(".icon-animate-water").one("mouseleave", vandmouseoutHandler); 24 } 25 // Attach the initial mouseenter event handler 26 $(".icon-animate-water").one("mouseenter", vandmouseenterHandler); 27 28 29 30 31 // ICON ANIMATION - VARME 32 function varmemouseoutHandler() { 33 //console.log('varme mouseleave '); 34 // svg that animates from frame2 to frame1 35 $(this).find('.icon-container-heat2 .safari').html('<svg class="varme" version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;">' + 36 '<g class="arrow1">' + 37 '<path class="arrow1line"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M89.2,39.7c0,0-21.8-15.5-40.8-0.2C27,55.6,11.6,38.1,11.6,38.1;M92,32.8c0,0-20.2,34.2-38.6,5.9C35.3,11,17,32.3,17,32.3;"></animate></path>' + 38 '</g>' + 39 '<g class="arrow2">' + 40 '<path class="arrow2line"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M9,63.9c0,0,18.8,11.7,40.6-2.2c19.3-12.9,37.5,4.9,37.5,4.9;M8,67.2c0,0,20.2-34.2,38.6-5.9C64.7,89,83,67.7,83,67.7;"></animate></path>' + 41 '</g>' + 42 '</svg>'); 43 // Reattach the mouseenter event handler 44 $(".icon-animate-heat2").one("mouseenter", varmemouseenterHandler); 45 } 46 function varmemouseenterHandler() { 47 //console.log('varme mouseenter '); 48 // svg that animates from frame1 to frame2 49 $(this).find('.icon-container-heat2 .safari').html('<svg class="varme" version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;">
49' + 50 '<g class="arrow1">' + 51 '<path class="arrow1line"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M92,32.8c0,0-20.2,34.2-38.6,5.9C35.3,11,17,32.3,17,32.3;M89.2,39.7c0,0-21.8-15.5-40.8-0.2C27,55.6,11.6,38.1,11.6,38.1;"></animate></path>' + 52 '</g>' + 53 '<g class="arrow2">' + 54 '<path class="arrow2line"><animate fill="freeze" attributeName="d" dur="0.5s" repeatCount="1" values="M8,67.2c0,0,20.2-34.2,38.6-5.9C64.7,89,83,67.7,83,67.7;M9,63.9c0,0,18.8,11.7,40.6-2.2c19.3-12.9,37.5,4.9,37.5,4.9;"></animate></path>' + 55 '</g>' + 56 '</svg>'); 57 // Attach the mouseout event handler only once 58 $(".icon-animate-heat2").one("mouseleave", varmemouseoutHandler); 59 } 60 // Attach the initial mouseenter event handler 61 $(".icon-animate-heat2").one("mouseenter", varmemouseenterHandler); 62 63 64 65 66 // SHOW AND HIDE TEXT BLOCKS ON MY PAGE 67 /*if($('.block-mypagetext').length>0){ 68 var userIsLoggedin = false; 69 if(mfPlugins.currentUser()) { 70 userIsLoggedin = true; 71 $('.block-mypagetext').show(); 72 } 73 } 74 if($('.block-mypagevideo').length>0){ 75 var userIsLoggedin = false; 76 if(mfPlugins.currentUser()) { 77 userIsLoggedin = true; 78 $('.block-mypagevideo').show(); 79 } 80 } 81 if($('.kmdblock-text').length>0){ 82 if(mfPlugins.currentUser()) { 83 $('.block-mypagelinkboxes').show(); 84 } 85 } 86 if($('.kmdblock-title').length>0){ 87 if(mfPlugins.currentUser()) { 88 $('.kmdblock-title').show(); 89 } 90 } 91 if($('.kmdblock-text').length>0){ 92 if(mfPlugins.currentUser()) { 93 $('.kmdblock-text').show(); 94 } 95 }*/ 96 function showBoxes() { 97 if ($('.block-mypagetext').length > 0) { 98 $('.block-mypagetext').show(); 99 } 100 if ($('.block-mypagevideo').length > 0) { 101 $('.block-mypagevideo').show(); 102 } 103 if ($('.block-mypagelinkboxes').length > 0) { 104 $('.block-mypagelinkboxes').show(); 105 } 106 if ($('.kmdblock-element').length > 0) { 107 $('.kmdblock-element').addClass('styleafterlogin'); 108 } 109 if ($('.kmdblock-title').length > 0) { 110 $('.kmdblock-title').show(); 111 } 112 if ($('.kmdblock-text').length > 0) { 113 $('.kmdblock-text').show(); 114 } 115 } 116 //if (typeof mfPlugins === 'undefined') {} 117 if($('.block-kmd').length>0) { // Only do this on min side pages 118 if(mfPlugins.currentUser()) { 119 //console.log("User is logged in - check using mfPlugin"); 120 showBoxes(); 121 } 122 // This runs only on initial login or logout 123 mfPlugins.subscribeEvent('mf-is-authenticated', function(isAuthenticated) { 124 if (isAuthenticated) { 125 //console.log("User is logged in - check using mf-is-authenticated"); 126 showBoxes(); 127 } else { 128 console.log("User is NOT logged in"); 129 } 130 }); 131 } 132 133 134 135 136 // STICKY HEADER AND BREAKING BANNER 137 var breaking = 0; 138 if($('.breakingbanner').length ) { 139 breaking = $('.breakingbanner').outerHeight(); 140 } 141 // position header elements on scroll, load an resize 142 $(window).on('load resize scroll', function() { 143 positionHeaderElements(breaking); 144 }); 145 // Close breaking banner 146 $('.breaking-closebutton').on('click', function () { 147 $('.breakingbanner').hide(); 148 $('.breakingbanner').attr('aria-hidden', 'true'); 149 breaking = 0; 150 positionHeaderElements(breaking); 151 setCookie('hide-breaking',true, 1); 152 }); 153 function positionHeaderElements(breakingHeight) { 154 scrollDistance = $(window).scrollTop(); 155 if(scrollDistance > breaking) { 156 $('.headerbar').addClass('scrolled'); 157 $('.headerbar').css('top', '0px'); 158 $('.mainmenu').css('top', '0px'); 159 $('.mainsubmenu').css('top', '0px'); 160 } else { 161 $('.headerbar').removeClass('scrolled'); 162 $('.headerbar').css('top', (breaking - scrollDistance - 1) + 'px'); 163 $('.mainmenu').css('top', (breaking - scrollDistance - 1) + 'px'); 164 $('.mainsubmenu').css('top', (breaking - scrollDistance - 1) + 'px'); 165 } 166 } 167 168 169 170 171 // TOGGLE MAIN MENU - open and close main menu 172 $('.header-menubutton').on('click', function (e) { 173 e.preventDefault(); 174 $(this).toggleClass('open'); 175 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 176 $('.headerbar').toggleClass('open'); 177 if ($('.mainmenu').is(':visible')) { 178 $('.mainmenu').removeClass('open'); 179 setTimeout(function() { 180 $('.mainmenu').hide(); 181 }, 500); 182 } else { 183 $('.mainmenu').show(); 184 setTimeout(function() { 185 $('.mainmenu').addClass('open'); 186 }, 100); 187 } 188 //$('.mainmenu').toggleClass('open'); 189 $('.mainmenu').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 190 //$('.mainmenu').removeClass('secondarylevelopen'); 191 //$('.mainsubmenu').removeClass('open'); 192 //$('.mainsubmenu').attr('aria-hidden', 'true'); 193 194 }); 195 $(document).mouseup(function(e) { 196 var menubutton = $(".header-menubutton"); 197 var menucontainer = $('.mainmenu'); 198 // hide menu on click outside 199 if ((!menucontainer.is(e.target) && menucontainer.has(e.target).length === 0) && (!menubutton.is(e.target) && menubutton.has(e.target).length === 0)) { 200 $('.header-menubutton').removeClass('open'); 201 $('.header-menubutton').attr('aria-expanded', 'false'); 202 $('.headerbar').removeClass('open'); 203 $('.mainmenu').removeClass('open'); 204 setTimeout(function() { 205 $('.mainmenu').hide(); 206 }, 500); 207 $('.mainmenu').attr('aria-hidden', 'true'); 208 //$('.mainmenu').removeClass('secondarylevelopen'); 209 //$('.mainsubmenu').removeClass('open'); 210 //$('.mainsubmenu').attr('aria-hidden', 'true'); 211 } 212 }); 213 214 // MAIN MENU ITEMS - open and close the submenu 215 $('button.mainmenu-button').on('click', function () { 216 var thisbutton = $(this); 217 var thissubmenu = $(this).next('.mainsubmenu'); 218 // remove open state on all except this 219 $('.mainmenu-button').not(thisbutton).removeClass('open'); 220 $('.mainmenu-button').not(thisbutton).attr('aria-expanded', 'false'); 221 // toggle open state on this button 222 $(thisbutton).toggleClass('open'); 223 $(thisbutton).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 224 // close all submenus except this 225 $('.mainsubmenu').not(thissubmenu).removeClass('open'); 226 setTimeout(function() { 227 $('.mainsubmenu').not(thissubmenu).hide(); 228 }, 500); 229 $('.mainsubmenu').not(thissubmenu).attr('aria-hidden', 'true'); 230 // toggle this submenu and make the main menu wide or narrow 231 $(thissubmenu).attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 232 // 233 /*var result = $(thissubmenu).toggleClass('open'); 234 if(result.hasClass('open') == true) { 235 $('.mainmenu').addClass('secondarylevelopen'); 236 } else { 237 $('.mainmenu').removeClass('secondarylevelopen'); 238 }*/ 239 if ($(thissubmenu).is(':visible')) { 240 $('.mainmenu').removeClass('secondarylevelopen'); 241 $(thissubmenu).removeClass('open'); 242 setTimeout(function() { 243 $(thissubmenu).hide(); 244 }, 500); 245 } else { 246 $('.mainmenu').addClass('secondarylevelopen'); 247 $(thissubmenu).show(); 248 setTimeout(function() { 249 $(thissubmenu).addClass('open'); 250 }, 100); 251 } 252 }); 253 254 // MAIN MENU SUBMENU ITEMS - open and close submenu items of submenu 255 $('.mainsubmenu-button').on('click', function () { 256 $(this).toggleClass('open'); 257 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 258 $(this).closest('.mainsubmenu-item').next('.mainsubmenu-subitems').slideToggle(); 259 $(this).closest('.mainsubmenu-item').next('.mainsubmenu-subitems').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 260 }); 261 262 263 264 265 // SUBPAGE SIDE MENU 266 if($('.subpagemenu').length) { 267 268 //manually collapse menu 269 /* 270 var ismanuallychaged = false;
271 $('.subpagemenu-button').on('click', function () { 272 ismanuallychaged = true 273 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 274 $('.subpagemenu-column').toggleClass('collapsed'); 275 $('.subpagesections-column').toggleClass('collapsed'); 276 $('.subpage-menu').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 277 }); 278 */ 279 280 //calculate where to automatically collapse the side menu 281 /* 282 var windowheight = $(window).height(); 283 var menuheight = $('.subpagemenu').outerHeight(); 284 var menutopdistance = $('.subpagemenu-column').offset().top; 285 var menuscrolldistance = 0; 286 var menucollapse = (menuheight + menutopdistance + 500) - windowheight; 287 //console.log('windowheight: ' + windowheight + ' - menuheight: ' + menuheight + ' - menutopdistance: ' + menutopdistance + ' - Menuscrolldistance: ' + menuscrolldistance + ' - menucollapse: ' + menucollapse); 288 */ 289 290 //open and close submenu items 291 $('.subpagemenu-item-button').on('click', function () { 292 $(this).toggleClass('open'); 293 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 294 $(this).closest('.subpagemenu-item').next('.subpagemenu-subitems').slideToggle(); 295 $(this).closest('.subpagemenu-item').next('.subpagemenu-subitems').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 296 297 //recalculate menuheight when submenu items are open and closed 298 /* 299 setTimeout(function() { 300 if($('.subpagemenu').outerHeight() > menuheight) { 301 menuheight = $('.subpagemenu').outerHeight(); 302 menucollapse = (menuheight + menutopdistance + 500) - windowheight; 303 } 304 }, 1000); 305 */ 306 }); 307 308 //make menu collapse on scroll 309 /* 310 $(window).on('load resize scroll', function() { 311 menuscrolldistance = $(window).scrollTop(); 312 if(!ismanuallychaged){ 313 if(menucollapse < 0){ 314 menucollapse = 500; 315 } 316 if(menuscrolldistance > menucollapse) { 317 $('.subpagemenu-column').addClass('collapsed'); 318 $('.subpagesections-column').addClass('collapsed'); 319 } else { 320 $('.subpagemenu-column').removeClass('collapsed'); 321 $('.subpagesections-column').removeClass('collapsed'); 322 } 323 } 324 }); 325 */ 326 327 //dynamic height of menu column 328 /* 329 $(window).on('load', function() { 330 var headerbar = 55; 331 var menubutton = $('.subpagemenu-button').outerHeight(); 332 $('.subpagemenu').css('max-height', 'calc(100vh - ' + headerbar + 'px - ' + menubutton + 'px)'); 333 //$('.subpage-column-inner').css('top', headerbar + 'px'); 334 }); 335 */ 336 337 } 338 339 340 341 342 // SUBPAGE MOBILEMENU 343 $('.subpagemobilemenu-button').on('click', function (e) { 344 e.preventDefault(); 345 $('.subpagemobilemenu').toggleClass('collapsed'); 346 $('.subpagemobilemenu-content').slideToggle(); 347 $('.subpagemobilemenu-content').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 348 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 349 }); 350 $('.subpagemobilemenu-item-button').on('click', function (e) { 351 $(this).toggleClass('open'); 352 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 353 $(this).closest('.subpagemobilemenu-item').next('.subpagemobilemenu-subitems').slideToggle(); 354 $(this).closest('.subpagemobilemenu-item').next('.subpagemobilemenu-subitems').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 355 }); 356 357 358 359 360 // TOPIC SLIDER 361 if($('.topicslider-slider').length>0){ 362 $('.topicslider-slider').each( function() { 363 $(this).slick({ 364 slidesToShow: 1, 365 arrows: true, 366 infinite: true, 367 centerMode: true, 368 centerPadding:'20%', 369 prevArrow: '<button type="button" class="slick-prev" title="Forrige"></button>', 370 nextArrow: '<button type="button" class="slick-next" title="Næste"></button>', 371 responsive: [ 372 { 373 breakpoint: 992, 374 settings: { 375 slidesToShow: 1, 376 arrows: true, 377 infinite: true, 378 centerMode: true, 379 centerPadding:'15%', 380 } 381 }, 382 { 383 breakpoint: 576, 384 settings: { 385 slidesToShow: 1, 386 arrows: true, 387 infinite: false, 388 centerMode: true, 389 centerPadding:'25px', 390 } 391 } 392 ] 393 }); 394 }); 395 } 396 397 398 // GALLERY SLIDER 399 if($('.block-gallery-slider').length>0){ 400 $('.block-gallery-slider').each( function() { 401 $(this).slick({ 402 slidesToShow: 1, 403 arrows: true, 404 infinite: true, 405 prevArrow: '<button type="button" class="slick-prev" title="Forrige"></button>', 406 nextArrow: '<button type="button" class="slick-next" title="Næste"></button>', 407 }); 408 }); 409 } 410 411 412 413 414 // NEWS SLIDER 415 if($('.frontpage-content .newsblock-slider').length>0){ 416 $('.frontpage-content .newsblock-slider').each( function() { 417 $(this).slick({ 418 slidesToShow: 4, 419 arrows: true, 420 infinite: true, 421 centerMode: false, 422 swipeToSlide: true, 423 prevArrow: $(this).closest('.block-news').find('.newsblock-prev'), 424 nextArrow: $(this).closest('.block-news').find('.newsblock-next'), 425 responsive: [ 426 { 427 breakpoint: 1200, 428 settings: { 429 slidesToShow: 4, 430 } 431 }, 432 { 433 breakpoint: 992, 434 settings: { 435 slidesToShow: 3, 436 arrows: true, 437 infinite: true, 438 centerMode: false, 439 } 440 }, 441 { 442 breakpoint: 576, 443 settings: { 444 slidesToShow: 1, 445 arrows: true, 446 infinite: false, 447 centerMode: true, 448 centerPadding:'25px', 449 } 450 } 451 ] 452 }); 453 }); 454 } 455 if($('.newsarticlebottom-slider').length>0) { 456 $('.newsarticlebottom-slider').each( function() { 457 $(this).slick({ 458 slidesToShow: 4, 459 arrows: true, 460 infinite: true, 461 centerMode: false, 462 swipeToSlide: true, 463 prevArrow: $(this).closest('.block-news').find('.newsblock-prev'), 464 nextArrow: $(this).closest('.block-news').find('.newsblock-next'), 465 responsive: [ 466 { 467 breakpoint: 1200, 468 settings: { 469 slidesToShow: 4, 470 } 471 }, 472 { 473 breakpoint: 992, 474 settings: { 475 slidesToShow: 3, 476 arrows: true, 477 infinite: true, 478 centerMode: false, 479 } 480 }, 481 { 482 breakpoint: 576, 483 settings: { 484 slidesToShow: 1, 485 arrows: true, 486 infinite: false, 487 centerMode: true, 488 centerPadding:'25px', 489 } 490 } 491 ] 492 }); 493 }); 494 } 495 if($('.subpage-content .newsblock-slider').length>0){ 496 $('.subpage-content .newsblock-slider').each( function() { 497 $(this).slick({ 498 slidesToShow: 3, 499 arrows: true, 500 infinite: true, 501 centerMode: false, 502 swipeToSlide: true, 503 prevArrow: $(this).closest('.block-news').find('.newsblock-prev'), 504 nextArrow: $(this).closest('.block-news').find('.newsblock-next'), 505 responsive: [ 506 { 507 breakpoint: 992, 508 settings: { 509 slidesToShow: 3, 510 arrows: true, 511 infinite: true, 512 centerMode: false, 513 centerPadding:'50px', 514 } 515 }, 516 { 517 breakpoint: 576, 518 settings: { 519 slidesToShow: 1, 520 arrows: true, 521 infinite: false, 522 centerMode: true, 523 centerPadding:'25px', 524 } 525 } 526 ] 527 }); 528 }); 529 } 530 531 532 533 // WAYPOINTS 534 if( $('.animation').length ) { 535 $('.animation').waypoint({ 536 handler: function() { 537 $(this).addClass('animate'); 538 }, 539 offset: '110%' 540 }); 541 } 542 if( $('.animationUp').length ) { 543 $('.animationUp').waypoint({ 544 handler: function() { 545 $(this).addClass('animateUp'); 546 }, 547 offset: '110%' 548 }); 549 } 550 if( $('.animationRight').length ) { 551 $('.animationRight').waypoint({ 552 handler: function() { 553 $(this).addClass('animateRight'); 554 }, 555 offset: '110%' 556 }); 557 } 558 if( $('.animationLeft').length ) { 559 $('.animationLeft').waypoint({ 560 handler: function() { 561 $(this).addClass('animateLeft'); 562 }, 563 offset: '110%' 564 }); 565 } 566 567 if( $('.animationUpdelay').length ) { 568 $('.animationUpdelay').waypoint({ 569 handler: function() { 570 $(this).addClass('animateUp'); 571 }, 572 offset: '80%' 573 }); 574 } 575 if( $('.animationRightdelay').length ) { 576 $('.animationRightdelay').waypoint({ 577 handler: function() { 578 $(this).addClass('animateRight'); 579 }, 580 offset: '80%' 581 }); 582 } 583 if( $('.animationLeftdelay').length ) { 584 $('.animationLeftdelay').waypoint({ 585 handler: function() { 586 $(this).addClass('animateLeft'); 587 }, 588 offset: '80%' 589 }); 590 } 591 592 if( $('.waveanimation').length ) { 593 $('.waveanimation').each( function() { 594 var wavestatus = 'wavy'; 595 $(this).waypoint({ 596 handler: function(direction) { 597 if (direction == 'down' && wavestatus == 'wavy') { 598 $(this).find('.safari').html('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1460 200" style="enable-background:new 0 0 1460 200;" xml:space="preserve">' + 599 '<path><animate fill="freeze" attributeName="d" dur="1s" repeatCount="1" values="M0,200h1460c0,0,0.1-51.5,0-100c-144,152-270-159-449.7,0C908,200,872,237,634.5,100C237-181,336,257,0,100L0,200z;M0,200h1460c0,0,0.1-51.5,0-100c-126,0-314,0-449.7,0c-146.3,0-239.3,0-375.7,0C441,100,
599183,100,0,100L0,200z;"></animate></path>' + 600 '</svg>'); 601 $(this).find('.chrome').addClass('flat'); 602 $(this).find('.chrome').removeClass('wavy'); 603 wavestatus = 'flat'; 604 //console.log(wavestatus); 605 } 606 }, 607 offset: '80%' 608 }); 609 $(this).waypoint({ 610 handler: function(direction) { 611 if (direction == 'up' && wavestatus == 'flat') { 612 $(this).find('.safari').html('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1460 200" style="enable-background:new 0 0 1460 200;" xml:space="preserve">' + 613 '<path><animate fill="freeze" attributeName="d" dur="1s" repeatCount="1" values="M0,200h1460c0,0,0.1-51.5,0-100c-126,0-314,0-449.7,0c-146.3,0-239.3,0-375.7,0C441,100,183,100,0,100L0,200z;M0,200h1460c0,0,0.1-51.5,0-100c-144,152-270-159-449.7,0C908,200,872,237,634.5,100C237-181,336,257,0,100L0,200z;"></animate></path>' + 614 '</svg>'); 615 $(this).find('.chrome').addClass('wavy'); 616 $(this).find('.chrome').removeClass('flat'); 617 wavestatus = 'wavy'; 618 //console.log(wavestatus); 619 } 620 }, 621 offset: '20%' 622 }); 623 }); 624 } 625 626 627 628 629 // NUMBER ANIMATION 630 function animateValue(obj, start, end, duration) { 631 let startTimestamp = null; 632 const decimals = (end.toString().split('.')[1] || '').length; // number of decimal digits 633 const step = (timestamp) => { 634 if (!startTimestamp) startTimestamp = timestamp; 635 const progress = Math.min((timestamp - startTimestamp) / duration, 1); 636 const value = progress * (end - start) + start; 637 const formatted = value.toFixed(decimals).replace('.', ','); 638 obj.html(formatted); 639 if (progress < 1) { 640 window.requestAnimationFrame(step); 641 } 642 }; 643 window.requestAnimationFrame(step); 644 } 645 646 // NUMBER IN CIRCLE 647 if( $('.numberincircle-centernumber').length ) { 648 $('.numberincircle-centernumber').each( function() { 649 var thenumber = $(this).attr('data-number'); 650 var object = $(this); 651 var isAnimationFinished = false; 652 $(this).waypoint({ 653 handler: function() { 654 if(!isAnimationFinished) { 655 animateValue(object, 0, thenumber, 2000); 656 isAnimationFinished = true; 657 } 658 }, 659 offset: '100%' 660 }); 661 }); 662 } 663 664 // NUMBER IN STATISTIC BLOCK 665 if( $('.block-numbers-animation').length ) { 666 $('.block-numbers-animation').each( function() { 667 var thenumber = $(this).attr('data-number'); 668 var object = $(this); 669 var isAnimationFinished = false; 670 $(this).waypoint({ 671 handler: function() { 672 if(!isAnimationFinished) { 673 animateValue(object, 0, thenumber, 2000); 674 isAnimationFinished = true; 675 } 676 }, 677 offset: '100%' 678 }); 679 }); 680 } 681 682 683 684 685 686 // INITIATE RELLAX 687 if( $('.frontpage-top-image').length ) { 688 var rellax = new Rellax('.frontpage-top-image', { 689 center:true, 690 speed: -3, 691 }); 692 } 693 694 695 696 // DATE MODULE READ MORE TEXT 697 $('.date-more-link').click(function() { 698 $(this).closest('.block-date').find('.date-description').slideDown(); 699 $(this).closest('.block-date').find('.date-description').attr('aria-hidden', 'false'); 700 $(this).attr('aria-expanded', 'true'); 701 $(this).closest('.block-date').find('.date-more-close').attr('aria-expanded', 'true'); 702 }); 703 $('.date-more-close').click(function() { 704 $(this).closest('.block-date').find('.date-description').slide
704Up(); 705 $(this).closest('.block-date').find('.date-description').attr('aria-hidden', 'true'); 706 $(this).attr('aria-expanded', 'false'); 707 $(this).closest('.block-date').find('.date-more-link').attr('aria-expanded', 'false'); 708 }); 709 710 711 712 // COMPARISON MODULE READ MORE TEXT 713 $('.comparison-listitem-more').click(function() { 714 $(this).closest('.comparison-listitem').find('.comparison-listitem-text2').slideToggle(); 715 $(this).closest('.comparison-listitem').find('.comparison-listitem-text2').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 716 $(this).closest('.comparison-listitem').find('.comparison-listitem-less').toggle(); 717 $(this).closest('.comparison-listitem').find('.comparison-listitem-less').attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 718 $(this).toggle(); 719 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 720 }); 721 $('.comparison-listitem-less').click(function() { 722 $(this).closest('.comparison-listitem').find('.comparison-listitem-text2').slideToggle(); 723 $(this).closest('.comparison-listitem').find('.comparison-listitem-text2').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 724 $(this).closest('.comparison-listitem').find('.comparison-listitem-more').toggle(); 725 $(this).closest('.comparison-listitem').find('.comparison-listitem-more').attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 726 $(this).toggle(); 727 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 728 }); 729 730 731 732 // FAQ ACCORDION 733 $('.faq-question').click(function() { 734 var item = $(this).closest('.faq-item'); 735 $('.faq-item').not(item).find('.faq-answer').slideUp(); 736 $('.faq-item').not(item).removeClass('open'); 737 $('.faq-item').not(item).find('.faq-question').attr('aria-expanded', 'false'); 738 $('.faq-item').not(item).find('.faq-answer').attr('aria-hidden', 'true'); 739 $(this).closest('.faq-item').find('.faq-answer').slideToggle(); 740 $(this).closest('.faq-item').toggleClass('open'); 741 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 742 $(this).next('.faq-answer').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 743 }); 744 var hashValue = window.location.hash; 745 if(hashValue && $('.faq-item'+hashValue).length>0 ){ 746 var currentitem = $('.faq-item'+hashValue); 747 $('html, body').animate({ 748 scrollTop: ($(currentitem).offset().top - 70) 749 }, 2000); 750 $(currentitem).closest('.faq-item').find('.faq-answer').slideToggle(); 751 $(currentitem).closest('.faq-item').toggleClass('open'); 752 $(currentitem).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 753 $(currentitem).next('.faq-answer').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 754 //console.log(hashValue); 755 } 756 757 758 759 // PUBLICATIONS ACCORDION 760 $('.publications-accordion-title').click(function() { 761 var item = $(this).closest('.publications-accordion-item'); 762 $('.publications-accordion-item').not(item).find('.publications-accordion-content').slideUp(); 763 $('.publications-accordion-item').not(item).removeClass('open'); 764 $('.publications-accordion-item').not(item).find('.publications-accordion-title').attr('aria-expanded', 'false'); 765 $('.publications-accordion-item').not(item).find('.publications-accordion-content').attr('aria-hidden', 'true'); 766 $(this).closest('.publications-accordion-item').find('.publications-accordion-content').slideToggle(); 767 $(this).closest('.publications-accordion-item').toggleClass('open'); 768 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 769 $(this).next('.publications-accordion-content').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 770 }); 771 772 773 774 // DOWNLOADS ACCORDION 775 $('.downloads-accordion-title').click(function() { 776 console.log('click'); 777 var item = $(this).closest('.downloads-accordion-item'); 778 $('.downloads-accordion-item').not(item).find('.downloads-accordion-content').slideUp(); 779 $('.downloads-accordion-item').not(item).removeClass('open'); 780 $('.downloads-accordion-item').not(item).find('.downloads-accordion-title').attr('aria-expanded', 'false'); 781 $('.downloads-accordion-item').not(item).find('.downloads-accordion-content').attr('aria-hidden', 'true'); 782 $(this).closest('.downloads-accordion-item').find('.downloads-accordion-content').slideToggle(); 783 $(this).closest('.downloads-accordion-item').toggleClass('open'); 784 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 785 $(this).next('.downloads-accordion-content').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 786 }); 787 788 789 790 // TIME LINE - READ MORE 791 $('.timeline-itemmorelink button').click(function() { 792 var item = $(this).closest('.timeline-item'); 793 $('.timeline-item').not(item).find('.timeline-itemmoretext').slideUp(); 794 $('.faq-item').not(item).find('.timeline-itemmorelink button').attr('aria-expanded', 'false'); 795 $('.faq-item').not(item).find('.timeline-itemmorelink .less').hide(); 796 $('.faq-item').not(item).find('.timeline-itemmorelink .more').show(); 797 $('.faq-item').not(item).find('.timeline-itemmoretext').attr('aria-hidden', 'true'); 798 $(this).closest('.timeline-item').find('.timeline-itemmoretext').slideToggle(); 799 $(this).closest('.timeline-item').find('.timeline-itemmorelink .less').toggle(); 800 $(this).closest('.timeline-item').find('.timeline-itemmorelink .more').toggle(); 801 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 802 $(this).next('.timeline-itemmoretext').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 803 }); 804 805 806 807 808 // SHOW ARTICLES IN GRID 809 if($('.newslist').length>0){ 810 $('.newslist').isotope({ 811 itemSelector: '.newslist-item', 812 layoutMode: 'packery', 813 }); 814 } 815 816 817 818 // VIDEO TEXT 819 $('.video-text-button').click(function() { 820 $(this).closest('.video-row').find('.video-text').slideToggle(); 821 $(this).attr('aria-expanded', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 822 $(this).closest('.video-row').find('.video-text').attr('aria-hidden', function(index, attr){ return attr === 'false' ? 'true' : 'false'; }); 823 }); 824 // VIDEO PLAY WITH THUMBNAIL 825 $('.video-play').click(function () { 826 var video = $(this).data('video'); 827 var container = $(this).closest('.video-wrapper'); 828 $(this).hide(); 829 $(container).html('<video controls playsinline autoplay><source src="' + video + '" type="video/mp4"></video>'); 830 }); 831 832 833 834 835 // AUTOPLAY VIDEO PAUSE AND PLAY BUTTON 836 $('.pauseplay').click(function () { 837 if($(this).closest('.pauseplay-container').find('video').get(0).paused){ 838 $(this).closest('.pauseplay-container').find('video').get(0).play(); 839 $(this).find('.pause').show(); 840 $(this).find('.play').hide(); 841 } else { 842 $(this).closest('.pauseplay-container').find('video').get(0).pause(); 843 $(this).find('.pause').hide(); 844 $(this).find('.play').show(); 845 } 846 }); 847 848 849 850 851 // SMOOTH SCROLL IN ANCHOR LINKS 852 $('a').on('click', function (e) { 853 var url = new URL(window.location.href); 854 var currentUrlPath = url.pathname; 855 var href = $(this).attr('href'); 856 var hrefParts = href.split('#'); 857 var hrefPath = hrefParts[0]; 858 var anchorIndex = href.indexOf("#"); 859 if (anchorIndex !== -1) { 860 var anchor = href.substring(anchorIndex); 861 } 862 if((currentUrlPath == hrefPath || hrefPath === '' ) && anchor && $(anchor).length>0) { 863 e.preventDefault(); 864 $('html, body').animate({ 865 scrollTop: $(anchor).offset().top - 85 866 }, 1000); 867 } 868 }); 869 870 $(window).on('load', function(e) { 871 var anchor = window.location.hash; 872 if(anchor && $(anchor).length>0 ) { 873 e.preventDefault(); 874 $('html, body').animate({ 875 scrollTop: $(anchor).offset().top - 85 876 }, 1000); 877 } 878 }); 879 880 // Scroll for My pages and KMD elements 881 if ($('body').hasClass('pagetype-myPage')) { 882 $(window).on('load', function() { 883 var anchor = window.location.hash; 884 if (!anchor || $(anchor).length === 0) return; 885 886 var container = $('.kmdblock-element > div'); 887 if (!container.length) return; 888 889 // Observe for child changes 890 var observer = new MutationObserver(function(mutations) { 891 // Scroll once, 500ms after content changes 892 setTimeout(function() { 893 $('html, body').animate({ 894 scrollTop: $(anchor).offset().top - 85 895 }, 1000); 896 console.log('scroll'); 897 }, 500); 898 899 observer.disconnect(); // stop observing after first scroll 900 }); 901 902 observer.observe(container[0], { childList: true, subtree: true }); 903 }); 904 } 905 906 907 908 909 // POPUP 910 // Set cookie funktion 911 function setCookie(cname, cvalue, exdays) { 912 var d = new Date(); 913 d.setTime(d.getTime() + (exdays*24*60*60*1000)); 914 var expires = "expires="+ d.toUTCString(); 915 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 916 } 917 // Get Cookie funktion 918 function getCookie(cname) { 919 var name = cname + "="; 920 var ca = document.cookie.split(';'); 921 for(var i = 0; i <ca.length; i++) { 922 var c = ca[i]; 923 while (c.charAt(0)===' ') { 924 c = c.substring(1); 925 } 926 if (c.indexOf(name) === 0) { 927 return c.substring(name.length,c.length); 928 } 929 } 930 return ""; 931 } 932 933 // Clear popup timer if older than 1 day 934 function clearStartTimeIfExpired() { 935 var start = localStorage.getItem("popupStartTime"); 936 if (!start) return; 937 var oneDay = 24 * 60 * 60 * 1000; // milliseconds 938 var fiveminutes = 5 * 60 * 1000; 939 var expired = (Date.now() - parseInt(start)) > fiveminutes; 940 //console.log('starttime - ' + start + ' - ' + new Date(Number(localStorage.getItem("popupStartTime")))
940); 941 //console.log('expired ' + expired); 942 if (expired) { 943 //console.log('timer has been removed'); 944 localStorage.removeItem("popupStartTime"); 945 } 946 } 947 948 // Track popup timer across pages 949 function getStartTime() { 950 return localStorage.getItem("popupStartTime"); 951 } 952 953 function setStartTime() { 954 localStorage.setItem("popupStartTime", Date.now()); 955 } 956 957 function getElapsedSeconds() { 958 var start = getStartTime(); 959 if (!start) return 0; 960 return (Date.now() - parseInt(start)) / 1000; 961 } 962 963 964 // Popup appears after x seconds 965 if($('.popup').length>0) { 966 967 // Clear old timer first 968 clearStartTimeIfExpired(); 969 970 // Create start time on first visit 971 if (!getStartTime()) { 972 setStartTime(); 973 //console.log('start time has been set'); 974 } 975 976 var popupid = $('.popup').data('id'); 977 var delay = $('.popup').data('delay'); 978 if(delay != "0" && delay!= "" && getCookie('hide-popup-' + popupid).trim().toLowerCase() !== "true") { 979 980 // Calculate remaining time 981 var elapsed = getElapsedSeconds(); 982 var remaining = delay - elapsed; 983 //console.log('elapsed: ' + elapsed + ' - remaining: ' + remaining ); 984 985 if (remaining <= 0) { 986 // Already passed total time â show immediately 987 if (getCookie('hide-popup-' + popupid).trim() !== "true") { 988 showModal(2); // show after two seconds 989 } 990 } else { 991 // Continue the countdown 992 setTimeout(function() { 993 if (getCookie('hide-popup-' + popupid).trim() !== "true") { 994 showModal(2); // show after two seconds 995 } 996 }, remaining * 1000); 997 } 998 999 } 1000 } 1001 1002 // Popup appears after click on tab 1003 $('.popup-tab').on('click', function (e) { 1004 showModal(0.001); 1005 var popupid = $('.popup').data('id'); 1006 setCookie('hide-popup-'+popupid,true, 7); 1007 localStorage.removeItem("popupStartTime"); 1008 }); 1009 1010 // Close popup 1011 $('.popup-close').on('click', function (e) { 1012 closeModal(); 1013 var popupid = $('.popup').data('id'); 1014 setCookie('hide-popup-'+popupid,true, 7); 1015 localStorage.removeItem("popupStartTime"); 1016 }); 1017 $('.popup-overlay').on('click', function (e) { 1018 closeModal(); 1019 var popupid = $('.popup').data('id'); 1020 setCookie('hide-popup-'+popupid,true, 7); 1021 localStorage.removeItem("popupStartTime"); 1022 }); 1023 1024 1025 function showModal(delay) { 1026 var popupid = $('.popup').data('id'); 1027 var delayMiliseconds = delay*1000; 1028 var delaystartMiliseconds = delayMiliseconds-100; 1029 setTimeout(function() { 1030 $('.popup').addClass('opening'); 1031 }, delaystartMiliseconds); 1032 setTimeout(function() { 1033 $('.popup').addClass('open'); 1034 if($('.popup.centered').length>0) { 1035 $('.popup-close').focus(); 1036 $('.main-body').attr('aria-hidden', 'true'); 1037 $('.popup-box').attr('aria-hidden', 'false'); 1038 deflectFocus(); 1039 } 1040 }, delayMiliseconds); 1041 }; 1042 1043 function closeModal() { 1044 $('.popup').removeClass('open'); 1045 setTimeout(function() { 1046 $('.popup').removeClass('opening'); 1047 }, 100); 1048 $('.popup-box').attr('aria-hidden', 'true'); 1049 if($('.popup.centered').length>0) { 1050 $('.main-body').attr('aria-hidden', 'false'); 1051 $('.main-body').off('.modalOpen'); 1052 } 1053 } 1054 1055 function deflectFocus() { 1056 $('.main-body').on('focusin.modalOpen', function(e) { 1057 $('.popup-close').focus(); 1058 }); 1059 //console.log('deflect'); 1060 }; 1061 1062 1063 1064 1065 // Quiz 1066 if($('.block-quiz').length>0){ 1067 $('.block-quiz').each( function() { 1068 var score = 0; 1069 // Navigate between questions 1070 $('.quiz-nextbutton').on('click', function (e) { 1071 $(this).closest('.quiz-section').hide(); 1072 $(this).closest('.quiz-section').next().show(); 1073 }); 1074 // Enable answerbutton when answer is selected 1075 $(this).find('.quiz-step-answers input[type="radio"]').on('change', function() { 1076 $(this).closest('.quiz-section').find('.quiz-answerbutton').prop('disabled', false); 1077 //$(this).closest('.quiz-section').find('.quiz-solution').hide(); 1078 }); 1079 // Answering the question - single answer 1080 $('.singleanswer .quiz-answerbutton').on('click', function (e) { 1081 var selectedanswer = $(this).closest('.quiz-section').find('.quiz-step-answers input:checked'); 1082 if(selectedanswer.length > 0) { 1083 var id = selectedanswer.attr('id'); 1084 var point = selectedanswer.data('point');
1085 score = score + point; // add point to score 1086 $(this).closest('.block-quiz').find('.quiz-ending .totalpoints').html(score); // show score 1087 $(this).hide(); // hide answerbutton 1088 $(this).closest('.quiz-section').find('input[type="radio"]').prop('disabled', true) // disable radio buttons 1089 $(this).closest('.quiz-section').find('.quiz-step-answers').hide(); // hide answers 1090 $(this).closest('.quiz-section').find('.quiz-answererror').hide(); // hide error 1091 $(this).closest('.quiz-section').find('.quiz-solution').hide(); // hide previous answers 1092 $(this).closest('.quiz-section').find('.quiz-solution[data-id="' + id + '"]').show(); // show explanation 1093 $(this).closest('.quiz-section').find('.quiz-nextbutton').show(); // show next-button 1094 } else { 1095 $(this).closest('.quiz-section').find('.quiz-answererror').show(); // show error 1096 } 1097 }); 1098 // Answering the question - multiple answer 1099 $('.multipleanswer .quiz-answerbutton').on('click', function (e) { 1100 var selectedanswer = $(this).closest('.quiz-section').find('.quiz-step-answers input:checked'); 1101 if(selectedanswer.length > 0) { 1102 var id = selectedanswer.attr('id'); 1103 var point = selectedanswer.data('point'); 1104 if(point == 1) { 1105 $(this).hide(); // hide answerbutton if the answer is correct 1106 $(this).closest('.quiz-section').find('.quiz-nextbutton').show(); // show next-button if answer is correct 1107 $(this).closest('.quiz-section').find('input[type="radio"]').prop('disabled', true) // disable radio buttons 1108 $(this).closest('.quiz-section').find('.quiz-step-answers').hide(); // hide answers 1109 } 1110 $(this).closest('.quiz-section').find('.quiz-answererror').hide(); // hide error 1111 $(this).closest('.quiz-section').find('.quiz-solution').hide(); // hide previous answers 1112 $(this).closest('.quiz-section').find('.quiz-solution[data-id="' + id + '"]').show(); // show description 1113 } else { 1114 $(this).closest('.quiz-section').find('.quiz-answererror').show(); // show error 1115 } 1116 }); 1117 // Reset and try again 1118 $('.quiz-tryagainbutton').on('click', function (e) { 1119 $(this).closest('.block-quiz').find('.quiz-section').hide(); // hide all sections 1120 $(this).closest('.block-quiz').find('.quiz-intro').show(); // show intro 1121 $(this).closest('.block-quiz').find('.quiz-solution').hide(); // hide solutions 1122 $(this).closest('.block-quiz').find('.quiz-step-answers').show(); // show answers 1123 $(this).closest('.block-quiz').find('input[type="radio"]').prop('checked', false).prop('disabled', false); // reset selected answer 1124 $(this).closest('.block-quiz').find('.quiz-step .quiz-nextbutton').hide(); // hide next button 1125 $(this).closest('.block-quiz').find('.quiz-step .quiz-answerbutton').prop('disabled', true).show(); // show answer button 1126 score = 0; // reset score 1127 }); 1128 }); 1129 } 1130 1131 1132 1133 1134 1135 1136});
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.