1var webpublic = { 2 focusableElementsString: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]', 3 currentFocus: '', 4 init: function () { 5 6 $('#btnRechercheBis, #btnRechercheTriple').on('click', function () { 7 $('#btnRecherche').trigger('click', [true]); 8 return false; 9 }); 10 11 $('#btnRecherche, #btnRechercheBis, #btnRechercheTriple').on('click', function () { 12 $('#blocRecherche #searchString').focus(); 13 }); 14 15 var height = $('.accueil .TPL_AUTOPROMO .TPL_RECHERCHE').outerHeight(); 16 $('.accueil .TPL_AUTOPROMO').css('margin-bottom', height / 2 + 'px'); 17 18 $('.TPL_AGENDAALAUNE, #linkBar, .TPL_ACCESRAPIDE, .TPL_ACTUALITELISTE, .TPL_AGENDALISTE, .TPL_ANNUAIRELISTE, .TPL_ACTUALITEALAUNE, .TPL_ENAVANT, .TPL_RECHERCHE .listeBloc, .liensBas, #reseauxSociaux, #menu').find('a').on('focus', function () { 19 $(this).closest('.item, .accs').addClass('focus'); 20 }).on('blur', function () { 21 $(this).closest('.focus').removeClass('focus'); 22 }); 23 24 25 26 }, 27 checkFlashInfo: function (nb) { 28 $('#btnCtrlFlashInfo').on('click', function (event, triggered) { 29 if (Cookies.get('C_FLASHINFO')) { 30 if (nb > 1) { 31 $('#flashInfoContainer').slick('resize'); 32 } 33 $('#flashInfoContainer').css('max-height', 'none'); 34 Cookies.remove('C_FLASHINFO'); 35 } else if (!triggered) { 36 Cookies.set('C_FLASHINFO', 1); 37 } 38 }); 39 if (!Cookies.get('C_FLASHINFO')) { 40 $('#btnCtrlFlashInfo').trigger('click', [true]); 41 } 42 }, 43 triggerMenuBig: function () { 44 $('#barreHaute #BH-partieDroite').prepend($('#reseauxSociaux')).prepend($('#liensHaut')); 45 $('#bandeauHaut .menuContainer').append($('#blocRecherche')); 46 $("ul.niv3").each(function() { 47 const idNiv3 = $(this).attr('id'); 48 49 $("ul.niv2 > li > a[aria-controls]").each(function() { 50 const ariaControls = $(this).attr("aria-controls"); 51 52 if (ariaControls === idNiv3) { 53 $(`#${idNiv3}`).insertAfter($(this).closest('ul.niv2')); 54 } 55 }); 56 }); 57 58 }, 59 triggerMenuSmall: function () { 60 $('#menu .inner').prepend($('#blocRecherche')).append($('#liensHaut')).append($('#reseauxSociaux')); 61 $('#btnRechercheBis').insertBefore($('#btnMenuMobile')); 62 $('#btnLangue').prependTo($('#menu ul.niv1')); 63 $("ul.niv3").each(function() { 64 var ariaControlsId = $(this).attr("id"); 65 $(this).insertAfter($(`a[aria-controls="${ariaControlsId}"]`)); 66 }); 67 }, 68 checkFocus: function (obj, evt) { 69 // if tab or shift-tab pressed 70 if (evt.which == 9) { 71 72 // get list of all children elements in given object 73 var o = obj.find('*'); 74 75 // get list of focusable items 76 var focusableItems; 77 focusableItems = o.filter(webpublic.focusableElementsString).filter(':visible'); 78 // get currently focused item 79 webpublic.currentFocus = jQuery(':focus'); 80 81 // get the number of focusable items 82 var numberOfFocusableItems; 83 numberOfFocusableItems = focusableItems.length; 84 85 // get the index of the currently focused item 86 var focusedItemIndex; 87 webpublic.focusedItemIndex = focusableItems.index(webpublic.currentFocus); 88 89 if (evt.shiftKey) { 90 //back tab 91 // if focused on first item and user preses back-tab, go to the last focusable item 92 if (webpublic.focusedItemIndex == 0) { 93 focusableItems.get(numberOfFocusableItems - 1).focus(); 94 evt.preventDefault(); 95 } 96 } else { 97 //forward tab 98 // if focused on the last item and user preses tab, go to the first focusable item 99 if (webpublic.focusedItemIndex == numberOfFocusableItems - 1) { 100 focusableItems.get(0).focus(); 101 evt.preventDefault(); 102 } 103 } 104 } 105 }, 106 checkFocusOut: function (obj, evt) { 107 // if escape pressed 108 if (evt.which == 27) { 109 // get list of all children elements in given object 110 var o = obj.find('*'); 111 112 // get list of focusable items 113 var cancelElement; 114 cancelElement = o.filter('.popinClose.js_selected'); 115 116 // close the modal window 117 cancelElement.click(); 118 evt.preventDefault(); 119 evt.stopPropagation(); 120 } 121 } 122}; 123$(webpublic.init);
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.