PageSourceSearch

https://membership.munhwa.com/js/login.js

js munhwa.com collected 2026-09-24 08:59:25 UTC 6,089 bytes, 179 lines download raw bytes

1/*<![CDATA[*/
2(function ($, utils, masUtils, memberUtils) {
3    'use strict';
4
5    /**
6     * 로그인
7     */
8    function fn_logoin() {
9        if ($(".member-popup").length > 0) {
10            return;
11        }
12        var id = $("#log_id").val();
13        var pwd = $("#log_pwd").val();
14        var saveYn = "N";
15        $('#log_id, #log_pwd').blur();
16        if ((id == "" && id.length == 0) || (pwd == "" && pwd.length == 0)) {
17            utils.message.alert({
18                title: local.htmlLoginFail,
19                message: local.htmlLoginFailMsg,
20                okText: local.htmlBtnOk
21            });
22            return;
23        }
24
25        if ($("input:checkbox[name='saveId']").is(":checked") == true) {
26            saveYn = "Y";
27        }
28
29        var data = JSON.stringify({
30            "loginId": id,
31            "loginPwd": pwd,
32            "saveYn": saveYn,
33        });
34        memberUtils.login(data, $("#log_pwd"), $("#rURL").val());
35
36    };
37
38
39    $(document).ready(function () {
40        // TODO: Wishpond사용안함
41        // (function (d, s, id) {
42        //     window.Wishpond = window.Wishpond || {};
43        //     Wishpond.merchantId = '1817819';
44        //     Wishpond.writeKey = '9240a75cd906';
45        //     var js, wpjs = d.getElementsByTagName(s)[0];
46        //     if (d.getElementById(id)) return;
47        //     js = d.createElement(s);
48        //     js.id = id;
49        //     js.src = "//cdn.wishpond.net/connect.js";
50        //     wpjs.parentNode.insertBefore(js, wpjs);
51        // }(document, 'script', 'wishpond-connect'));
52
53
54        // 링크 초기화
55        //masUtils.initLink();
56
57        $('input').attr('autocomplete', 'off');
58        $('#btnLogin').attr('disabled', false);
59
60        // 쿠키에서 아이디 조회
61        if (location.hostname === "localhost") {
62            utils.constant.domain = "localhost";    // test
63        }
64        var cSaveYn = utils.cookie.get(masUtils.constants.COOKIE_SAVE_YN);
65        var cSaveId = utils.cookie.get(masUtils.constants.COOKIE_SAVE_ID);
66        if (cSaveId != "" && cSaveId != null && cSaveYn == "Y") {
67            $("#log_id").val(cSaveId);
68            $("input:checkbox[name='saveId']").prop('checked', true);
69        }
70
71        $('#topDomainUrl').click(function (e) {
72            location.href = $('#domainUrl').val();
73        });
74
75        // 네이버 로그인
76        $('#btnNaver').on('click', function (e) {
77            e.preventDefault();
78            var url = $('#naverAuthorizeUrl').val();
79            /*
80            var strWindowFeatures = 'titlebar=1, resizable=1, scrollbars=yes, width=504, height=642';
81            window.open(url, 'naverloginpop', strWindowFeatures);*/
82            location.href=url;
83        });
84
85        // 카카오 로그인
86        $('#btnKakao').on('click', function (e) {
87            e.preventDefault();
88           /* var url = $('#kakaoAuthorizeUrl').val();
89            var strWindowFeatures = 'width=464, height=682, scrollbar=yes, resizable=yes';
90            window.open(url, 'kakaologinpop', strWindowFeatures);*/
91            const hostProtocol  = window.location.protocol;
92            const hostUrl = window.location.host.replaceAll("/","");
93            const kakaoJsAppKey = $("#kakaoJsAppKey").val();
94            Kakao.init(kakaoJsAppKey);
95            Kakao.Auth.authorize({
96                redirectUri: hostProtocol+"//"+hostUrl+masUtils.constants.KAKAO_LOGIN_API,
97            });
98        });
99
100        $('#btnGoogle').on('click', function (e) {
101          e.preventDefault();
102          if(masUtils.fnCheckUserAgent() == "NotSupport"){
103            utils.message.alert({message:local.htmlLoginMessage, okText: local.htmlBtnOk});
104            return false;
105          }
106          // var url = "/sns/login?joinType=google"
107          // window.open(url, '_blank', 'width=518px,height=700px');
108        });
109
110        // 애플 로그인
111        $('#btnApple').on('click', function (e) {
112            e.preventDefault();
113            var url = $('#appleAuthorizeUrl').val();
114            /*var strWindowFeatures = 'width=464, height=682, scrollbar=yes, resizable=yes';
115            window.open(url, 'appleloginpop', strWindowFeatures);*/
116            location.href=url;
117        });
118
119        // 로그인
120        $('#btnLogin').off('click').on('click', function (e){
121            const method = loginFrm.method.toUpperCase();
122            if (method === 'POST') {
123                e.preventDefault();
124                e.stopPropagation();
125                fn_logoin();
126            }
127        });
128
129        loginFrm.addEventListener('submit', function(e) {
130            const method = loginFrm.method.toUpperCase();
131            if (method === 'POST') {
132                e.preventDefault();
133                e.stopPropagation();
134                fn_logoin();
135            }
136
137        });
138
139        // // 비밀번호 변경
140        // $('#btnChangePwd').click(function (e) {
141        //     $("#changePwdPop").hide();
142        //     location.href = "/member/changepwd?targetURL=" + $("#rURL").val();
143        // });
144        //
145        // // 비밀번호 변경 팝업 닫기
146        // $('#btnCloseChangePwd').click(function (e) {
147        //     $("#changePwdPop").hide();
148        //
149        //     var returnUrl = $("#rURL").val();
150        //     if (!returnUrl) {
151        //         window.history.back();
152        //     } else {
153        //         location.href = returnUrl;
154        //     }
155        // });
156
157        $('#log_id').keydown(function (e) {
158            const method = loginFrm.method.toUpperCase();
159            if (method === 'POST' && e.keyCode == 13) {
160                e.preventDefault();
161                e.stopPropagation();
162                fn_logoin();
163            }
164        });
165
166        $('#log_pwd').keydown(function (e) {
167            const method = loginFrm.method.toUpperCase();
168            if (method === 'POST' && e.keyCode == 13) {
169                e.preventDefault();
170                e.stopPropagation();
171                fn_logoin();
172            }
173        });
174
175
176    });
177
178})(window.jQuery, window.utils, window.masUtils, window.memberUtils);
179/*]]>*/

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.