1$(document).ready(function(){ 2// Cookies 3 // Shows Cookie Hint 4 // - Shows Cookie Hint if Cookie Consent hasn't been stored 5 function isCookiePresent(cookieName) { 6 const cookies = document.cookie.split(';'); 7 return cookies.some(cookie => cookie.trim().startsWith(`${cookieName}=`)); 8 } 9 10 // - Shows/hides Cookie Hint based on the tx_cookies-consent Cookie being present 11 if (!isCookiePresent('tx_cookies-consent')) { 12 $('#tx_cookies_inner').addClass('show'); 13 $('#tx_cookies_showPermanent').removeClass('show'); 14 } 15 16 // Moves the Cookie Hint inside .cookies-btn container if both elements exist 17 const cookieBtn = $('#tx_cookies'); 18 const cookieBtnTarget = $('.cookies-btn'); 19 20 if (cookieBtn.length && cookieBtnTarget.length) { 21 cookieBtn.appendTo(cookieBtnTarget); 22 23 // - Shows the Cookie Settings Button 24 $(".cookieSettings-btn").show(); 25 } 26 27 // Reloads the page when Cookies are accepted 28 $(document).on('click', '#tx_cookies_accept', function () { 29 window.location.reload(); 30 }); 31 32 // Deletes Cookies 33 // - Sets Cookie Prefixes that are to be deleted 34 const cookiePrefixes = [ 35 '_ga', 36 '_ga_', 37 '_gid', 38 '_gat', 39 '_clck', 40 '_clsk', 41 ]; 42 43 // - Iterates over all cookies on the current and host domain and expires those matching the Cookies Prefixes 44 function deletesCookies() { 45 const cookies = document.cookie.split(';'); 46 47 cookies.forEach(cookie => { 48 const [rawCookieName] = cookie.split('='); 49 const cookieName = rawCookieName.trim(); 50 51 if (cookiePrefixes.some(cookiePrefix => cookieName === cookiePrefix || cookieName.startsWith(cookiePrefix))) { 52 // - Targets current domain and host domain and expires the Cookies 53 document.cookie = `${cookieName}=; Max-Age=0; path=/;`; 54 document.cookie = `${cookieName}=; Max-Age=0; path=/; domain=${location.hostname};`; 55 } 56 }); 57 } 58 59 // - Deletes Cookies when Cookies are disabled 60 $(document).on('click', '#tx_cookies_disable', function () { 61 // -- Remembers analytics are disabled 62 sessionStorage.setItem('analyticsDisabled', '1'); 63 64 // -- Deletes Cookies 65 deletesCookies(); 66 67 // -- Reloads the page 68 window.location.reload(); 69 }); 70 71 // - Prevents Cookies from returning on page reload 72 if (sessionStorage.getItem('analyticsDisabled') === '1') { 73 // -- Deletes Cookies 74 deletesCookies(); 75 76 // -- Removes from Session Storage so it only runs once 77 sessionStorage.removeItem('analyticsDisabled'); 78 } 79 80// Search 81 // Adds an autocomplete attribute 82 $("#ke_search_sword").attr("autocomplete", "on"); 83 // Adds a role attribute for accessibility 84 $("#kesearch_num_results").attr("role", "status" ); 85 // Adds hidden legend and labels for accessibility 86 $(".kesearch_searchbox").prepend('<legend class="visually-hidden">Search our website</legend>'); 87 $(".kesearchbox").prepend('<label for="ke_search_sword" class="visually-hidden">Search our website</label>'); 88 89 // Changes placeholder text 90 $(".kesearchbox input").attr("placeholder", "Search"); 91 92 // Changes the Find button to a search icon 93 $('.submitbutt input').replaceWith(function () { 94 return "<input id='image' type='image' alt='Search the site' src='/typo3conf/ext/thisbase_sitepackage/Resources/Public/Images/Icons/Search-icon.png'>"; 95 }); 96 97 // Removes next and prev buttons 98 $('.kesearch_pagebrowser .next').remove(); 99 $('.kesearch_pagebrowser .prev').remove(); 100 101// Powermail Forms 102 // Removes h3 heading from form 103 $('.tx-powermail h3').remove(); 104 105 // Changes label on select, ratio and checkbox on the form to <p> tags for accessibility 106 $('.powermail_fieldwrap_type_check .powermail_label, .powermail_fieldwrap_type_radio .powermail_label').replaceWith(function () { 107 return "<p>" + $(this).html() + "</p>"; 108 }); 109 110 // Adds autocomplete attribute on Powermail inputs, textarea and select boxes 111 $('.powermail_input, .powermail_textarea, .powermail_select').attr("autocomplete", "on"); 112 113 // Fixes autocomplete attribute on New Powermail HP Field for accessibility 114 $('.tx-powermail input[autocomplete*="new-powermail-hp"]').attr("autocomplete", "on"); 115 116 // Hides label from assistive technologies as the associated input is hidden 117 $('label[for*="powermail_hp"]').attr("aria-hidden", "true"); 118 119 // Removes aria required from Radio/Check buttons and Date Picker for accessibility 120 $('.powermail_radio, .powermail_checkbox, .powermail_date').removeAttr("aria-required"); 121 122 // Changes Powermail Confirmation h1 to a <span> 123 $('.powermail_confirmation h1').replaceWith(function () { 124 return "<span><strong>" + $(this).html() + "</strong></span>"; 125 }); 126 127 // Changes Next button value to say Submit on Powermail Confirmation 128 $(".tx-powermail input[data-powermail-form-ajax=submit]").attr("value", "Submit"); 129 130 // Adds table header to Powermail submission tables for accessibility 131 $('.tx-powermail table').prepend('<thead><tr><th scope="col">Question</th><th scope="col">Your answer</th></tr></thead>'); 132 133 // Overrides button text on Powermail split pages 134 $('.powermail_tab_navigation .btn-primary').text("Next"); 135 $('.powermail_tab_navigation .btn-warning').text("Previous"); 136 137 // Replaces forms with text (when mail issues happen) 138 // $('.tx-powermail').replaceWith(function () { 139 // return "<p><strong>Please note:</strong> We are currently experiencing issues with our mail server. Whlist the issue is being resolved, the form on this page has been hidden. Sorry for any inconvenience this may cause.</p>"; 140 // }); 141 142// Front-End Login 143 // Changes the header from h3 to h2 144 $('.frame-type-felogin_login h3').replaceWith(function () { 145 return "<h2>" + $(this).html() + "</h2>"; 146 }); 147 148// News 149 // Adds alt tag to News Placeholder image 150 $("img[src='/typo3conf/ext/thisbase_sitepackage/Resources/Public/
150Images/Placeholders/news.png']").attr('alt', 'News Placeholder'); 151 152 // --- List View 153 // Moves the image out of the <a> tag 154 $('.news-list-view .news-img-wrap a').contents().unwrap(); 155 156 // Removes next and previous buttons 157 $('.news-list-view .f3-widget-paginator .next').remove(); 158 $('.news-list-view .f3-widget-paginator .previous').remove(); 159 160 // Wraps the children of .new-list-view in a row 161 $(".news-list-view").children().wrapAll('<div class="row"></div>'); 162 163 // --- Details view 164 // Applies styles to only the details page 165 if ($(".newsDetail")[0]){ 166 // - Converts .newsTitle into a <h1> 167 $('.news-single .newsTitle').replaceWith(function () { 168 return "<h1>" + $(this).html() + "</h1>"; 169 }); 170 171 // - Moves article title and teaser text to the banner 172 $( "#banner h1" ).replaceWith( $(".news-single h1") ); 173 $( "#banner p" ).replaceWith( $(".news-single .teaser-text p") ); 174 175 // - Replaces last breadcrumb with the article name from the banner. Fall back of using Article if #banner h1 isn't present 176 $("#breadcrumb li:last-child").replaceWith('<li class="breadcrumb-item"><span property="name">' + ($("#banner h1").first().text() || "Article") + '</span></li>').text(); 177 } 178 179 // Removes whitespace in the empty News elements 180 if ($('.news-text-wrap, .news-related-wrap').text().trim() === '') { 181 $('.news-text-wrap, .news-related-wrap').html(''); 182 } 183 184// Glossary 185 // Removes the active class on the 'All' link if a Glossary letter is active 186 if (window.location.pathname.includes('/glossary-by-letter/')) { 187 $('#glossary #allLink').removeClass('active'); 188 } 189 190 // --- Details view 191 // Applies styles to only the details page 192 if ($(".glossaryDetail")[0]){ 193 // - Moves Glossary header to the banner 194 $("#banner h1").replaceWith($(".tx-glossary2 h1").show().css("display", "block")); 195 196 // - Replaces last breadcrumb with the Glossary header from the banner. Fall back of using Article if #banner h1 isn't present 197 $("#breadcrumb li:last-child").replaceWith('<li class="breadcrumb-item"><span property="name">' + ($("#banner h1").first().text() || "Show") + '</span></li>').text(); 198 } 199 200//Delays 201 // Shows Search 202 $(".tx-kesearch-pi1").show(); 203 204}); //end of document ready
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.