PageSourceSearch

https://m.whodadoc.com/assets/consumer/mobile/v3/js/appCommon.js?dummy=1

js whodadoc.com collected 2026-09-25 13:31:11 UTC 37,768 bytes, 1,212 lines download raw bytes

1// @formatter:off
2String.prototype.empty = function () {
3    return !!this;
4}
5
6String.prototype.startWiths = function (str) {
7    return this.indexOf(str) === 0;
8}
9
10String.prototype.has = function (str) {
11    return this.indexOf(str) > -1;
12}
13
14String.prototype.byte = function () {
15    let str = this;
16    let l = 0;
17    for (let i = 0; i < str.length; i++) {
18        l += (str.charCodeAt(i) > 128) ? 2 : 1;
19    }
20    return l;
21}
22String.prototype.cutByte = function (len) {
23    let str = this;
24    let l = 0;
25    for (let i = 0; i < str.length; i++) {
26        l += (str.charCodeAt(i) > 128) ? 2 : 1;
27        if (l > len) {
28            return str.substring(0, i);
29        }
30    }
31    return String(str);
32}
33
34$._login = {
35    returnUrl: null,
36    check : function(callback, failCallback, ret){
37        this.returnUrl = ret;
38		let $this = this
39        $.ajax({
40            type: 'post'
41            ,url : '/common/system/loginUserCheck'
42            , dataType : 'json'
43            , success: function(data,result, xhr) {
44
45                if(data.result !== "success" || data.body <= 0){
46                    $this.notLoginProc(xhr, failCallback);
47                }else{
48                    if(callback != null){
49                        callback();
50                    }
51                }
52            },error : function(xhr){
53                $this.notLoginProc(xhr, failCallback);
54            }
55        });
56
57
58    },
59    notLoginProc : function(xhr, failCallback){
60        if (this.returnUrl == null || this.returnUrl  === "undefined" || this.returnUrl  === "") {
61            this.returnUrl  = location.href;
62        }
63        if(xhr != null){
64            xhr.abort();
65        }
66
67        this.openLogin();
68    },
69    openLogin : function() {
70        $("#pop_login").addClass("show");
71        setTimeout(function () {
72            $("#pop_login").addClass("show");
73        }, ($("#pop_login").css("transition-duration").slice(0, -1)) * 1000);
74	}
75}
76
77$._link = {
78    goMileageMall: function(uid, guid) {
79
80        if (!guid) {
81            guid = "";
82        }
83        let url = "https://mwhodadoc.interparkb2b.co.kr/SSO/SSO.aspx?id=" + uid + "&usertype=M&guid=" + guid;
84        if (idopIF.isApp) {
85            idopIF.openInNewWindow(url);
86        } else {
87            window.open(url);
88        }
89    }
90}
91
92$._common = {
93    alert: function (msg, alertCallback) {
94        $(".alert_layer .content").text(msg);
95        $(".alert_layer .btnarea").empty();
96        $(".alert_layer .btnarea").append($("<button></button>", {'class': 'btn_large btn_pink', 'id': 'btn_confirm', 'value': 'true', 'text': '확인'}));
97        $(".alert_layer").show();
98        $("#btn_confirm,#btn_cancel").on("click", function() {
99			if(!!alertCallback) {
100				alertCallback();
101			}
102			$(".alert_layer").hide();
103		});
104    },
105    confirm: function (msg, confirmCallback) {
106		$(".alert_layer .content").text(msg);
107        $(".alert_layer .btnarea").empty();
108        $(".alert_layer .btnarea").append($("<button></button>", {'class': 'btn_large', 'id': 'btn_cancel', 'value': 'false', 'text': '취소'}));
109        $(".alert_layer .btnarea").append($("<button></button>", {'class': 'btn_large btn_pink', 'id': 'btn_confirm', 'value': 'true', 'text': '확인'}));
110        $(".alert_layer").show();
111        $("#btn_confirm,#btn_cancel").on("click", function() {
112			if(eval($(this).val())) {
113				confirmCallback(true);
114			} else {
115				confirmCallback(false);
116			}
117			$(".alert_layer").hide();
118		});
119    },
120    empty: function (o) {
121        return !!(o == null || o === "undefined" || o === "");
122    },
123    location: function (callback, district) {
124        if (!$._common.empty(district)) {	// 저장된 지역 먼저
125            $._ajax.get("common/getAddrToCoords", {"addr": district}, function (data) {
126                if (data.body.status === "OK" && data.body.addresses.length > 0) {
127                    callback({"x": data.body.addresses[0].x, "y": data.body.addresses[0].y});
128                } else {
129                    callback({"x": 127.0372752, "y": 37.4776427});
130                }
131            });
132        } else { // 저장된 지역이 없으면 현재 좌표
133            //현재 좌표 얻기
134            if (navigator.geolocation) {
135                //위치 정보를 얻기
136                navigator.geolocation.getCurrentPosition(function (pos) {
137                        x = pos.coords.longitude;
138                        y = pos.coords.latitude;
139                        callback({"x": x, "y": y});
140                    },
141                    function (e) { //errorCallback
142                        callback({"x": 127.0372752, "y": 37.4776427});
143                    }, { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 });
144            } else {	// 현재 좌표를 얻을 수 없으면 지정 좌표
145                callback({"x": 127.0372752, "y": 37.4776427});
146            }
147        }
148    },
149    clipboard: function (text) {
150        let IE = !!(document.all);
151
152        if (IE) {
153            window.clipboardData.setData("Text", text);
154            alert("복사 되었습니다");
155
156        } else {
157            prompt("이 글의 주소입니다. Ctrl+C를 눌러 클립보드로 복
157사하세요", text);
158        }
159    },
160    /*
161     *  oid : textarea
162     *  tid : 바이트 값 텍스트 필드
163     *  len : 길이
164     */
165    byteCheck: function (oid, tid, len) {
166        $(oid).on("keyup", function () {
167            let bytetext = "";
168            const byte = function (str) {
169                return str.byte();
170            };
171            if (byte($(this).val()) > len) {
172                alert(len + "byte 이상 입력할수 없습니다.");
173                bytetext = $(this).val().cutByte(len);
174                $(this).val("");
175                $(this).val(bytetext);
176            }
177            $(tid).html(byte($(this).val()));
178
179        });
180    }
181}
182
183
184$._form = {
185    serialize: function (selector, type) {
186        if (type === "json") {
187            return JSON.stringify($(selector).serializeArray().reduce(function (a, x) {
188                a[x.name] = x.value;
189                return a;
190            }, {}));
191        } else if (type === "querystring") {
192            return $(selector).serialize();
193        } else if (type === "serialize") {
194            return $(selector).serializeArray().reduce(function (a, x) {
195                a[x.name] = x.value;
196                return a;
197            }, {});
198        }
199    },
200    checked: function (selector) {
201        let values = [];
202        $.each($(selector), function (i) {
203            if ($(this).is(":checked")) {
204                values.push($(this).val());
205            }
206        });
207
208        return values;
209    },
210    checkedQuerystring: function (selelctor, parameterName) {
211        let values = "";
212        let checkedCnt = 0;
213        $.each($(selelctor), function (i) {
214            if ($(this).is(":checked")) {
215
216                if (checkedCnt > 0) {
217                    values += "&";
218                }
219                values += parameterName;
220                values += "=";
221                values += $(this).val();
222                checkedCnt++;
223            }
224        });
225
226        return values;
227    },
228    add: function (body, callback, failureCallback, noAlert) {
229        $._ajax.post("add", body, callback, failureCallback, noAlert);
230    },
231    modify: function (body, callback, failureCallback, noAlert) {
232        $._ajax.post("modify", body, callback, failureCallback, noAlert);
233    },
234    modifyUseyn: function (body, useYn, callback, failureCallback, noAlert) {
235        $._ajax.post("modify-useyn?useYn=" + useYn, body, callback, failureCallback, noAlert);
236    }
237}
238
239$._ajax = {
240    post: function (url, body, callback, failureCallback, noAlert) {
241        this.tracePost(url, body, "", callback, failureCallback, noAlert);
242    },
243    tracePost: function (url, body, traceId, callback, failureCallback, noAlert) {
244        $.ajax({
245            url: url,
246            type: "post",
247            dataType: "json",
248            contentType: "application/json",
249            beforeSend: function (xhr) {
250                xhr.setRequestHeader("content-type", "application/json; charset=UTF-8");
251
252                if (!$._common.empty(traceId)) {
253                    xhr.setRequestHeader("REQUEST_TRACE_ID", traceId);
254                }
255            },
256            data: body,
257            success: function (data) {
258                if (!noAlert) {
259                    $._common.alert(data.body);
260                }
261                if (data.result === "success") {
262                    if (!$._common.empty(callback)) {
263                        callback(data.body);
264                    }
265                } else {
266                    if (!$._common.empty(failureCallback)) {
267                        failureCallback(data.body);
268                    }
269                }
270            },
271            error: function (data) {
272                if (!$._common.empty(failureCallback)) {
273                    failureCallback(data.body);
274                }
275            }
276        });
277    },
278    get: function (url, param, callback, failureCallback) {
279        this.traceGet(url, param, "", callback, failureCallback);
280    },
281    traceGet: function (url, param, traceId, callback, failureCallback) {
282        let res;
283        $.ajax({
284            url: url,
285            type: "get",
286            dataType: "json",
287            beforeSend: function (xhr) {
288                if (!$._common.empty(traceId)) {
289                    xhr.setRequestHeader("REQUEST_TRACE_ID", traceId);
290                }
291            },
292            data: param,
293            success: function (data) {
294                if (data.result === "success") {
295                    if ($._common.empty(callback) == null) {
296                        return data.body;
297                    } else {
298                        if (!$._common.empty(callback)) {
299                            callback(data.body);
300                        }
301                    }
302                } else {
303                    if ($._common.empty(failureCallback)) {
304                        return data.body;
305                    } else {
306                        if (!$._common.empty(failureCallback)) {
307                            failureCallback(data.body);
308                        }
309                    }
310                }
311            }
312        });
313    },
314    fileUpload: function (fileObj, callback, failureCallback, isAddwork) {
315        isAddwork = isAddwork == null ? false : isAddwork;
316        let root = $(fileObj).parent();
317
318        let $form = $("<form style='display:none;'></form>");
319        $form.attr('action', 'uploadAttachFile');
320        $form.attr('method', 'post');
321        $form.attr('enctype', 'multipart/form-data')
322        $form.appendTo('body');
323
324        let $this = $(fileObj);
325        $this.appendTo($form);
326
327        if (fileObj instanceof Array) {
328            $.each(fileObj, function (i, v) {
329                $form.append($("<input />", {'name': 'attachFiles[' + i + '].addwork', 'value': (isAddwork ? 'Y' : 'N')}))
330            });
331        } else {
332            $form.append($("<input />", {'name': 'attachFiles[0].addwork', 'value': (isAddwork ? 'Y' : 'N')}))
333        }
334
335        let option = {
336            'type': 'POST',
337            'url': 'uploadAttachFile',
338            'data': $form,
339            'dataType': 'json',
340            'contentType': 'text/plain',
341            'async': false,
342            'iframeSrc': 'about:blank',
343            beforeSend: function (xhr) {
344                //xhr.setRequestHeader("content-type" , "text/plain; charset=utf-8");
345            },
346            'complete': function (jqXHR, textStatus) {
347                $(root).prepend($(fileObj).clone().val(''));
348                $form.remove();
349            },
350            'success': function (data) {
351
352            	if (data.result == "success") {
353            		if (!$._common.empty(callback)) {
354                    	callback(data.body);
355                	}
356            	}else{
357				 	if (!$._common.empty(failureCallback)) {
358                    	failureCallback(data.body);
359                	}
360            	}
361            },
362            'error': function (data, textStatus, errorThrown) {
363                if (!$._common.empty(failureCallback)) {
364                    failureCallback(data.body);
365                }
366            }
367        };
368        $($form).ajaxSubmit(option);
369
370    },
371    imageView: function (fileId, callback) {
372
373        let formData = {"fileId": fileId};
374        $._ajax.get("getImageBinary", formData, callback);
375
376    },
377    sendAppLink: function (phoneno, app) {
378        if ($._common.empty(phoneno)) {
379            alert("전송할 전화번호가 없습니다.");
380            return;
381        }
382
383        let msg = "";
384
385        if (app === "consumer") {
386            msg = "후다닥건강 APP 설치:\nhttps://m.whodadoc.com/download";
387        } else {
388            msg = "후다닥의사(PRO) 설치링크\n https://hcp.whodadoc.com/download";
389        }
390
391        let param = {"phoneno": phoneno, "message": msg};
392
393        $._ajax.get("common/sms/send", param, function (data) {
394            alert("문자가 전송 되었습니다.");
395        }, function (data) {
396            alert(data);
397        });
398    },
399    getHtml: function (url, param, callback, failureCallback) {
400        this.traceGetHtml(url, param, "", callback, failureCallback);
401    },
402    traceGetHtml: function (url, param, traceId, callback, failureCallback) {
403        let res;
404        $.ajax({
405            url: url,
406            type: "get",
407            dataType: "html",
408            beforeSend: function (xhr) {
409                if (!$._common.empty(traceId)) {
410                    xhr.setRequestHeader("REQUEST_TRACE_ID", traceId);
411                }
412            },
413            data: param,
414            success: function (data) {
415                if (data != null) {
416                    if (callback == null) {
417                        return data;
418                    } else {
419                        callback(data);
420                    }
421                } else {
422                    callback(data);
423                }
424            }
425        });
426    }
427}
428
429/*
430뒤로 가기 시 현재 페이지 상태 유지
431container : 상태를 유지할 container selector
432*/
433$._delegate = {
434    keepState: {
435        container: ".state-area",
436        storageName: "",
437        use: false,
438        on: function (options) {
439            this.use = true;
440
441            if (options && options.container) {
442                this.container = options.container;
443            }
444
445            this.execute();
446        },
447        execute: function () {
448            let storageName  ; let currentLocation = location.href;
449
450            currentLocation = currentLocation.replace("https://", "").replace("http://", "");
451            currentLocation = currentLocation.substring(currentLocation.indexOf("/") + 1);
452
453            if (currentLocation.indexOf("?") > -1) {
454                currentLocation = currentLocation.substring(0, currentLocation.indexOf("?"));
455            }
456
457            if ($._common.empty(storageName)) {
458                storageName= "";
459                let splits = currentLocation.split("/");
460                for (const element of splits) {
461                    storageName = storageName + "_" + element;
462                }
463                this.storageName = storageName;
464            }
465
466            this.recover();
467
468            $(document).on("click", "a", function () {
469                $._delegate.keepState.put();
470            });
471        },
472        put: function () {
473            if (this.use) {
474                if (typeof (Storage) !== undefined && localStorage != null) {
475                    let data = $(this.container).html();
476
477                    localStorage.removeItem(this.storageName);
478                    localStorage.setItem(this.storageName, data);
479                    localStorage.setItem("currentPage", $._delegate.more.page);
480                }
481            }
482
483        },
484        recover: function () {
485            if (this.use) {
486                window.onpageshow = function (event) {
487                    if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
488                        if (typeof (Storage) != undefined && localStorage != null) {
489                            var data = localStorage.getItem($._delegate.keepState.storageName);
490
491                            if (data != null) {
492                                $($._delegate.keepState.container).html("");
493                                $($._delegate.keepState.container).append($(data));
494                                $._delegate.more.page = localStorage.getItem("currentPage");
495                                localStorage.removeItem($._delegate.keepState.storageName);
496                                localStorage.removeItem("currentPage");
497                            }
498                        }
499                    }
500                }
501            }
502        }
503    },
504    more: {
505        proceeding: false,
506        // 실행 여부
507        executable: true,
508        container: ".state-area",
509        page: 1,
510        use: false,
511        on: function (options) {
512            this.use = true;
513        },
514        init: function (options) {
515            this.use = true;
516            this.executable = true;
517            this.page = 1;
518        },
519        execute: function (url) {
520            if (this.executable) {
521                this.container = $._delegate.keepState.container;
522
523                $.ajax({
524                    url: url,
525                    success: function (data) {
526                        if ($(data).find($._delegate.more.container).length > 0 && $(data).find($._delegate.more.container).html().trim().length > 0) {
527
528                            if ($(data).find($._delegate.more.container).find(".no-data").length === 0) {
529                                $($._delegate.more.container).append($(data).find($._delegate.more.container).html());
530                            } else {
531                                $._delegate.more.executable = false;
532                            }
533                        } else {
534                            $._delegate.more.executable = false;
535                        }
536
537                        $._delegate.keepState.put();
538                        $._delegate.more.proceeding = false;
539
540                        //feUI.EllipsisText();
541                    }
542                });
543            } else {
544                $._delegate.more.proceeding = false;
545                //feUI.EllipsisText();
546            }
547        },
548        defaultMovePageTarget: function (totalPage) {
549
550
551            if ($._delegate.more.excutable) {
552                return null;
553            }
554
555            const nextPage = parseInt($._delegate.more.page) + 1;
556
557            /*	데이터 무한조회 방지	*/
558            const totPage = $("[name=searchForm] [name='totalPage']").val();
559            if (typeof totPage != "undefined" && totPage != null && nextPage > totPage) {
560                return null;
561            }
562
563
564            $._delegate.more.page = nextPage;
565            $("[name=searchForm] [name='search.page']").val($._delegate.more.page);
566
567            //IMP 담당의사 목록(모바일)
568            if (location.href.indexOf('imp/chargeDoctor/list') > -1) {
569                $("[name=searchForm] [name='baseSearch.page']").val($._delegate.more.page);
570            }
571
572            let querystring = $._form.serialize("[name=searchForm]", "querystring");
573            //hcp 건강퀴즈 체크
574            let list = "list?"
575            let url = location.href.split('/')
576            if (url[url.length - 1] === "healthQuizList") {
577                list = "healthQuizList?"
578            }
579            if (url[url.length - 1] === "list2") {
580                list = "list2?"
581            }
582            return list + querystring;
583        },
584        //팝업에서 target으로 지정한 class에 스크롤 페이징 (default class: .state-area)
585        popupScroll: function (target) {
586            let container = target || this.container;
587
588            $(container).scroll(function () {
589                if ($._delegate.more.use && !$._delegate.more.proceeding) {
590                    if ($(this).prop('scrollHeight') - $(this).outerHeight() <= $(this).scrollTop()) {
591
592                        $._delegate.more.proceeding = true;
593
594                        let target;
595
596                        if (typeof movePageTarget != "undefined") {
597                            target = movePageTarget();
598                        } else {
599                            target = $._delegate.more.defaultMovePageTarget();
600                        }
601
602                        if (target != null) {
603                            $._delegate.more.execute(target);
604                        }
605                    }
606
607                }
608            });
609        },
610        //팝업창 등에서 조건 검색시 reload없이 렌더링
611        search: function () {
612            if ($._delegate.more.use && !$._delegate.more.proceeding) {
613                $(this.container).empty();
614
615                $._delegate.more.proceeding = true;
616                $._delegate.more.executable = true;
617
618                this.page = 0;
619
620                let target;
621
622                if (typeof movePageTarget != "undefined") {
623                    target = movePageTarget();
624                } else {
625                    target = $._delegate.more.defaultMovePageTarget();
626                }
627
628                if (target != null) {
629                    $._delegate.more.execute(target);
630                }
631            }
632        }
633    }
634}
635
636
637//스크롤 하단 이동시 처리
638$(window).scroll(function () {
639    if ($._delegate.more.use && !$._delegate.more.proceeding) {
640
641        let minus = ($(".floating-menu").length > 0 && location.href.indexOf("hcp.") > -1) ? 87 : 0;
642        let scroll = $(document).height() - $(window).height() - minus;
643
644        if (($(window).scrollTop() < scroll + 50) && ($(window).scrollTop() > scroll - 110)) {
645
646            $._delegate.more.proceeding = true;
647
648            let target;
649
650            if (typeof movePageTarget != "undefined") {
651                target = movePageTarget();
652            } else {
653                target = $._delegate.more.defaultMovePageTarget();
654            }
655
656            if (target != null) {
657                $._delegate.more.execute(target);
658            }
659        }
660        // 말줄임
661        // if( $("[class*=ellipsis]").length > 0){
662        // 	feUI.EllipsisText();
663        // }
664    }
665
666});
667
668//global ajax setting
669$(document).ajaxError(function (event, request, settings) {
670
671    let result  ; if (request.status === 401) {
672        top.location.href = "/auth/login?ret=" + location.href;
673    } else if (request.status === 500) {
674
675        if (settings.dataType === "json") {
676            result= JSON.parse(request.responseText);
677            $._common.alert(result.body);
678        } else {
679            $._common.alert("오류가 발생 했습니다.");
680        }
681    } else if (request.status === 400) {
682
683        if (settings.dataType === "json") {
684            result= JSON.parse(request.responseText);
685
686            let body = result.body;
687
688            try {
689                body = eval(result.body);
690            } catch (e) {
691            }
692
693            if (result.failure === "validation") {
694                if (body.length > 0) {
695                    $._common.alert(body[0].message);
696                }
697            } else {
698                $._common.alert(body);
699            }
700        } else {
701            $._common.alert("잘못된 요청입니다.");
702        }
703    } else if (request.status === 412) {
704        $._common.alert(JSON.parse(request.responseText).body);
705    } else {
706        if (request.status !== 200 && request.status !== 0) {
707            $._common.alert("오류가 발생 했습니다.");
708        }
709    }
710});
711
712$._cookie = {
713    set: function (key, value, expired) {
714        let today = new Date();
715
716        if (expired != null && expired === 1) {
717            today.setHours(23, 59, 59, 999);
718        } else {
719            today.setDate(today.getDate() + expired);
720        }
721
722        let cookie = key + "=" + escape(value) + "; path=/; ";
723        if (expired != null) {
724            cookie = cookie + "expires=" + today.toGMTString() + ";"
725        }
726
727        document.cookie = cookie;
728    },
729    get: function (key) {
730        return $.cookie(key);
731    }
732}
733$._app = {
734
735    naverMap: function (addr, name) {
736
737        let query = ((name && name !== "") ? name + " " : "") + addr;
738
739        if (idopIF.type === "A" || idopIF.type === "WA") {
740
741            url = encodeURIComponent("intent://search?query=" + query + "&appname=IDOP#Intent;scheme=nmap;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=com.nhn.android.nmap;end");
742
743            if (idopIF.type === "A") {
744
745                idopIF.openInNewWindow("http://" + document.domain + "/common/appSchema?type=naver&url=" + url);
746
747            } else {
748
749                window.open("http://" + document.domain + "/common/appSchema?url=" + url);
750
751            }
752
753        } else if (idopIF.type === "I" || idopIF.type === "WI") {
754
755            var url = "nmap://search?query=" + encodeURIComponent(query) + "&appname=com.example.myapp";
756
757            if (idopIF.type == "I") {
758
759                idopIF.openInNewWindow("http://" + document.domain + "/common/appSchema?type=naver&url=" + url);
760
761            } else {
762
763                location.href = url;
764
765                setTimeout(function () {
766
767                    //window.location.href = 'https://itunes.apple.com/kr/app/id311867728?mt=8';
768                    window.location = 'itms-appss://apps.apple.com/kr/app/id311867728';
769
770                }, 100);
771
772
773            }
774
775        }
776
777    },
778
779    openNaverApp: function (url) {
780
781        if (idopIF.type == "WA") {
782
783            window.open(url);
784
785        } else {
786
787            location.href = url;
788
789            setTimeout(function () {
790
791                //window.location.href = 'https://itunes.apple.com/kr/app/id311867728?mt=8';
792                window.location = 'itms-appss://apps.apple.com/kr/app/id311867728';
793
794            }, 2000);
795
796        }
797
798    },
799
800    openKakaoApp: function (url) {
801
802        if (idopIF.type == "WA") {
803
804            location.href = url;
805
806        } else {
807
808            /*
809            setTimeout(function () {
810
811                //window.location.href = 'https://itunes.apple.com/kr/app/id304608425';
812                window.location = 'itms-appss://apps.apple.com/kr/app/id304608425';
813
814            }, 500);
815
816			location.href = url;
817
818			setTimeout(function () {
819                window.close();
820            }, 4000);
821			*/
822			setTimeout(function () {
823			    if (new Date().valueOf() - Date().now > 100) return;
824			    window.location = "itms-apps://apps.apple.com/kr/app/id304608425";
825			}, 25);
826			window.location = url;
827
828        }
829
830    },
831
832    openKakaoTApp: function (url) {
833
834        if (idopIF.type == "WA") {
835
836            document.location.href = url;
837
838        } else {
839
840            location.href = url;
841
842            setTimeout(function () {
843
844                //window.location.href = 'https://itunes.apple.com/kr/app/id981110422';
845                //window.location.href = 'items-appss://apps.apple.com/app/id981110422';
846                window.location = 'itms-appss://apps.apple.com/kr/app/id981110422';
847
848            }, 2000);
849
850            setTimeout(function () {
851                window.close();
852            }, 4000);
853
854        }
855
856    },
857
858    navi: function (x, y, name) {
859
860        Kakao.Navi.start({
861            name: name,
862            x: x,
863            y: y,
864            coordType: 'wgs84'
865        });
866
867    },
868
869    kakaoMap: function (x, y, name) {
870
871        //var url = "https://map.kakao.com/link/map/" + name + "," + y + "," + x;
872        if (idopIF.type == "A" || idopIF.type == "WA") {
873
874            var url = encodeURIComponent("Intent://look?p=" + y + "," + x + "#Intent;scheme=daummaps;package=net.daum.android.map;end");
875            if (idopIF.isApp) {
876
877                idopIF.openInNewWindow("http://" + document.domain + "/common/appSchema?type=kakao&url=" + url);
878
879            } else {
880
881                window.open(url);
882
883            }
884
885        } else if (idopIF.type == "I" || idopIF.type == "WI") {
886
887            var url = encodeURIComponent("kakaomap://look?p=" + y + "," + x + "&appname=com.example.myapp");
888
889            if (idopIF.type == "I") {
890
891                idopIF.openInNewWindow("http://" + document.domain + "/common/appSchema?type=kakao&url=" + url);
892
893            } else {
894
895                location.href = url;
896
897                setTimeout(function () {
898
899                    //window.location.href = 'https://itunes.apple.com/app/id304608425';
900                    //window.location.href = 'items-appss://apps.apple.com/app/id304608425';
901                    //location.href = 'itms-appss://apps.apple.com/kr/app/id304608425';
902                    top.location.href = 'itms-appss://apps.apple.com/kr/app/id304608425';
903
904                }, 100);
905
906
907            }
908
909        }
910
911    },
912
913    roadSearch: function (x, y, name) {
914        $._common.location(function (data) {
915
916            if (idopIF.type == "A" || idopIF.type == "WA") {
917
918                var url = encodeURIComponent("Intent://route?sp=" + data.y + "," + data.x + "&ep=" + y + "," + x + "&by=CAR#Intent;scheme=daummaps;package=net.daum.android.map;end");
919                if (idopIF.isApp) {
920
921                    idopIF.openInNewWindow("http://" + document.domain + "/common/appSchema?type=kakao&url=" + url);
922
923                } else {
924
925                    window.open(decodeURIComponent(url));
926
927                }
928
929            } else if (idopIF.type == "I" || idopIF.type == "WI") {
930                data.ey = y;
931                data.ex = x;
932
933                top.iosKakaoMap(data);
934
935//					var url = encodeURIComponent("kakaomap://route?" + encodeURIComponent( "sp="+ data.y + "," + data.x + "&ep="+ y + "," + x + "&by=CAR") + "&appname=com.example.myapp");
936//
937//					if ( idopIF.type == "I" ) {
938//
939//						idopIF.openInNewWindow( "http://" + document.domain + "/common/appSchema?url=" + url );
940//
941//					} else {
942//
943//					    location.href = decodeURIComponent(url);
944//
945//					    setTimeout(function() {
946//
947//					    	//window.location = 'https://itunes.apple.com/kr/app/id304608425?mt=8';
948//					    	//window.location.href = 'items-appss://apps.apple.com/app/id304608425';
949//					    	//window.location.href = 'itms-apps://itunes.apple.com/app//id304608425?mt=8';
950//					    	window.location.href = 'itms-apps://itunes.apple.com/app//id304608425?mt=8';
951//					    	//window.parent.location.href = 'http://www.naver.com';
952//
953//					    }, 500);
954//
955//
956//					}
957
958            }
959
960        });
961
962    },
963
964    kakaoT: function () {
965
966        $._common.location(function (data) {
967
968            if (idopIF.type == "A" || idopIF.type == "WA") {
969
970                var url = encodeURIComponent("Intent://route?" + encodeURIComponent("sp=" + data.y + "," + data.x + "&ep=" + y + "," + x + "&by=CAR") + "#Intent;scheme=kakaotaxi;package=com.kakao.taxi;end");
971                if (idopIF.isApp) {
972
973                    idopIF.openInNewWindow("http://" + document.domain + "/common/appSchema?type=kakao&url=" + url);
974
975                } else {
976
977                    window.open(decodeURIComponent(url));
978
979                }
980
981            } else if (idopIF.type == "I" || idopIF.type == "WI") {
982
983                top.iosKakaoT();
984
985//					var url = "kakaotaxi://";
986//
987//					if ( idopIF.type == "I" ) {
988//
989//						idopIF.openInNewWindow( "http://" + document.domain + "/common/appSchema?url=" + url );
990//
991//					} else {
992//
993//
994//						try{
995//
996//							location.href = url;
997//
998//						}catch(e){}
999//
1000//					    setTimeout(function() {
1001//
1002//					    	//window.location.href = 'https://itunes.apple.com/kr/app/id981110422';
1003//					    	//window.location = 'https://itunes.apple.com/kr/app/id981110422';
1004//					    	//window.location.replace('itms-appss://apps.apple.com/kr/app/id981110422');
1005//					    	window.location = 'itms-apps://itunes.apple.com/app//id981110422?mt=8';
1006//					    	//window.top.location = 'http://daum.net';
1007//					    	//window.open("/common/appSchema?url=itms-apps://itunes.apple.com/app//id981110422?mt=8");
1008//
1009//					    }, 500);
1010//
1011//
1012//					}
1013
1014            }
1015
1016        });
1017
1018    }
1019
1020}
1021
1022
1023$._ga = {
1024    tag: {
1025        load: function (category, label) {
1026            this.send('load', category, label);
1027        },
1028        click: function (category, label) {
1029            this.send('click', category, label);
1030        },
1031        swipe: function (category, label) {
1032            this.send('swipe', category, label);
1033        },
1034        send: function (event, category, label) {
1035            if (location.href.indexOf("m.whodadoc.com") > -1 || location.href.indexOf("hcp.whodadoc.com") > -1 || location.href.indexOf("mhcp.whodadoc.com") > -1) {
1036                gtag(
1037                    'event', event, {
1038                        'event_category': category,
1039                        'event_label': label
1040                    }
1041                )
1042            }
1043        }
1044    }
1045}
1046
1047$(document).on("click", ".gtag-click", function () {
1048    let category = $(this).data("gtag-category");
1049    let label = $(this).data("gtag-click-label");
1050    $._ga.tag.click(category, label);
1051});
1052
1053$(document).on("swipe", ".gtag-swipe", function () {
1054    let category = $(this).data("gtag-category");
1055    let label = $(this).data("gtag-swipe-label");
1056    $._ga.tag.swipe(category, label);
1057});
1058
1059// imp요청 바로 하기
1060function callImp(text) {
1061    let msg = "'" + text + "' 건으로 IMP 요청을 하시겠습니까?";
1062    if (confirm(msg)) {
1063        let formName = "tmpImpForm";
1064
1065        let form = $("<form></form>").prop("name", formName);
1066        let input = $("<input></input>").prop("name", "reqMemo").prop("type", "hidden").val(text);
1067        input.appendTo(form);
1068        form.appendTo($("body"));
1069
1070        const formData = $._form.serialize("form[name=" + formName + "]", "serialize");
1071        form.remove();
1072        // 알람 리스트 추가 #1069 조영희 부장 - 1964, 배대호 차장 - 833 , 정유경 과장 - 1991
1073        // 200528 김영은 차장님 요청으로 삭제
1074//		formData['userList'] = [{'id' : 833} ,{'id' : 1964}, {'id' : 1991}];
1075        $._ajax.post("/hcpMypage/imp/add", JSON.stringify(formData), function () {
1076
1077        });
1078    }
1079
1080}
1081
1082// 앱푸시에서 url 물고 오면 이동 시킨다.
1083function CB_pushResult(moveURL) {
1084    location.replace(moveURL);
1085}
1086
1087//복약 알림 팝업 열기
1088function showNoticePopup(id) {
1089    $.ajax({
1090        url: '/health/medicationRemind/noticePopup',
1091        type: "get",
1092        data: {"id": id},
1093        success: function (results, textStatus, jqXHR) {
1094            $(results).children('div').appendTo('body').modal();
1095        }
1096    });
1097}
1098
1099//복약 확인
1100function injectConfirmPopup(id) {
1101    let yyyy = new Date().getFullYear().toString();
1102    let mm = (new Date().getMonth() + 1).toString();
1103    let dd = new Date().getDate().toString();
1104
1105    let params = {
1106        id: id,
1107        confirmDtm: yyyy + (mm[1] ? mm : '0' + mm[0]) + (dd[1] ? dd : '0' + dd[0]),
1108        injectYn: 'Y'
1109    }
1110
1111    $.ajax({
1112        url: "/health/medicationRemind/injectConfirm",
1113        type: "post",
1114        dataType: "json",
1115        contentType: "application/json",
1116        data: JSON.stringify(params),
1117        success: function (data) {
1118            if (data.result === 'fail') {
1119                alert(data.body);
1120                window.location.href = '/auth/login';
1121            }
1122        }
1123    });
1124}
1125
1126//복약 알림 다시울림
1127function lateNoticeAlarm(id) {
1128    if (idopIF.isApp) {
1129        idopIF.setNoticeTime(id, "10");
1130    }
1131}
1132
1133// 현재주소 파라미터 가져오기
1134function getParam(name) {
1135    let param = "";
1136    let results = new RegExp('[\?&amp;]' + name + '=([^&amp;#]*)').exec(window.location.href);
1137    if (results != null && results !== "")
1138        param = results[1] || 0;
1139    return param;
1140}
1141
1142// 만 14세 미만인지 체크
1143function isChild(birthDate) {
1144    let today = new Date();
1145    let yyyy = today.getFullYear();
1146    let mm = today.getMonth() < 9 ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1); // getMonth()
1147    let dd = today.getDate() < 10 ? "0" + today.getDate() : today.getDate();
1148
1149    return parseInt(yyyy + mm + dd) - parseInt(birthDate) - 140000 < 0;
1150}
1151
1152function whodadocshopAgreement(userId) {
1153	$("input[name=radio_agreement]").each(function() {
1154		if($(this).is(":checked")) {
1155			if($(this).val() === "Y") {
1156				let formData = new FormData();
1157				formData.userId = userId;
1158				formData.system = "7";
1159				$._ajax.post("/interface/addWhodadocShopCollectPrivacy", JSON.stringify(formData), function(data) {
1160					goWhodadocshop(userId);
1161					history.go(-1);
1162				});
1163			} else {
1164				alert("동의하지 않으면 해당 서비스를 이용할 수 없습니다.");
1165			}
1166		}
1167	});
1168}
1169
1170function goWhodadocshop(userId) {
1171	$.ajax({
1172	  url: "/interface/getWhodadocShopCollectPrivacy",
1173	  type: 'get',
1174	  data: {"userId":userId},
1175	  async: false,
1176	  success: function(data) {
1177		if(data.body.agreeYn === "Y") {
1178			$.ajax({
1179			  url: "/interface/getExternalLinkageParam",
1180			  type: 'get',
1181			  data: {"userId":userId},
1182			  async: false,
1183			  success: function(data) {
1184				let url = "https://api.shop.whodadoc.com/member/check_login.php?token=" + data.body.token + "&uid=" + data.body.uid + "&loginId=" + data.body.loginId;
1185				if (idopIF.isApp) {
1186					idopIF.openInNewWindow(url);
1187				}else{
1188					window.open(url);
1189				}
1190			  },
1191			  error: function(xhr) {
1192			    console.error(xhr.status);
1193			  }
1194			});
1195		} else {
1196			location.href="/common/clause/whodadocshop";
1197		}
1198	  },
1199	  error: function(xhr) {
1200	    console.error(xhr.status);
1201	  }
1202	});
1203}
1204// console.log on/off 설정
1205let orgConsole = console;
1206let orgLog = console.log;
1207console.off = function() {
1208	this.log = function() {};
1209};
1210console.on = function() {
1211	this.log = orgLog;
1212};

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.