PageSourceSearch

https://129.go.kr/resources/js/app/darkModeCommon.js

js 129.go.kr collected 2026-10-01 07:11:29 UTC 1,710 bytes, 52 lines download raw bytes

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.