1var $ = jQuery; 2 3(function ($) { 4 $(function () { 5 /* ----------------------------------------------------------- 6 Konstanten & Startwerte 7 ----------------------------------------------------------- */ 8 const root = document.documentElement; 9 const CONTRAST_KEY = 'sh-contrast-mode'; 10 const TEXTSIZE_KEY = 'sh-text-large'; 11 /* ----------------------------------------------------------- 12 Toggle-Funktionen 13 ----------------------------------------------------------- */ 14 function setContrast(on) { 15 const $el = $('.style-helper[data-type="contrast"]'); 16 $el.find('.style-switch').toggleClass('style-switch-active', on); 17 $el.attr('aria-pressed', on ? 'true' : 'false'); 18 document.documentElement.classList.toggle('sh-contrast-mode', on); 19 localStorage.setItem(CONTRAST_KEY, on ? '1' : '0'); 20 } 21 function setTextSize(on) { 22 const $el = $('.style-helper[data-type="textsize"]'); 23 $el.find('.style-switch').toggleClass('style-switch-active', on); 24 $el.attr('aria-pressed', on ? 'true' : 'false'); 25 document.documentElement.classList.toggle('sh-text-large', on); 26 localStorage.setItem(TEXTSIZE_KEY, on ? '1' : '0'); 27 } 28 /* ----------------------------------------------------------- 29 Status beim Laden wiederherstellen 30 ----------------------------------------------------------- */ 31 setContrast(localStorage.getItem(CONTRAST_KEY) === '1'); 32 setTextSize(localStorage.getItem(TEXTSIZE_KEY) === '1'); 33 /* ----------------------------------------------------------- 34 Delegierter Click-Handler (beide Buttons) 35 ----------------------------------------------------------- */ 36 $(document).on('click', '.style-helper', function () { 37 const type = $(this).data('type'); 38 if (type === 'contrast') { 39 const next = localStorage.getItem(CONTRAST_KEY) !== '1'; 40 setContrast(next); 41 42 } else if (type === 'textsize') { 43 const next = localStorage.getItem(TEXTSIZE_KEY) !== '1'; 44 setTextSize(next); 45 } 46 }); 47 }); 48})(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.