PageSourceSearch

https://www.medigatenews.com/resources/medigate/js/ui.js?v=202506

js medigatenews.com collected 2026-10-02 07:41:20 UTC 14,846 bytes, 485 lines download raw bytes

1function displayCorona(){
2	$.ajax({ //코로나 집계 현황
3		type: "GET",
4		url: "/medigate/crawling.jsp",
5		dataType: "text",
6		success: function(data){
7			console.log('corona', data);
8
9			if(data && data.indexOf("#")){
10				var coronArr = data.split("#");
11				//console.log('coronArr', coronArr);
12				//확진,검사중,격리해제,사망
13				$('#corona1').html("("+coronArr[0]+")");
14				$('#corona2').html(coronArr[1]);
15				$('#corona3').html(coronArr[2]);
16				$('#corona4').html(coronArr[3]);
17				$('#corona5').html(coronArr[4]);
18			}
19			else{
20				$('#side_corona').hide();
21			}
22		},
23		error: function(err){
24			console.log("PORTLET CORONA ERROR", err);
25		}
26	});
27}
28
29$(document).ready(function(){
30
31	//$(".top_banner_wrap .btn_close").click(function(){ $(".top_banner_wrap").slideUp();}); //상단 배너 닫기
32
33	var search_open = false;
34	$(".lnb_wrap .btn_search").click(function(){
35		if(search_open== false){
36			search_open = true;
37			$(".search_wrap").show();
38			$("#keyword").focus();
39			$(this).children().children().attr("src", function(){ return $(this).attr("src").replace("_off","_on")})
40		}else{
41			search_open = false;
42			$(this).children().children().attr("src", function(){ return $(this).attr("src").replace("_on","_off")})
43			$(".search_wrap").hide();
44		}
45	});
46	$(".container_inner .body_bg").height($(".container_inner").height());
47
48	$(".pds_article .tab li a").mouseover(function(){
49		var idx = $(this).parent().index();
50		$(".pds_article .tab li").removeClass("on");
51		$(this).parent().addClass("on");
52		switch (idx){
53			case 0: $(this).parents(".tab").attr("class","tab tab0");
54			break;
55			case 1: $(this).parents(".tab").attr("class","tab tab1");
56			break;
57			case 2: $(this).parents(".tab").attr("class","tab tab2");
58			break;
59			case 3: $(this).parents(".tab").attr("class","tab tab3");
60			break;
61		}
62		$(".pds_article .cont").hide();
63		$(".pds_article .cont").eq(idx).show();
64		return false;
65
66	});
67	$(".people_article .tab li a").mouseover(function(){
68		var idx = $(this).parent().index();
69		$(".people_article .tab li").removeClass("on");
70		$(this).parent().addClass("on");
71		switch (idx){
72			case 0: $(this).parents(".tab").attr("class","tab tab0");
73			break;
74			case 1: $(this).parents(".tab").attr("class","tab tab1");
75			break;
76			case 2: $(this).parents(".tab").attr("class","tab tab2");
77			break;
78			case 3: $(this).parents(".tab").attr("class","tab tab3");
79			break;
80		}
81		$(".people_article .cont").hide();
82		$(".people_article .cont").eq(idx).show();
83		return false;
84
85	});
86
87	function setDefualtComumnTab(){
88		var idx = parseInt($("#column_tab_no").text(), 10);
89		if(idx == 1){
90			$(".column_article .tab li").removeClass("on");
91			$(".column_article .cont").hide();
92			$(".column_article .cont").eq(idx).show();
93			$(".column_article .tab").attr("class","tab tab"+idx);
94			$(".column_article .tab li").eq(idx).addClass("on");
95		}
96	}
97	setDefualtComumnTab(); //최신 뉴스의 Tab display
98
99	//s:2015-04-24
100	$(".column_article .tab li a").mouseover(function(){
101		var idx = $(this).parent().index();
102		$(".column_article .tab li").removeClass("on");
103		$(this).parent().addClass("on");
104		$(".column_article .cont").hide();
105		$(".column_article .cont").eq(idx).show();
106		switch (idx){
107			case 0: $(this).parents(".tab").attr("class","tab tab0");
108			break;
109			case 1: $(this).parents(".tab").attr("class","tab tab1");
110			break;
111		}
112		return false;
113	});
114
115	//e:2015-04-24
116	$(".rank_article .tab li a").mouseover(function(){
117		var idx = $(this).parent().index();
118		$(".rank_article .tab li").removeClass("on");
119		$(this).parent().addClass("on");
120		$(".rank_article .cont").hide();
121		$(".rank_article .cont").eq(idx).show();switch (idx){
122			case 0: $(this).parents(".tab").attr("class","tab tab0");
123			break;
124			case 1: $(this).parents(".tab").attr("class","tab tab1");
125			break;
126		}
127		return false;
128
129	});
130
131	$(".mg_eventresearch .tab li a").mouseover(function(){
132		var idx = $(this).parent().index();
133		$(".mg_eventresearch .tab li").removeClass("on");
134		$(this).parent().addClass("on");
135		$(".mg_eventresearch .cont").hide();
136		$(".mg_eventresearch .cont").eq(idx).show();switch (idx){
137			case 0: $(this).parents(".tab").attr("class","tab tab0");
138			break;
139			case 1: $(this).parents(".tab").attr("class","tab tab1");
140			break;
141		}
142		return false;
143
144	});
145
146	$(".menu_wrap .s_menu a").mouseover(function(){
147		var idx = $(this).parent().index();
148		$(".menu_wrap .s_menu a").removeClass("on");
149		$(this).addClass("on");
150		$(".sMenu_wrap").show();
151		$(".sMenu_wrap .menu").hide();
152		$(".sMenu_wrap .menu").show();
153	});
154	$(".sMenu_wrap").mouseleave(function(){
155		$(".menu_wrap .s_menu a").removeClass("on");
156		$(".sMenu_wrap, .sMenu_wrap .menu").hide();
157	});
158	$(".sMenu_wrap .btn_close").click(function(){
159		$(".menu_wrap .s_menu a").removeClass("on");
160		$(".sMenu_wrap, .sMenu_wrap .menu").hide();
161	});
162	$(".lnb_wrap .hd,.search_wrap").mouseover(function(){
163		$(".menu_wrap .s_menu a").removeClass("on");
164		$(".sMenu_wrap, .sMenu_wrap .menu").hide();
165
166	});
167
168	function chkBoxFn(trg){
169		$(document).on("change", trg, function(){
170			if($(this).attr("type") == "radio"){
171				$("input[name=" + $(this).attr("name") + "]").parent().removeClass("on");
172				$("input[name=" + $(this).attr("name") + "]").parent().parent("label").removeClass("on");
173			}
174			if($(this).prop("checked") == true){
175				$(this).parent().addClass("on");
176				$(this).parent().parent("label").addClass("on");
177			} else {
178				$(this).parent().removeClass("on");
179				$(this).parent().parent("label").removeClass("on");
180			}
181		});
182	}
183	chkBoxFn(".chkBox input");
184
185	$(".slide_wrap .prev, .slide_wrap .next , .column .prev, .column .next, .medical_trend .prev, .medical_trend .next").on({
186		mouseover : function(){
187			$(this).children().attr("src", function(){ return $(this).attr("src").replace("_off.png","_on.png") });
188		},
189		mouseleave : function(){
190			$(this).children().attr("src", function(){ return $(this).attr("src").replace("_on.png","_off.png") });
191		}
192	})
193});
194
195
196	// Stick Placeholders jQuery Plugin
197(function($) {
198  var alterParent = function(options, event) {
199    var label = $(this).data('label');
200
201    if (event && event.type === 'focusin') {
202      label.css('opacity', options.placeholderFocusOpacity);
203    } else if (event && event.type === 'focusout') {
204      label.css('opacity', options.placeholderOpacity);
205    }
206
207    if (event && event.type !== 'keydown') {
208      toggleLabel(this, label);
209    } else {
210      // Use timeout to catch val() just after the key is pressed
211      // Using keyup is too slow.
212      (function(input) {
213        setTimeout(function() {
214          toggleLabel(input, label);
215        }, 0);
216      })(this);
217    }
218  };
219
220  var toggleLabel = function(input, label) {
221    if ($(input).val()) {
222      label.hide();
223    } else {
224      label.show();
225    }
226  };
227
228  /*
229  $.fn.stickyPlaceholders = function(options) {
230    var defaults = {
231      wrapperClass: 'sticky-placeholder-wrapper',
232      wrapperDisplay: 'block',
233      labelClass: 'sticky-placeholder-label',
234      placeholderAttr: 'placeholder',
235      dataAttr: 'data-sticky-placeholder',
236      placeholderColor: '#000',
237      placeholderOpacity: 0.5,
238      placeholderFocusOpacity: 0.25
239    };
240    options = $.extend(defaults, options);
241
242    return this.each(function() {
243      var input       = $(this),
244          placeholder = input.attr(options.placeholderAttr),
245          wrapper     = $(this).wrap('<span class="' + options.wrapperClass + '" />').parent().css({'position':'relative', 'display':options.wrapperDisplay}),
246          label       = $('<label class="' + options.labelClass + '" for="' + input.attr('id') + '">' + placeholder + '</label>').appendTo(wrapper),
247          labelStyle;
248
249      // store a reference to each input's label
250      input.data('label', label);
251
252      // remove the placeholder attribute to avoid conflcits
253      input.removeAttr('placeholder');
254
255      // If the dataAttr is set and it's not equal to the placeholderAttr
256      if ( options.dataAttr && options.placeholderAttr !== options.dataAttr ) {
257        input.attr('data-sticky-placeholder', placeholder);
258      }
259
260      labelStyle = {
261        'color': options.placeholderColor,
262        'cursor': 'text',
263        'font-family': input.css('font-family'),
264        'font-weight': input.css('font-weight'),
265        'font-size': input.css('font-size'),
266        'left': parseInt(input.css('border-left-width'), 10) + parseInt(input.css('margin-left'), 10),
267        'line-height': this.currentStyle ? this.currentStyle.lineHeight : input.css('line-height'),
268        // fix for an IE/jQuery bug returning 1px when the line-height doesn't have a unit: http://bugs.jquery.com/ticket/2671
269        'opacity': options.placeholderOpacity,
270        'padding-left': input.css('padding-left'),
271        'padding-top': input.css('padding-top'),
272        'position': 'absolute',
273        'text-transform': input.css('text-transform'),
274        'top': parseInt(input.css('border-top-width'), 10) + parseInt(input.css('margin-top'), 10)
275      };
276      label.css(labelStyle);
277
278      // hide the placeholder if the input already has a value
279      if (input.val()) {
280        label.hide();
281      }
282
283      $(this).bind('keydown input focusin focusout', function(event) {
284        alterParent.call(this, options, event);
285      });
286
287      // prevent click/dblclick from selecting the label text
288      label.bind('mousedown', function(e) {
289        e.preventDefault();
290      });
291
292      // call alterParent initially without an event to set up the wrapper elements
293      alterParent.call(this, options);
294    });
295  };
296  */
297})(jQuery);
298
299
300
301// (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
302// 	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
303// 	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
304// 	'https://www.googletagmanager.com/gtag/js?id='+i+dl;f.parentNode.insertBefore(j,f);
305// 	})(window,document,'script','dataLayer','G-4EEBN5N2M9');
306
307// ui.js - original
308
309$(document).ready(function() {
310	//responsive menu toggle
311	$("#menutoggle").click(function() {
312		$('.xs-menu').toggleClass('displaynone');
313
314		});
315	//add active class on menu
316	/*
317	$('ul li').click(function(e) {
318		e.preventDefault();
319		$('li').removeClass('active');
320		$(this).addClass('active');
321	});
322	*/
323	//drop down menu
324	$(".drop-down").hover(function() {
325		$(".drop-down .mega-menu").removeClass("display-on");
326		$(this).children(".mega-menu").addClass('display-on');
327	});
328	$(".drop-down").mouseleave(function(ev) {
329		var el = document.elementFromPoint(ev.pageX, ev.pageY);
330		var outClass = $(el).attr("class");
331
332		if($(el).attr("class") !== "add-menu close"){
333			$(this).children(".mega-menu").removeClass('display-on');
334		}
335	});
336	$(".drop-down .mega-menu").hover(function() {
337		$(".drop-down .mega-menu").removeClass("display-on");
338		$(this).addClass('display-on');
339	});
340
341	$('#news_focus').each(function(){
342		var isNewsFocus = true;
343
344		 var $this = $(this), numberOfOptions = $(this).children('option').length;
345
346	    $this.addClass('select-hidden');
347	    $this.wrap('<div class="select"></div>');
348	    $this.after('<div class="select-styled"></div>');
349
350	    var $styledSelect = $this.next('div.select-styled');
351	    $styledSelect.text($this.children('option').eq(0).text());
352
353	    var $list = $('<ul />', {
354	        'class': 'select-options'
355	    }).insertAfter($styledSelect);
356
357	    for (var i = 0; i < numberOfOptions; i++) {
358	        $('<li />', {
359	            text: $this.children('option').eq(i).text(),
360	            rel: $this.children('option').eq(i).val()
361	        }).appendTo($list);
362	    }
363	    var $listItems = $list.children('li');
364
365	    //set default value
366	    if(isNewsFocus){
367		    var selMgUtp = getCookie('mgUtp'); //DOCTOR, PHARMA, GENERAL
368		    if(selMgUtp != ''){
369		    	defaultUserType(selMgUtp);
370		    }
371	    }
372
373	    $listItems.each(function(index, item){
374	        var val = $(this).attr('rel');
375	        if(val == selMgUtp){
376	            var label = $(this).text();
377	            $styledSelect.text(label);
378	        }
379	    })
380
381		 $styledSelect.click(function(e) {
382	        e.stopPropagation();
383	        $('div.select-styled.active').not(this).each(function(){
384	            $(this).removeClass('active').next('ul.select-options').hide();
385	        });
386	        $(this).toggleClass('active').next('ul.select-options').toggle();
387	    });
388
389	    $listItems.click(function(e) {
390	        var selectedValue = $(this).attr('rel');
391	        console.log('selectedValue ->', selectedValue); //DOCTOR, PHARMA, GENERAL
392	        e.stopPropagation();
393	        $styledSelect.text($(this).text()).removeClass('active');
394	        $this.val(selectedValue);
395	        $list.hide();
396	        //console.log($this.val());
397
398	        if(isNewsFocus){
399		        //RETREIEVE DATA OF SELECTED VALUE
400		        choiceUserType(selectedValue);
401	        }
402	    });
403
404	    $(document).click(function() {
405	        $styledSelect.removeClass('active');
406	        $list.hide();
407	    });
408	});
409
410	//open popup
411	$('.cd-popup-trigger').on('click', function(event){
412		event.preventDefault();
413		$('.cd-popup').addClass('is-visible');
414	});
415
416	//close popup
417	$('.cd-popup').on('click', function(event){
418		if( $(event.target).is('.cd-popup-close') || $(event.target).is('.cd-popup') ) {
419			event.preventDefault();
420			$(this).removeClass('is-visible');
421		}
422	});
423	//close popup when clicking the esc keyboard button
424	$(document).keyup(function(event){
425    	if(event.which=='27'){
426    		$('.cd-popup').removeClass('is-visible');
427	    }
428    });
429
430	$("btn_search").click(function(){
431		$("p").toggle();
432	});
433
434	$("#switch").on('click', function () {
435		if ($(".lstarea").hasClass("list")) {
436			$(".lstarea").removeClass("list");
437			$("#switch").removeClass("switched");
438			localStorage.setItem('recent_switched', 'N'); //added by hsjung
439		}
440		else {
441			$(".lstarea").addClass("list");
442			$("#switch").addClass("switched");
443			localStorage.setItem('recent_switched', 'Y'); //added by hsjung
444		}
445	});
446
447	$(".btn_search").on('click', function () {
448		if ($(".add-menu").hasClass("close")) {
449			$(".add-menu").removeClass("close");
450			$("#search-bar").focus();
451		}
452		else {
453			$(".add-menu").addClass("close");
454			$("#search-bar").val('');
455			$("#search-bar").onblur();
456		}
457	});
458});
459
460//서치바
461function searchToggle(obj, evt){
462    var container = $(obj).closest('.search-wrapper');
463	if(!container.hasClass('active')){
464		container.addClass('active');
465		evt.preventDefault();
466	}
467	else if(container.hasClass('active') && $(obj).closest('.input-holder').length == 0){
468		container.removeClass('active');
469		// clear input
470		container.find('.search-input').val('');
471	}
472}
473
474var initialPos = $('#nav').offset().top,
475	scrollPos = function() {
476		return $(window).scrollTop();
477	};
478
479$(window).on('scroll', function() {
480	if(scrollPos() > initialPos) {
481		$('#nav').addClass('nav--stuck');
482	} else {
483		$('.nav--stuck').removeClass('nav--stuck');
484	}
485})

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.