PageSourceSearch

https://www.gamejob.co.kr/Scripts/AdBanner/AdBanner.js

js gamejob.co.kr collected 2026-10-03 21:51:38 UTC 4,939 bytes, 122 lines download raw bytes

1var AdBanner = {
2    data: {
3        options10per: {
4            root: null,
5            rootMargin: "0px",
6            threshold: 0.1,
7        },
8        observer10per: null,
9        UUID_KEY: 'GJ_USER_UUID',
10        JK_DOMAIN: '.gamejob.co.kr',
11    },
12    init: function () {
13        var me = this;
14        me.methods();
15
16        jQuery(document).on("click", ".imgAdBnnr", function () {
17            var data = jQuery(this).data();
18            if (!jQuery(this).hasClass("isSendClickLog") && !jQuery(this).hasClass("IsDefault")) {
19                jQuery(this).addClass("isSendClickLog");
20                me.methods().SendTargetLog(data, "CLICK");
21            }
22            me.methods().OpenTargetLink(data);
23        });
24
25        me.data.observer10per = new IntersectionObserver(me.methods().handleIntersect10per, me.data.options10per);
26
27        me.methods().LoadBanner();
28    },
29    methods: function () {
30        var me = this;
31
32        return {
33            LoadBanner: function () {
34                // 배너 10% 이상 표시 (노출 로그 발송)
35                var $items10per = document.querySelectorAll(".imgAdBnnr");
36                $items10per.forEach((item) => {
37                    me.data.observer10per.observe(item);
38                });
39            },
40            handleIntersect10per: function (entries) {
41                entries.forEach((entry) => {
42                    if (entry.intersectionRatio >= 0.1) {
43                        if (!jQuery(entry.target).hasClass("isSendImpLog") && !jQuery(this).hasClass("IsDefault")) {
44                            jQuery(entry.target).addClass("isSendImpLog");
45                            me.methods().SendTargetLog(jQuery(entry.target).data(), "IMPRESSION");
46                        }
47                    }
48                });
49            },
50            SendTargetLog: function (logData, logtype) {
51                logData.logType = logtype;
52                logData.uuid = me.methods().getUUID();
53                var logUrl = "/Net/AdBannerApi/AdBannerLog";
54
55                //로그 데이터 전송
56                jQuery.ajax({
57                    type: "POST",
58                    url: logUrl,
59                    cache: false,
60                    data: logData
61                }).done(function (data) {
62                    console.log(data.rtnVal);
63                });
64            },
65            OpenTargetLink: function (logData) {
66                var targetInfo = "_blank";
67                if (logData.linktype == "CURRENT_WINDOW") {
68                    targetInfo = "_self";
69                }
70                window.open(logData.linkurl, targetInfo);
71            },
72            getUUID: function () {
73                const uuid = window.localStorage.getItem(me.data.UUID_KEY);
74                if (!uuid) {
75                    return me.methods().setUUID();
76                }
77                const uuidCookie = me.methods()._getCookie(me.data.UUID_KEY);
78                if (uuidCookie !== uuid) {
79                    me.methods()._setCookie(me.data.UUID_KEY, uuid, 10000);
80                }
81                return uuid;
82            },
83            setUUID: function () {
84                if (typeof window === 'undefined') {
85                    return;
86                }
87                const uuid =
88                    window?.crypto && crypto.randomUUID
89                        ? crypto.randomUUID()
90                        : '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, c =>
91                            (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
92                        );
93                window?.localStorage.setItem(me.data.UUID_KEY, uuid);
94
95                me.methods()._setCookie(me.data.UUID_KEY, uuid, 10000);
96                return uuid;
97            },
98            _setCookie: function (cookie_name, value, days) {
99                var exdate = new Date();
100                exdate.setDate(exdate.getDate() + days);
101
102                // 설정 일수만큼 현재시간에 만료값으로 지정
103                var cookie_value = escape(value) + ((days == null) ? '' : '; expires=' + exdate.toUTCString()) + ';path=/';
104                document.cookie = cookie_name + '=' + cookie_value;
105            },
106            _getCookie: function (name) {
107                var x, y;
108                var val = document.cookie.split(';');
109
110                for (var i = 0; i < val.length; i++) {
111                    x = val[i].substr(0, val[i].indexOf('='));
112                    y = val[i].substr(val[i].indexOf('=') + 1);
113                    x = x.replace(/^\s+|\s+$/g, ''); // 앞과 뒤의 공백 제거하기
114
115                    if (x == name) {
116                        return unescape(y); // unescape로 디코딩 후 값 리턴
117                    }
118                }
119            },
120        }
121    }
122};

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.