From 605e68a090fb134a5390172b6d59e0744b01948c Mon Sep 17 00:00:00 2001 From: JSYOO Date: Tue, 9 Nov 2021 10:17:49 +0900 Subject: [PATCH] =?UTF-8?q?js=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/js/nlib.js | 56 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/js/nlib.js b/src/main/webapp/js/nlib.js index 341bc6e6..af58b39d 100644 --- a/src/main/webapp/js/nlib.js +++ b/src/main/webapp/js/nlib.js @@ -166,7 +166,6 @@ function fn_layerPopFormSubmit(formName, display) { url: url, data: dataList }).done(function(response){ - alert("response:" + response); $("#NLIB_LAYER_POPUP").empty().append(response); }); } @@ -214,7 +213,7 @@ function risShow(risId){ html+='
'; html+='
'; html+='
'; - html+='

서지정보 내ㅋㅌㅊ보내기(Export)

'; + html+='

서지정보 내보내기(Export)

'; html+='
'; html+='
'; html+='
'; @@ -254,6 +253,12 @@ function risClose(){ $("#export-data").remove(); } +function forgetPassword(form) +{ + $("#"+form).attr("action", "/member/initPasswordForm.do"); + fn_layerPopFormSubmit(form,true); +} + function risDownload(risId){ $("#risId").val(risId); @@ -261,6 +266,53 @@ function risDownload(risId){ document.risDownloadForm.submit(); } + +function fn_changeInterest(masterId,onOff){ + var html=""; + + if(onOff == "on") + { + $.ajax({ + type: "POST", + url: "/interest/insertInterest.ajax", + async: false, + data: {"masterId" : masterId} + }).done(function(result){ + alert(result); + if(result == "관심자료에 추가되었습니다.") + { + $("#favorites_"+masterId).removeAttr("onclick"); + $("#favorites_"+masterId).attr("onclick","fn_changeInterest('" + masterId + "','off')"); + $("#favorites_"+masterId).attr("title","관심자료에서 삭제합니다."); + html += "\"즐겨찾기" + html += "\"즐겨찾기"; + $("#favorites_"+masterId).html(html); + } + }); + } + if(onOff == "off") + { + var masterIdArray = []; + masterIdArray.push(masterId); + $.ajax({ + url : "/interest/deleteInterests.ajax", + type : "POST", + async: false, + data : {"masterIdList" : masterIdArray}, + success : function(){ + alert("선택하신 관심자료가 삭제되었습니다."); + $("#favorites_"+masterId).removeAttr("onclick"); + $("#favorites_"+masterId).attr("onclick","fn_changeInterest('" + masterId + "','on')"); + $("#favorites_"+masterId).attr("title","관심자료로 등록합니다."); + html += "\"즐겨찾기" + html += "\"즐겨찾기"; + $("#favorites_"+masterId).html(html); + },error : function(){ + } + }); + } + +} function insertInterest(masterId){ $.ajax({ type: "post",