PageSourceSearch

https://www.koreaboardgames.com/js/product/SB-PRO-05-REVIEW.js

js koreaboardgames.com collected 2026-10-01 13:09:57 UTC 8,434 bytes, 261 lines download raw bytes

1// 리뷰관련 팝업 관련 스크립트
2var pdReview = {
3	callReviewSavePop : function(revwSeq, ordNo, dtlSeq){				// 리뷰 작성/수정 팝업 호출
4		$("#pdDetailReviewDetail").hide(); //24.05.13 추가
5		if(!cmnChkLogin()){
6			cmnModal.confirm("로그인 필요합니다. 로그인 화면으로 이동 하시겠습니까?", function(isOk){
7				if(isOk){
8					location.href ="/login/memberLogin?returnUrl="+location.pathname+location.search;
9				}
10			});
11			return false;
12		}
13		let param = {
14			prdCd : pdDetail.prdCd
15		}
16		if(revwSeq){
17			$.extend(param, {revwSeq : revwSeq});
18		}
19		if(ordNo){
20			param.ordNo = ordNo;
21		}
22		if(dtlSeq != null && dtlSeq !== ''){
23			var selectedDtlSeq = parseInt(dtlSeq, 10);
24			if(!isNaN(selectedDtlSeq)){
25				param.dtlSeq = selectedDtlSeq;
26			}
27		}
28		try {
29			var usp = new URLSearchParams(window.location.search);
30			var qOrd = usp.get('ordNo');
31			var qDtl = usp.get('dtlSeq');
32			if (!param.ordNo && qOrd) {
33				param.ordNo = qOrd;
34			}
35			if (param.dtlSeq == null && qDtl != null && qDtl !== '') {
36				var dtlNum = parseInt(qDtl, 10);
37				if (!isNaN(dtlNum)) {
38					param.dtlSeq = dtlNum;
39				}
40			}
41		} catch (e) { /* ignore */ }
42		cmAjax({
43			url: "/product/ajax/popupPdDetailReviewSave"
44			, type: "POST"
45			, data: JSON.stringify(param)
46			, dataType: "html"
47			, async: false
48			, success: function (html) {
49				$('#pdDetailRevwSavePopArea').html(html);
50				if($("#pdDetailReviewSave input[name=ordNo]").val() == '' || $("#pdDetailReviewSave input[name=dtlSeq]").val() == ''){	// 등록 / 수정 리뷰 없음
51					$('#pdDetailRevwSavePopArea').html('');
52					cmnModal.alert("상품리뷰는 제품을 구매하신 고객만 작성이 가능합니다. 제품구매후 작성해 주시기 바랍니다.");
53				}else{
54					// 별점
55					new StarRating(".reviewStarRating");
56					// 이미지 업로드
57					cmnFileUploader.init("#pdDetailReviewSave .reviewImgUpload", 50, { isReview: true });
58					// 팝업 오픈
59		 			openPopup('#pdDetailReviewSave');
60				}
61			}
62			, error: function (e) {
63				console.log(e);
64				return false;
65			}
66		});
67	}
68	, revwContsLgth : function(obj){				// 리뷰 작성/수정 길이
69		$("#revwContsLgth").text($(obj).val().length);
70	} 
71	, cancelReviewSavePop : function(){				// 리뷰 작성/수정 팝업 닫기
72		$("#pdDetailReviewSave .modal_close").trigger("click");
73	}
74	, cancelReviewViewPop : function(){				//24.05.13 리뷰 닫기 추가
75		$("#pdDetailReviewDetail .modal_close").trigger("click");
76	}
77	, saveReviewSavePop : function(){				// 리뷰 작성/수정 팝업 저장
78		let $thisPopArea = $("#pdDetailReviewSave");					
79		let imgInfoArr = new Array();
80		$thisPopArea.find('.reviewImgDiv .reviewImgUpload').each(function(i){
81			if($(this).data('filepath')){
82				let thisImgInfo = {
83					filePath : $(this).data('filepath')
84					, orgFileName : $(this).data('orgfilename')
85					, fileName : $(this).data('filename')
86					, fileSize : $(this).data('filesize')
87					, fileType : $(this).data('filetype')
88				}
89				imgInfoArr.push(thisImgInfo);
90			}
91		});
92		var dtlSeqRaw = $thisPopArea.find('input[name=dtlSeq]').val();
93		var dtlSeqNum = parseInt(dtlSeqRaw, 10);
94		var reviewPrdCd = $thisPopArea.find('input[name=prdCd]').val();
95		let param = {
96			prdCd : reviewPrdCd || pdDetail.prdCd
97			, revwSeq : $thisPopArea.find('input[name=revwSeq]').val()
98			, ordNo : $thisPopArea.find('input[name=ordNo]').val()
99			, dtlSeq : (dtlSeqRaw !== '' && !isNaN(dtlSeqNum)) ? dtlSeqNum : null
100			, revwScore : $thisPopArea.find('select[name=revwScore]').val()
101			, revwContents : $thisPopArea.find('textarea[name=revwContents]').val()
102			, reviewStarRating : $thisPopArea.find('.reviewStarRating').val()
103			, pdReviewAttachList : imgInfoArr
104		}
105		if(param.revwContents == ''){
106			cmnModal.alert("내용을 입력해 주세요.");
107			return false;
108		}
109
110		//금칙어 체크
111		if(!forbiddenWordChk($("textarea[name='revwContents']").val())) {
112			openPopup('#modalPdDetailForbiddenChk');
113			return false;
114		}
115
116
117		if(param.revwScore == ''){
118			cmnModal.alert("상품 평점을 입력해 주세요.");
119			return false;
120		}
121
122		var $slots = $thisPopArea.find('.reviewImgDiv .reviewImgUpload');
123		var totalSlots = $slots.length;
124		var attachCountWithFilepath = imgInfoArr.length;
125		if(typeof sendBehaviorLog === 'function'){
126			sendBehaviorLog('review_save_attempt', { source: 'product', totalSlots: totalSlots, attachCountWithFilepath: attachCountWithFilepath });
127		}
128
129		cmAjax({
130			url: "/product/ajax/pdDetailReviewSave"
131			, type: "POST"
132			, data: JSON.stringify(param)
133			, dataType: "json"
134			, async: false
135			, success: function (result) {
136				if(result && result.status && result.status !== "SUCC"){
137					cmnModal.alert(result.message || "리뷰 저장에 실패했습니다.");
138					return;
139				}
140				if(param.revwSeq){
141					cmnModal.alert("수정 되었습니다.");
142				}else{
143					cmnModal.alert("저장 되었습니다.");
144					sendDfinery2Event("review_complete", {product_id: param.prdCd, product_name: pdDetail.prdNm || 'Unknown Product'});
145				}
146				$("#pdDetailReviewSave .modal_close").trigger("click");
147				if(typeof pdDetail.callReview == 'function' && pdDetail.revwPage){	// 상품 상세의 경우 리뷰리스트 재호출
148					pdDetail.callReview(pdDetail.revwPage);
149				}
150
151				// 디파이너리 유저정보 업데이트
152				setUserPropertyNew();
153			}
154			, error: function (e) {
155				console.log(e);
156				if(typeof sendBehaviorLog === 'function'){
157					sendBehaviorLog('review_save_error', { source: 'product', attachCountWithFilepath: imgInfoArr.length, status: e && e.status });
158				}
159				return false;
160			}
161		});
162	}
163	, callReviewDetailPop : function(revwSeq){		// 리뷰 상세 팝업 호출
164		let param ={
165			revwSeq : revwSeq
166		}
167		cmAjax({
168			url: "/product/ajax/popupPdDetailReviewDetail"
169			, type: "POST"
170			, data: JSON.stringify(param)
171			, dataType: "html"
172			, async: false
173			, success: function (html) {
174				$('#pdDetailRevwDetailPopArea').html(html);
175				reviewThumbSwiper();
176				// 팝업 오픈							
177	 			openPopup('#pdDetailReviewDetail');
178			}
179			, error: function (e) {
180				console.log(e);
181				return false;
182			}
183		});
184	}
185	, cancelReviewDetailPop : function(){			// 리뷰 상세 팝업 닫기
186		$("#pdDetailReviewDetail .modal_close").trigger("click");
187	}
188	, callReviewReport : function(revwSeq){			// 리뷰 신고 팝업 호출
189		if(!cmnChkLogin()){
190			cmnModal.confirm("로그인 필요합니다. 로그인 화면으로 이동 하시겠습니까?", function(isOk){
191				if(isOk){
192					location.href ="/login/memberLogin?returnUrl="+location.pathname+location.search;
193				}
194			});
195			return false;
196		}
197		let param = {
198			revwSeq : revwSeq
199		}
200		cmAjax({
201			url: "/product/ajax/popupPdDetailReviewReport"
202			, type: "POST"
203			, data: JSON.stringify(param)
204			, dataType: "html"
205			, async: false
206			, success: function (html) {
207				$('#pdDetailRevwReportPopArea').html(html);
208				// 팝업 오픈
209	 			openPopup('#pdDetailReviewReport');
210			}
211			, error: function (e) {
212				console.log(e);
213				return false;
214			}
215		});
216	}
217	, revwRptContsLgth : function(obj){				// 리뷰 신고 내용 길이 확인
218		$("#revwRptContsLgth").text($(obj).val().length);
219	}
220	, cancelReviewReport : function(){				// 리뷰 신고 팝업 취소
221		$("#pdDetailReviewReport .modal_close").trigger("click");
222	}
223	, saveReviewReport : function(revwSeq){			// 리뷰 신고 팝업 등록
224		if(!cmnChkLogin()){
225			cmnModal.confirm("로그인 필요합니다. 로그인 화면으로 이동 하시겠습니까?", function(isOk){
226				if(isOk){
227					location.href ="/login/memberLogin?returnUrl="+location.pathname+location.search;
228				}
229			});
230			return false;
231		}
232		
233		let rtpReason = $("#pdRevwRptTxt").val();
234		if(rtpReason.trim().length == 0){
235			cmnModal.alert("신고 내용을 입력하여 주세요.");
236			return false;
237		}
238		let param = {
239			revwSeq : revwSeq
240			, prdCd : pdDetail.prdCd
241			, rtpType : $("#pdDetailReviewReport input[name='rptType']:checked").val()
242			, rtpReason : $("#pdRevwRptTxt").val()
243		}		
244		cmAjax({
245			url: "/product/ajax/pdDetailReviewReportSave"
246			, type: "POST"
247			, data: JSON.stringify(param)
248			, dataType: "json"
249			, async: false
250			, success: function (result) {
251				cmnModal.alert("신고 되었습니다.");
252				$("#pdDetailReviewReport .modal_close").trigger("click");
253				$(".revwseqLi"+revwSeq).remove();
254			}
255			, error: function (e) {
256				console.log(e);
257				return false;
258			}
259		});
260	}
261}

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.