// 아래의 소스코드는 daum.net 카페의 자바스크립트를 참고하였습니다. // 회원이름 클릭시 회원정보등을 보여주는 레이어 function insertHead(name, text, evt) { var idx = this.heads.length; var row = new SideViewRow(-idx, name, text, evt); this.heads[idx] = row; return row; } function insertTail(name, evt) { var idx = this.tails.length; var row = new SideViewRow(idx, name, evt); this.tails[idx] = row; return row; } function SideViewRow(idx, name, onclickEvent) { this.idx = idx; this.name = name; this.onclickEvent = onclickEvent; this.renderRow = renderRow; this.isVisible = true; this.isDim = false; } function renderRow() { if (!this.isVisible) return ""; var str = "
  • "+this.onclickEvent+"
  • "; return str; } function showSideView(curObj, mb_id, name, email, homepage) { var sideView = new SideView('sideview', curObj, mb_id, name, email, homepage); sideView.showLayer(); } function SideView(targetObj, curObj, mb_id, name, email, homepage) { this.targetObj = targetObj; this.curObj = curObj; this.mb_id = mb_id; name = name.replace(/…/g,""); this.name = name; this.email = email; this.homepage = homepage; this.showLayer = showLayer; this.makeNameContextMenus = makeNameContextMenus; this.heads = new Array(); this.insertHead = insertHead; this.tails = new Array(); this.insertTail = insertTail; this.getRow = getRow; this.hideRow = hideRow; this.dimRow = dimRow; // 회원이라면 // (비회원의 경우 검색 없음) //if (g4_is_member) { // 쪽지보내기 if (mb_id) // 불여우 자바스크립트창이 뜨는 오류를 수정 this.insertTail("memo", '쪽지보내기'); // 메일보내기 if (email) this.insertTail("mail", '메일보내기'); // 홈페이지 if (homepage) this.insertTail("homepage", '홈페이지'); // 자기소개 if (mb_id) this.insertTail("info", '자기소개'); //} // 게시판테이블 아이디가 넘어왔을 경우 if (g4_bo_table) { if (mb_id) // 회원일 경우 아이디로 검색 this.insertTail("mb_id", "아이디로 검색"); else // 비회원일 경우 이름으로 검색 this.insertTail("name", "이름으로 검색"); } if (mb_id) this.insertTail("new", "전체게시물"); // 최고관리자일 경우 if (g4_is_admin == "super") { // 회원정보변경 if (mb_id) this.insertTail("modify", "회원정보변경"); // 포인트내역 if (mb_id) this.insertTail("point", "포인트내역"); } } function showLayer() { clickAreaCheck = true; var oSideViewLayer = document.getElementById(this.targetObj); var oBody = document.body; var curObjParent = this.curObj.parentNode; if (oSideViewLayer == null) { oSideViewLayer = document.createElement("div"); oSideViewLayer.id = this.targetObj; //oSideViewLayer.style.position = "absolute"; //oBody.appendChild(oSideViewLayer); } curObjParent.appendChild(oSideViewLayer); oSideViewLayer.innerHTML = this.makeNameContextMenus(); /* if (getAbsoluteTop(this.curObj) + this.curObj.offsetHeight + oSideViewLayer.scrollHeight + 5 > oBody.scrollHeight) oSideViewLayer.style.top = getAbsoluteTop(this.curObj) - getAbsoluteTop(this.curObj.offsetParent) - oSideViewLayer.scrollHeight + "px"; else oSideViewLayer.style.top = getAbsoluteTop(this.curObj) - getAbsoluteTop(this.curObj.offsetParent) + this.curObj.offsetHeight + "px"; oSideViewLayer.style.left = getAbsoluteLeft(this.curObj) - getAbsoluteLeft(this.curObj.offsetParent) - this.curObj.offsetWidth + 65 + "px"; */ divDisplay(this.targetObj, 'block'); selectBoxHidden(this.targetObj); } /* function getAbsoluteTop(oNode) { var oCurrentNode=oNode; var iTop=0; while(oCurrentNode.tagName!="body") { iTop+=oCurrentNode.offsetTop - oCurrentNode.scrollTop; oCurrentNode=oCurrentNode.offsetParent; } return iTop; } function getAbsoluteLeft(oNode) { var oCurrentNode=oNode; var iLeft=0; iLeft+=oCurrentNode.offsetWidth; while(oCurrentNode.tagName!="body") { iLeft+=oCurrentNode.offsetLeft; oCurrentNode=oCurrentNode.offsetParent; } return iLeft; } */ function makeNameContextMenus() { var str = ""; return str; } function getRow(name) { var i = 0; var row = null; for (i=0; i