1function getCookie(cookieName) { 2 cookieName = `${cookieName}=`; 3 let cookieData = document.cookie; 4 5 let cookieValue = ""; 6 let start = cookieData.indexOf(cookieName); 7 8 if (start !== -1) { 9 start += cookieName.length; 10 let end = cookieData.indexOf(";", start); 11 if (end === -1) end = cookieData.length; 12 cookieValue = cookieData.substring(start, end); 13 } 14 15 return unescape(cookieValue); 16} 17 18//ì¤íì ë¤í¬ëª¨ë 19function fn_colorMode(){ 20 var colorType = getCookie('color-them'); 21 // ìì¤í ìì´ ë¤í¬ì¼ë 22 if(window.matchMedia('(prefers-color-scheme: dark)').matches){ 23 document.body.classList.add('dark'); 24 document.querySelector('html').setAttribute('data-bs-theme', 'dark'); 25 } 26 27 // ì¿ í¤ë¡ ë¤í¬ëª¨ë ì§ì íì ë 28 if(colorType == 'dark'){ 29 document.body.classList.remove('adaptive-color-scheme'); 30 document.body.classList.add('dark'); 31 document.querySelector('html').setAttribute('data-bs-theme', 'dark'); 32 } else if(colorType == 'light'){ 33 document.body.classList.remove('adaptive-color-scheme'); 34 document.body.classList.remove('dark'); 35 document.querySelector('html').removeAttribute('data-bs-theme'); 36 } 37} 38 39fn_colorMode(); 40 41//ë¤í¬ëª¨ë 42function fn_colorType(){ 43 var colorType = getCookie('color-them'); 44 var systemMode = document.body.classList.contains('adaptive-color-scheme'); 45 var bodyColor = document.body.classList.contains('dark'); 46 47 if(colorType == 'dark' || (systemMode && !bodyColor)){ 48 setCookie('color-them','light',7); 49 } else { 50 setCookie('color-them','dark',7); 51 } 52}
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.