PageSourceSearch

https://edu.kpanet.or.kr/js/popup/popupUtil.js;jsessionid=ABBE8FF2B2463D03C885822C755F01AC

js kpanet.or.kr collected 2026-10-02 10:52:32 UTC 4,195 bytes, 115 lines download raw bytes

1function createHomeOpenPopup(popupList) {
2
3    popupList.forEach((elem, idx) => {
4
5        // 쿠키 조회
6        const cookies = document.cookie.split(';');
7        const cookieNames = cookies.map(cookie => {
8            return cookie.split('=')[0].trim();
9        });
10
11        const result = cookieNames.includes('popupCookie' + elem.popSeq);
12
13        // 쿠키가 없을 경우만 창 띄움
14        if (!result) {
15            fnOpenWindowPopup(elem, idx);
16        }
17
18    });
19
20}
21
22/***************************************************
23 * 이미지 사이즈 조회
24 * *************************************************/
25function fnImageSize(filePath) {
26
27    const img = new Image();
28
29    // img.src = "https://hp.health.or.kr" + filePath; // 개발
30    img.src = filePath; // 운영
31
32    function promiseSize() {
33        return new Promise((resolve, reject) => {
34
35            img.onload = function () {
36                resolve({
37                    "width": this.width,
38                    "height": this.height
39                });
40            }
41            img.onerror = function () {
42                reject("이미지 로드 실패");
43            }
44        });
45    }
46
47    return promiseSize().then(result => {
48
49        return result;
50    }).catch(err => {
51        console.error(err);
52    });
53
54}
55
56//모바일기기이름을 담은 배열
57const mobile_keys = new Array('iPhone','iPad','Android','BlackBerry','Windows Phone', 'Windows CE','LG','MOT','SAMSUNG','SonyEricsson','Nokia');
58
59/***************************************************
60 * 윈도우 팝업창 생성
61 * *************************************************/
62async function fnOpenWindowPopup(elem, idx) {
63
64    const url = "testPopup";
65    const name = "windowPopup";
66
67    let filePath;
68    let isMobile = false;
69
70    for(let i in mobile_keys){
71        if(navigator.userAgent.match(mobile_keys[i])){
72            isMobile = true;
73        }
74    }
75
76    if (isMobile) {
77        filePath = "https://edu.kpanet.or.kr" + elem.moAttachFilePath;
78    } else {
79        filePath = "https://edu.kpanet.or.kr" + elem.pcAttachFilePath;
80    }
81
82    // 이미지 경로를 통해 이미지 사이즈 조회
83    const sizePromise = fnImageSize(filePath);
84    const sizeObj = await sizePromise;
85
86    const windowWidth = 450;
87    // 현재 화면 크기에 비례
88    const calHeight = ((sizeObj.height * windowWidth) / sizeObj.width) + 30;
89
90    const xOffset = 750 - (idx * 150);
91    const yOffset = 100;
92    // const left = (idx+1) * 150;
93    const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
94    const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
95    const calWidth = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
96    const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
97    const newLeft = ((calWidth / 2) - xOffset) + dualScreenLeft;
98    const newTop = ((height / 2) - yOffset) + dualScreenTop;
99
100    // 이미지의 높이가 윈도우 창보다 작을 경우 => 윈도우 사이즈 조절
101    let option = `width = ${windowWidth}, height = ${calHeight}, top = ${newTop}, left = ${newLeft}`;
102
103    let pattern = /(?:https?:\/\/)?(?:www\.)?([^\s\/?#.]+\.[^\s\/?#.:]+|http:[^\s\/?#.:]+)(?:\:[0-9]+)?(?:\/[^\s]*)?/g;
104    if (elem.linkUrl.match(pattern) !== null) {
105        const popupUrl = new URL(elem.linkUrl);
106        if (popupUrl.search !== "") {
107            const encodingLinkUrl = popupUrl.origin + popupUrl.pathname + "?" + encodeURIComponent(popupUrl.search.substring(1, popupUrl.search.length));
108            window.open(`/${elem.popSeq}/homeOpenPopup.cm?filePath=${filePath}&popupName=${elem.title}&linkUrl=${encodingLinkUrl}`, elem.title, option);
109        } else
110            window.open(`/${elem.popSeq}/homeOpenPopup.cm?filePath=${filePath}&popupName=${elem.title}&linkUrl=${elem.linkUrl}`, elem.title, option);
111    } else
112        window.open(`/${elem.popSeq}/homeOpenPopup.cm?filePath=${filePath}&popupName=${elem.title}&linkUrl=${elem.linkUrl}`, elem.title, option);
113}
114
115

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.