PageSourceSearch

https://kjfm.or.kr/script/user_dev.js?t=20260925151504

js kjfm.or.kr collected 2026-09-25 06:15:17 UTC 14,615 bytes, 512 lines download raw bytes

1
2	$(window).scroll(function() {
3		var scrollValue = $(window).scrollTop(),
4		basic_h = $(".header_wrap").outerHeight()+50;
5		if (scrollValue > basic_h) {
6			$("div.navigation_wrap").addClass("fixed");
7			$("dl.gnbSearch").addClass("fixed");
8			$(".article_paging").addClass("fixed");
9			$(".wrapper").addClass("fixed");
10			$(".top_btn").addClass("fixed");
11		} else {
12			$("div.navigation_wrap").removeClass("fixed");
13			$("dl.gnbSearch").removeClass("fixed");
14			$(".article_paging").removeClass("fixed");
15			$(".wrapper").removeClass("fixed");
16			$(".top_btn").removeClass("fixed");
17		}
18	});
19
20
21//View Page JS
22
23function journal_download(type, sid, filename) {
24	var increase_column;
25
26	if(type == "pdf") {
27		var openWindow = window.open("about:blank");
28		openWindow.location.href = '/upload/pdf/' + filename;
29
30		increase_column = "pdf_down";
31
32	} else if(type == "pdf_a") {
33		var openWindow = window.open("about:blank");
34		openWindow.location.href = '/upload/article/' + filename;
35
36		increase_column = "pdf_down";
37
38	} else if(type == "epub") {		
39		location.href = '/func/download.php?' + filename;		
40		increase_column = "epub_down";
41	}
42
43	$.ajax({
44		type: 'POST',
45		data: {table: 'journal_tbl', column: increase_column, count: 1, condition_column: 'sid', condition_value: sid},
46		url: '/func/count_increase.php'
47	});
48}
49
50
51
52
53// Photo Viewer Functions
54
55function openPhotoView(obj, xml_file, img_file) {
56    if (window.outerWidth >= 1361) {
57        fetchImageData(xml_file, img_file);
58        initializeOverlay();
59        handleThumbnail(obj);
60    }
61}
62
63function openPhotoView_MainPage(obj, xml_file, img_file) {
64    if (window.outerWidth >= 1361) {
65        event.preventDefault();
66        fetchImageData(xml_file, img_file);
67        initializeOverlay();
68        handleThumbnail(obj);
69    }
70}
71
72function openPhotoView_btn(obj, xml_file, img_file) {
73    if (window.outerWidth >= 1361) {
74        img_file = `/upload/thumbnails/${img_file}`;
75        changeMainImage(img_file);
76        initializeOverlay();
77        handleThumbnail(obj);
78    }
79}
80
81function fetchImageData(xml_file, img_file) {
82    $.ajax({
83        type: 'POST',
84        data: { xml_file: xml_file, img_file: img_file },
85        url: '/journal/image_view_text.php',
86        success: function (result) {
87			$(".main_image_txt").html("");
88            $(".main_image_txt").append(result);
89        }
90    });
91}
92
93function initializeOverlay() {
94    $("#overlay").show();
95    thumb_array = [];
96}
97
98function handleThumbnail(obj) {
99    $(obj).parent().parent().find('img.article_image').each(function (index) {
100        thumb_array.push($(this).attr("src"));
101
102        if ($(obj).attr("src") === $(this).attr("src")) {
103            thumb_index = index;
104            let img_name = $(this).attr("src");
105
106            if (img_name.includes('thum_')) {
107                const originalImage = img_name.replace(/thum_/, '');
108                changeMainImage(originalImage);
109            } else {
110                changeMainImage(img_name);
111            }
112        }
113    });
114}
115
116function closePhotoView() {
117    $('#overlay').hide();
118    $(".change_txt").remove();
119    thumb_array = [];
120}
121
122function changeMainImage(src) {
123    $("<img />").attr("src", src).on("load", function () {
124        let ratio = 800 / this.width;
125        let width = this.width * ratio;
126        let height = this.height * ratio;
127
128        if (height > 448) {
129            ratio = 448 / this.height;
130            width = this.width * ratio;
131            height = this.height * ratio;
132        }
133
134        const mainImage = $("#overlay #main_image_wrap #main_image");
135        mainImage.attr('src', this.src);
136        mainImage.attr('width', width);
137        mainImage.attr('height', height);
138    });
139}
140
141
142//ÆäÀÌÁö ¼±ÅÃ
143function page_search(page){
144	$('#page')[0].value = page;
145	$('#filter_form')[0].submit();
146}
147
148//ÆäÀÌÁö»õ·Î°íħ
149function f_page_reload(){
150	location.href = location.href;
151}	
152
153//ÇÊÅÍ ÃʱâÈ­
154function f_filter_reset(){
155	history.replaceState({}, null, location.pathname);// GET ÆÄ¶ó¹ÌÅͰ¡ ÀÖ´Â °æ¿ì ÆÄ¶ó¹ÌÅÍ »èÁ¦
156	$("ul > li > input:checkbox[name='p_filter_topic[]']").each(function() {
157		$(this)[0].checked = false;
158	});
159	$("ul > li > input:checkbox[name='p_filter_category[]']").each(function() {
160		$(this)[0].checked = false;
161	});
162	$("ul > li > input:checkbox[name='p_filter_keyword[]']").each(function() {
163		$(this)[0].checked = false;
164	});
165	$("ul > li > input:checkbox[name='p_filter_author[]']").each(function() {
166		$(this)[0].checked = false;
167	});
168	$("ul > li > input:checkbox[name='p_filter_year[]']").each(function() {
169		$(this)[0].checked = false;
170	});
171	$("ul > li > input:checkbox[name='p_filter_fund[]']").each(function() {
172		$(this)[0].checked = false;
173	});
174	$('#filter_form')[0].submit();
175
176}
177
178///////////////Main Page function/////////////////////////
179
180function Main_goPage(vol, no) {
181	
182	var f = document.paging;
183
184	f.vol.value = vol;
185	f.no.value = no;
186
187	f.action = "./index.php"
188
189	f.method = "post"
190	f.submit();
191	
192};
193
194///////////////View Page function/////////////////////////
195
196function View_XMLDownload(doi) {
197	
198	var f = document.paging;
199	f.doi.value = doi;
200	f.action = "./scholar_xmls.php";
201	f.method = "post"
202	f.submit();
203	
204	
205};
206
207//////////////////////////////////////////////////////////
208
209
210$(window).resize(function () {
211    if (window.outerWidth <= 1361) {
212        closePhotoView();
213    }
214});
215
216$(function () {
217
218///////////////////////filter script	/////////////////////////////
219	$(document).on("click","a#filter_category_more",function() {
220		
221		if($("#filter_category_layer").css("display") == "none"){
222			$('#filter_category_layer').show();
223		} else {
224			$('#filter_category_layer').hide();
225		}
226
227		return false
228	});
229
230	$(document).on("click","a#filter_topic_more",function() {
231		
232		if($("#filter_topic_layer").css("display") == "none"){
233			$('#filter_topic_layer').show();
234		} else {
235			$('#filter_topic_layer').hide();
236		}
237
238		return false
239	});
240
241	$(document).on("click","a#filter_keyword_more",function() {
242		
243		if($("#filter_keyword_layer").css("display") == "none"){
244			$('#filter_keyword_layer').show();
245		} else {
246			$('#filter_keyword_layer').hide();
247		}
248
249		return false
250	});
251
252	$(document).on("click","a#filter_author_more",function() {
253		
254		if($("#filter_author_layer").css("display") == "none"){
255			$('#filter_author_layer').show();
256		} else {
257			$('#filter_author_layer').hide();
258		}
259
260		return false
261	});
262
263	$(document).on("click","a#filter_year_more",function() {
264		
265		if($("#filter_year_layer").css("display") == "none"){
266			$('#filter_year_layer').show();
267		} else {
268			$('#filter_year_layer').hide();
269		}
270
271		return false
272	});
273
274	$(document).on("click","a#filter_fund_more",function() {
275		
276		if($("#filter_fund_layer").css("display") == "none"){
277			$('#filter_fund_layer').show();
278		} else {
279			$('#filter_fund_layer').hide();
280		}
281
282		return false
283	});
284
285	$('ul > li > input:checkbox').on("click", function(){		
286		var this_name = $(this)[0].name;
287		var this_value = $(this)[0].value;
288		var this_checked = $(this)[0].checked;
289
290		$('ul > li > input:checkbox').each(function() {
291			if($(this)[0].name == this_name && $(this)[0].value == this_value) { 
292				$(this)[0].checked = this_checked;
293			}
294		});
295	});
296
297	$('ul[name="filter"] > li > input:checkbox').on("click", function(){	
298		//history.replaceState({}, null, location.pathname);// GET ÆÄ¶ó¹ÌÅͰ¡ ÀÖ´Â °æ¿ì ÆÄ¶ó¹ÌÅÍ »èÁ¦
299		$('#page')[0].value = "1";
300		$('#filter_form')[0].submit();
301	});
302
303	//filer layer
304	$(document).on("click","input#filter_layer_submit",function() {
305		//history.replaceState({}, null, location.pathname);// GET ÆÄ¶ó¹ÌÅͰ¡ ÀÖ´Â °æ¿ì ÆÄ¶ó¹ÌÅÍ »èÁ¦
306		$('#page')[0].value = "1";
307		$('#filter_form')[0].submit();
308	});
309
310	$(document).on("click","a#filter_layer_close",function() {
311		$('.layer_pop').each(function() {
312			$(this).hide();
313		});
314	});	
315
316	//±âŸ
317	$(document).on("click","span[name='funded_link']",function() {
318		var this_value = $(this)[0].innerText;
319
320		$("ul > li > input:checkbox[name='p_filter_fund[]']").each(function() {
321			if($(this)[0].value == this_value) { 
322				$(this)[0].checked = true;
323			}
324		});
325
326		$('#page')[0].value = "1";
327		$('#filter_form')[0].submit();
328	});
329//////////////////////////////////////////////////////////////////////////
330
331
332////////////////viewpage script///////////////////////////
333
334    $('form[name="cited_btn"] a.btnPoint_down').on("click", function (e) {
335        e.preventDefault(); // ±âº» µ¿ÀÛ ¹æÁö
336
337        // .layer_pop ¿ä¼Ò ã±â
338        //var cited_popup = $(this).closest(".layer_pop");
339		var cited_popup = $(this).closest(".articleAside").find(".layer_pop");
340
341		// .layer_popÀÇ display ¼Ó¼º È®ÀÎ ¹× Åä±Û
342		if (cited_popup.is(":hidden")) {
343			cited_popup.show(); // º¸À̱â
344		} else {
345			cited_popup.hide(); // ¼û±â±â
346		}
347
348        return false;
349    });
350
351    // Close ¹öư Ŭ¸¯ À̺¥Æ®
352    $(".layer_pop .close").on("click", function (e) {
353        e.preventDefault(); // ±âº» µ¿ÀÛ ¹æÁö
354
355        // .layer_pop ¼û±â±â
356        $(this).closest(".layer_pop").hide();
357
358        return false;
359    });
360
361    // ´Ý±â ¹öư(.close_ic a) Ŭ¸¯ À̺¥Æ®
362    $(".close_ic a").on("click", function (e) {
363        e.preventDefault(); // ±âº» µ¿ÀÛ ¹æÁö
364
365        // .close_ic ±âÁØÀ¸·Î .div_dc_back ¼û±â±â
366        var cited_popup = $(this).closest(".div_dc_back");
367        cited_popup.hide();
368
369        return false;
370    });
371
372	if ($('form[name="cited_btn"]').length) {
373
374		$('form[name="cited_btn"] select').change( function(){
375			type = $(this).val();
376			number = $(this).closest('.popupWrap').find('input:hidden[name="number"]').val();
377			//text = $(this).closest("dd").find('.popupCon')[0];
378			text = $(this).closest('.popupWrap').find('#cited_text');
379			$.ajax({
380				type: 'POST',
381				data: {type:type, number:number},
382				url: '../journal/ajax_cited_text.php',
383				success: function(result) {
384					text.html(result);
385				}
386			});
387		});
388
389		$('form[name="cited_btn"] a.btnPoint').on("click", function(){
390			//text = $(this).closest("dd").find('.popupCon')[0].innerText;
391			var text = $(this).parents(".popupWrap").find("#cited_text").text();
392			$('#clip_target').val(text);
393			$('#clip_target').select();
394			
395			document.execCommand('copy');
396			alert('Citation successfully copied.');
397		});
398
399	
400
401		$('form[name="cited_btn"] a.btnDef').on("click", function(){
402			type = $(this).val();
403			number = $(this).closest('.popupWrap').find('input:hidden[name="number"]').val();
404			//text = $(this).closest("dd").find('.popupCon')[0];
405			text = $(this).closest('.popupWrap').find('#cited_text');
406			$.ajax({
407				type: 'POST',
408				data: {type:type, number:number},
409				url: '../journal/ajax_cited_text.php',
410				success: function(result) {
411					text.html(result);
412				}
413			});
414		});
415	}
416//////////////////////////////////////////////////////////
417	/*
418    $('a[href*="#"]:not([href="#"])').click(function () {
419        event.preventDefault();
420        const target = $(this.hash);
421        const headerHeight = $('.header__container').height();
422        const articleMenuHeight = $('.articleMenu').height() || 0;
423        const offsetTop = target.offset().top - (headerHeight + articleMenuHeight);
424
425        $('html, body').animate({ scrollTop: offsetTop }, 1);
426    });
427	*/
428
429    function scrollToAnchor() {
430        var target = $(window.location.hash);
431        if (target.length) {
432            var header_height = $('.navigation_wrap').height() || 0;
433            var articleMenu_height = $('.articleMenu').height() || 0;
434			alert(header_height);
435			alert(articleMenu_height);
436            var offset_top = target.offset().top - (header_height + articleMenu_height + 150);
437            $('html, body').stop(true, true).animate({scrollTop: offset_top}, 500);
438        }
439    }
440	/*
441    // ¸µÅ© Ŭ¸¯ ½Ã ¾ÞÄ¿·Î À̵¿
442    $('a[href*="#"]:not([href="#"])').click(function(event) {
443        var thisDomain = window.location.hostname;
444        var linkDomain = this.hostname;
445
446        if (thisDomain === linkDomain) {
447            event.preventDefault();
448            window.location.hash = this.hash;
448 // URL¿¡ ¾ÞÄ¿ Ãß°¡
449            scrollToAnchor(); // ½ºÅ©·Ñ À̵¿
450        } else {
451            window.location.href = this.href; // ´Ù¸¥ µµ¸ÞÀÎÀ¸·Î °¡´Â °æ¿ì ±âº» µ¿ÀÛ ¼öÇà
452        }
453    });
454	*/
455
456	$('a[href*="#"]:not([href="#"])').click(function (event) {
457		const href = $(this).attr('href'); // Ŭ¸¯µÈ ¸µÅ©ÀÇ href
458		const currentUrl = window.location.origin + window.location.pathname; // ÇöÀç ÆäÀÌÁöÀÇ URL (µµ¸ÞÀÎ+°æ·Î)
459		const targetUrl = href.split('#')[0] ? new URL(href, window.location.origin).href : currentUrl; // ¸µÅ©ÀÇ URL (¾ÞÄ¿ Á¦¿Ü)
460
461		// °°Àº ÆäÀÌÁö ³» ¾ÞÄ¿ÀÎÁö È®ÀÎ
462		const isSamePage = currentUrl === targetUrl;
463
464		if (isSamePage) {
465			// °°Àº ÆäÀÌÁö ³» ¾ÞÄ¿ ó¸®
466			event.preventDefault(); // ±âº» µ¿ÀÛ ¹æÁö
467			const target = $(this.hash); // ¾ÞÄ¿ Ÿ°Ù
468			if (target.length) {
469				const headerHeight = $('.navigation_wrap').height() || 0;
470				const articleMenuHeight = $('.articleMenu').height() || 0;
471				const offsetTop = target.offset().top - (headerHeight + articleMenuHeight);
472
473				// ½ºÅ©·Ñ ¾Ö´Ï¸ÞÀ̼Ç
474				$('html, body').stop(true, true).animate({ scrollTop: offsetTop }, 500);
475			}
476		} else {
477			// ´Ù¸¥ ÆäÀÌÁö À̵¿
478			// À̵¿ ÈÄ ¾ÞÄ¿ µ¿ÀÛÀ» ºê¶ó¿ìÀú ±âº» µ¿ÀÛ¿¡ ¸Ã±è
479		}
480	});
481
482
483});
484
485	//Supple °ü·Ã
486	$(window).on("load", function () {
487		const hash = window.location.hash;
488		if(hash){
489			if (hash === "#supplementary-material" || hash === "#supplementary-materials") {
490				const targetLink = $('.conMenu li a').filter(function () {
491					return $(this).text().trim().toLowerCase() === "supplementary materials" ||
492						   $(this).text().trim().toLowerCase() === "supplementary material";
493				});
494
495				if (targetLink.length) {
496					// ¸µÅ©¿¡ "on" Ŭ·¡½º Ãß°¡
497					$('.conMenu li a').removeClass('on'); // ´Ù¸¥ ¸µÅ©ÀÇ "on" Ŭ·¡½º Á¦°Å
498					targetLink.addClass('on');
499
500					// ½ºÅ©·Ñ À̵¿
501					const headerHeight = $('.navigation_wrap').height();
502					const articleMenuHeight = $('.articleMenu').height() || 0;
503					const targetSection = $(targetLink.attr('href')); // ¸µÅ©ÀÇ href ¼Ó¼ºÀ» ±âÁØÀ¸·Î ¼½¼Ç ã±â
504					if (targetSection.length) {
505						const offsetTop = targetSection.offset().top - (headerHeight + articleMenuHeight);
506						$('html, body').animate({ scrollTop: offsetTop }, 1);
507					}
508				}
509
510			}
511		}
512	});

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.