PageSourceSearch

https://i.compasspub.com/eng/front/js/ui.js

js compasspub.com collected 2026-10-02 06:37:11 UTC 6,559 bytes, 272 lines download raw bytes

1//gnb
2$(function(){
3	if ($("#gnb").size() == 1){
4	var $gnb = $("#gnb").find('ul');
5	// default reset
6	function resetGnb(){
7		// $gnb.find('>li').each(function(){
8		// 	var $self = $(this);
9		// 	imgReplace($self.find('>a>img'),'on');
10		// 	$('.m01Layer').hide()
11		// 	$gnb.find("> li").removeClass('on');
12		// })
13	};
14	
15	
16	// 1depth control 
17	$gnb.find("> li > a")
18		.bind("mouseenter", function(){
19			resetGnb();
20			// if( $(this).hasClass('m01') ) {
21			// 	$('.m01Layer').show()
22			// } else {
23			// 	$('.m01Layer').hide()
24			// }
25			
26			
27			// $gnb.find("> li").removeClass('on');
28			// $(this).parent('li').addClass('on');
29
30			// var dpe2ImgReset = $gnb.find("> li > ul > li")
31			// dpe2ImgReset.each(function(){
32			// 	$(this).find('>a>img').attr('src', $(this).find('>a>img').attr('src').replace('_on.gif', '_off.gif'));
33			// });
34			// $(this).find('>img').attr('src', $(this).find('>img').attr('src').replace('_off.gif', '_on.gif'));
35		})
36		.bind("focusin", function(){
37			$(this).mouseenter();
38		});
39
40	//gnb reset
41	$('#header').bind("mouseleave", function(){
42		resetGnb()
43		var gnb1DepImg = $gnb.find("> li")
44		gnb1DepImg.each(function(){
45			// $(this).find('>a>img').attr('src', $(this).find('>a>img').attr('src').replace('_on.gif', '_off.gif'));
46		});
47		try{ gnbInit(gnbDep1) } catch(err){}
48	});
49
50	//init
51	function gnbInit(dep1, dep2){
52		resetGnb();
53		if (dep1 != 0){
54			var $gnb_dep1 = $gnb.find('> li').eq(dep1-1);
55			// imgReplace($gnb_dep1.find('>a>img'),'off');
56			// $gnb_dep1.find('ul').show()
57		}
58	}
59	try{ gnbInit(gnbDep1) } catch(err){}
60	}
61})
62
63/* lnb */
64$(function(){
65	if ($("#lnb").size() == 1){
66	var $lnb = $("#lnb").find('ul.menu');
67	// default reset
68	function resetLnb(){
69		$lnb.find('>li').each(function(){
70			var $self = $(this);
71			$self.find('>a').removeClass('on')
72		})
73	};
74	// 1depth control 
75	$lnb.find("> li > a")
76		.bind("mouseenter", function(){
77			resetLnb();
78			$(this).addClass('on')
79		})
80		.bind("focusin", function(){
81			$(this).mouseenter();
82		});
83
84	//lnb reset
85	$('#lnb .menu').bind("mouseleave", function(){
86		resetLnb()
87		try{ lnbInit(lnbDep1, lnbDep2) } catch(err){}
88	});
89	//init
90	function lnbInit(dep1, dep2){
91		resetLnb();
92		if (dep1 != 0){
93			var $lnb_dep1 = $lnb.find('> li').eq(dep1-1);
94			$lnb_dep1.find('>a').addClass('on').next('ul').css({'display':'block'});
95
96			if (dep2 != 0){
97				var $lnb_dep2 = $lnb_dep1.find('ul li').eq(dep2-1);
98				$lnb_dep2.addClass('on')
99			}
100		}
101	}
102	try{ lnbInit(lnbDep1, lnbDep2) } catch(err){}
103	}
104})
105
106$(function(){
107	//input[type="file"]
108	$('div.file_form_area').fileform();
109
110	//textarea
111	$('div.textarea_wrap').placeholder({selector: 'textarea.textarea'});
112})
113
114/* 
115 * input, textarea placeholder
116 * param : input, textarea 등 셀렉터
117 */
118;(function($){
119	$.fn.extend({
120		placeholder: function( options ){
121			this.defaults = {
122				selector: 'input.inputbox'
123			};
124			var settings = $.extend({}, this.defaults, options);
125			return this.has(settings.selector).has('label').not('.has-placeholder').each(function() {
126				var $this = $(this),
127					$inputbox = $this.find(settings.selector),
128					$label = $this.find('label');
129				$label.css('cursor', 'text').on('click', function() {
130					$inputbox.focus();
131				});
132				$inputbox.on('focus', function() {
133					$label.hide();
134				}).on('blur', function() {
135					$inputbox.val($.trim($inputbox.val()));
136					if( $inputbox.val().length) {
137						$label.hide();
138					} else {
139						$label.show();
140					}
141				});
142				$inputbox.trigger('blur');
143				$this.addClass('has-placeholder');
144			});
145		}
146	});
147})(jQuery);
148
149/* input[type="file"] 커스텀 스타일 */
150;(function($){
151	$.fn.extend({
152		fileform: function( options ) {
153			this.defaults = {
154			};
155			var settings = $.extend({}, this.defaults, options);
156			return this.each(function() { 
157				var $this = $(this),
158					$input = $this.find('input.inputbox'),
159					$ul = $this.find('ul.file_list'),
160					$file = $this.find('input[type="file"]');
161				$this.on('click', 'a.btn_sub', function() {
162					$file.trigger('click');
163				});
164				$file.on('change', function(e) {
165					if($this.is('.single')) {
166						$input.val(this.value);
167					} else {
168						$.each(this.files, function() {
169							$ul.append('<li><input type="checkbox" name="file">' + this.name + '<a><span class="blind">delete</span></a></li>')
170						});
171					}
172				});
173				$ul.on('click', 'a', function() {
174					//filelist is read only
175				});
176			});
177		}
178	});
179})(jQuery);
180
181/* faq */
182$(function () {
183	$('.faq-wrap dt a').click(function () {
184		var faqListContainer = $(this).parent().parent();
185		var currentContent = $(this).parent().next('dd');
186		if ( 'block' == $(this).parent().next('dd').css('display') ) {
187			currentContent.slideUp(280);
188			$('.faq-wrap dt').removeClass('active');
189		} else {
190			faqListContainer.find('dd').slideUp(280);
191			currentContent.stop().slideDown(280);
192			$('.faq-wrap dt').removeClass('active');
193			$(this).parent('dt').addClass('active');
194		}
195	});
196});
197
198/*  image file name change */
199function imgReplace(obj,current){
200	switch (current){
201		case 'on' :
202			obj.attr('src',obj.attr('src').replace('_on.','_off.'));
203			break;
204		case 'off' :
205			obj.attr('src',obj.attr('src').replace('_off.','_on.'));
206			break;
207	}
208};
209
210/*약관및방침*/
211function combine(){
212	$( ".combine" ).load( "/eng/include/combine.html" );
213}
214
215$(document).ready(function() {
216	combine();
217});
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236/* family site */
237$(function() {
238	$('.fSite .btn').click(function() {
239		var thisHref = $(this).attr('data-position');
240		var siteLayer = "." + thisHref;
241		$(siteLayer).stop().slideToggle(200);
242		return false;
243	});
244
245	$('.fSite .f_site_list a').click(function(event) {
246		$('.fSite .f_site_list').slideUp()
247	});
248});
249
250$(function() {
251	$('.testBx').find('a>img').hover(function() {
252		$(this).parent().addClass('on');
253		imgReplace($(this),'off');
254	}, function() {
255		$(this).parent().removeClass('on');
256		imgReplace($(this),'on');
257	});
258});
259
260
261
262/* popup */
263function PopupCenter(popNM, parms, width, height){
264	var sw  = screen.availWidth ;
265	var sh  = screen.availHeight ;	
266	px=(sw - width)/2 ;
267	py=(sh - height)/2 ;
268	var set  = 'top=' + py + ',left=' + px ;
269	set += ',width=' + width + ',height=' + height + ',menubar = no, toolbar = no, location = no, status = no, scrollbars = yes, resizable = no' ;
270	window.name="pop";
271	window.open (popNM + parms , '' , set) ;
272}

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.