PageSourceSearch

http://wjst.kr/modules/board/skins/sketchbook5/js/board.js?20200518172238

js wjst.kr collected 2026-09-26 00:18:13 UTC 18,583 bytes, 616 lines download raw bytes

1// Board
2function board(bdObj){
3(function($){
4// Option
5	var bd = $(bdObj);
6	var default_style = bd.attr('data-default_style');
7	var bdBubble = bd.attr('data-bdBubble');
8	var lstViewer = bd.attr('data-lstViewer');
9	var bdFilesType = bd.attr('data-bdFilesType');
10	var bdImgOpt = bd.attr('data-bdImgOpt');
11	var bdImgLink = bd.attr('data-bdImgLink');
12	var bdNavSide = bd.attr('data-bdNavSide');
13
14	ie8Check = navigator.userAgent.match(/msie [7]/i) || navigator.userAgent.match(/msie [8]/i);
15// Login
16	if(bdLogin){
17		bd.find('a.bd_login').click(function(){
18			if(confirm(bdLogin.split('@')[0])) window.location.href = bdLogin.split('@')[1];
19			return false;
20		});
21	};
22
23// Category Navigation
24	var cnb = bd.find('div.bd_cnb');
25	var cnb2 = bd.find('ul.cTab');
26	if(cnb.length){
27		var cMore = bd.find('li.cnbMore');
28	    var cItem = cnb.find('>ul>li');
29	    var lastEvent = null;
30	    function cnbToggle(){
31	        var t = $(this);
32	        if(t.next('ul').is(':hidden') || t.next('ul').length==0){
33	            cItem.find('>ul').fadeOut(100);
34	            t.next('ul').fadeIn(200);
35	        };
36	    };
37	    function cnbOut(){
38	        cItem.find('ul').fadeOut(100);
39	    };
40	    cItem.find('>a').mouseover(cnbToggle).focus(cnbToggle);
41	    cItem.mouseleave(cnbOut);
42		cItem.find('>ul').each(function(){
43			var t = $(this);
44			t.append('<i class="edge"></i>');
45			if(ie8Check) t.prepend('<i class="ie8_only bl"></i><i class="ie8_only br"></i>');
46			if(t.width() > $('html,body').width()-t.offset().left){
47				t.addClass('flip');
48			};
49		});
50		cItem.find('>ul>li.on').parents('ul:first').show().prev().addClass('on');
51	    function cnbStart(){
52			// If Overflow
53			cItem.each(function(){
54				if($(this).offset().top!=cMore.offset().top){
55					$(this).addClass('cnb_hide').nextAll().addClass('cnb_hide');
56					cMore.css('visibility','visible');
57					return false;
58				} else {
59					$(this).removeClass('cnb_hide').nextAll().removeClass('cnb_hide');
60					cMore.css('visibility','hidden');
61				};
62			});
63			cnb.find('>.bg_f_f9').css('overflow','visible');
64		};
65		cnbStart();
66		$(window).resize(cnbStart);
67		function cnbMore(){
68			cnb.toggleClass('open').find('i.fa').toggleClass('fa-caret-up').toggleClass('fa-caret-down');
69			return false;
70		};
71		if((cnb.find('.cnb_hide a,.cnb_hide li').hasClass('on')) && !cnb.hasClass('open')) cnbMore();
72		cMore.click(cnbMore);
73	} else if(cnb2.length){
74		cnb2.find('>li>ul>li.on').parents('li:first').addClass('on');
75		$(window).resize(function(){
76			var h = cnb2.find('>li>ul').height();
77			if(h>20){
78				cnb2.css('margin-bottom',20+h);
79			} else {
80				cnb2.removeAttr('style');
81			};
82		}).resize();
83	};
84
85// Speech Bubble
86	if(!bdBubble){
87		bd.find('a.bubble').hover(function(){
88			var t = $(this);
89			if(!t.hasClass('no_bubble') && !t.find('.wrp').length){
90				t.append('<span class="wrp"><span class="speech">'+t.attr('title')+'</span><i class="edge"></i></span>').removeAttr('title');
91				if($('html,body').width()-t.offset().left < 80){
92					t.addClass('left').find('.wrp').css({marginTop:t.parent('.wrp').height()/2})
93				} else if(t.offset().top < 80 && !t.parent().parent().hasClass('rd_nav_side')){
94					t.addClass('btm').find('.wrp').css({marginLeft:-t.find('.wrp').width()/2})
95				} else {
96					t.find('.wrp').css({marginLeft:-t.find('.wrp').width()/2})
97				};
98				if(ie8Check) t.find('.wrp').prepend('<i class="ie8_only bl"></i><i class="ie8_only br"></i>');
99			};
100			if(ie8Check) return;
101			if(t.is('.left,.right,.btm')){
102				t.find('.wrp:hidden').fadeIn(150)
103			} else {
104				t.find('.wrp:hidden').css('bottom','150%').animate({
105					bottom:'100%'
106				},{duration:150,specialEasing:{left:'easeInOutQuad'},complete:function(){
107					},step:null,queue:false
108				}).fadeIn(150)
109			}
110		},function(){
111			if(ie8Check) return;
112			$(this).find('.wrp').fadeOut(100)
113		})
114	};
115
116// sketchbook's Toggle2 (Original : XE UI)
117	var tgC2 = bd.find('.tg_cnt2');
118	bd.find('.tg_btn2').click(function(){
119		var t = $(this);
120		var h = t.attr('data-href');
121		if(t.next(h).is(':visible')){
122			t.focus().next().fadeOut(200);
123		} else {
124			tgC2.filter(':visible').hide();
125			t.after($(h)).next().fadeIn(200).css('display','block').find('a,input,button:not(.tg_blur2),select,textarea').eq(0).focus();
126		};
127		return false;
128	});
129	function tgClose2(){
130		tgC2.filter(':visible').fadeOut(200).prev().focus();
131	};
132	$(document).keydown(function(event){
133		if(event.keyCode != 27) return true; // ESC
134		return tgClose2();
135	});
136	tgC2.mouseleave(tgClose2);
137	bd.find('.tg_blur2').focusin(tgClose2);
138	bd.find('.tg_close2,#install_ng2 .close').click(tgClose2);
139
140// Form Label Overlapping
141	bd.find('.itx_wrp label').next()
142		.focus(function(){
143			$(this).prev().css('visibility','hidden');
144		})
145		.blur(function(){
146			if($(this).val()==''){
147				$(this).prev().css('visibility','visible');
148			} else {
149				$(this).prev().css('visibility','hidden');
150			};
151		});
152	// IE8 Fix;
153	if(ie8Check){
154		bd.find('.bd_guest .itx_wrp label').click(function(){
155			$(this).next().focus();
156		});
157	};
158
159// Scroll
160	bd.find('a.back_to').click(function(){
161		$('html,body').animate({scrollTop:$($(this).attr('href')).offset().top},{duration:1000,specialEasing:{scrollTop:'easeInOutExpo'}});
162		return false;
163	});
164
165// Search
166	var srchWindow = bd.find('.bd_faq_srch');
167	bd.find('a.show_srch').click(function(){
168		if(srchWindow.is(':hidden')){
169			srchWindow.fadeIn().find('.itx').focus();
170		} else {
171			srchWindow.fadeOut();
172			$(this).focus();
173		};
174		return false;
175	});
176	bd.find('.bd_srch_btm_itx').focus(function(){
177		bd.find('.bd_srch_btm .itx_wrp').animate({width:140},{duration:1000,specialEasing:{width:'easeOutBack'}}).parent().addClass('on');
178	});
179
180// With Viewer
181	var wView = bd.find('a.viewer_with');
182	wView.click(function(){
183		if(wView.hasClass('on')){
184			$.cookie('cookie_viewer_with','N');
185			wView.removeClass('on');
186			bd.find('.bd_lst a.hx').removeAttr('onClick');
187		} else {
188			$.cookie('cookie_viewer_with','Y');
189			wView.addClass('on');
190			bd.find('.bd_lst a.hx').attr('onClick','window.open(jQuery(this).attr(\'data-viewer\'),\'viewer\',\'width=9999,height=9999,scrollbars=yes,resizable=yes,toolbars=no\');return false;');
191		};
192		return false;
193	});
194	if($.cookie('cookie_viewer_with')=='Y') bd.find('.bd_lst a.hx').attr('onClick','window.open(jQuery(this).attr(\'data-viewer\'),\'viewer\',\'width=9999,height=9999,scrollbars=yes,resizable=yes,toolbars=no\');return false;');
195
196// List Viewer
197	if(lstViewer) bd.find('.bd_lst a.hx').append('<button class="bg_color" title="'+lstViewer+'" onClick="window.open(jQuery(this).parent().attr(\'data-viewer\'),\'viewer\',\'width=9999,height=9999,scrollbars=yes,resizable=yes,toolbars=no\');return false;">Viewer</button>');
198
199// Gallery hover effect
200	bd.find('.info_wrp').hover(function(){
201		var t = $(this);
202		var st = t.find('.info.st,.info.st1');
203		var tL = bd.find('ol.bd_tmb_lst');
204		if(tL.hasClass('tmb_bg3')){
205			st.stop(true,true).animate({opacity:.8},200);
206		} else {
207			if(ie8Check){
208				st.stop(true,true).animate({opacity:.7},200);
209			} else {
210				st.stop(true,true).animate({opacity:1},200);
211			};
212		};
213		t.find('.info').stop(true,true).animate({top:0,left:0},200);
214	},
215	function(){
216		var t = $(this);
217		t.find('.info.st,.info.st1').animate({opacity:0}
217,200);
218		t.find('.info.st2').animate({top:'-100%'},200);
219		t.find('.info.st3').animate({left:'-100%'},200);
220		t.find('.info.st4').animate({top:'-100%',left:'-100%'},200);
221	});
222
223// Imagesloaded
224	var bdOl = bd.find('ol.bd_lst');
225	if(bdOl.length && !bdOl.hasClass('img_loadN')){
226		bdOl.find('.tmb').each(function(){
227			var t = $(this);
228			t.imagesLoaded(function(){
229				t.parent().addClass('fin_load').fadeIn(250);
230			});
231		});
232	};
233
234// List Style
235if(default_style=='webzine'){
236// Webzine
237	var bd_zine = bd.find('ol.bd_zine');
238	if(bd_zine.attr('data-masonry')){
239		if(bd_zine.attr('data-masonry')!='_N'){
240			bd_zine.imagesLoaded(function(){
241				bd_zine.masonry({
242					itemSelector:'li',
243					isFitWidth:true,
244					isAnimated:true,
245					animationOptions:{duration:500,easing:'easeInOutExpo',queue:false}
246				});
247			});
248		} else {
249			bd_zine.imagesLoaded(function(){
250				bd_zine.masonry({
251					itemSelector:'li',
252					isFitWidth:true
253				});
254			});
255		};
256	};
257} else if(default_style=='gallery'){
258// Gallery
259	var bd_tmb_lst = bd.find('ol.bd_tmb_lst');
260	if(bd_tmb_lst.attr('data-gall_deg')){
261		if(ie8Check) return;
262		var gall_deg = bd_tmb_lst.attr('data-gall_deg');
263		bd_tmb_lst.find('.tmb_wrp').each(function(){
264			var m = Math.floor(Math.random()*gall_deg*2-gall_deg);
265			$(this).css({
266				'msTransform':'rotate('+m+'deg)',
267				'-moz-transform':'rotate('+m+'deg)',
268				'-webkit-transform':'rotate('+m+'deg)'
269			});
270		});
271	};
272} else if(default_style=='cloud_gall'){
273// Cloud Gallery
274	bdCloud(bd);
275} else if(default_style=='guest'){
276// Guest
277	// Editor
278	bd.find('form>.simple_wrt textarea').focus(function(){
279		$(this).parent().parent().next().slideDown();
280	})
281	.autoGrow();
282	bd.find('form input[type=submit]').click(function(){
283		$.removeCookie('socialxe_content');
284	});
285	if(bd.find('form>div.wysiwyg').length){
286		if($('#re_cmt').length) editorStartTextarea(2,'content','comment_srl');
287	} else {
288		$.getScript("modules/editor/tpl/js/editor_common.min.js",function(){
289			if($('#re_cmt').length) editorStartTextarea(2,'content','comment_srl');
290			var cmtWrt = bd.find('form.cmt_wrt textarea');
291			if(bd.find('form.bd_wrt_main textarea').length){
292				$.getScript('files/cache/js_filter_compiled/35d29adbe4b14641f9eac243af40093b.'+lang_type+'.compiled.js');
293				editorStartTextarea(1,'content','document_srl');
294			};
295			cmtWrt.each(function(){
296				editorStartTextarea($(this).attr('id').split('_')[1],'content','comment_srl');
297			});
298		});
299	};
300	
301};
302
303// Link Board
304	if(bd.attr('data-link_board')){
305		bd.find('a.viewer_with').click(function(){
306			location.reload();
307			return false;
308		});
309		if(bd.attr('data-link_board')==3) bdLinkBoard(bd);
310	};
311
312// Read Page Only
313if(bd.find('div.rd').length){
314	// Prev-Next
315	bdPrevNext(bd);
316	function rdPrev(){
317		var a = bd.find('.bd_rd_prev .wrp');
318		$(this).append(a).attr('href',bd.find('.bd_rd_prev').attr('href'));
319		a.css({marginLeft:-a.width()/2});
320	};
321	bd.find('a.rd_prev').mouseover(rdPrev).focus(rdPrev);
322	function rdNext(){
323		var a = bd.find('.bd_rd_next .wrp');
324		$(this).append(a).attr('href',bd.find('.bd_rd_next').attr('href'));
325		a.css({marginLeft:-a.width()/2});
326	};
327	bd.find('a.rd_next').mouseover(rdNext).focus(rdNext);
328	// Hide : et_vars, prev_next
329	bd.find('.fdb_hide,.rd_file.hide,.fdb_lst .cmt_files').hide();
330	if(bd.find('.rd table.et_vars th').length) bd.find('.rd table.et_vars').show();
331	if(!bd.find('.bd_rd_prev').length) bd.find('a.rd_prev').hide();
332	if(!bd.find('.bd_rd_next').length) bd.find('a.rd_next').hide();
333	// Read Navi
334	bd.find('.print_doc').click(function(){
335		if($(this).hasClass('this')){
336			print();
337		} else {
338			window.open(this.href,'print','width=860,height=999,scrollbars=yes,resizable=yes').print();
339		};
340		return false;
341	});
342	bd.find('.font_plus').click(function(){
343		var c = $('.bd .xe_content');
344		var font_size = parseInt(c.css('fontSize'))+1;
345		c.css('font-size',''+font_size+'px');
346		return false;
347	});
348	bd.find('.font_minus').click(function(){
349		var c = $('.bd .xe_content');
350		var font_size = parseInt(c.css('fontSize'))-1;
351		c.css('font-size',''+font_size+'px');
352		return false;
353	});
354	// File Type
355	if(bdFilesType=='Y'){
356		if(bd.find('.rd_file li').length==0){
357			bd.find('.rd_file,.rd_nav .file').hide();
358		} else {
359			if(default_style!='blog'){
360				bd.find('.rd_file strong b').text(bd.find('.rd_file li').length);
361			} else {
362				bd.find('.rd_file strong b').text($(this).parents('.rd').find('.rd_file li').length);
363			};
364		};
365	};
366
367	// Content Images
368	if(bdImgOpt) bd.find('.xe_content img').draggable();
369	if(bdImgLink){
370		bd.find('.xe_content img').click(function(){
371			window.location.href=$(this).attr('src');
372		});
373	};
374	// Side Navi Scoll
375	if(!bdNavSide){
376		$(window).scroll(function(){
377			var sT = $(this).scrollTop();
378			var o = bd.find('div.rd_nav_side .rd_nav');
379			if((sT > bd.find('div.rd_body').offset().top) && (sT < bd.find('hr.rd_end').offset().top-$(this).height())){
380				o.fadeIn(200);
381			} else {
382				o.fadeOut(200);
383			};
384		});
385	};
386	// To SNS
387	bd.find('.to_sns a').click(function(){
388		var t = $(this);
389		var type = t.attr('data-type');
390		var p = t.parent();
391		var url = p.attr('data-url');
392		var title = p.attr('data-title');
393		if(!type){
394			return;
395		} else if(type=="facebook"){
396			var loc = '//www.facebook.com/sharer/sharer.php?u='+url+'&t='+title;
397		} else if(type=="twitter"){
398			loc = '//twitter.com/home?status='+title+' '+url;
399		} else if(type=="google"){
400			loc = '//plus.google.com/share?url='+url;
401		} else if(type=="pinterest"){
402			loc = '//pinterest.com/pin/create/bookmarklet/?url='+url+'&description='+title;
403		};
404		window.open(loc);
405		return false;
406	});
407	// Comment Count
408	if(!bd.find('.rd .nametag').length) bdCmtPn(bd);
409	// Editor
410	if(bd.find('form.bd_wrt').length){
411		bd.find('form>.simple_wrt textarea').focus(function(){
412			$(this).parent().parent().next().slideDown();
413		})
414		.autoGrow();
415		bd.find('form [type=submit]').click(function(){
416			$.removeCookie('socialxe_content');
417		});
418		if(bd.find('form>div.wysiwyg').length){
419			editorStartTextarea(2,'content','comment_srl');
420		} else {
421			$.getScript("modules/editor/tpl/js/editor_common.min.js",function(){
422				editorStartTextarea(2,'content','comment_srl');
423				var cmtWrt = bd.find('form.cmt_wrt textarea');
424				if(default_style=='blog'){
425					cmtWrt.each(function(){
426						editorStartTextarea($(this).attr('id').split('_')[1],'content','comment_srl');
427					});
428				} else {
429					editorStartTextarea(cmtWrt.attr('id').split('_')[1],'content','comment_srl');
430					cmtWrt.val($.cookie('socialxe_content'))
431					.bind('keydown change',function(){
432						$.cookie('socialxe_content',$(this).val());
433					});
434				};
435			});
436		};
437	};
438};
439
440})(jQuery)
441}
442
443jQuery(function($){
444// NanumPen Font
445	$('body').append('<div class="fontcheckWrp"><p id="fontcheck_np1" style="font-family:\'나눔손글씨 펜\',\'Nanum Pen Script\',np,monospace,Verdana !important">Sketchbook5, 스케치북5</p><p id="fontcheck_np2" style="font-family:monospace,Verdana !important">Sketchbook5, 스케치북5</p></div>');
446	var bd = $('div.bd');
447	if($('#fontcheck_np1').width()==$('#fontcheck_np2').width()){
448		bd.removeClass('use_np');
449		$.removeCookie('use_np');
450	} else {
451		bd.addClass('use_np');
452		$.cookie('use_np','use_np');
453	};
454});
455
456// Prev-Next
457function bdPrevNext(bd){
458	jQuery(document).keydown(function(event){
459		var eT = event.target.nodeName.toLowerCase();
460		if(eT=='textarea' || eT=='input' || eT=='select') return true;
461		var p = bd.find('.bd_rd_prev');
462		var n = bd.find('.bd_rd_next');
463		// fixed for 'prettyphoto' addon
464		if(!jQuery('div.pp_overlay').length){
465			if(event.keyCode==37 && p.length){
466				window.location.href = p.attr('href');
467			} else	if(event.keyCode==39 && n.length){
468				window.location.href = n.attr('href');
469			} else 	if(event.keyCode==27 && jQuery('#viewer').length){
470				self.close();
471			} else {
472				return true;
473			};
474		};
475	});
476}
477
478function reComment(doc_srl,cmt_srl,edit_url){
479	var o = jQuery('#re_cmt').eq(0);
480	o.find('input[name=error_return_url]').val('/'+doc_srl);
481	o.find('input[name=mid]').val(current_mid);
482	o.find('input[name=document_srl]').val(doc_srl);
483	o.appendTo(jQuery('#comment_'+cmt_srl)).fadeIn().find('input[name=parent_srl]').val(cmt_srl);
484	o.find('a.wysiwyg').attr('href',edit_url);
485	o.find('textarea').focus();
486}
487
488function bdCmtPn(bd){
489	var t = jQuery('#'+bd.find('.rd').attr('data-docSrl')+'_comment .bd_pg');
490	t.clone().toggleClass('bd_pg cmt_pg').appendTo(t.prev().prev());
491}
492
493// FAQ
494function bdFaq(a){
495	var t = jQuery('#bdFaq_'+a);
496	if(t.hasClass('open')){
497		t.removeClass('open').find('.a').slideUp(200);
498	} else {
499		t.addClass('open').find('.a').slideDown(200).end().siblings().removeClass('open').find('.a').slideUp(200);
500	};
501}
502
503// Cloud Gallery
504function bdCloud(bd){
505(function($){
506	var cGall = bd.find('.bd_cloud');
507	var cgRt = bd.find('button.bd_cg_rt');
508	var cgRd = bd.find('button.bd_cg_rd');
509	var cgRf = bd.find('button.bd_cg_rf');
510	var cloud_deg = Number(cGall.attr('data-deg'));
511	var cloud_y = Number(cGall.attr('data-y'));
512	var thumbnail_width = Number(cGall.attr('data-tmb'));
513	var cloud_z = Number(cGall.attr('data-z'));
514	counts = [cloud_z+1];
515	cGall.find('a').draggable({
516		containment:"document",
517		start: function(){
518			$(this).css('zIndex',counts[0]++)
519		}
520	});
521    function cloud(){
522		cGall.find('a').each(function(){
523			var t = $(this);
524			var m = Math.floor(Math.random()*cloud_deg*2-cloud_deg);
525			t.css({
526				top:Math.floor(Math.random()*(cloud_y-thumbnail_width-51)),
527				left:Math.floor(Math.random()*(cGall.width()-(thumbnail_width+22))),
528				'msTransform':'rotate('+m+'deg)',
529				'-moz-transform':'rotate('+m+'deg)',
530				'-webkit-transform':'rotate('+m+'deg)'
531			});
532			t.imagesLoaded(function(){
533				t.fadeIn(200);
534			});
535		});
536    };
537	function yesRand(){
538		cGall.removeClass('no_rd');
539		cgRd.removeClass('off');
540		$.removeCookie('cg_rd');
541		cloud();
542	};
543	function noRand(){
544		cGall.addClass('no_rd').css('height','');
545		cgRd.addClass('off');
546		$.cookie('cg_rd','N');
547		noRotate();
548		cGall.imagesLoaded(function(){
549			if($(window).width()<640){
550				cGall.masonry({
551					itemSelector:'a',
552					isFitWidth:true
553				});
554			} else {
555				cGall.masonry({
556					itemSelector:'a',
557					isFitWidth:true,
558					isAnimated:true,
559					animationOptions:{duration:500,easing:'easeInOutExpo',queue:false}
560				});
561			};
562			$(this).find('a').fadeIn(200);
563		})
564	};
565	function yesRotate(){
566		if(cGall.hasClass('no_rd')) return true;
567		cGall.removeClass('no_rt');
568		cgRt.removeClass('off');
569		$.removeCookie('cg_rt');
570	};
571	function noRotate(){
572		cGall.addClass('no_rt');
573		cgRt.addClass('off');
574		$.cookie('cg_rt','N');
575	};
576	cgRf.click(function(){
577		if(cgRd.hasClass('off')){
578			cGall.removeClass('no_rd');
579			cgRd.removeClass('off');
580			$.removeCookie('cg_rd');
581		};
582		cloud();
583	});
584	cgRd.click(function(){
585		if(cgRd.hasClass('off')){
586			yesRand();
587		} else {
588			noRand();
589		};
590	});
591	cgRt.click(function(){
592		if(cgRt.hasClass('off')){
593			yesRotate();
594		} else {
595			noRotate();
596		};
597	});
598	if($(window).width()<640 || cgRd.hasClass('off')){
599		noRand();
600	} else {
601		cloud();
602		if(cgRt.hasClass('off')) noRotate();
603	};
604})(jQuery)
605}
606
607// Link Board
608function bdLinkBoard(bd){
609	if(bd.find('a.viewer_with').hasClass('on')){
610		var hx = bd.find('a.hx,.bd_tb_lst .link_url a');
611		hx.each(function(){
612			jQuery(this).attr('href',jQuery(this).attr('href')+'?iframe=true&width=100%&height=100%').attr('rel','prettyPhoto[iframes]');
613		});
614		hx.prettyPhoto({hideflash:true,social_tools:false});
615	};
616}

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.