PageSourceSearch

https://mbs-korea.com/js/apms.js?ver=180820

js mbs-korea.com collected 2026-10-08 23:32:19 UTC 18,447 bytes, 567 lines download raw bytes

1
2// Name Layer
3if (typeof(SIDEVIEW_JS) == 'undefined') { // 한번만 실행
4
5	if (typeof g5_is_member == 'undefined')
6        alert(aslang[0]);
7    if (typeof g5_bbs_url == 'undefined')
8        alert(aslang[1]);
9
10    var SIDEVIEW_JS = true;
11
12    // 아래의 소스코드는 daum.net 카페의 자바스크립트를 참고하였습니다.
13    // 회원이름 클릭시 회원정보등을 보여주는 레이어
14    function insertHead(name, text, evt) 
15    {
16        var idx = this.heads.length;
17        var row = new SideViewRow(-idx, name, text, evt);
18        this.heads[idx] = row;
19        return row;
20    }
21
22    function insertTail(name, evt) 
23    {
24        var idx = this.tails.length;
25        var row = new SideViewRow(idx, name, evt);
26        this.tails[idx] = row;
27        return row;
28    }
29
30    function SideViewRow(idx, name, onclickEvent) 
31    {
32        this.idx = idx;
33        this.name = name;
34        this.onclickEvent = onclickEvent;
35        this.renderRow = renderRow;
36        
37        this.isVisible = true;
38        this.isDim = false;
39    }
40
41    function renderRow() 
42    {
43        if (!this.isVisible)
44            return "";
45        
46        var str = "<tr><td id='sideViewRow_"+this.name+"'>"+this.onclickEvent+"</td></tr>";
47        return str;
48    }
49
50    function showSideView(curObj, mb_id, name, email, homepage) 
51    {
52        var sideView = new SideView('nameContextMenu', curObj, mb_id, name, email, homepage);
53        sideView.showLayer();
54    }
55
56    function SideView(targetObj, curObj, mb_id, name, email, homepage) 
57    {
58        this.targetObj = targetObj;
59        this.curObj = curObj;
60        this.mb_id = mb_id;
61        name = name.replace(/…/g,"");
62        this.name = name;
63        this.email = email;
64        this.homepage = homepage;
65        this.showLayer = showLayer;
66        this.makeNameContextMenus = makeNameContextMenus;
67        this.heads = new Array();
68        this.insertHead = insertHead;
69        this.tails = new Array();
70        this.insertTail = insertTail;
71        this.getRow = getRow;
72        this.hideRow = hideRow;		
73        this.dimRow = dimRow;
74    
75        // 회원이라면 // (비회원의 경우 검색 없음)
76        if (g5_is_member) {
77            // 자기소개
78            if (mb_id) 
79                this.insertTail("info", "<a href=\""+g5_bbs_url+"/profile.php?mb_id="+mb_id+"\" rel=\"nofollow\" onclick=\"win_profile(this.href); return false;\">"+aslang[2]+"</a>");
80            // 홈페이지
81            if (homepage) 
82                this.insertTail("homepage", "<a href=\""+homepage+"\" target=\"_blank\">"+aslang[3]+"</a>");
83			// 쪽지보내기
84            if (mb_id) 
85                // 불여우 자바스크립트창이 뜨는 오류를 수정
86                this.insertTail("memo", "<a href=\""+g5_bbs_url+"/memo_form.php?me_recv_mb_id="+mb_id+"\" rel=\"nofollow\" onclick=\"win_memo(this.href); return false;\">"+aslang[4]+"</a>");
87            // 메일보내기
88            if (email) 
89                this.insertTail("mail", "<a href=\""+g5_bbs_url+"/formmail.php?mb_id="+mb_id+"&name="+encodeURI(name)+"&email="+email+"\" rel=\"nofollow\" onclick=\"win_email(this.href); return false;\">"+aslang[5]+"</a>");
90        }
91
92		var pim_target = '';
93		if(g5_pim) {
94			pim_target = ' target="_blank"';
95		}
96		// 게시판테이블 아이디가 넘어왔을 경우
97        if (g5_bo_table) {
98            if (mb_id) { // 회원일 경우 아이디로 검색
99                this.insertTail("mb_id", "<a href=\""+g5_bbs_url+"/board.php?bo_table="+g5_bo_table+"&sca="+g5_sca+"&sfl=mb_id,1&stx="+mb_id+"\""+pim_target+" rel=\"nofollow\">"+aslang[6]+"</a>");
100                this.insertTail("mb_cid", "<a href=\""+g5_bbs_url+"/board.php?bo_table="+g5_bo_table+"&sca="+g5_sca+"&sfl=mb_id,0&stx="+mb_id+"\""+pim_target+" rel=\"nofollow\">"+aslang[7]+"</a>");
101			} else { // 비회원일 경우 이름으로 검색
102                this.insertTail("name", "<a href=\""+g5_bbs_url+"/board.php?bo_table="+g5_bo_table+"&sca="+g5_sca+"&sfl=wr_name,1&stx="+name+"\""+pim_target+" rel=\"nofollow\">"+aslang[6]+"</a>");
103                this.insertTail("cname", "<a href=\""+g5_bbs_url+"/board.php?bo_table="+g5_bo_table+"&sca="+g5_sca+"&sfl=wr_name,0&stx="+name+"\""+pim_target+" rel=\"nofollow\">"+aslang[7]+"</a>");
104			}
105		}
106		// 전체게시물
107        if (mb_id)
108            this.insertTail("new", "<a href=\""+g5_bbs_url+"/new.php?mb_id="+mb_id+"\""+pim_target+" rel=\"nofollow\" class=\"link_new_page\" onclick=\"check_goto_new(this.href, event);\">"+aslang[8]+"</a>");
109
110        // 최고관리자일 경우
111        if (g5_is_admin == "super") {
112            // 포인트내역과 1:1문의
113            if (mb_id) {
114                this.insertTail("qna", "<a href=\""+g5_bbs_url+"/qalist.php?qmb="+mb_id+"\" rel=\"nofollow\">"+aslang[40]+"</a>");
115				this.insertTail("point", "<a href=\""+g5_admin_url+"/point_list.php?sfl=mb_id&stx="+mb_id+"\" target=\"_blank\" rel=\"nofollow\">"+aslang[9]+"</a>");
116                this.insertTail("modify", "<a href=\""+g5_admin_url+"/member_form.php?w=u&mb_id="+mb_id+"\" target=\"_blank\" rel=\"nofollow\">"+aslang[10]+"</a>");
117			}
118		}
119    }
120
121    function showLayer() {
122        clickAreaCheck = true;
123        var oSideViewLayer = document.getElementById(this.targetObj);
124        var oBody = document.body;
125            
126        if (oSideViewLayer == null) {
127            oSideViewLayer = document.createElement("DIV");
128            oSideViewLayer.id = this.targetObj;
129            oSideViewLayer.style.position = 'absolute';
130            oBody.appendChild(oSideViewLayer);
131        }
132        oSideViewLayer.innerHTML = this.makeNameContextMenus();
133        
134        if (getAbsoluteTop(this.curObj) + this.curObj.offsetHeight + oSideViewLayer.scrollHeight + 5 > oBody.scrollHeight)
135            oSideViewLayer.style.top = (getAbsoluteTop(this.curObj) - oSideViewLayer.scrollHeight) + 'px';
136        else
137            oSideViewLayer.style.top = (getAbsoluteTop(this.curObj) + this.curObj.offsetHeight) + 'px';
138
139        oSideViewLayer.style.left = (getAbsoluteLeft(this.curObj) - this.curObj.offsetWidth + 14) + 'px';
140
141        divDisplay(this.targetObj, 'block');
142
143        selectBoxHidden(this.targetObj);
144    }
145
146    function getAbsoluteTop(oNode) {
147        var oCurrentNode=oNode;
148        var iTop=0;
149        while(oCurrentNode.tagName!="BODY") {
150            iTop+=oCurrentNode.offsetTop - oCurrentNode.scrollTop;
151            oCurrentNode=oCurrentNode.offsetParent;
152        }
153        return iTop;
154    }
155
156    function getAbsoluteLeft(oNode) {
157        var oCurrentNode=oNode;
158        var iLeft=0;
159        iLeft+=oCurrentNode.offsetWidth;
160        while(oCurrentNode.tagName!="BODY") {
161            iLeft+=oCurrentNode.offsetLeft;
162            oCurrentNode=oCurrentNode.offsetParent;
163        }
164        return iLeft;
165    }
166
167
168    function makeNameContextMenus() {
169        var str = "<table class='mbLayer'>";
170        
171        var i=0;
172        for (i=this.heads.length - 1; i >= 0; i--)
173            str += this.heads[i].renderRow();
174       
175        var j=0;
176        for (j=0; j < this.tails.length; j++)
177            str += this.tails[j].renderRow();
178        
179        str += "</table>";
180        return str;
181    }
182
183    function getRow(name) {
184        var i = 0;
185        var row = null;
186        for (i=0; i<this.heads.length; ++i) 
187        {
188            row = this.heads[i];
189            if (row.name == name) return row;
190        }
191
192        for (i=0; i<this.tails.length; ++i) 
193        {
194            row = this.tails[i];
195            if (row.name == name) return row;
196        }
197        return row;
198    }
199
200    function hideRow(name) {
201        var row = this.getRow(name);
202        if (row != null)
203            row.isVisible = false;
204    }
205
206    function dimRow(name) {
207        var row = this.getRow(name);
208        if (row != null)
209            row.isDim = true;
210    }
211    // Internet Explorer에서 셀렉트박스와 레이어가 겹칠시 레이어가 셀렉트 박스 뒤로 숨는 현상을 해결하는 함수
212    // 레이어가 셀렉트 박스를 침범하면 셀렉트 박스를 hidden 시킴
213    // <div id=LayerID style="display:none; position:absolute;" onpropertychange="selectBoxHidden('LayerID')">
214    function selectBoxHidden(layer_id) {
215        //var ly = eval(layer_id);
216        var ly = document.getElementById(layer_id);
217
218        // 레이어 좌표
219        var ly_left   = ly.offsetLeft;
220        var ly_top    = ly.offsetTop;
221        var ly_right  = ly.offsetLeft + ly.offsetWidth;
222        var ly_bottom = ly.offsetTop + ly.offsetHeight;
223
224        // 셀렉트박스의 좌표
225        var el;
226
227        for (i=0; i<document.forms.length; i++) {
228            for (k=0; k<document.forms[i].length; k++) {
229                el = document.forms[i].elements[k];    
230                if (el.type == "select-one") {
231                    var el_left = el_top = 0;
232                    var obj = el;
233                    if (obj.offsetParent) {
234                        while (obj.offsetParent) {
235                            el_left += obj.offsetLeft;
236                            el_top  += obj.offsetTop;
237                            obj = obj.offsetParent;
238                        }
239                    }
240                    el_left   += el.clientLeft;
241                    el_top    += el.clientTop;
242                    el_right  = el_left + el.clientWidth;
243                    el_bottom = el_top + el.clientHeight;
244
245                    // 좌표를 따져 레이어가 셀렉트 박스를 침범했으면 셀렉트 박스를 hidden 시킴
246                    if ( (el_left >= ly_left && el_top >= ly_top && el_left <= ly_right && el_top <= ly_bottom) || 
247                         (el_right >= ly_left && el_right <= ly_right && el_top >= ly_top && el_top <= ly_bottom) ||
248                         (el_left >= ly_left && el_bottom >= ly_top && el_right <= ly_right && el_bottom <= ly_bottom) ||
249                         (el_left >= ly_left && el_left <= ly_right && el_bottom >= ly_top && el_bottom <= ly_bottom) ||
250                         (el_top <= ly_bottom && el_left <= ly_left && el_right >= ly_right)
251                        )
252                        el.style.visibility = 'hidden';
253                }
254            }
255        }
256    }
257
258    // 감추어진 셀렉트 박스를 모두 보이게 함
259    function selectBoxVisible() {
260        for (i=0; i<document.forms.length; i++) {
261            for (k=0; k<document.forms[i].length; k++) {
262                el = document.forms[i].elements[k];    
263                if (el.type == "select-one" && el.style.visibility == 'hidden')
264                    el.style.visibility = 'visible';
265            }
266        }
267    }
268
269    function divDisplay(id, act) {
270        selectBoxVisible();
271
272        document.getElementById(id).style.display = act;
273    }
274
275    function hideSideView() {
276        if (document.getElementById("nameContextMenu"))
277            divDisplay ("nameContextMenu", 'none');
278    }
279
280    var clickAreaCheck = false;
281    document.onclick = function() {
282        if (!clickAreaCheck) 
283            hideSideView();
284        else 
285            clickAreaCheck = false;
286    }
287}
288
289function apms_print(url) {
290
291	if(!url) url = g5_purl;
292
293	if (url.indexOf('?') > 0) {
294		url	= url + '&pim=1&ipwm=1';
295	} else {
296		url	= url + '?pim=1&ipwm=1';
297	}
298	window.open(url, 'print', "width=760,height=720,scrollbars=1");
299	return false;
300}
301
302function apms_form(id, url) {
303	window.open(url, id, "width=810,height=680,scrollbars=1");
304	return false;
305}
306
307function apms_page(id, url, opt) {
308	$("#" + id).load(url, function() {
309	    if(typeof is_SyntaxHighlighter != 'undefined'){
310			SyntaxHighlighter.highlight();
311		}
312	});
313
314	if(typeof(window["comment_box"]) == "function"){
315		switch(id) {
316			case 'itemcomment'	: comment_box('', 'c'); break;
317			case 'viewcomment'	: comment_box('', 'c'); break;
318		}
319		document.getElementById("btn_submit").disabled = false;
320	}
321
322	if(opt) {
323	   $('html, body').animate({
324			scrollTop: $("#" + id).offset().top - 100
325		}, 500);
326	}
327}
328
329function apms_emoticon(fid, sid) {
330
331	if(!fid) fid = 'wr_content';
332
333	var url = g5_bbs_url + '/emoticon.php?fid=' + fid;
334
335	if(sid) {
336		url = url + '&sid=' + sid;
337	}
338
339	window.open(url, "emoticon", "width=600,height=600,scrollbars=1");
340	return false;
341}
342
343function apms_delete(id, href, url) {
344	if (confirm(aslang[11])) {
345		$.post(href, { js: "on" }, function(data) {
346			str = data.substr(0, 2);
347			data = data.replace(str,'');
348			if(str == "1|") {
349				if(data) alert(data);
350				return false;
351			} else {
352				if(data) alert(data);
353				apms_page(id, url); 
354			}
355		});
356	}
357}
358
359function apms_comment(id) {
360	var str;
361	var c_url;
362	if(id == 'viewcomment') {
363		c_url = './write_comment_update.page.php';
364	} else {
365		c_url = './itemcommentupdate.php';
366	}
367	var f = document.getElementById("fviewcomment");
368	var url = document.getElementById("comment_url").value;
369	if (fviewcomment_submit(f)) {
370		$.ajax({
371			url : c_url,
372			type : 'POST',
373			cache : false,
374			data : $("#fviewcomment").serialize() + "&js=on",
375			dataType : "html",
376			success : function(data) {
377				str = data.substr(0, 2);
378				data = data.replace(str,'');
379				if(str == "1|") {
380					if(data) alert(data);
381					return false;
382				} else {
383					apms_page(id, url);
384					document.getElementById("btn_submit").disabled = false;
385					document.getElementById('wr_content').value = "";
386				}
387			},
388			error : function(data) {
389				alert(aslang[12]);
390				return false;
391			}
392		});
393	}
394}
395
396function apms_good(bo_table, wr_id, act, id, wc_id) {
397	var href;
398
399	if(wr_id && wc_id) {
400		href = './good.comment.php?bo_table=' + bo_table + '&wr_id=' + wr_id + '&good=' + act + '&wc_id=' + wc_id;
401	} else {
402		if(wr_id) {
403			href = './good.apms.php?bo_table=' + bo_table + '&wr_id=' + wr_id + '&good=' + act;
404		} else {
405			href = './good.php?it_id=' + bo_table + '&good=' + act;
406		}
407	}
408
409	$.post(href, { js: "on" }, function(data) {
410		if(data.error) {
411			alert(data.error);
412			return false;
413		} else if(data.success) {
414			alert(data.success);
415			$("#"+id).text(number_format(String(data.count)));
416		}
417	}, "json");
418}
419
420function apms_like(mb_id, act, id) {
421	var href = g5_bbs_url + '/like.php?id=' + mb_id + '&act=' + act;
422	$.post(href, { js: "on" }, function(data) {
423		if(data.error) {
424			alert(data.error);
425			return false;
426		} else if(data.success) {
427			alert(data.success);
428			$("#"+id).text(number_format(String(data.count)));
429		}
430	}, "json");
431}
432
433function apms_shingo(bo_table, wr_id, act) {
434	var str;
435
436	if(act == "lock") {
437		str = aslang[13];
438	} else if(act == "unlock") {
439		str = aslang[14];
440	} else {
441		str = aslang[15];
442		act = "";
443	}
444
445	var href = './shingo.php?bo_table=' + bo_table + '&wr_id=' + wr_id + '&act=' + act;
446
447	if (confirm(str)) {
448		$.post(href, { js: "on" }, function(data) {
449			if(data.msg) {
450				alert(data.msg);
451				return false;
452			}
453		}, "json");
454	}
455}
456
457// SNS
458function apms_sns(id, url) {
459	switch(id) {
460		case 'facebook'		: window.open(url, "win_facebook", "menubar=0,resizable=1,width=600,height=400"); break;
461		case 'twitter'		: window.open(url, "win_twitter", "menubar=0,resizable=1,width=600,height=400"); break;
462		case 'googleplus'	: window.open(url, "win_googleplus", "menubar=0,resizable=1,width=600,height=600"); break;
463		case 'naverband'	: window.open(url, "win_naverband", "menubar=0,resizable=1,width=410,height=540"); break;
464		case 'naver'		: window.open(url, "win_naver", "menubar=0,resizable=1,width=450,height=540"); break;
465		case 'kakaostory'	: window.open(url, "win_kakaostory", "menubar=0,resizable=1,width=500,height=500"); break;
466		case 'tumblr'		: window.open(url, "win_tumblr", "menubar=0,resizable=1,width=540,height=600"); break;
467		case 'pinterest'	: window.open(url, "win_pinterest", "menubar=0,resizable=1,width=800,height=500"); break;
468	}
469    return false;
470}
471
472// Response
473function apms_response(mb_id, id, win, page, read) {
474
475	var href = g5_bbs_url + '/response.php?mb_id=' + mb_id + '&id=' + id + '&win=' + win + '&page=' + page + '&read=' + read;
476
477	document.location.href = href;
478
479	return false;
480}
481
482function apms_textarea(id, mode) {
483	var textarea_height = $('#'+id).height();
484	if(mode == 'down') {
485		$('#'+id).height(textarea_height + 50);
486	} else if(mode == 'up') {
487		if(textarea_height - 50 > 50) {
488			$('#'+id).height(textarea_height - 50);
489		}
490	} else {
491		$('#'+id).height(mode);
492	}
493}
494
495function owl_random(owlSelector){
496	owlSelector.children().sort(function(){
497		return Math.round(Math.random()) - 0.5;
498	}).each(function(){
499		$(this).appendTo(owlSelector);
500	});
501}
502
503var apms_leave = function(href) {
504    if(confirm(aslang[16])) {
505        document.location.href = href;
506	}
507	return false;
508}
509
510var apms_image = function(href) {
511	var new_win = window.open(href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
512    new_win.focus();
513	return false;
514}
515
516$(function(){
517	$(".remember-me").click(function(){
518		if($(this).is(":checked")) {
519			if(!confirm(aslang[17])) {
520				$(this).attr("checked", false);
521				return false;
522			}
523		}
524    });
525
526	$('.leave-me').click(function() {
527		apms_leave(this.href);
528		return false;
529    });
530
531	$("a.item_image").click(function() {
532		apms_image(this.href);
533		return false;
534	});
535
536	$(".go-top").click(function() {
537	   $('html, body').animate({ scrollTop: 0 }, 500);
538	   return false;
539	});
540
541	$(".widget-setup").click(function() {
542		var wset = $('.btn-wset');
543		if(wset.is(":visible")){
544			wset.hide();
545		} else {
546			wset.show();
547		}
548		return false;
549	});
550
551	// Tabs
552	$('.nav-tabs[data-toggle="tab-hover"] > li > a').hover( function(){
553		$(this).tab('show');
554	});
555
556	// Toggles
557	$('.at-toggle .panel-heading a').on('click', function () {
558		var clicked_toggle = $(this);
559
560		if(clicked_toggle.hasClass('active')) {
561			clicked_toggle.parents('.at-toggle').find('.panel-heading a').removeClass('active');
562		} else {
563			clicked_toggle.parents('.at-toggle').find('.panel-heading a').removeClass('active');
564			clicked_toggle.addClass('active');
565		}
566	});
567});

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.