var globalCommonWebServer = "http://www.samsungimaging.co.kr" var globalCommonImgServer = "http://image.samsungimaging.co.kr"; var globalCommon = {}; /** * 공통 로그인 DWR 호출 */ function globalSignIn() { nv.$('loginId').value = nv.Str.trim(nv.$('loginId').value); var loginId = nv.$('loginId').value; var password = nv.$('password').value; var rememberId = nv.$('rememberId'); var emailYn = checkedRadio('emailYn'); var remmeberIdValue = "N"; if(rememberId && rememberId.checked) { remmeberIdValue = "Y"; } SignDWR.signIn(loginId, password, remmeberIdValue, emailYn, signComplete); return false; } function checkedRadio(identifier){ var ele = document.getElementsByName(identifier); var eleValue = ''; for (var idxe = 0 ; idxe < ele.length ; idxe++) { if (ele[idxe].checked == true) { eleValue = ele[idxe].value; } } return eleValue; } /** * 로그인 DWR 결과 * @param {String} data 결과값 */ function signComplete(data) { if(data == "id") { globalCommon.alertMsg('아이디를 입력해주세요'); } else if(data == "pw") { globalCommon.alertMsg('비밀번호를 입력해주세요'); } else if(data == "nodata") { globalCommon.alertMsg('귀하의 정보가 유효하지 않습니다.'); } else if(data == "error") { globalCommon.alertMsg('application is error.'); } else if(data == "noauth") { globalCommon.alertMsg('이메일 인증이 완료되지 않았습니다. 이메일을 확인해주세요.
인증메일이 도착하지 않았다면 아래의 버튼을 클릭하여
다른 이메일 주소로 인증메일을 요청해주세요. 감사합니다.'); } else if(data == "noactive") { globalCommon.alertMsg('귀하의 정보가 유효하지 않습니다.'); } else if(data == "noinfo") { location.href = "/common/myprofile/member/addInfoForm.do"; } else { location.href = nv.$('returnUrl').value; } } function resetLayer(obj) { if(nv.$(obj)) { nv.$(obj).style.display = "none"; } } /** * 알럿 메세지 표시 */ globalCommon.alertMsg = function(messageText, actionFunction) { var htmlTxt = ""; if(actionFunction == null || actionFunction == '') { actionFunction = 'nv.LBox.off();'; } htmlTxt += "
"; htmlTxt += " \"CLOSE\""; htmlTxt += " \"\" \"Sorry\"
"; htmlTxt += "
"+messageText+"
"; htmlTxt += "
"; nv.LBox.on(htmlTxt); } /** * 알럿 메세지 표시 */ globalCommon.alertConfirm = function(messageText, buttonType, cancelHref, secondButtonType) { var firstImg = "\"OK\""; if(buttonType || buttonType != '') { if(buttonType == 'delete') { firstImg = "\"DELETE\""; } else if(buttonType == 'applytoall') { firstImg = "\"APPLY"; } else if(buttonType == 'continue') { firstImg = "\"CONTINEW\""; } else if(buttonType == 'gotosupport') { firstImg = "\"GO"; } else if(buttonType == 'signin') { firstImg = "\"SIGN"; } else if(buttonType == 'yesdiscardit') { firstImg = "\"YES"; } else if(buttonType == 'yes') { firstImg = "\"YES\""; } else if(buttonType == 'send') { firstImg = "\"SEND\""; } else if(buttonType == 'change') { firstImg = "\"CHANGE\""; } else if(buttonType == 'cancel') { firstImg = "\"CANCEL\""; } else if(buttonType == 'no') { firstImg = "\"NO\""; } else if(buttonType == 'nocontinueediting') { firstImg = "\"NO"; } } var secondImg = "\"CANCEL\""; if(secondButtonType || secondButtonType != '') { if(secondButtonType == 'cancel') { secondImg = "\"CANCEL\""; } else if(secondButtonType == 'no') { secondImg = "\"NO\""; } else if(secondButtonType == 'nocontinueediting') { secondImg = "\"NO"; } else if(secondButtonType == 'gotosupport') { secondImg = "\"GOTO"; } else if(secondButtonType == 'register') { secondImg = "\"REGISTER\""; } } var cancelScript = 'javascript:nv.LBox.off();'; if(cancelHref || cancelHref != '') { cancelScript = cancelHref; } var htmlTxt = ""; htmlTxt += "
"; htmlTxt += " \"CLOSE\""; htmlTxt += " \"\"
"; htmlTxt += "
"+messageText+"
"; htmlTxt += "
"+firstImg+" "+secondImg+"
"; htmlTxt += "
"; nv.LBox.on(htmlTxt); } /** * 확인 알럿 메세지 표시 없이 SUBMIT */ globalCommon.alertNoConfirm = function() { nvConfirm.submit(); } /** * 알럿 메세지 표시 */ globalCommon.alertScriptConfirm = function(messageText, buttonType, scriptHref, cancelHref, secondButtonType) { var firstImg = "\"OK\""; if(buttonType || buttonType != '') { if(buttonType == 'delete') { firstImg = "\"DELETE\""; } else if(buttonType == 'applytoall') { firstImg = "\"APPLY"; } else if(buttonType == 'continue') { firstImg = "\"CONTINEW\""; } else if(buttonType == 'gotosupport') { firstImg = "\"GO"; } else if(buttonType == 'signin') { firstImg = "\"SIGN"; } else if(buttonType == 'yesdiscardit') { firstImg = "\"YES"; } else if(buttonType == 'yes') { firstImg = "\"YES\""; } else if(buttonType == 'send') { firstImg = "\"SEND\""; } else if(buttonType == 'change') { firstImg = "\"CHANGE\""; } else if(buttonType == 'cancel') { firstImg = "\"CANCEL\""; } else if(buttonType == 'no') { firstImg = "\"NO\""; } else if(buttonType == 'nocontinueediting') { firstImg = "\"NO"; } } var secondImg = "\"CANCEL\""; if(secondButtonType || secondButtonType != '') { if(secondButtonType == 'cancel') { secondImg = "\"CANCEL\""; } else if(secondButtonType == 'no') { secondImg = "\"NO\""; } else if(secondButtonType == 'nocontinueediting') { secondImg = "\"NO"; } else if(secondButtonType == 'gotosupport') { secondImg = "\"GOTO"; } else if(secondButtonType == 'register') { secondImg = "\"REGISTER\""; } } var cancelScript = 'javascript:nv.LBox.off();'; if(cancelHref || cancelHref != '') { cancelScript = cancelHref; } var htmlTxt = ""; htmlTxt += "
"; htmlTxt += " \"CLOSE\""; htmlTxt += " \"\"
"; htmlTxt += "
"+messageText+"
"; htmlTxt += "
"+firstImg+" "+secondImg+"
"; htmlTxt += "
"; nv.LBox.on(htmlTxt); } /** * 알럿 메세지 표시 */ globalCommon.alertNotice = function(messageText, actionFunction) { var htmlTxt = ""; if(actionFunction == null || actionFunction == '') { actionFunction = 'nv.LBox.off();'; } var firstImg = "\"OK\""; htmlTxt += "
"; htmlTxt += " \"CLOSE\""; htmlTxt += " \"\"
"; htmlTxt += "
"+messageText+"
"; htmlTxt += "
"+firstImg+"
"; htmlTxt += "
"; nv.LBox.on(htmlTxt, actionFunction); } /** * 태그 유효성 체크 * @param {string} tags 태그 * @return {boolean} 유효성 여부 */ globalCommon.tagValidator = function(tagElement){ if(!tagElement) return true; var parseTags = tagElement.value.split(","); var tagArray = new Array(); for(var i=0; i 30) { var str1 = '태그 가 너무 깁니다.'; var str2 = '
30 byte 이하로 입력해주세요.'; var str3 = str1+str2; globalCommon.alertMsg(str3); tagElement.focus(); return false; } for(var j=i+1; j 10) { globalCommon.alertMsg("죄송합니다, 태그를 10개이상 입력할 수없습니다."); return false; } // 정리된 태그를 element에 세팅 var tagValue = ""; for(i=0; i0) tagValue += ","; tagValue += tagArray[i]; } tagElement.value = tagValue; return true; } /** * 온로드 */ function whenDOMReady(fn) { var f = arguments.callee; if ("listeners" in f) { // already initialized if (f.listeners) { // still loading f.listeners.push(fn); } else { // DOM is ready fn(); } return; } f.listeners = [fn]; f.callback = function() { nv.Event.removeListener(window, "load", f.callback); if (document.removeEventListener) { document.removeEventListener("DOMContentLoaded", f.callback, false); } if (f.listeners) { while (f.listeners.length) { f.listeners.shift()(); } f.listeners = null; } }; if (document.addEventListener) { document.addEventListener("DOMContentLoaded", f.callback, false); } nv.Event.addListener(window, "load", f.callback); } /** * miniprofile 중 makeFriend * @param {boolean} loginUser 로그인여부 */ function makeFriend(loginUser) { loginUser = true; if(loginUser) { var miniprofileForm = nv.$('miniprofileForm'); var validator = new nv.Validator(miniprofileForm, globalCommon.alertMsg); var miniprofileMessage = nv.$('miniprofileMessage'); var miniprofileGroup = nv.$('miniprofileGroup'); var miniprofileUserId = nv.$('miniprofileUserId'); var miniprofileLoginId = nv.$('miniprofileLoginId'); if(miniprofileMessage) { validator.checkRequired('miniprofileMessage', '\'message\'을 입력해주세요.', true); validator.checkMaxLength('miniprofileMessage', 4000, '', true); } if(validator.validate()) { var dMessage = miniprofileMessage.value; var dGroup = miniprofileGroup.value; var dUserId = miniprofileUserId.value; var dLoginId = miniprofileLoginId.value; try { MiniprofileDWR.requestFriend(dUserId, dLoginId, dMessage, dGroup, { callback:function(resultValue) { if(resultValue == 'nonsession') { globalCommon.alertMsg('로그인이 필요합니다.'); } else if(resultValue == 'success') { globalCommon.alertNotice('초대메일을 발송 했습니다.'); closePop('miniprofile'); } } } ); } catch(e) { closePop('miniprofile'); } } } else { globalCommon.alertMsg('로그인이 필요합니다.'); } } /** * miniprofile 중 Make a friend 화면으로 이동 * @param {boolean} loginUser 로그인 여부 */ function moveMakeafriend(loginUser) { loginUser = true; if(loginUser) { startPop('miniopen2'); } else { globalCommon.alertMsg('로그인이 필요합니다.'); } } /** * miniprofile 중 gallery로 이동 * @param {boolean} url gallery url */ function miniprofileGallery(url) { if(url == null || url == '') { globalCommon.alertMsg('갤러리가 존재하지 않습니다.') } else { location.href = url; } } /** * miniprofile 호출 DWR * @param {boolean} isRight 우측/좌측여부 * @param {string} userId userid * @param {string} e onclick event */ function showProfile(isRight, userId, e) { /* 2009-11-18 임시로 막음. 고객 요청으로 ,현재 가입된회원수가 적어서(대부분 이관된 회원이기 때문에 재가입율이 오른다음 OPEN ) var pos = getEventPosition(e); MiniprofileDWR.getProfile(userId, { callback:function(resultValue) { setProfile(resultValue, isRight, pos); } } ); */ } /** * miniprofile을 setting * @param {object} bean miniprofile 정보 * @param {boolean} isRight 우측/좌측 여부 * @param {string} x X좌표 * @param {string} y Y좌표 */ function setProfile(bean, isRight, pos) { //20091103 프로파일을 뛰울때 다른 프로파일 레이어 닫히는 처리 var miniprofileObj = document.getElementById('miniprofile'); var unjoinedObj = document.getElementById('unjoined'); var notavailableObj = document.getElementById('notavailable'); if(miniprofileObj){ miniprofileObj.style.display="none"; } if(unjoinedObj){ unjoinedObj.style.display="none"; } if(notavailableObj){ notavailableObj.style.display="none"; } if(bean.userStatus == 5) { if(isRight == 'right') { layerRight(pos, 'unjoined'); } else { layerLeft(pos, 'unjoined'); } return; } if(bean.userType == 2) { if(isRight == 'right') { layerRight(pos, 'notavailable'); } else { layerLeft(pos, 'notavailable'); } return; } var html = ""; html += "
"; html += "
"; html += " "; html += " "; html += "
"; html += " "; html += "
"; html += " "; html += "
\"\"\"\"
"; html += "
"; html += "
"; html += "
"; html += " \"\""; html += " "+bean.profileName+"'s
\"프로파일\"
"; html += " \"닫기\""; html += "
"; html += "
"; html += "

"+bean.loginId+"

"; var countryInfo = ""; if((bean.country != '' && bean.language != '') && (bean.country != null && bean.language != null)) { countryInfo = bean.country+" / "+bean.language.replace(' (KO)', ''); if(countryInfo.length > 32) { countryInfo = countryInfo.substring(0, 32) + ".."; } } html += "

"+countryInfo+"

"; html += "
"; html += "
"; html += "
"; html += "
\"활동지수\"
"; html += "
"; if(bean.activity > 0) { html += "\"\""; } html += "
"; html += "
\"인기지수\"
"; html += "
"; if(bean.popularity > 0) { html += "\"\""; } html += "
"; html += "
\"베스트지수\"
"; html += "
"; if(bean.performance > 0) { html += "\"\""; } html += "
"; html += "
"; html += "
"; html += "
"; html += "
"; html += "
"; html += "
"; html += "
    "; if(bean.memberStickers != null) { for(var i = 0; i < bean.memberStickers.length; i++) { html += "
  • \"\"/
  • "; } } html += "
"; html += "
"; html += "
"; html += " \"\""; html += "
"; if(bean.memberProducts != null) { for(var i = 0; i < 1; i++) { html += "
\"\"
"; html += "
"+bean.memberProducts[i].langPrdNm+"
"+(bean.memberProducts[i].prdCtgSeq==1?"Carmera":"Camcorder")+"
"; } } html += "
"; html += " \"\""; html += "
"; if(bean.sessionUserId != bean.userId) { html += "
"; if(!bean.friend) { html += "\"\""; } html += "\"\"
"; } html += "
"; html += "
"; var minilayer = nv.$('layerminiprofile'); var miniprofileDiv = nv.$('miniprofile'); if(miniprofileDiv) { minilayer.removeChild(miniprofileDiv); } miniprofileDiv = document.createElement('div'); miniprofileDiv.id = 'miniprofile'; miniprofileDiv.className = 'miniprofile'; miniprofileDiv.style.display = 'none'; miniprofileDiv.innerHTML = html; minilayer.appendChild(miniprofileDiv); if(isRight == 'right') { layerRight(pos, 'miniprofile'); } else { layerLeft(pos, 'miniprofile'); } } var currentMiniProductIdx = 0; function getMiniProduct(userId, idx) { if(currentMiniProductIdx > -1) { MiniprofileDWR.getMiniprofileProduct(userId, (currentMiniProductIdx + (idx)), { callback:function(bean) { if(bean != null) { currentMiniProductIdx = currentMiniProductIdx + (idx); var miniProduct = nv.$('miniProduct'); if(miniProduct) { var miniProduct1 = nv.$('miniProduct1'); var miniProduct2 = nv.$('miniProduct2'); if(miniProduct1) { miniProduct.removeChild(miniProduct1); miniProduct.removeChild(miniProduct2); } miniProduct1 = document.createElement('div'); miniProduct1.id = 'miniProduct1'; miniProduct1.className = 'panelpic floatl'; miniProduct1.innerHTML = "\"\""; miniProduct.appendChild(miniProduct1); miniProduct2 = document.createElement('div'); miniProduct2.id = 'miniProduct2'; miniProduct2.className = 'paneltxt floatl mgl10 mgt15'; miniProduct2.innerHTML = ""+bean.langPrdNm+"
"+(bean.prdCtgSeq==1?"Carmera":"Camcorder")+""; miniProduct.appendChild(miniProduct2); } } } } ); } } function layerLeft(pos, objName){ var objectLayer = nv.$(objName) objectLayer.style.display = 'block'; if(objName == 'miniprofile') { objectLayer.style.left = pos.x + 'px'; objectLayer.style.top = (pos.y - 95) + 'px'; } else { objectLayer.style.left = (pos.x + 15) + 'px'; objectLayer.style.top = (pos.y - 10) + 'px'; } } function layerRight(pos, objName){ var objectLayer = nv.$(objName) objectLayer.style.display = 'block'; if(objName == 'miniprofile') { objectLayer.style.left = (pos.x - 185) + 'px'; objectLayer.style.top = (pos.y - 95) + 'px'; } else { objectLayer.style.left = (pos.x - 160) + 'px'; objectLayer.style.top = (pos.y - 10) + 'px'; } } /** * Notification의 comment 영역 조회 DWR */ function getNotificationCommentList() { MiniprofileDWR.getNotificationCommentList(setNotificatoinComment); } /** * Notification의 comment 영역 layer setting * @param {object} bean comment object */ function setNotificatoinComment(bean) { var notificationDiv = nv.$('notificationDiv'); if(notificationDiv) { var commentopen = nv.$('commentopen'); if(commentopen) { notificationDiv.removeChild(commentopen); } commentopen = document.createElement('div'); commentopen.id = 'commentopen'; commentopen.style.display = 'none'; var html = ""; html += "
"; html += "
"; html += "
"; html += " \"COMMENT\"\"close\""; html += "
"; html += " \"내가"; html += "
"; if(bean != null) { var bean1 = bean[0]; if(bean1 != null) { html += " "; } else { html += "

\"새

"; } } html += "
"; html += "
"; html += " \"내가"; html += "
"; if(bean != null) { var bean2 = bean[1]; if(bean2 != null) { html += " "; } else { html += "

\"새

"; } } html += "
"; html += "
"; html += "\"\""; html += "
"; commentopen.innerHTML = html; notificationDiv.appendChild(commentopen); } startPop('commentopen'); } /** * Notification의 New update 조회 DWR */ function getNotificationNewUpdate() { MiniprofileDWR.getBuddyListByContentsUpdated(setNotificationNewUpdate); } /** * Notification의 New update layer setting * @param {object} */ function setNotificationNewUpdate(bean) { var notificationDiv = nv.$('notificationDiv'); if(notificationDiv) { var newupdates = nv.$('newupdates'); if(newupdates) { notificationDiv.removeChild(newupdates); } newupdates = document.createElement('div'); newupdates.id = 'newupdates'; newupdates.style.display = 'none'; var html = ""; html += "
"; html += "
"; html += " \"새\"close\""; html += "
"; if(bean != null) { html += "

\"새

"; } else { html += "

\"업데이트

"; } html += "
"; html += "
    "; if(bean != null) { for(var i = 0; i < bean.length; i++) { html += "
  • "; html += "
    \"\"
    "; html += "
    "+bean[i].profileName+"
    "+bean[i].recentDate+"
    "; html += "
  • "; } } html += " "; html += "
"; html += "
"; html += "
"; html += " \"\""; newupdates.innerHTML = html; notificationDiv.appendChild(newupdates); } startPop('newupdates'); } /** * invate a friend메뉴에서 사용하는 address book 팝업객체 */ var popInviteAddress; /** * invite friend address book popup */ function fnInviteAddressBook(){ popInviteAddress = window.open("/invite/invite.popup.do?typeKey=1","popInviteAddress","fullscreen=no,titlebar=no,toolbar=no,directories=no,status=no,menubar=no, scrollbars=no, resizable=no,location=no, width=400,height=550,top="+(screen.availheight-650)/2+",left="+(screen.availheight-615)/2); popInviteAddress.focus(); } /** * invite friend div close시 팝업닫음 */ function fnCloseInviteFriend(){ closePopie('invitefriend'); if ( typeof(popInviteAddress) != 'undefined' && !popInviteAddress.closed ) { popInviteAddress.close(); } } function fnInviteGoogleSet(data) { if(nv.Str.trim(nv.$("friendEmail").value) != '') { nv.$("friendEmail").value += "," + data; } else { nv.$("friendEmail").value = ""; nv.$("friendEmail").value = data; } } /** * invite friend 구글연동 콜백 - 데이터에 따라 액션 분기(메일주소get/인증) */ function fnInviteGoogleAddressCallback(data) { if (data) { nv.Popup.open('/common/mynetwork/makeAFriends/popup/findFromSNS.do?snsName=googlecontacts&snsMethod=contactsAll&callback=fnInviteGoogleSet', 'popup_find_from_sns', 337, 376, 'no', 'no'); } else { nv.Popup.open('/common/mynetwork/setNetworks/popup/auth.do?snsName=googlecontacts&snsMethod=contactsAll&callback=fnInviteGoogleAddressCallback', 'sns_auth', 381, 180, 'no', 'no'); } } /** * invite friend 구글연동 */ function fnInviteGoogleAddress() { TokenCheckDWR.checkAccessToken('googlecontacts', fnInviteGoogleAddressCallback); } /** * 초대 메일 전송 결과 콜백 * @param resultValue : 전송결과 boolean */ function fnInviteFriendSendMailCallback(resultValue){ fnCloseInviteFriend(); globalCommon.alertNotice('초대메일을 발송 했습니다.'); } /** * 초대 쪽지메일전송 */ function fnInviteFriendSend(type,id){ var mailAddr = nv.$("friendEmail").value; //받는사람 메일주소(구분자 : ',') if(nv.Str.trim(mailAddr) == '') { globalCommon.alertMsg('\'받을사람\'을 입력해주세요.'); return; } if(mailAddr.indexOf(',') > 0) { var mailArray = mailAddr.split(','); for(var i = 0; i < mailArray.length; i++) { if(!nv.Str.isEmail(mailArray[i])) { globalCommon.alertMsg('이메일이 존재하지 않습니다. 확인해주세요.'); return; } } } else { if(!nv.Str.isEmail(mailAddr)) { globalCommon.alertMsg('이메일이 존재하지 않습니다. 확인해주세요.'); return; } } var message = nv.$("txtAreaInviteFriendMessage").value; //사용자가 입력한 메시지 if(nv.Str.trim(message) == '') { globalCommon.alertMsg('\'메세지\'을 입력해주세요.'); return; } if(message.search(/<\/?[^>]+(>|$)/g) != -1) { globalCommon.alertMsg('HTML 태그 message는 허용되지 않습니다 .'); return; } MiniprofileDWR.sendNoteForInviteFriend(type,id,mailAddr,message, { callback:function() { fnInviteFriendSendMailCallback(); } } ); } /** * InviteFriend 호출 DWR * @param {int} type * - 1 : Gallery * - 2 : Photo * - 3 : Video * - 4 : SlideShow * - 5 : product * - 6 : Froum * - 7 : Collaborate * - 8 : Challenge * - 11 : web-Zine * - 12 : academy(offline) * - 13 : academy(online) * @param {string} id (dwr에서 형변환) * - Gallery일때 : long blogId * - Photo일때 : long log_id * - Video일때 : long log_id * - SlideShow일때 : long log_id * - product일때 : String[] langPrdSeqs * - Froum일때 : long boardId * - Collaborate일때 :long blogId * - Challenge일때 : long blogId * - web-Zine일때 : long webZineId * - academy(offline)일때 : long offlineAcademyId * - academy(online)일때 : long onlineAcademyId */ function fnShowInviteFriend(type,id){ MiniprofileDWR.getInviteFriend(type,id, { callback:function(resultValue) { fnSetInviteFriendForm(resultValue,type,id); } } ); } /** * invite a friend div 생성 콜백 메서드 */ function fnSetInviteFriendForm(bean,type,id){ if(!bean.login) { return; } var html = ""; html += "
"; html += "
\"INVITE\"\"
"; html += "
"; html += "
"; switch(type){ case 1: html += "
\"\"
"; html += "

"+bean.title+"

"; html += "

"+bean.desc+"

"; break; case 2: case 9: case 10: html += "
\"\"
"; html += "

"+bean.title+"

"; html += "

"+bean.desc+"

"; break; case 11: html += "
"; if(bean.imgSrc){ html += "\"\""; } html += "
"; html += "

"+bean.title+"

"; html += "

"+bean.desc+"

"; break; case 12: html += "
\"\"
"; html += "

"+bean.title+"

"; html += "

"+bean.desc+"

"; break; case 13: html += "
\"\"
"; html += "

"+bean.title+"

"; html += "

"+bean.desc+"

"; break; case 3: html += "
"; html += "
"; html += "
\"\"
"; html += " \"\""; html += "
"; html += "
"; html += "

"+bean.title+"

"; html += "

"+bean.desc+"

"; break; case 4: html += "
"; html += "
"; html += "
\"\"
"; html += " \"\""; html += "
"; html += "
"; html += "

"+bean.title+"

"; html += "

"+bean.desc+"

"; break; case 5: html += "
\"\"
"; html += "

"+bean.title+"

"; break; case 6: html += "
\"\"
"; html += "

"+bean.title+"

"; html += "

Since \"\" "+bean.desc+"

"; break; case 7: html += "
\"\"
"; html += "

"+bean.title+"

"; html += "

Opened till \"\" "+bean.registerDate+"

"; break; case 8: html += "
\"\"
"; html += "

"+bean.title+"

"; html += "

Opened till \"\" "+bean.registerDate+"

"; break; } html += "
"; html += "
"; html += " \"To\""; html += "
"; html += "
" html += " " html += "
" if(bean.regular) { html += " \"\"\"\""; } html += "
"; html += " \"To\""; html += "
"; html += " "; html += "
"; html += " \"save\"\"cancel\""; html += "
"; html += "
\"\"
"; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += "
"; html += "
"; var invite = nv.$('layerInvitefreind'); var invitefriendDiv = nv.$('invitefriend'); if(invitefriendDiv) { invite.removeChild(invitefriendDiv); } invitefriendDiv = document.createElement('div'); invitefriendDiv.id = 'invitefriend'; invitefriendDiv.className = 'invitefriend'; invitefriendDiv.style.display = 'block'; invitefriendDiv.innerHTML = html; invite.appendChild(invitefriendDiv); } /*-------------------------------------------------- 기능 : 즐겨찾기 Add INPUT : blogId, objectType, objectId RETURN : MSG : 해당 파라미터 null 체크시 리턴 메세지 ----------------------------------------------------*/ function favoriteAdd(blogId, objectType, objectId, isYn) { if(blogId == null || blogId == 'undefined') { globalCommon.alertMsg('\'블로그 아이디\'을 입력해주세요.'); return; } else if(objectId == null || objectId == 'undefined') { globalCommon.alertMsg('\'오브젝트 타입\'을 입력해주세요.'); return; } else if(objectType == null || objectType == 'undefined') { globalCommon.alertMsg('\'오브젝트 아이디\'을 입력해주세요.'); return; } else { MiniprofileDWR.favoriteMessage(blogId, objectType, objectId, { callback:function(resultValue) { favoriteComplete(resultValue,blogId, objectType, objectId, isYn); } } ); //MiniprofileDWR.favoriteMessage(blogId, objectType, objectId, favoriteComplete); } } /** * PhotoOfToday favorites add/delete */ /*-------------------------------------------------- 기능 : PhotoOfToday 즐겨찾기 추가 삭제 INPUT : blogId, logId , index RETURN : MSG : ----------------------------------------------------*/ function changePhotoTodayFavorite( blogId, logId, index){ var checkStar = document.getElementById("checkStar"+index); var favoriteType = 1; if(checkStar.value == 'true'){ //체크된 이미지. MiniprofileDWR.favoriteDelete(blogId, favoriteType, logId, favoriteDelCompleteCallback); checkStar.src = globalCommonImgServer+"/img/common/mygallery/star_off.png"; checkStar.value = 'false'; } else { MiniprofileDWR.favoriteMessage(blogId, favoriteType , logId, favoriteAddCompleteCallback); checkStar.src = globalCommonImgServer+"/img/common/mygallery/star_on.png"; checkStar.value = 'true'; } } function favoriteAddCompleteCallback(data) { if(data == "success"){ favoriteConfrim(1); } else{ globalCommon.alertNotice('즐겨찾기 등록에 실패하였습니다.'); } } function favoriteDelCompleteCallback(data){ if(data == "DeleteSuccess") { globalCommon.alertNotice('파일삭제가 완료 되었습니다.'); }else { globalCommon.alertNotice('즐겨찾기 삭제에 실패하였습니다.'); } } /*-------------------------------------------------- 기능 : 즐겨찾기 추가 성공이나 존재시 출력 메세지 INPUT : objectType RETURN : MSG : 해당 메세지 출력 ----------------------------------------------------*/ function favoriteConfrim(objectType) { var objectStr = ""; if(objectType==1) { objectStr ="사진이"; }else if(objectType==8) { objectStr ="동영상이"; }else if(objectType==9) { objectStr ="create"; }else if(objectType==2) { objectStr ="갤러리가"; }else if(objectType==3) { objectStr ="공모전이"; }else if(objectType==4) { objectStr ="스킬&테크닉이"; }else if(objectType==5) { objectStr ="포럼이"; }else if(objectType==6) { objectStr ="게시글이"; }else if(objectType==7) { objectStr ="제품이"; } var confirmMessage = ""+objectStr+" 즐겨찾기에 추가되었습니다."; confirmMessage += "
"; confirmMessage += "아래의 경로에서 즐겨찾기를 확인하실 수 있습니다. "; confirmMessage += "
"; confirmMessage += "나의 갤러리>나의 활동내역>나의 즐겨찾기"; confirmMessage += "
"; confirmMessage += "
"; confirmMessage += "지금 나의 즐겨찾기를 방문하기를 원하십니까?"; globalCommon.alertScriptConfirm(confirmMessage, 'yes', 'javascript:goToFavorite('+objectType+');', 'javascript:nv.LBox.off();', 'cancel') } /*-------------------------------------------------- 기능 : 해당 즐겨찾기 페이지로 이동 INPUT : objectType RETURN : MSG : 해당 메세지 출력 ----------------------------------------------------*/ function goToFavorite(objectType) { document.location.href = "/common/myprofile/member/favorite.do?favoriteType="+objectType; } /*-------------------------------------------------- 기능 : 즐겨찾기 add 이후 메세지 출력 INPUT : favoriteComplete(data) RETURN : MSG : 해당 메세지 출력 ----------------------------------------------------*/ function favoriteComplete(data,blogId, objectType, objectId) { if(data == "SessionUserFalse") { globalCommon.alertMsg('로그인이 필요합니다.'); } else if(data == "exist") { favoriteConfrim(objectType); } else if(data == "typeUserAssociate" ){ } else if(data =="error"){ globalCommon.alertMsg('즐겨찾기에 오류가 발생했습니다.'); } else if(data == "success"){ favoriteConfrim(objectType); MiniprofileDWR.getMyFavoriteCnt(objectId, objectType, favoriteCntUpdate); } } function favoriteCntUpdate(cnt) { var favoriteCnt = nv.$('favoriteCnt'); favoriteCnt.innerHTML = "["+cnt+"]" ; } /*-------------------------------------------------- 기능 : 즐겨찾기를 삭제한다 INPUT : objectUserId, objectType, objectId RETURN : favoriteDelComplete MSG : ----------------------------------------------------*/ function favoriteDel(objectUserId, objectType, objectId) { MiniprofileDWR.favoriteDelete(objectUserId, objectType, objectId,favoriteDelComplete); } /*-------------------------------------------------- 기능 : 즐겨찾기 삭제후 메세지 출력 INPUT : favoriteDelComplete(data) RETURN : 해당 메세지 MSG : 해당 메세지 출력 ----------------------------------------------------*/ function favoriteDelComplete(data){ if(data == "SessionUserFalse") { globalCommon.alertMsg('로그인이 필요합니다.'); } else if(data == "ZeroRowCount") { globalCommon.alertMsg('이 포스트는 존재하지 않습니다.'); } else if(data == "DeleteSuccess") { globalCommon.alertNotice('\'즐겨찾기\'을 입력해주세요..'); } } /*-------------------------------------------------- 기능 : myGalleryAdd 하기 INPUT : blogid, objectType RETURN : MSG : NONE ----------------------------------------------------*/ function myGalleryAdd(blogId, objectType) { //MiniprofileDWR.myGalleryAdd(blogId, objectType, myGalleryAddComplete); MiniprofileDWR.myGalleryAdd(blogId, objectType, { callback:function(resultValue) { myGalleryAddComplete(resultValue,blogId, objectType); } } ); } /*-------------------------------------------------- 기능 : myGallery 추가 후 건수증가 INPUT : data RETURN : MSG : NONE ----------------------------------------------------*/ function myGalleryAddComplete(data,blogId, objectType) { if(data == "SessionUserFalse") { globalCommon.alertMsg('로그인이 필요합니다.'); } else if(data == "exist") { favoriteConfrim(objectType); } else { favoriteConfrim(objectType); var favoriteCnt = nv.$('favoriteCnt'); favoriteCnt.innerHTML = "["+data+"]" ; } } /*-------------------------------------------------- 기능 : 즐겨찾기 호출 INPUT : 해당 gallery에 해당하는 user id ,해당 게시물에 맞는 object Id (photo 인지 video인지) ,current 페이지 수정 하지마세요. ,한페이지당 출력할 건수 RETURN : MSG : NONE ----------------------------------------------------*/ function favoriteInformation(blogId, objectType) { var currentPage = 1; var totalPage = 16; //if(objectType == 4 || objectType == 5 || objectType == 6) { // totalPage = 12; //} MiniprofileDWR.getMyFavoriteList(blogId,objectType,currentPage,totalPage, { callback:function(resultValue) { if(resultValue==null) { MiniprofileDWR.getMyFavoriteProfile(blogId,objectType, { callback:function(result) { myFavoriteProfile(result,blogId,objectType); } } ); return; } else { favoritereturnList(resultValue,blogId,objectType); } } } ); } /*-------------------------------------------------- 기능 : myProfile만 화면 출력한다. List 제외 INPUT : RETURN : MSG : NONE ----------------------------------------------------*/ function myFavoriteProfile(bean,blogId,objectType){ var html = ""; // Skill , Forum 화면 /* if(objectType == 4 || objectType == 5 || objectType == 6) { html +="
"; html +="
"; html +=" \"close\""; html +="
"; html +="
"; html +=" \"Faborite\""; if(objectType == 4 || objectType == 5) { html +="
"; html +=" "; html +="
"; } html +="
"; html +="
"+bean.tiTle+"
"; html +="
"+bean.descRiption+"
"; html +="
"; html +="
"; html +="
"; html +="
"; html +="
"; html +="
"; html +="
"; html +="
"; html +="
"; var favoriteLayer = nv.$('layerMyfavorite'); var favoriteShowDiv = nv.$("myfavorite"); if(favoriteShowDiv) { favoriteLayer.removeChild(favoriteShowDiv); } favoriteShowDiv = document.createElement('div'); favoriteShowDiv.id = 'myfavorite'; favoriteShowDiv.className = 'rbox_pks'; favoriteShowDiv.width = '730px'; favoriteShowDiv.style.display = 'block'; favoriteShowDiv.innerHTML = html; favoriteLayer.appendChild(favoriteShowDiv); } else { */ html += "
"; html += "
"; html += " \"FAVORITE\""; html += " "; html += " "; //html += " \"\"/ "; html += " "; html += " "; //html += " \"\"/ "; html += " "; html += " "; html += " "; html += " \"\"/ "; html += " "; html += "
"; html += "
"; html += "
"; if(objectType == 4 || objectType == 5) { html += "
"; html += " "; html += "
"; } html += "

"; html += " "+bean.tiTle+" "; html += " "; html += "

"; html += "

"+bean.descRiption+" "; html += "

"; html += " "; html += "
"; html += "
"; html += "
    "; html += "
"; html += "
"; html += "
"; html += "
"; var favoriteLayer = nv.$('layerMyfavorite'); var favoriteShowDiv = nv.$("myfavorite"); if(favoriteShowDiv) { favoriteLayer.removeChild(favoriteShowDiv); } favoriteShowDiv = document.createElement('div'); favoriteShowDiv.id = 'myfavorite'; favoriteShowDiv.className = 'invitefriend'; favoriteShowDiv.style.display = 'block'; favoriteShowDiv.innerHTML = html; favoriteLayer.appendChild(favoriteShowDiv); // } } /*-------------------------------------------------- 기능 : 조회 조건 검색 INPUT : 검색 값 RETURN : MSG : NONE ----------------------------------------------------*/ function favoritereturnCnt(cnt) { var favoriteCnt = nv.$('favoriteCnt'); favoriteCnt.value = cnt; } /*-------------------------------------------------- 기능 : 이전 페이지 INPUT : currentPage value RETURN : MSG : NONE ----------------------------------------------------*/ function prev(currPage,totalPage,blogId,objectType) { if(currPage==1) { return; } else { var prev = 0; prev = currPage -1; //if(objectType == 4 || objectType == 5 || objectType == 6) { // MiniprofileDWR.getMyFavoriteList(blogId,objectType ,prev ,12,favoritereturnList); //} else { MiniprofileDWR.getMyFavoriteList(blogId,objectType ,prev ,16,favoritereturnList); //} } } /*-------------------------------------------------- 기능 : 다음 페이지 INPUT : currentPage value RETURN : MSG : NONE ----------------------------------------------------*/ function next(currPage,totalPage,blogId,objectType) { if(totalPage == currPage) { return; } else { var nextPage = 0; nextPage = currPage+1; //if(objectType == 4 || objectType == 5 || objectType == 6) { // MiniprofileDWR.getMyFavoriteList(blogId,objectType ,nextPage ,12,favoritereturnList); //} else { MiniprofileDWR.getMyFavoriteList(blogId,objectType ,nextPage ,16,favoritereturnList); //} } } /*-------------------------------------------------- 기능 : 내 게시물을 즐겨찾기한 목록을 상단에 출력 INPUT : bean,blogId,objectType RETURN : 해당 목록 화면 MSG : NONE ----------------------------------------------------*/ function favoritereturnList(bean,blogId,objectType) { var currPage = bean[0].currentPage; var totalPage = bean[0].totalPage; var totalCnt = bean[0].cnt; var lengths = bean.length; var title = bean[0].tiTle; var imgSrc = bean[0].imgPath; var descRiption = bean[0].descRiption; var objectType = bean[0].objectType; var blogId = bean[0].objectUserId; var html = ""; /* if(objectType == 4 || objectType == 5 || objectType == 6) { html +="
"; html +="
"; html +=" \"close\""; html +="
"; html +="
"; html +=" \"Faborite\""; if(objectType == 4 || objectType == 5) { html +="
"; html +=" "; html +="
"; } html +="
"; html +="
"+title+"
"; // html +="
benjamin@samsung.com
"; html +="
"+descRiption+"
"; html +="
"; html +="
"; html +="
"; html +=" \"Preview\" "; html +=" \"Next\""; html +="
"; html +="
    "; for(var i=0; i"; html +="
    "+bean[i].myFavoriteRegisterDate+"
    "; html +="
    \"\"/
    "; html +=" "; html +=" "; } html +="
"; html +="
"; html +="
"; html +="
"; html +="
"; html +="
"; var favoriteLayer = nv.$('layerMyfavorite'); var favoriteShowDiv = nv.$("myfavorite"); if(favoriteShowDiv) { favoriteLayer.removeChild(favoriteShowDiv); } favoriteShowDiv = document.createElement('div'); favoriteShowDiv.id = 'myfavorite'; favoriteShowDiv.className = 'rbox_pks'; favoriteShowDiv.width = '730px'; favoriteShowDiv.style.display = 'block'; favoriteShowDiv.innerHTML = html; favoriteLayer.appendChild(favoriteShowDiv); } else { */ html += "
"; html += "
"; html += " \"FAVORITE\""; html += " "; html += " "; html += " \"\"/ "; html += " "; html += " "; html += " \"\"/ "; html += " "; html += " "; html += " "; html += " \"\"/ "; html += " "; html += "
"; html += "
"; html += "
"; if(objectType == 4 || objectType == 5 || objectType == 2) { html += "
"; html += " "; html += "
"; } html += "

"; html += " "+title+" "; html += " "; html += "

"; html += "

"+descRiption+" "; html += "

"; html += " "; html += "
"; html += "
"; html += "
    "; for(var i=0; i "; html += "
    "; html += " \"\"/ "; html += "
    "; html += "
    "; html += " "+bean[i].myFavoriteProfileName+" "; html += " "; html += "
    "+bean[i].myFavoriteRegisterDate+" "; html += "
    "; html += " "; } html += "
"; html += "
"; html += "
"; html += "
"; var favoriteLayer = nv.$('layerMyfavorite'); var favoriteShowDiv = nv.$("myfavorite"); if(favoriteShowDiv) { favoriteLayer.removeChild(favoriteShowDiv); } favoriteShowDiv = document.createElement('div'); favoriteShowDiv.id = 'myfavorite'; favoriteShowDiv.className = 'invitefriend'; favoriteShowDiv.style.display = 'block'; favoriteShowDiv.innerHTML = html; favoriteLayer.appendChild(favoriteShowDiv); // } } /** * 경고문구 후 로그인 페이지로 이동한다 */ function goLoginPage(url){ globalCommon.alertScriptConfirm("로그인이 필요합니다.", "insert", "javascript:location.href='"+url+"'"); } popupCopyTheUrl = function() { var htmlStr = " "; htmlStr += "
"; htmlStr += "
"; htmlStr += "
"; htmlStr += " \"close\" "; htmlStr += " \"Copy "; htmlStr += " "; htmlStr += "
\"복사\"
"; htmlStr += "
"; htmlStr += "
"; htmlStr += "
"; htmlStr += " "; var urlLayer = nv.$('urlLayer'); var urlShowDiv = nv.$("urlShowDiv"); if(urlShowDiv) { urlLayer.removeChild(urlShowDiv); } urlShowDiv = document.createElement('div'); urlShowDiv.id = 'urlShowDiv'; urlShowDiv.className = 'urlShowDiv'; urlShowDiv.style.display = 'block'; urlShowDiv.innerHTML = html; urlLayer.appendChild(urlShowDiv); } /** * script tag 제거 */ function scriptFilter(contents){ beforeHTML = contents; replacingExpr = "]*>([\\S\\s]*?)<\/script>"; afterHTML = beforeHTML.replace(new RegExp(replacingExpr, "gi"), ""); return afterHTML; } /* * String이 모두 숫자인지 체크 * 모두 숫자이면 true 아니면 false 리턴*/ function num_check(str){ var err = 0; for(i=0;i0) return false; else return true; } /** * XSS 관련 내용을 제거한다. * * orgStr 바꾸기를 원하는 Html * return 바뀐 Html */ function xssFunction(orgStr) { orgStr = orgStr.replace(/(<[^>]*) on([A-Z]+)[\t\n\r ]*=([^>]*)>/ig, '$1 Xon$2=$3>'); orgStr = orgStr.replace(/(<[^>]*)expression([^>]*)>/ig, '$1 $2>'); orgStr = orgStr.replace(/]*>/ig, ''); orgStr = orgStr.replace(/<[\t\n\r ]*OBJECT[^>]*>/ig, ''); orgStr = orgStr.replace(/<[\t\n\r ]*FORM[^>]*>/ig, ''); orgStr = orgStr.replace(/<[\t\n\r ]*BASE[^>]*>/ig, ''); return orgStr; } function allowScriptAccess (orgStr) { orgStr = orgStr.replace(/(<[^>]*)ALLOWSCRIPTACCESS([^>]*)>/ig, '$1allowaccess$2>') return orgStr; } /** * 공통 페이지 로그인 */ globalCommon.goLoginPage = function(url) { if(nv.$('commonUserLoginForm') && nv.$('commonUserLoginForm').returnUrl) { if(!url || url == "" || url == "NaN") { url = encodeURI(document.URL); } nv.$('commonUserLoginForm').returnUrl.value = url; nv.$('commonUserLoginForm').submit(); } } function setBirthDate(objName, date) { var obj = nv.$(objName); if(obj) { MiniprofileDWR.setBirthDate(date, 'yyyy.MM.dd', { callback:function(result) { obj.value = result; } }); } } function getByteCount(val) { // 입력받은 문자열을 escape() 를 이용하여 변환한다. // 변환한 문자열 중 유니코드(한글 등)는 공통적으로 %uxxxx로 변환된다. var temp_estr = escape(val); var s_index = 0; var e_index = 0; var temp_str = ""; var cnt = 0; // 문자열 중에서 유니코드를 찾아 제거하면서 갯수를 센다. while ((e_index = temp_estr.indexOf("%u", s_index)) >= 0) // 제거할 문자열이 존재한다면 { temp_str += temp_estr.substring(s_index, e_index); s_index = e_index + 6; cnt ++; } temp_str += temp_estr.substring(s_index); temp_str = unescape(temp_str); // 원래 문자열로 바꾼다. // 유니코드는 2바이트 씩 계산하고 나머지는 1바이트씩 계산한다. return ((cnt * 2) + temp_str.length) + ""; } //특수문자를 공백으로 변경하여 리턴 function changeSpecialCharBlank(str) { for (var i=0; i < str .length; i++) { ch_char = str .charAt(i); ch = ch_char.charCodeAt(); if( (ch >= 33 && ch <= 47) || (ch >= 58 && ch <= 64) || (ch >= 91 && ch <= 96) || (ch >= 123 && ch <= 126) ) { str = str.replace(ch_char,' '); } } return str; } /** * dwr Global Error */ function dwrGlobalError(){ if(nv.LBox){ nv.LBox.off(); } globalCommon.alertMsg('죄송합니다, 귀하의 요청을 실행하는 데 문제가있습니다.'); } /** * 쿠폰 알림 팝업 */ function cuponinfoWindowOpen(){ var width = 340; var height = 300; var resizable = "no"; var scrollbars = "no"; var url = "/main/cuponPop.do"; nv.Popup.open(url, "cuponPopup", width, height, scrollbars, resizable); } /** * 포인트 알림 팝업 */ function pointPop(){ var width = 340; var height = 300; var resizable = "no"; var scrollbars = "no"; var url = "/main/pointPop.do"; nv.Popup.open(url, "pointPopup", width, height, scrollbars, resizable); } /** * 포인트몰 바로가기 */ function goPointMall(){ window.open("http://shop.samsungimaging.co.kr/shopping/index.do","shop"); self.close(); } /** * 고객지원 바로가기 * 2010 패쇄 */ var externalLinkWindow; function goExternalLinkWindows(viewName){ if(externalLinkWindow)externalLinkWindow.close(); var width = 1020; var height = 694; var scrollbars = 1; var resizable = 0; var title = "exLinkWindow"; var action = "/zoomin/memberInfoSend.do?site="+viewName; externalLinkWindow = window.open(action, title, "width=" + width + ", height=" + height + ", left=" + (screen.width/2-parseInt(width)/2) + ", top=" + (screen.height/2-parseInt(height)/2) + ", scrollbars=" + scrollbars + ", resizable=" + resizable + ", toolbar=no, directories=no, status=no, menubar=no"); } /* * DIV 내부에 존재하는 이미지 들의 사이즈를 조정한다. * * divName : 이미지가 존재하는 div명(텍스트로 전달) * maxWidth : 허용할 최대 가로크기(옵션) (-1시 무시) * maxHeight : 허용할 최대 세로 크기(옵션) (-1시 무시) * hideFlag : 이미지 리사이징 동안 본문정보를 보일것인지 여부(옵션) true입력시 감췄다가 보임 * * resize_images('dealerdetsright', 550); * resize_images('dealerdetsright', 550, 400); */ function resize_images(divName, maxWidth, maxHeight) { var isCheckWidth = (maxWidth!=undefined && maxWidth>0); var isCheckHeight = (maxHeight!=undefined && maxHeight>0); var obj = document.getElementById(divName); var imgList = obj.getElementsByTagName('img'); if(imgList) { if(!imgList.length) { var imgObj = imgList; var imgWidth = imgObj.width; var imgHeight = imgObj.height; if(isCheckWidth) { if(imgWidth > maxWidth) { var widthRatio = maxWidth/imgWidth; imgObj.width = imgWidth * widthRatio; imgObj.height = imgHeight * widthRatio; } } imgWidth = imgObj.width; imgHeight = imgObj.height; if(isCheckHeight) { if(imgHeight > maxHeight) { var heightRatio = maxHeight/imgHeight; imgObj.height = imgHeight * heightRatio; imgObj.width = imgWidth * heightRatio; } } } else { for(var i=0; i maxWidth) { var widthRatio = maxWidth/imgWidth; imgObj.width = imgWidth * widthRatio; imgObj.height = imgHeight * widthRatio; } } imgWidth = imgObj.width; imgHeight = imgObj.height; if(isCheckHeight) { if(imgHeight > maxHeight) { var heightRatio = maxHeight/imgHeight; imgObj.height = imgHeight * heightRatio; imgObj.width = imgWidth * heightRatio; } } } } } }