1(function ($) { 2 3 // Skip Link ie11 Fix 4 $('.skip-link').click(function (e) { 5 e.preventDefault(); 6 var skipLinkTarget = $(this).attr('href'); 7 if($(skipLinkTarget).length){ 8 // If the skip link's target exist, but no focus div is located, create a div to focus on just inside of the target 9 if(!$('#skip-link-focus').length){ 10 $("<div id='skip-link-focus' tabindex='-1'></div>").prependTo(skipLinkTarget); 11 } 12 // Focus on the rendered skip link target element 13 $('#skip-link-focus').focus(); 14 }else{ 15 // If the skip link target does not exist, focus on the first heading 16 $(':header:first').attr('tabindex', '-1').focus(); 17 } 18 }); 19 20 $('.page-link').click(function () { 21 $('.page-link').attr('tabindex', '-1'); 22 }); 23 24 // Empty Links using #'s 25 $('a[href="#"]').click(function (e) { 26 e.preventDefault ? e.preventDefault() : (e.returnValue = false); 27 }); 28 29 $('.page-item a').click(function (e) { 30 e.preventDefault ? e.preventDefault() : (e.returnValue = false); 31 }); 32 33 jQuery.extend(jQuery.expr[':'], { 34 focusable: function (el, index, selector) { 35 var $element = $(el); 36 return $element.is(':input:enabled, a[href], area[href], object, [tabindex]') && !$element.is(':hidden'); 37 } 38 }); 39 40 function focusOnElement($element) { 41 if (!$element.length) { 42 return; 43 } 44 if (!$element.is(':focusable')) { 45 // add tabindex to make focusable and remove again 46 $element.attr('tabindex', -1).on('blur focusout', function () { 47 $(this).removeAttr('tabindex'); 48 }); 49 } 50 $element.focus(); 51 } 52 53 $(document).ready(function () { 54 55 // Given a window.location.hash, return its value with all non-ID attribute characters removed (any chars not alpha, numerical, hyphen, or underscore) 56 function sanitizeLocationHash(hash) { 57 var sanitizedHash = ''; 58 if(hash && 0 < hash.length){ 59 sanitizedHash = hash.match(/[A-Za-z0-9\-\_]/g).join(''); 60 } 61 return sanitizedHash; 62 }; 63 64 // If there is a window.location.hash available and it is valid, ensure the element obtains focus 65 function focusOnLocationHash() { 66 var locationHash = sanitizeLocationHash(window.location.hash); 67 if(locationHash && 0 < locationHash.length && $('#' + locationHash).length){ 68 focusOnElement($('#' + locationHash)); 69 } 70 }; 71 72 // On page load, if there is a window.location hash, ensure it obtains focus 73 focusOnLocationHash(); 74 75 // if the hash has been changed (activation of an in-page link) 76 $(window).bind('hashchange', function () { 77 focusOnLocationHash(); 78 }); 79 80 // BUG #5286 - Displaying languague attribute on the conte and title and link where Spanis Language is used 81 if (window.location.href.split('/')[window.location.href.split('/').length - 1] == "adjustments-to-district-office-operations") { 82 if ($(".component.content a[href$='/las-oficinas-del-distrito-estan-abiertas']").length) { 83 $(".component.content a[href$='/las-oficinas-del-distrito-estan-abiertas']").attr('lang', 'es'); 84 } 85 } 86 87 if (window.location.href.split('/')[window.location.href.split('/').length - 1] == "las-oficinas-del-distrito-estan-abiertas") { 88 if ($('.component.container.page-title.corporate').length) { 89 $('.component.container.page-title.corporate').attr('lang', 'es'); 90 } 91 92 if (($('.component.container.page-title.corporate').next(".component.content")).length) { 93 $('.component.container.page-title.corporate').next(".component.content").attr('lang', 'es'); 94 } 95 96 } 97 // BUG #5286 fix ended 98 99 100 if ($('.errorMessage').length) { 101 $('.errorMessage').focus(); 102 } 103 104 105 // Handle email request verification in page notifications 106 function handleEmailRequestVerification() { 107 fetch("/api/sitecore/RegistrationForm/SubmitPlayerAccountVeritication", { 108 method: 'GET', 109 headers: { 110 'Content-Type': 'application/json', 111 } 112 }) 113 .then(response => { 114 if (!response.ok) { 115 throw new Error('Network response was not ok'); 116 } 117 118 if (response.status !== 200) { 119 return false; 120 } 121 }) 122 .catch(error => { 123 console.error('Error:', error); 124 }); 125 } 126 127 // Some pages fetch notifications after page load, so we must attach the event after the fetch is done and the event is triggered 128 window.addEventListener('PageNotificationsUpdated', function () { 129 $("#requestVerification").click(function () { 130 handleEmailRequestVerification(); 131 }); 132 });
133 134 // Other pages include notifications statically, so an event will not be emitted. 135 $("#requestVerification").click(function () { 136 handleEmailRequestVerification(); 137 }); 138 }); 139 140 $('.radio-1').on('click', function (e) { 141 $('.radio-label-1').attr('aria-checked', 'false'); 142 if (this.checked) { 143 $(e.target).next('.radio-label-1').attr('aria-checked', 'true'); 144 } 145 }); 146 147 $('.radio-2').on('click', function (e) { 148 $('.radio-label-2').attr('aria-checked', 'false'); 149 if (this.checked) { 150 $(e.target).next('.radio-label-2').attr('aria-checked', 'true'); 151 } 152 }); 153 154 155 // Remove Title Attibute from Breadcrumbs 156 $(".breadcrumb-item a").removeAttr("title"); 157})(jQuery);
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.