PageSourceSearch

https://skoolooks.com/app/javascript/js/board-display.js?dummy=20261007133135

js skoolooks.com collected 2026-10-07 04:32:05 UTC 20,586 bytes, 604 lines download raw bytes

1/* 게시판넣기 기능추가 */
2$(function(){
3			
4	/* 이미지꾸미기 이미지 마우스오버 이벤트 설정 */
5	$(".BoardgoodsDisplayImageWrap")
6	.live("mouseenter",function(){
7		var decoration = $(this).data("decoration");
8		var goodsInfo = $(this).data("goodsInfo");
9		var imageObj = $(this).find("img:eq(0)");
10		
11		if(decoration){
12			if(decoration['image_border']){
13				$(this).css({"border":decoration['image_border_width'] + "px solid " + decoration['image_border'],"margin":"-"+decoration['image_border_width']+"px"});
14			}
15			
16			if(decoration['image_opacity']){
17				imageObj.css({"opacity":1-decoration['image_opacity']/100});
18			}
19			
20			if(decoration['image_icon'] && decoration['image_icon_over']=='y'){
21				var imageIconObj = $(".goodsDisplayImageIcon",this);
22				imageIconObj.show();	
23			}
24
25			if(decoration['image_overay2'] || decoration['image_overay2_text']){
26
27				if($(".goodsDisplayImageOveray2",this).length){
28					var overay2Obj = $(".goodsDisplayImageOveray2",this);
29				}else{
30					var overay2Obj = $("<div class='goodsDisplayImageOveray2'><div class='goodsDisplayImageOveray2Bg'></div><div class='goodsDisplayImageOveray2Text'></div></div>");
31				}
32				
33				var overay2Height = 20;
34				var overay2Top = $(".goodsDisplayImageOveray1",this).length ? $(this).height() - $(".goodsDisplayImageOveray1",this).height(): $(this).height();
35
36				switch(decoration['image_overay2']){
37					case "":
38					default:
39						var overay2Text = decoration['image_overay2_text'];
40					
41						break;
42				}
43				
44				overay2Obj
45				.css({
46					'position'			: 'absolute',
47					'left'				: 0,
48					'top'				: overay2Top-overay2Height,
49					'width'				: $(this).width(),
50					'height'			: overay2Height
51				});
52				
53				$(".goodsDisplayImageOveray2Bg",overay2Obj)
54				.css({
55					'background-color'	: '#000000',
56					'color'				: '#fff',
57					'opacity'			: 0.3,
58					'position'			: 'absolute',
59					'left'				: 0,
60					'top'				: 0,
61					'width'				: $(this).width(),
62					'height'			: overay2Height
63				});
64				
65				$(".goodsDisplayImageOveray2Text",overay2Obj)
66				.html(overay2Text)
67				.css({
68					'color'				: '#fff',
69					'font-size'			: '11px',
70					'font-weight'		: 'bold',
71					'text-align'		: 'center',
72					'position'			: 'absolute',
73					'overflow'			: 'hidden',
74					'white-space'		: 'nowrap',
75					'line-height'		: overay2Height+'px',
76					'left'				: 0,
77					'top'				: 0,
78					'width'				: $(this).width()
79				});
80				imageObj.after(overay2Obj.show());
81				
82			}else{
83				$(".goodsDisplayImageOveray2",this).remove();
84			}
85		}
86	})
87	.live("mouseleave",function(){
88		var decoration = $(this).data("decoration");
89		var goodsInfo = $(this).data("goodsInfo");
90		var imageObj = $(this).find("img:eq(0)");
91		
92		if(decoration){
93			if(decoration['image_border']){
94				$(this).css({"border":0,"margin":"0px"});
95			}
96			
97			if(decoration['image_opacity']){
98				imageObj.css({"opacity":1});
99			}
100			
101			if(decoration['image_overay2'] || decoration['image_overay2_text']){
102				$(".goodsDisplayImageOveray2",this).hide();
103			}
104			
105			if(decoration['image_icon'] && decoration['image_icon_over']=='y'){
106				$(".goodsDisplayImageIcon",this).hide();
107			}
108		}
109	});
110	
111	/* 어드민 */
112	$(".goodsDisplayDecorationContainer").each(function(){
113		var goodsDisplayDecorationContainer = this;
114		
115		/* 샘플이미지 : 사이즈변경 */
116		$("select.image_size",goodsDisplayDecorationContainer).change(function(){
117			var image_size = $(this).val();
118			$(".BoardgoodsDisplayImageWrap img, .goodsDisplayImageTable",goodsDisplayDecorationContainer).css({"width":$("option:selected",this).attr('width'),"height":$("option:selected",this).attr('height')});
119			goods_image_decoration_data_(goodsDisplayDecorationContainer);
120		}).change();
121		
122		/* 이미지꾸미기 - 오버레이 입력폼 show,hide 효과 */
123		$("select.image_overay1, select.image_overay2",goodsDisplayDecorationContainer).change(function(){
124			if($(this).val()=='') $(this).parent().children(".image_overay_text").show();
125			else $(this).parent().children(".image_overay_text").hide();		
126		}).change();
127		
128		/* 이미지꾸미기 - 아이콘 선택창 열기 버튼  */
129		$(".image_icon_select",goodsDisplayDecorationContainer).live("click",function(){
130			var uniqueKey = "image_icon_select_"+Math.floor(Math.random()*10000000);
131			$(this).attr('uniqueKey',uniqueKey);
132			$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
133			set_display_image_icon_();
134			openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
135		});
136		
137		/* 이미지꾸미기 - 체크박스값에 따른 disabled 처리 */
138		$(".image_decorate_chk",goodsDisplayDecorationContainer).change(function(){
139			if($(this).is(":checked")){
140				$(this).closest(".image_decoration_table").find("*").not(this).filter(function(){return $(this).is("select") || $(this).children().length==0;}).css('opacity',1).removeAttr('disabled');
141			}else{
142				$(this).closest(".image_decoration_table").find("*").not(this).filter(function(){return $(this).is("select") || $(this).children().length==0;}).css('opacity',0.3).attr('disabled',true);
143			}	
144		}).change();
145	
146		/* 이미지꾸미기 선택정보를 샘플이미지에 적용*/
147		$(".image_decoration_table select, .image_decoration_table input",goodsDisplayDecorationContainer).change(function(){
148			goods_image_decoration_data_(goodsDisplayDecorationContainer);
149		});
150		
151		/* 상품정보 텍스트정렬을 샘플이미지에 적용 */
152		$("input.text_align",goodsDisplayDecorationContainer).change(function(){
153			if($(this).is(':checked')){
154				$(".goodsDisplayAlign",goodsDisplayDecorationContainer).css("text-align",$(this).val());
155			}
156		}).change();
157		
158		/* 상품정보 항목 값 변경 */
159		$("div.info_item .info_item_selector",goodsDisplayDecorationContainer).live('change',function(){
160			//change_info_item_(this);
161		});
162	
163		/* 상품정보 항목 Sortable */
164		$(".info_item_container",goodsDisplayDecorationContainer).sortable({
165				placeholder: "info_item_holder"
166		});
167		
168		set_info_item_data(goodsDisplayDecorationContainer);
169	});
170	
171	/* 어드민 - 이미지꾸미기 - 아이콘 선택 */
172	$("#displayImageIconPopup img.icon").live("click",function(){
173		var uniqueKey = $("#displayImageIconPopup input[name='uniqueKey']").val();
174		
175		$(".image_icon_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
176		
177		var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/","");
178
179		$(".image_icon_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_icon').val(selectedIconName).change();
180		closeDialog("displayImageIconPopup");
181	});	
182	
183	/* 이미지꾸미기 이미지 설정 */
184	set_goods_display_decoration_(".BoardgoodsDisplayImageWrap");
185});
186
187/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
188function set_display_image_icon_(){	
189	$.getJSON('../design/display_image_icon', function(data) {
190		var tag = '';
191		$("div#displayImageIconPopup ul li").remove();	
192
193		for(var i=0;i<data.length;i++){			
194			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
195			tag += '<img src="/data/icon/goodsdisplay/'+data[i]+'" border="0" class="icon hand hover-select">';					
196			tag += '</li>';
197		}
198		$("div#displayImageIconPopup ul").html(tag);
199	});	
200}
201
202/* 이미지꾸미기 이미지 설정 */
203function set_goods_display_decoration_(selector, force){
204	
205	$(selector)
206	.css({'position':'relative','display':'inline-block'})
207	.each(function(){
208		
209		var that = this;
210		var imageObj = $(this).find("img:eq(0)");
211
212		if($(this).data('decorationLoaded') || !$(this).attr("decoration")){
213			return;
214		}
215		
216		if($(that).attr("decoration")) $(that).data("decoration",eval("("+Base64.decode($(that).attr("decoration"))+")"));
217		//if($(that).attr("goodsInfo")) $(that).data("goodsInfo",eval("("+Base64.decode($(that).attr("goodsInfo"))+")"));
218		
219		var decoration = $(that).data("decoration");
220		//var goodsInfo = $(that).data("goodsInfo");
221		
222		if(decoration){
223			
224			if(decoration['image_icon']){
225				if($(".goodsDisplayImageIcon",this).length){
226					$(".goodsDisplayImageIcon",this).remove();
227				}
228				
229				var imageIconObj = $("<div class='goodsDisplayImageIcon'><img src='/data/icon/goodsdisplay/"+decoration['image_icon']+"' /><span class='goodsDisplayImageIconText'></span></div>");
230				
231				if(decoration['image_icon_location']=='right'){
232					imageIconObj
233					.css({
234						'position'			: 'absolute',
235						'left'				: imageObj.position().left,
236						'top'				: imageObj.position().top,
237						'width'				: '100%',
238						'text-align'		: 'right'
239					});
240				}else{
241					imageIconObj
242					.css({
243						'position'			: 'absolute',
244						'left'				: imageObj.position().left,
245						'top'				: imageObj.position().top
246					});
247				}
248				
249				switch(decoration['image_icon']){
250					case 'icon_best_no.png':
251						var designDisplayObj = $(that).closest("div.designDisplay, div.designCategoryBoardDisplay, div.designCategoryRecommendDisplay");
252						 
253						if(designDisplayObj.length){
254							designDisplayObj.data('iconIdx',num(designDisplayObj.data('iconIdx'))+1);
255							var iconText = designDisplayObj.data('iconIdx');
256						}else{
257							var iconText = 1;
258						}
259						$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
260							'position'		: 'absolute',
261							'font-size'		: '16px',
262							'font-family'	: 'tahoma',
263							'font-weight'	: 'bold',
264							'text-align'	: 'center',
265							'color'			: '#ffffff',
266							'letter-spacing': '-1px',
267							'width'			: 48,
268							'top'			: $(imageObj).position().top+25
269						});
270						
271						if(decoration['image_icon_location']=='right'){
272							$(".goodsDisplayImageIconText",imageIconObj).css({
273								'left'			: $(imageObj).width()-48
274							});
275						}else{
276							$(".goodsDisplayImageIconText",imageIconObj).css({
277								'left'			: 0
278							});
279						}
280					break;
281					case 'icon_number.png':
282						var designDisplayObj = $(that).closest("div.designDisplay");
283						if(designDisplayObj.length){
284							designDisplayObj.data('iconIdx',num(designDisplayObj.data('iconIdx'))+1);
285							var iconText = designDisplayObj.data('iconIdx');
286						}else{
287							var iconText = 1;
288						}
289						$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
290							'position'		: 'absolute',
291							'font-size'		: '18px',
292							'font-family'	: 'tahoma',
293							'font-weight'	: 'bold',
294							'text-align'	: 'right',
295							'color'			: '#ffffff',
296							'letter-spacing': '-1px',
297							'width'			: 28,
298							'top'			: $(imageObj).position().top+10
299						});
300						
301						if(decoration['image_icon_location']=='right'){
302							$(".goodsDisplayImageIconText",imageIconObj).css({
303								'left'			: $(imageObj).width()-46
304							});
305						}else{
306							$(".goodsDisplayImageIconText",imageIconObj).css({
307								'left'			: 0
308							});
309						}
310					break;
311					case 'icon_sale.png': 
312						if(decoration['image_icon_location']=='right'){
313							$(".goodsDisplayImageIconText",imageIconObj).css({
314								'left'			: $(imageObj).width()-48
315							});
316						}else{
317							$(".goodsDisplayImageIconText",imageIconObj).css({
318								'left'			: 0
319							});
320						}						
321					break;
322				}
323				
324				if(decoration['image_icon_over']=='y'){
325					imageIconObj.hide();
326				}else{
327					imageIconObj.show();
328				}
329				
330				imageObj.after(imageIconObj);
331			}else{
332				$(".goodsDisplayImageIcon",that).remove();
333			}
334
335			if(decoration['image_overay1'] || decoration['image_overay1_text']){
336				
337				if($(".goodsDisplayImageOveray1",this).length){
338					$(".goodsDisplayImageOveray1",this).remove();
339				}
340
341				var overay1Obj = $("<div class='goodsDisplayImageOveray1'><div class='goodsDisplayImageOveray1Bg'></div><div class='goodsDisplayImageOveray1Text'></div></div>");
342				
343				var overay1Height = 20;
344
345				switch(decoration['image_overay1']){  
346					default:
347						var overay1Text = decoration['image_overay1_text'];
348					
349						break;
350				}
351	
352				overay1Obj
353				.css({
354					'position'			: 'absolute',
355					'left'				: 0,
356					'top'				: '100%',
357					'margin-top'		: -overay1Height,
358					'width'				: $(that).width(),
359					'height'			: overay1Height
360				});
361				
362				$(".goodsDisplayImageOveray1Bg",overay1Obj)
363				.css({
364					'background-color'	: '#000000',
365					'color'				: '#fff',
366					'opacity'			: 0.3,
367					'position'			: 'absolute',
368					'left'				: 0,
369					'top'				: 0,
370					'width'				: $(that).width(),
371					'height'			: overay1Height
372				});
373
374				$(".goodsDisplayImageOveray1Text",overay1Obj)
375				.html(overay1Text)
376				.css({
377					'color'				: '#fff',
378					'font-size'			: '11px',
379					'font-weight'		: 'bold',
380					'text-align'		: 'center',
381					'position'			: 'absolute',
382					'overflow'			: 'hidden',
383					'white-space'		: 'nowrap',
384					'line-height'		: overay1Height+'px',
385					'left'				: 0,
386					'top'				: 0,
387					'width'				: $(that).width()
388				});
389				overay1Obj.show();
390
391				imageObj.after(overay1Obj);
392				
393			}else{
394				$(".goodsDisplayImageOveray1",that).remove();
395			}
396		}
397		
398		$(that).data('decorationLoaded',true);
399		
400	});
401
402	// FAQ 게시글 보기
403	$('a.boad_faqview_btn').on('click', function() {
404		event.preventDefault();
405		var faqview_btn = $(this);
406		call_faq_view(faqview_btn);
407	});
408}
409
410
411
412
413/* 어드민 : 이미지꾸미기 선택정보를 샘플이미지에 적용*/
414function goods_image_decoration_data_(goodsDisplayDecorationContainer){
415	var data = {};
416	
417	if($("input.use_image_border",goodsDisplayDecorationContainer).is(":checked")){
418		if($("input.image_border",goodsDisplayDecorationContainer).val().length){
419			data.image_border = $("input.image_border",goodsDisplayDecorationContainer).val();
420			data.image_border_width = $("input.image_border_width",goodsDisplayDecorationContainer).val();
421		}
422	}
423	
424	if($("input.use_image_opacity",goodsDisplayDecorationContainer).is(":checked")){
425		if($("input.image_opacity",goodsDisplayDecorationContainer).val().length){
426			data.image_opacity = $("input.image_opacity",goodsDisplayDecorationContainer).val();
427		}
428	}
429	
430	if($("input.use_image_icon",goodsDisplayDecorationContainer).is(":checked")){
431		if($("input.image_icon",goodsDisplayDecorationContainer).val().length){
432			data.image_icon = $("input.image_icon",goodsDisplayDecorationContainer).val();
433		}
434		if($("select.image_icon_location",goodsDisplayDecorationContainer).val().length){
435			data.image_icon_location = $("select.image_icon_location",goodsDisplayDecorationContainer).val();
436		}
437		if($("select.image_icon_over",goodsDisplayDecorationContainer).val().length){
438			data.image_icon_over = $("select.image_icon_over",goodsDisplayDecorationContainer).val();
439		}
440	}
441	
442	if($("input.use_image_overay",goodsDisplayDecorationContainer).is(":checked")){
443		if($("select.image_overay1",goodsDisplayDecorationContainer).val().length){
444			data.image_overay1 = $("select.image_overay1",goodsDisplayDecorationContainer).val();
445		}else if($("input.image_overay1_text",goodsDisplayDecorationContainer).val().length){
446			data.image_overay1 = $("select.image_overay1",goodsDisplayDecorationContainer).val();
447			data.image_overay1_text = $("input.image_overay1_text",goodsDisplayDecorationContainer).val();
448		}
449		
450		if($("select.image_overay2",goodsDisplayDecorationContainer).val().length){
451			data.image_overay2 = $("select.image_overay2",goodsDisplayDecorationContainer).val();
452		}else if($("input.image_overay2_text",goodsDisplayDecorationContainer).val().length){
453			data.image_overay2 = $("select.image_overay2",goodsDisplayDecorationContainer).val();
454			data.image_overay2_text = $("input.image_overay2_text",goodsDisplayDecorationContainer).val();
455		}
456	}
457	
458	var i,dataCnt = 0;
459	for(i in data) {
460		dataCnt++;
461		data[i] = data[i].replace(/"/g,'\\"');
462	}
463
464	var decoration = Base64.encode(JSONtoString(data));
465
466	$(".BoardgoodsDisplayImageWrap",goodsDisplayDecorationContainer).data("decorationLoaded",false);
467	$(".BoardgoodsDisplayImageWrap",goodsDisplayDecorationContainer).attr("decoration",decoration);
468	$(".BoardgoodsDisplayImageWrap",goodsDisplayDecorationContainer).data("decoration",data);
469	$("input.image_decoration",goodsDisplayDecorationContainer).val(decoration);
470	
471	/* 이미지꾸미기 이미지 설정 */
472	set_goods_display_decoration_(".BoardgoodsDisplayImageWrap");
473}
474
475function set_info_item_data(goodsDisplayDecorationContainer){
476	
477	var info_item_settings = eval($(".info_settings",goodsDisplayDecorationContainer).val());
478	
479	if(typeof info_item_settings == 'object'){
480		/* 상품정보 항목 저장값 출력 */
481		for(var i=0;i<info_item_settings.length;i++){
482			
483			var new_info_item = add_new_info_item_(goodsDisplayDecorationContainer);
484			var info_item_setting = info_item_settings[i];
485	
486			for(var key in info_item_setting){
487				var cellSelector = ".info_item_cell_" + key;
488				var selector = ".info_item_" + key;
489				var selectValue = info_item_setting[key];
490				
491				if($(selector,new_info_item).length){
492					switch($(selector,new_info_item)[0].tagName){
493						case 'INPUT':
494							if($(selector,new_info_item).attr('type')=='text'){
495								$(selector,new_info_item).val(selectValue).change();
496							}else if($(selector,new_info_item).attr('type')=='radio' ){
497								$(selector,new_info_item).each(function(idx){ 
498									if( $(this).val() == selectValue ) {
499										$(this).attr('checked',true).change();
500									} 
501								});
502							}else{
503								$(selector,new_info_item).attr('checked',true);
504							}
505						break;
506						case 'SELECT':
507							$(selector,new_info_item).val(selectValue);
508						break;
509					}
510				}
511			}
512			
513			$(".info_item_kind",new_info_item).change();
514		}
515	}else{
516		var idx=0;
517		
518		for(key in info_item_config){
519			add_new_info_item_(goodsDisplayDecorationContainer);
520			$(".info_item_kind",goodsDisplayDecorationContainer).eq(idx).val(key).change();
521			idx++;
522		}
523	}
524	
525	apply_input_style();
526	
527}
528
529/* 어드민 : 상품정보 항목 추가 */
530function add_new_info_item_(obj){
531	var goodsDisplayDecorationContainer = $(obj).closest(".goodsDisplayDecorationContainer");
532	
533	$(".info_item_default .colorpicker",goodsDisplayDecorationContainer).customColorPicker("destroy");
534	var new_info_item = $("div.info_item_default",goodsDisplayDecorationContainer).clone();
535	new_info_item.removeClass("hide").removeClass("info_item_default").show();
536	new_info_item.find("input.info_setting").removeAttr('disabled');
537
538	$("div.info_item_container",goodsDisplayDecorationContainer).append(new_info_item);
539	
540	$(".colorpicker",goodsDisplayDecorationContainer).customColorPicker();
541	
542	//change_info_item_(new_info_item);
543
544	$(".customFontDecoration",new_info_item).customFontDecoration({"change":function(){
545		//change_info_item_(new_info_item);
546	}});
547	
548	return new_info_item;
549}
550
551/* 어드민 : 상품정보 항목 삭제 */
552function remove_info_item_(obj){
553	$(obj).closest("div.info_item").remove();
554}
555
556/* 어드민 : 상품정보 항목 값 변경 */
557function change_info_item_(obj){
558
559	var info_item = $(obj).closest("div.info_item");
560	var kind = $(".info_item_kind",info_item).val();
561	var data = {};
562	var result_string = '';
563	
564	$(".info_item_cell",info_item).hide();
565
566	for(var i=0;i<info_item_config[kind].length;i++){
567
568		var key = info_item_config[kind][i];
569
570		var cellSelector = ".info_item_cell_" + key;
571		var selector = ".info_item_" + key;
572		var selectValue = "";
573		
574		$(cellSelector,info_item).show();
575
576		if($(selector,info_item).length){
577			switch($(selector,info_item)[0].tagName){
578				case 'INPUT':
579					if($(selector,info_item).attr('type')=='text'){
580						selectValue = $(selector,info_item).val();
581					}else if($(selector,info_item).is(':checked')){
582						selectValue = $(obj).val();
583					}
584				break;
585				case 'SELECT':
586					selectValue = $(selector,info_item).val();
587				break;
588			}
589		}
590		
591		if(key=='font_decoration'){
592			
593			data[key] = selectValue.replace(/"/g,'\\"');
594		}else{
595			data[key] = selectValue;
596		}
597	}
598
599	result_string = (JSONtoString(data));	 				
600
601	$("input.info_setting",info_item).val(result_string);
602	
603
604}

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.