1let mainNavigationItemsALL = document.querySelectorAll('.main-navigation-toolbar:not(.menu-as-sidebar) .main-navigation a'); 2 3for (let i = 0; i < mainNavigationItemsALL.length; i++){ 4 // console.log(mainNavigationItemsALL[i]) 5 //mainNavigationItemsALL[i].setAttribute('tabindex', '-1'); 6} 7 8let firstContentSection = document.querySelector('main > section:first-of-type'); 9if(firstContentSection){ 10 //firstContentSection.setAttribute('tabindex', '0'); 11} 12 13let footerSection = document.querySelector('#footer_area'); 14//footerSection.setAttribute('tabindex', '0'); 15 16let mainNavigationNAVTAG = document.querySelector('.main-navigation'); 17mainNavigationNAVTAG.setAttribute('tabindex', '0'); 18 19 20let mainNavigationFirstItem1 = document.querySelector('.main-navigation > ul > li:first-child > a'); 21let mainNavigationFirstLevel1 = document.querySelectorAll('.main-navigation > ul > li > a'); 22let mainNavigation1 = document.querySelector('.main-navigation'); 23 24mainNavigationFirstItem1.onfocus = function (){ 25 // console.log('focus TAB'); 26 mainNavigation1.classList.add('main-nav-is-Active-TAB'); 27 //mainNavigationFirstItem1.parentNode.classList.add('has-focus'); 28} 29 30 31let mainNavItemsNotFirtsLevel = document.querySelectorAll('.main-navigation > ul > li > ul a'); 32 33for (let i = 0; i < mainNavItemsNotFirtsLevel.length; i++){ 34 //mainNavItemsNotFirtsLevel[i].style.background='red' 35 mainNavItemsNotFirtsLevel[i].setAttribute('tabindex', '-1'); 36 //console.log(mainNavItemsNotFirtsLevel[i]); 37} 38 39 40 41 42document.addEventListener('keyup', (event) => { 43 44 let mainNavButtonIfKeyboard = document.querySelectorAll('.main-navigation .has-focus .isLevel2Item button'); 45 for (let i = 0; i < mainNavButtonIfKeyboard.length; i++) { 46 mainNavButtonIfKeyboard[i].setAttribute('tabindex', '-1'); 47 } 48 /* for (let i = 0; i < mainNavigationFirstLevel1.length; i++) { 49 mainNavigationFirstLevel1[i].onblur = function (){ 50 console.log('on blur') 51 mainNavigationFirstLevel1[i].parentNode.classList.remove('has-focus'); 52 } 53 }*/ 54 55 56 57 58 document.body.classList.add('key-is-used'); 59 60 var name = event.key; 61 var code = event.code; 62 var w = event.which; 63 var ww = event.keyCode; 64 65 66 67 68 69 let accessibilityDashboardFirstItem = document.querySelector('#sr-only-dashboard-info '); 70 //let accessibilityDashboardFirstItem = document.querySelector('.d-button.reset-all '); 71 let accessibilityDashboardFirstItemInfo = document.querySelector('#sr-only-dashboard-info'); 72 let accessibilityDashboardFirstAccordion = 73 document.querySelector('.accessibility-dashboard .dashboard-section:first-of-type summary'); 74 75 // main Navigation 76 77 let mainNavigation = document.querySelector('.main-navigation'); 78 let mainNavigationItems = document.querySelectorAll('.main-navigation > ul > li > a'); 79 let mainNavigationUlALL = document.querySelectorAll('.main-navigation > ul > li > a'); 80 81 let mainNavigationAnyItemFocused = document.querySelector('.main-navigation a:focus'); 82 let mainNavigationItemsFocused = document.querySelector('.main-navigation > ul > li > a:focus'); 83 let mainNavigationFirstItem = document.querySelector('.main-navigation > ul > li:first-child > a'); 84 let mainNavigationFirstItemFocused = document.querySelector('.main-navigation > ul > li:first-child > a:focus'); 85 let glideSlider = document.querySelector('.glide'); 86 87 // let level2Items = document.querySelectorAll('.main-navigation > ul > li.has-focus > ul > div > li a'); 88 let level2Items = document.querySelectorAll('.main-navigation > ul > li.has-focus > ul a'); 89 90 let level2ItemsFocused = document.querySelectorAll('.main-navigation > ul > li.has-focus > ul > div > li.has-focus-sub'); 91 92 let level2ItemsIfAnyHasFocus = document.querySelector('.main-navigation > ul > li.has-focus > ul > div > li > a:focus'); 93 let level2ItemsIfAnyHasFocusFirstDiv = document.querySelector('.main-navigation > ul > li.has-focus > ul > div:first-child > li > a:focus'); 94 let level2ItemsIsFirstChild = document.querySelector('.main-navigation > ul > li.has-focus > ul > div > li:first-child > a:focus'); 95 96 let level3ItemsIfAnyHasFocus = document.querySelector('.main-navigation > ul > li.has-focus > ul > div > li > ul > li > a:focus'); 97 98 99 100 101 102 // top Navigation 103 let toolbarNavigation = document.querySelector('.toolbar-navigation'); 104 let toolbarNavigationItems = document.querySelectorAll('.toolbar-navigation > ul > li > a'); 105 let toolbarNavigationAnyItemFocused = document.querySelector('.toolbar-navigation a:focus'); 106 let toolbarNavigationFirstItem = document.querySelector('.toolbar-navigation > ul > li:first-child > a'); 107 108 //let burgerButton = document.getElementById('help-asideMenu'); 109 let burgerButton = document.querySelector('#help-asideMenu.default-asideMenu'); 110 111 let key = event.code; 112 let key2 = event.key; 113 114 115 let resetMainNav = function (){ 116 console.log('reset main nav') 117 mainNavigation.classList.remove('main-nav-is-Active'); 118 mainNavigation.classList.remove('main-nav-is-Active-TAB'); 119 mainNavigationFirstItem.parentNode.classList.remove('has-focus'); 120 let showSR = document.querySelector('.show---sr'); 121 if(showSR){ 122 showSR.classList.remove('show---sr'); 123 } 124 //document.querySelector('.main-navigation > ul > li > ul').classList.remove('show---sr'); 125 let hasFocusLi = document.querySelector('.has-focus'); 126 if(hasFocusLi){ 127 hasFocusLi.classList.remove('has-focus'); 128 } 129 mainNavigationFirstItem.setAttribute('aria-expanded', 'false'); 130 } 131 132 var activeElement = document.activeElement; 133 var inputs = ['input', 'select', 'textarea']; 134 135 if (activeElement && inputs.indexOf(activeElement.tagName.toLowerCase()) !== -1) {
136 //console.log('yes inputs') 137 return false; 138 }else{ 139 //console.log('not inputs'); 140 141 if(key ==='Escape'){ 142 document.body.classList.remove('adhs'); 143 resetMainNav(); 144 } 145 146 if(key ==='KeyA'){ 147 // A is alway active no matter if keyboard is activated or not 148 document.querySelector('.accessibility').click(); 149 function focus1ItemOnDashboard(){ 150 accessibilityDashboardFirstItem.focus(); 151 } 152 function open1ItemOnDashboard(){ 153 154 //accessibilityDashboardFirstAccordion.click()Ã¥ 155 // console.log(accessibilityDashboardFirstAccordion); 156 } 157 setTimeout(focus1ItemOnDashboard, 1000); 158 setTimeout(open1ItemOnDashboard, 700); 159 } 160 161 162 let keyboardActivate = document.querySelector('.k---a'); 163 if(keyboardActivate){ 164 // ************************************************** 165 // ***** If Keyboard is activated - Single **** 166 // ************************************************** 167 168 if(key ==='KeyM'){ 169 mainNavigationFirstItem.focus(); 170 mainNavigation.classList.add('main-nav-is-Active'); 171 mainNavigationFirstItem.parentNode.classList.add('has-focus'); 172 mainNavigationFirstItem.setAttribute('aria-expanded', 'true'); 173 174 175 if(burgerButton){ 176 burgerButton.click(); 177 } 178 if(document.getElementById('no-glide')){ 179 document.querySelector('#no-glide').click(); 180 } 181 } 182 183 if(key ==='KeyT'){ 184 toolbarNavigationFirstItem.focus(); 185 resetMainNav(); 186 } 187 188 if(key ==='KeyC'){ 189 firstContentSection.focus(); 190 } 191 192 if(key ==='KeyF'){ 193 footerSection.focus(); 194 } 195 196 if(key ==='KeyU'){ 197 document.querySelector('.plus').click(); 198 } 199 200 if(key ==='KeyD'){ 201 document.querySelector('.minus').click(); 202 } 203 204 if(key ==='KeyQ'){ 205 document.querySelector('.minus_lh').click(); 206 } 207 208 if(key ==='KeyW'){ 209 document.querySelector('.plus_lh').click(); 210 } 211 212 } 213 } 214 215 216 if(event.altKey) { 217 var n = event.key; 218 var c = event.code; 219 //console.log(n) 220 221 if(c ==='KeyV'){ 222 document.querySelector('#keyboard_activate').click(); 223 } 224 225 if(c ==='KeyY'){ 226 document.querySelector('.reset-all').click(); 227 } 228 229 if(event.which == '89'){ 230 document.querySelector('.reset-all').click(); 231 } 232 233 let keyboardActivate = document.querySelector('.k---a'); 234 235 if(keyboardActivate){ 236 // ************************************************** 237 // ***** If Keyboard is activated ALT + ... **** 238 // ************************************************** 239 240 if(c ==='KeyG'){ 241 document.querySelector('#adhs-switch').click(); 242 resetMainNav(); 243 } 244 245 if(c ==='KeyJ'){ 246 document.querySelector('#changeNightMode').click(); 247 } 248 249 if(c ==='KeyK'){ 250 document.querySelector('#toggleImages').click(); 251 } 252 253 if(c ==='KeyO'){ 254 document.querySelector('#keyboard_visible').click(); 255 } 256 257 258 259 } 260 261 } 262 263 264 265 if(mainNavigationAnyItemFocused){ 266 mainNavigation.classList.add('main-nav-is-Active'); 267 }else if(!mainNavigationAnyItemFocused){ 268 mainNavigation.classList.remove('main-nav-is-Active'); 269 // mainNavigation.classList.remove('main-nav-is-Active-TAB'); 270 // mainNavigationFirstItem.parentNode.classList.remove('has-focus'); 271 // mainNavigationFirstItem.setAttribute('aria-expanded', 'false'); 272 } 273 274 275 if(toolbarNavigationAnyItemFocused){ 276 toolbarNavigation.classList.add('toolbar-nav-is-Active'); 277 }else if(!toolbarNavigationAnyItemFocused){ 278 toolbarNavigation.classList.remove('toolbar-nav-is-Active'); 279 } 280 281 function disableSliderArrows(){ 282 let isGlide = document.querySelector('.glide'); 283 if(isGlide){ 284 const sliders = document.querySelectorAll('.glide') 285 const conf = { 286 keyboard: false, 287 }
288 sliders.forEach(item => { 289 new Glide(item, conf).mount().destroy(); 290 }); 291 } 292 } 293 294 let typeRangeFocused = document.querySelector('input[type="range"]:focus'); 295 296 if(typeRangeFocused){ 297 // disableSliderArrows(); 298 } 299 300 let activeMainNAv = document.querySelector('.main-nav-is-Active'); 301 if(activeMainNAv){ 302 303 //disableSliderArrows(); 304 305 306 307 // LEVEL 1 ---- This method move focus to next item input on DOWN or to previous item input on UP arrow key press. 308 const focusableInputElements = mainNavigationItems; 309 //Creating an array from the node list 310 const focusable= [...focusableInputElements]; 311 //get the index of current item 312 const index = focusable.indexOf(document.activeElement); 313 // Create a variable to store the index of next item to be focussed 314 let nextIndex = 0; 315 316 317 318 319 // LEVEL 2 ---- This method move focus to next item input on DOWN or to previous item input on UP arrow key press. 320 const focusableInputElements_2level = level2Items; 321 //Creating an array from the node list 322 const focusable_2level= [...focusableInputElements_2level]; 323 //get the index of current item 324 const index_2level = focusable_2level.indexOf(document.activeElement); 325 // Create a variable to store the index of next item to be focussed 326 let nextIndex_2level = 0; 327 328 let parentHasFocus = document.querySelector('.has-focus > ul'); 329 let subActive = document.querySelector('.sub-active'); 330 331 332 let hasTabFocus = document.querySelector('.has-focus-Tab'); 333 if(hasTabFocus){ 334 if (event.keyCode === 40){ 335 //console.log(document.activeElement.parentNode) 336 //document.activeElement.parentNode.querySelector('ul').classList.add('open---sub'); 337 338 } 339 } 340 341 342 if (event.keyCode === 37) { 343 // left arrow 344 event.preventDefault(); 345 for (let i = 0; i < mainNavigationItems.length; i++){ 346 mainNavigationItems[i].parentNode.classList.remove('has-focus'); 347 } 348 for (let i = 0; i < mainNavigationUlALL.length; i++){ 349 mainNavigationUlALL[i].setAttribute('aria-expanded', 'false'); 350 } 351 352 353 354 355 if(document.querySelector('.open---sub')){ 356 document.querySelector('.open---sub').classList.remove('open---sub'); 357 } 358 359 nextIndex= index > 0 ? index-1 : 0; 360 focusableInputElements[nextIndex].focus(); 361 focusableInputElements[nextIndex].parentNode.classList.add('has-focus'); 362 let ulInFocusedElement = focusableInputElements[nextIndex].parentNode.querySelector('ul'); 363 if(ulInFocusedElement){ 364 ulInFocusedElement.setAttribute('aria-expanded', 'true'); 365 } 366 focusableInputElements[nextIndex].setAttribute('aria-expanded', 'true'); 367 if(subActive){ 368 subActive.classList.remove('sub-active'); 369 } 370 } 371 else if (event.keyCode === 39) { 372 // right arrow 373 event.preventDefault(); 374 for (let i = 0; i < mainNavigationItems.length; i++){ 375 mainNavigationItems[i].parentNode.classList.remove('has-focus'); 376 //mainNavigationItems[i].parentNode.querySelector('ul').classList.remove('open---sub'); 377 } 378 for (let i = 0; i < mainNavigationUlALL.length; i++){ 379 mainNavigationUlALL[i].setAttribute('aria-expanded', 'false'); 380 } 381 if(document.querySelector('.open---sub')){ 382 document.querySelector('.open---sub').classList.remove('open---sub'); 383 } 384 385 386 387 nextIndex= index+1 < focusable.length ? index+1 : index; 388 focusableInputElements[nextIndex].focus(); 389 focusableInputElements[nextIndex].parentNode.classList.add('has-focus'); 390 let ulInFocusedElement = focusableInputElements[nextIndex].parentNode.querySelector('ul'); 391 if(ulInFocusedElement){ 392 ulInFocusedElement.setAttribute('aria-expanded', 'true'); 393 } 394 focusableInputElements[nextIndex].setAttribute('aria-expanded', 'true'); 395
396 if(subActive){ 397 subActive.classList.remove('sub-active'); 398 } 399 } 400 401 if(event.keyCode === 40){ 402 // down arrow 403 event.preventDefault(); 404 405 if(parentHasFocus){ 406 parentHasFocus.classList.add('sub-active'); 407 for (let i = 0; i < level2ItemsFocused.length; i++){ 408 level2ItemsFocused[i].classList.remove('has-focus-sub'); 409 } 410 nextIndex_2level = index_2level+1 < focusable_2level.length ? index_2level+1 : index_2level; 411 focusableInputElements_2level[nextIndex_2level].focus(); 412 focusableInputElements_2level[nextIndex_2level].parentNode.classList.add('has-focus-sub'); 413 } 414 } 415 416 if(event.keyCode === 38){ 417 // up arow 418 // console.log('up') 419 event.preventDefault(); 420 if(parentHasFocus){ 421 for (let i = 0; i < level2ItemsFocused.length; i++){ 422 level2ItemsFocused[i].classList.remove('has-focus-sub'); 423 } 424 nextIndex_2level= index_2level > 0 ? index_2level-1 : 0; 425 focusableInputElements_2level[nextIndex_2level].focus(); 426 focusableInputElements_2level[nextIndex_2level].parentNode.classList.add('has-focus-sub'); 427 428 if(level2ItemsIsFirstChild){ 429 if(event.keyCode === 38){ 430 let parent_1_level = focusableInputElements_2level[nextIndex_2level].parentNode.parentNode.parentNode.parentNode; 431 let parent_1_level_a = parent_1_level.querySelector('a'); 432 let parent_1_level_ul = parent_1_level.querySelector('ul'); 433 parent_1_level_a.focus(); 434 //parent_1_level_ul.classList.add('close--ul') 435 } 436 } 437 } 438 } 439 440 let allMainNavLi = document.querySelectorAll('.main-navigation li'); 441 let allMainNavUl = document.querySelectorAll('.main-navigation li ul'); 442 let removeHasFocus = ()=> { 443 for (let i = 0; i < allMainNavLi.length; i++){ 444 allMainNavLi[i].classList.remove('has-focus'); 445 } 446 } 447 let setAriaExpandedFalse = ()=> { 448 for (let i = 0; i < allMainNavUl.length; i++){ 449 allMainNavUl[i].setAttribute('aria-expand', 'false'); 450 } 451 } 452 453 if(level2ItemsIfAnyHasFocus){ 454 if(event.keyCode === 39){ 455 event.preventDefault(); 456 //console.log('should find next a'); 457 // console.log(level2ItemsIfAnyHasFocus); 458 let parent_1_level = level2ItemsIfAnyHasFocus.parentNode.parentNode.parentNode.parentNode.nextElementSibling; 459 let parent_1_level_a = parent_1_level.querySelector('a'); 460 parent_1_level_a.focus() 461 removeHasFocus(); 462 setAriaExpandedFalse(); 463 parent_1_level_a.parentNode.classList.add('has-focus'); 464 parent_1_level_a.parentNode.querySelector('ul').setAttribute('aria-expanded', 'true'); 465 //parent_1_level_a.parentNode.querySelector('ul').classList.remove('close--ul'); 466 467 // console.log(parent_1_level) 468 } 469 470 if(event.keyCode === 37){ 471 event.preventDefault(); 472 // console.log('should find prev a'); 473 // console.log(level2ItemsIfAnyHasFocus); 474 let parent_1_level = level2ItemsIfAnyHasFocus.parentNode.parentNode.parentNode.parentNode.previousElementSibling; 475 let parent_1_level_a = parent_1_level.querySelector('a'); 476 parent_1_level_a.focus() 477 removeHasFocus(); 478 setAriaExpandedFalse(); 479 parent_1_level_a.parentNode.classList.add('has-focus'); 480 parent_1_level_a.parentNode.querySelector('ul').setAttribute('aria-expanded', 'true'); 481 482 // console.log(parent_1_level) 483 } 484 } 485 486 if (level3ItemsIfAnyHasFocus){ 487 if(event.keyCode === 39){ 488 // console.log('should find next a'); 489 //console.log(level3ItemsIfAnyHasFocus); 490 let parent_1_level = level3ItemsIfAnyHasFocus.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextElementSibling; 491 let parent_1_level_a = parent_1_level.querySelector('a'); 492 parent_1_level_a.focus() 493 removeHasFocus(); 494 setAriaExpandedFalse(); 495 parent_1_level_a.parentNode.classList.add('has-focus'); 496 parent_1_level_a.parentNode.querySelector('ul').setAttribute('aria-expanded', 'true'); 497 498 //console.log(parent_1_level) 499 } 500 501 if(event.keyCode === 37){ 502 // console.log('should find next a'); 503 // console.log(level3ItemsIfAnyHasFocus); 504 let parent_1_level = level3ItemsIfAnyHasFocus.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousElementSibling; 505 let parent_1_level_a = parent_1_level.querySelector('a'); 506 parent_1_level_a.focus() 507 removeHasFocus(); 508 setAriaExpandedFalse(); 509 parent_1_level_a.parentNode.classList.add('has-focus'); 510 parent_1_level_a.parentNode.querySelector('ul').setAttribute('aria-expanded', 'true'); 511 512 // console.log(parent_1_level) 513 } 514 } 515 516 517 /* TAB ********************* */ 518 519 let active = document.activeElement 520 let tabF = document.querySelectorAll('.tab--f'); 521 let hasFocusAD = document.querySelectorAll('.has-focus'); 522 523 if (event.keyCode === 9){ 524 for (let i = 0; i < tabF.length; i++){ 525 tabF[i].classList.remove('tab--f'); 526 } 527 for (let i = 0; i < hasFocusAD.length; i++){ 528 hasFocusAD[i].classList.remove('has-focus'); 529 hasFocusAD[i].querySelector('a').setAttribute('aria-expanded', 'false'); 530 } 531 active.classList.add('tab--f'); 532 533 } 534 let tab_f = document.querySelector('.tab--f'); 535 if(active.classList.contains('tab--f')){ 536 if (event.keyCode === 40){ 537 event.preventDefault(); 538 for (let i = 0; i < hasFocusAD.length; i++){ 539 hasFocusAD[i].classList.remove('has-focus'); 540 hasFocusAD[i].querySelector('a').setAttribute('aria-expanded', 'false'); 541 542 } 543 active.parentNode.classList.add('has-focus'); 544 active.setAttribute('aria-expanded', 'true'); 545 } 546 } 547 548 /* ********************** TAB*/ 549 550 551 552 553 if(name === "Escape"){ 554 document.querySelector('.main-nav-is-Active').classList.remove('main-nav-is-Active'); 555 let hasFocusE = document.querySelector('.has-focus') 556 if(hasFocusE){ 557 hasFocusE.classList.remove('has-focus'); 558 hasFocusE.querySelector('a').setAttribute('aria-expanded', 'false'); 559 } 560 for (let i = 0; i < mainNavigationUlALL.length; i++){ 561 mainNavigationUlALL[i].setAttribute('aria-expanded', 'false'); 562 } 563 let subIsActiveE = document.querySelector('.sub-active'); 564 if(subIsActiveE){ 565 subIsActiveE.classList.remove('sub-active'); 566 } 567 let allElements = document.querySelectorAll('*'); 568 for (let i = 0; i < allElements.length; i++){ 569 allElements[i].blur(); 570 } 571 572 if(document.getElementById('yes-glide')){ 573 document.getElementById('yes-glide').click(); 574 } 575 if(document.querySelector('.accessibility-dashboard .close-it')){ 576 document.querySelector('.accessibility-dashboard .close-it').click(); 577 } 578 if(document.querySelector('.accessibility-dashboard .close-it')){ 579 document.querySelector('.accessibility-dashboard .close-it').click(); 580 } 581 582 } 583 } 584 585 586 587 /*Toolbar Navigation*/ 588 let activeToolbarNav = document.querySelector('.toolbar-nav-is-Active'); 589 if(activeToolbarNav){ 590 591 // disableSliderArrows(); 592 593 // LEVEL 1 ---- This method move focus to next item input on DOWN or to previous item input on UP arrow key press. 594 const focusableInputElements = toolbarNavigationItems; 595 //Creating an array from the node list 596 const focusable= [...focusableInputElements]; 597 //get the index of current item 598 const index = focusable.indexOf(document.activeElement); 599 // Create a variable to store the index of next item to be focussed 600 let nextIndex = 0; 601 602 if (event.keyCode === 37) { 603 nextIndex= index > 0 ? index-1 : 0; 604 focusableInputElements[nextIndex].focus(); 605 } 606 else if (event.keyCode === 39) { 607 608 nextIndex= index+1 < focusable.length ? index+1 : index; 609 focusableInputElements[nextIndex].focus(); 610 } 611 612 613 } 614 /*Toolbar Navigation*/ 615 616 617 618 if(name === 'Escape'){ 619 620 if(document.querySelector('.accessibility-dashboard .close-it')){ 621 document.querySelector('.accessibility-dashboard .close-it').click(); 622 } 623 } 624 625 626 627}, false); 628 629 630 631document.addEventListener('keydown', (event) => { 632 let mainNavIsActive = document.querySelector('.main-navigation.main-nav-is-Active'); 633 if(mainNavIsActive){ 634 if (event.keyCode === 37){ 635 event.preventDefault(); 636 } 637 if (event.keyCode === 39){ 638 event.preventDefault(); 639 } 640 if (event.keyCode === 38){ 641 event.preventDefault(); 642 } 643 if (event.keyCode === 40){ 644 event.preventDefault(); 645 } 646 } 647 648 var code = event.code; 649 650 // quick access 651 652 let link1_f = document.querySelector('#openDashboard:focus'); 653 let link2_f = document.querySelector('#goToMainNav:focus'); 654 let link3_f = document.querySelector('#goToContent:focus'); 655 let link4_f = document.querySelector('#openKeys:focus'); 656 let linkFooter_f = document.querySelector('#goToFirst:focus'); 657 658 let openDash = function (){ 659 document.querySelector('.accessibility').click(); 660 } 661 let goToMainNavigation = function (){
662 mainNavigationNAVTAG.focus() 663 } 664 let keyboardVisible = function (){ 665 document.querySelector('#keyboard_visible').click() 666 } 667 668 if(link1_f){ 669 if(code === 'Enter'){ 670 setTimeout( 671 openDash 672 , 1000 673 ) 674 } 675 } 676 if(link2_f){ 677 if(code === 'Enter'){ 678 setTimeout( 679 goToMainNavigation 680 , 1000 681 ) 682 } 683 } 684/* if(link3_f){ 685 if(code === 'Enter'){ 686 firstContentSection.focus(); 687 } 688 }*/ 689 if(link4_f){ 690 if(code === 'Enter'){ 691 setTimeout( 692 keyboardVisible 693 , 1000 694 ) 695 } 696 } 697 if(linkFooter_f){ 698 if(code === 'Enter'){ 699 // console.log('go to first') 700 setTimeout( 701 document.querySelector('#openDashboard').focus() 702 , 1000); 703 704 } 705 } 706 707 if(code === 'Escape'){ 708 709 if(document.querySelector('.accessibility-dashboard .close-it')){ 710 document.querySelector('.accessibility-dashboard .close-it').click(); 711 } 712 } 713 714 715}, false) 716 717 718 719document.addEventListener('mousedown', (event) => { 720 document.body.classList.remove('key-is-used'); 721}) 722 723 724let accessibilityMenuItem = document.querySelector('.accessibility'); 725if(accessibilityMenuItem){ 726 727 let accessibilityDashboard = document.querySelector('.accessibility-dashboard') 728 accessibilityMenuItem.onclick = (e) => { 729 e.preventDefault() 730 accessibilityDashboard.classList.toggle('show'); 731 //let accessibilityDashboardFirstItem = document.querySelector('.d-button.reset-all '); 732 let accessibilityDashboardFirstItem = document.querySelector('#sr-only-dashboard-info'); 733 function focus1ItemOnDashboard(){ 734 accessibilityDashboardFirstItem.focus(); 735 } 736 setTimeout(focus1ItemOnDashboard, 1000); 737 } 738} 739 740 741// let keyboardActiveBtn = document.querySelector('#keyboard_activate'); 742// if(keyboardActiveBtn){ 743// keyboardActiveBtn.onclick = (e) => { 744// document.body.classList.toggle('k---a') 745// } 746// } 747 748 749 750let mainNanvButtonSROnly = document.querySelectorAll('.main-navigation-toolbar .btn---sr'); 751if(mainNanvButtonSROnly){ 752 for (let i = 0; i < mainNanvButtonSROnly.length; i++){ 753 mainNanvButtonSROnly[i].onclick = function (e){ 754 e.preventDefault(); 755 let currentDropWrap = e.target.parentNode.parentNode.querySelector('ul'); 756 //console.log(e.target); 757 let dropWrap = document.querySelectorAll('.main-navigation > ul > li > ul'); 758 let aInRichMenu = document.querySelectorAll('.menu-column a'); 759 let buttonInRichMenu = document.querySelectorAll('.menu-column .open-3-level'); 760 if(currentDropWrap.classList.contains('show---sr')){ 761 dropWrap[i].classList.remove('show---sr'); 762 currentDropWrap.classList.remove('show---sr'); 763 for (let i = 0; i < aInRichMenu.length; i++){ 764 aInRichMenu[i].setAttribute('tabindex', '-1'); 765 } 766 for (let i = 0; i < buttonInRichMenu.length; i++){ 767 buttonInRichMenu[i].setAttribute('tabindex', '0'); 768 } 769 }else{ 770 for (let i = 0; i < dropWrap.length; i++){ 771 dropWrap[i].classList.remove('show---sr'); 772 //console.log(dropWrap[i]) 773 } 774 currentDropWrap.classList.add('show---sr'); 775 currentDropWrap.focus(); 776 for (let i = 0; i < aInRichMenu.length; i++){ 777 aInRichMenu[i].setAttribute('tabindex', '0'); 778 } 779 for (let i = 0; i < buttonInRichMenu.length; i++){ 780 buttonInRichMenu[i].setAttribute('tabindex', '-1'); 781 } 782 } 783 784 //console.log(e.target.parentNode.querySelector('.drop-wrapp')) 785 } 786 } 787} 788
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.