/** * 카테고리 페이지로 이동 */ function chooseCategory(id) { location.href="/learn/forum/category/message/list.do?categoryId="+id; } /* * textarea 글자수 체크 */ function calc_length(maxlength, objName){ var obj = document.getElementById(objName); var i, len=0; var msg=""; var s = obj.value; for(i=0;i < s.length; i++){ (s.charCodeAt(i) > 255)? len+=2:len++; (len < maxlength)? msg+=s.charAt(i):msg } if ( len > maxlength ){ globalCommon.alertMsg('Contents must be written less than '+maxlength+' characters.'); obj.value = msg; return; } } /* * textarea 글자수 체크 */ function calc_length_comment(maxlength, obj){ var i, len=0; var msg=""; var s = obj.value; for(i=0;i < s.length; i++){ (s.charCodeAt(i) > 255)? len+=2:len++; (len < maxlength)? msg+=s.charAt(i):msg } if ( len > maxlength ){ globalCommon.alertMsg('Contents must be written less than '+maxlength+' characters.'); obj.value = msg; return; } } /* * forum/main.jsp * Hot 포럼 change 하는 스크립트 */ function change(g) { document.getElementById('sp01').innerHTML = ''; document.getElementById('sp02').innerHTML = ''; document.getElementById('sp03').innerHTML = ''; document.getElementById('sp04').innerHTML = ''; document.getElementById('sp05').innerHTML = ''; document.getElementById('sp0'+g).innerHTML = ''; if(document.getElementById('hotimg'+g)){ document.getElementById('hotimg'+g).innerHTML = 'hot'; } if(document.getElementById('hot'+g)){ if(document.getElementById('hot1')){ document.getElementById('hot1').style.display="none"; } if(document.getElementById('hot2')){ document.getElementById('hot2').style.display="none"; } if(document.getElementById('hot3')){ document.getElementById('hot3').style.display="none"; } if(document.getElementById('hot4')){ document.getElementById('hot4').style.display="none"; } if(document.getElementById('hot5')){ document.getElementById('hot5').style.display="none"; } if(document.getElementById('hot'+g)){ document.getElementById('hot'+g).style.display="block"; } } } /* * forum/category/message/list.jsp * 스페샬 리스트 상세페이지로 이동 */ function the(id){ location.href = "/learn/forum/speciallist/view.do?userKey="+id } /** * special user을 setting * @param {object} bean miniprofile 정보 * @param {boolean} isRight 우측/좌측 여부 * @param {string} x X좌표 * @param {string} y Y좌표 */ function showSpecialUser(isRight, userId, userName, e) { var profileLoc = ""; var className = ""; if(isRight == 'right'){ className="leftbar"; profileLoc = "left"; }else{ className="rightbar"; profileLoc = "right"; } if(nv.$('miniprofile')) { nv.$('miniprofile').style.display = 'none'; } var html = ""; html += "
"; html += "
\"\"
"; html += " "; html += "
"; var sminilayer = nv.$('layeSpecialuser'); var sminiprofileDiv = nv.$('varticle'); if(sminiprofileDiv) { //sminilayer.removeChild(sminiprofileDiv); sminiprofileDiv.innerHTML = html; }else{ sminiprofileDiv = document.createElement('DIV'); sminiprofileDiv.id = 'varticle'; sminiprofileDiv.className = 'varticle'; sminiprofileDiv.style.display = 'none'; sminiprofileDiv.innerHTML = html; sminilayer.appendChild(sminiprofileDiv); } if(isRight == 'right') { onItleft(e, 'varticle'); } else { onItright(e, 'varticle'); } //shapeMiniSlide(); } // /WEB-INF/jsps/com-front/community/learn/forum/landing/landingMyForum.jsp /** * 참여 정보 탭변경 */ function changeActiv(id) { if("activImg1"==id) { document.getElementById("activImg1").innerHTML = "ARTICLE"; document.getElementById("activImg2").innerHTML = "ARTICLE"; document.getElementById("activity1").style.display= "block"; document.getElementById("activity2").style.display = "none"; } if("activImg2"==id) { document.getElementById("activImg1").innerHTML = "FORUM"; document.getElementById("activImg2").innerHTML = "FORUM"; document.getElementById("activity1").style.display = "none"; document.getElementById("activity2").style.display = "block"; } } /** * 즐겨찾기 탭변경 */ function changeFavo(id) { if("favo1"==id) { document.getElementById("favo1").innerHTML = "ARTICLE"; document.getElementById("favo2").innerHTML = "ARTICLE"; document.getElementById("favotite1").style.display= "block"; document.getElementById("favotite2").style.display = "none"; } if("favo2"==id) { document.getElementById("favo1").innerHTML = "FORUM"; document.getElementById("favo2").innerHTML = "FORUM"; document.getElementById("favotite1").style.display = "none"; document.getElementById("favotite2").style.display = "block"; } } /** * 경고문구 후 로그인 페이지로 이동한다 */ function goLoginPage(url){ globalCommon.alertScriptConfirm("You need to sign-in.", "signin", "javascript:globalCommon.goLoginPage('"+url+"')", "javascript:nv.LBox.off()", "cancel"); } /** * 관리자 문의 게시판으로 간다. */ function gotoSupport(process){ if(process == 'delete'){ globalCommon.alertScriptConfirm("You cannot delete this article because replies and comments posted for the article.
If you want to delete this article, please contact the admnistrator.", "gotosupport", "javascript:location.href='"+webServer+"/common/support/qna/qna.write.form.do'", "javascript:nv.LBox.off()", "cancel"); }else{ globalCommon.alertScriptConfirm("You cannot update this article because replies and comments posted for the article.
If you want to update this article, please contact the admnistrator.", "gotosupport", "javascript:location.href='"+webServer+"/common/support/qna/qna.write.form.do'", "javascript:nv.LBox.off()", "cancel"); } } /* * /WEB-INF/jsps/com-front/community/learn/forum/message/list.jsp * 정렬방식을 변경한다. */ function changeSorting(){ var selectIndexHint = document.getElementById("selectIndexHint"); document.listForm.indexHint.value=selectIndexHint.options[selectIndexHint.selectedIndex].value; document.listForm.submit(); } /* * /WEB-INF/jsps/com-front/community/learn/forum/message/list.jsp * 검색을 수행한다. */ function messageSearch(){ document.listForm.submit(); } /* * /WEB-INF/jsps/com-front/community/learn/forum/message/write.jsp, update.jsp * 글쓰기 취소 */ function cancel(message){ globalCommon.alertScriptConfirm(message, "continue", "javascript:history.back()","javascript:nv.LBox.off()","cancel"); } /* * /WebContent/WEB-INF/jsps/com-front/community/learn/forum/category/message/list.jsp * 포럼검색 */ function forumSearch(){ var frm = document.listForm; frm.action = "/learn/forum/category/message/list.do"; frm.submit(); } /* * /WebContent/WEB-INF/jsps/com-front/community/learn/forum/landing/landingSpecilist.jsp * 해당 아이디의 스페샬 리스트 페이지로 이동 */ function the(id){ location.href = "/learn/forum/speciallist/view.do?userKey="+id } /* * /WebContent/WEB-INF/jsps/com-front/community/learn/forum/message/view.jsp * 신고 */ var _objname; function startReportPop(objname, messageId){ _objname = objname; ForumDWR.getReport(messageId, resultIsReport); } function resultIsReport(data) { if(data > 0){ globalCommon.alertNotice('you have already reported this.',''); }else{ var openname = document.getElementById(_objname); openname.style.display = ''; } } function insertReport(objname,messageId){ _objname = objname; var validator = new nv.Validator("", globalCommon.alertMsg); var reportReasonCodeValue=""; var reportReasonCodeList = document.getElementById("reportReasonCodeList"); var reportReasonCode = reportReasonCodeList.getElementsByTagName("li"); var reportReason=""; for(var i=0;i < reportReasonCode.length;i++){ if(reportReasonCode[i].getElementsByTagName("input")[0].checked){ reportReasonCodeValue=reportReasonCode[i].getElementsByTagName("input")[0].value; } } if(reportReasonCodeValue==3){ validator.checkRequired('reportReason', 'You need to enter reason.', false); //validator.checkRegex('reportReason', /<\/?[^>]+(>|$)/g, false, '태그를 입력할 수 없습니다.', true); validator.checkMaxLength('reportReason', 500, 'The reason must be written less than 500 byte.', true); if(!validator.validate()) return; reportReason=xssFunction(document.getElementById('reportReason').value); }else{ reportReason=""; } ForumDWR.insertReport(messageId, reportReasonCodeValue, reportReason, resultInsertReport); } function insertReport2(objname,messageId,idx){ _objname = objname; var validator = new nv.Validator("", globalCommon.alertMsg); var reportReasonCodeValue=""; var reportReasonCodeList = document.getElementById("reportReasonCodeList_"+idx); var reportReasonCode = reportReasonCodeList.getElementsByTagName("li"); var reportReason=""; for(var i=0;i < reportReasonCode.length;i++){ if(reportReasonCode[i].getElementsByTagName("input")[0].checked){ reportReasonCodeValue=reportReasonCode[i].getElementsByTagName("input")[0].value; } } if(reportReasonCodeValue == 3){ validator.checkRequired('reportReason_'+idx, 'You need to enter reason.', false); //validator.checkRegex('reportReason_'+idx, /<\/?[^>]+(>|$)/g, false, '태그를 입력할 수 없습니다.', true); validator.checkMaxLength('reportReason_'+idx, 500, 'The reason must be written less than 500 byte.', true); if(!validator.validate()) return; reportReason=xssFunction(document.getElementById('reportReason_'+idx).value); }else{ reportReason=""; } ForumDWR.insertReport(messageId, reportReasonCodeValue, reportReason, resultInsertReport); } function resultInsertReport(data){ if(data==1){ closePop(_objname); globalCommon.alertNotice('It has been sent to the administrator.',''); } if(data==2){ closePop(_objname); globalCommon.alertNotice('you have already reported this.',''); } } /* * /WebContent/WEB-INF/jsps/com-front/community/learn/forum/specialist/view.jsp * 스페셜 리스트의 글목록 검색 수행 */ function specialSearch() { var frm = document.viewForm; frm.action = "/learn/forum/speciallist/view.do"; frm.submit(); } /*-------------------------------------------------- 기능 : 해당 페이지 Url을 복사한다. INPUT : RETURN : MSG : NONE ----------------------------------------------------*/ function copyUrlPop(){ var url = document.URL; //url = url.substring(0,((url.length)-1)); var html = ""; html += "
"; html += "
"; html += " "; html += " "; html += " \"\"/ "; html += " "; html += " \"Copy"; html += " "; html += "
"; html += " "; html += " \"copy\"/ "; html += " "; html += "
"; html += "
"; html += "
"; var urlLayer = nv.$('copyUrlLayer'); var urlShowDiv = nv.$("copyurl"); if(urlShowDiv) { urlLayer.removeChild(urlShowDiv); } urlShowDiv = document.createElement('div'); urlShowDiv.id = 'copyurl'; urlShowDiv.className = 'copytheurl'; urlShowDiv.innerHTML = html; urlLayer.appendChild(urlShowDiv); } /*-------------------------------------------------- 기능 : 해당 Url을 클립보드에 복사한다. INPUT : RETURN : MSG : NONE ----------------------------------------------------*/ function copyTheUrl() { if (nv.BrowserDetector.isIE) { window.clipboardData.setData("Text", document.URL); }else { globalCommon.alertNotice('Only IE'); } }