|
|
@@ -126,14 +126,16 @@
|
|
|
<div class="cmt_thumb">
|
|
|
<div class="form_field">
|
|
|
<div class="imgUpload">
|
|
|
- <label for="fileAdd" class="fileAdd" onclick="fnFileAdd()">업로드</label>
|
|
|
- <input type="file" id="fileAdd" name="files[]" />
|
|
|
- <input type="hidden" id="orgFileNm" name="orgFileNm">
|
|
|
- <input type="hidden" id="sysFileNm" name="sysFileNm">
|
|
|
+ <label for="fileAdd" class="fileAdd">업로드</label>
|
|
|
+ <input type="file" id="fileAdd" name="files" />
|
|
|
+ <th:block th:each="num: ${#numbers.sequence(1,10)}">
|
|
|
+ <input type="hidden" th:id="${'orgFileNm' + num}" name="orgFileNm" >
|
|
|
+ <input type="hidden" th:id="${'sysFileNm' + num}" name="sysFileNm">
|
|
|
+ </th:block>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <button type="submit" class="btn btn_dark"><span>등록</span></button>
|
|
|
+ <button type="button" class="btn btn_dark" onclick="fnReplySave()"><span>등록</span></button>
|
|
|
</form>
|
|
|
</div>
|
|
|
<div class="cmt_group" id="replyList">
|
|
|
@@ -244,6 +246,11 @@
|
|
|
<form id="pollListForm" name="pollListForm" th:action="@{'/planning/event/poll/form'}" th:method="post">
|
|
|
<input type="hidden" name="planSq" th:value="${planInfo.planSq}"/>
|
|
|
</form>
|
|
|
+<form id="searchForm" name="searchForm" th:action="@{/planning/reply/list}" th:method="post">
|
|
|
+ <input type="hidden" name="pageNo" value="1" />
|
|
|
+ <input type="hidden" name="planSq" th:value="${planInfo.planSq}" />
|
|
|
+ <input type="hidden" name="pageSize" value="10" />
|
|
|
+</form>
|
|
|
|
|
|
<!-- 댓글 이미지 팝업 -->
|
|
|
<div class="modal fade thumb_img_pop" id="thumbImgPop" tabindex="-1" role="dialog" aria-labelledby="thumbImgLabel" aria-hidden="true">
|
|
|
@@ -268,7 +275,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- //댓글 이미지 팝업 -->
|
|
|
-
|
|
|
+<script src="/ux/plugins/gaga/gaga.paging.js"></script>
|
|
|
<script th:inline="javascript">
|
|
|
|
|
|
let review = [[${reviewInfo}]];
|
|
|
@@ -743,67 +750,69 @@ var fnTextConfirm = function() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 파일 업로드 확인
|
|
|
-var fnFileAdd = function() {
|
|
|
- //로그인 확인
|
|
|
- if (!cfCheckLogin()) {
|
|
|
- mcxDialog.alert("로그인 후 참여 가능합니다.");
|
|
|
- $("#replyText").val('');
|
|
|
- return false;
|
|
|
- }
|
|
|
+var ajaxReplyList = function () {
|
|
|
+ gagaPaging.init('searchForm', fnSearchCallback, 'paging', 10);
|
|
|
+ gagaPaging.load(1);
|
|
|
+ /* $.getJSON('/planning/reply/list?planSq='+plan.planSq, function(result, status) { */
|
|
|
+
|
|
|
+ /* }); */
|
|
|
}
|
|
|
|
|
|
-var ajaxReplyList = function () {
|
|
|
- $.getJSON('/planning/reply/list?planSq='+plan.planSq, function(result, status) {
|
|
|
- $("#replyList").html('');
|
|
|
- if (status == 'success') {
|
|
|
- var html = '';
|
|
|
- html += '<div class="cmt_list_tit">';
|
|
|
- html += ' <strong>댓글</strong><span class="cnt">('+result.replyList.length.addComma()+')</span>';
|
|
|
- html += '</div>';
|
|
|
- if (result.replyList.length>0) {
|
|
|
- html += '<ul class="cmt_list">';
|
|
|
- $.each(result.replyList, function (idx, item) {
|
|
|
- html += ' <li>';
|
|
|
- html += ' <div class="cmt_top">';
|
|
|
- html += ' <span class="writer">'+item.maskingCustId+'</span>';
|
|
|
- html += ' <span class="date">'+item.entryDt+'</span>';
|
|
|
- html += ' </div>';
|
|
|
- html += ' <div class="cmt_cont">';
|
|
|
- html += ' <div class="img_wrap clear">';
|
|
|
- html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img01.jpg" alt="썸네일"></span>';
|
|
|
- html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img02.jpg" alt="썸네일"></span>';
|
|
|
- html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img03.jpg" alt="썸네일"></span>';
|
|
|
- html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img04.jpg" alt="썸네일"></span>';
|
|
|
- html += ' </div>';
|
|
|
- html += ' <p>'+item.entryVal1+'</p>';
|
|
|
- if (item.entryCustNo == result.custNo) {
|
|
|
- html += ' <button class="btn btn_default btn_del"><span>삭제</span></button>';
|
|
|
- }
|
|
|
- html += ' </div>';
|
|
|
- html += ' </li>';
|
|
|
- });
|
|
|
- html += '</ul>';
|
|
|
- }else{
|
|
|
- html += '<div class="nodata" id="replyNoData"> ';
|
|
|
- html += ' <div class="txt_box"> ';
|
|
|
- html += ' <p> ';
|
|
|
- html += ' 등록된 댓글이 없습니다. ';
|
|
|
- html += ' </p> ';
|
|
|
- html += ' </div> ';
|
|
|
- html += '</div> ';
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- $("#replyList").append(html);
|
|
|
- });
|
|
|
+var fnSearchCallback = function (result) {
|
|
|
+ $("#replyList").html('');
|
|
|
+ if (result!=null) {
|
|
|
+ var html = '';
|
|
|
+ html += '<div class="cmt_list_tit">';
|
|
|
+ html += ' <strong>댓글</strong><span class="cnt">('+result.replyList.length.addComma()+')</span>';
|
|
|
+ html += '</div>';
|
|
|
+ if (result.replyList.length>0) {
|
|
|
+ html += '<ul class="cmt_list">';
|
|
|
+ $.each(result.replyList, function (idx, item) {
|
|
|
+ html += ' <li>';
|
|
|
+ html += ' <div class="cmt_top">';
|
|
|
+ html += ' <span class="writer">'+item.maskingCustId+'</span>';
|
|
|
+ html += ' <span class="date">'+item.entryDt+'</span>';
|
|
|
+ html += ' </div>';
|
|
|
+ html += ' <div class="cmt_cont">';
|
|
|
+ html += ' <div class="img_wrap clear">';
|
|
|
+ html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img01.jpg" alt="썸네일"></span>';
|
|
|
+ html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img02.jpg" alt="썸네일"></span>';
|
|
|
+ html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img03.jpg" alt="썸네일"></span>';
|
|
|
+ html += ' <span class="pics"><img class="picsThumbs" src="/images/pc/thumb/ev_list_img04.jpg" alt="썸네일"></span>';
|
|
|
+ html += ' </div>';
|
|
|
+ html += ' <p>'+item.entryVal1+'</p>';
|
|
|
+ if (item.entryCustNo == result.custNo) {
|
|
|
+ html += ' <button class="btn btn_default btn_del"><span>삭제</span></button>';
|
|
|
+ }
|
|
|
+ html += ' </div>';
|
|
|
+ html += ' </li>';
|
|
|
+ });
|
|
|
+ html += '</ul>';
|
|
|
+ }else{
|
|
|
+ html += '<div class="nodata" id="replyNoData"> ';
|
|
|
+ html += ' <div class="txt_box"> ';
|
|
|
+ html += ' <p> ';
|
|
|
+ html += ' 등록된 댓글이 없습니다. ';
|
|
|
+ html += ' </p> ';
|
|
|
+ html += ' </div> ';
|
|
|
+ html += '</div> ';
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $("#replyList").append(html);
|
|
|
+
|
|
|
+ // Create pagination
|
|
|
+ gagaPaging.createPagination(result.paging.pageable);
|
|
|
}
|
|
|
|
|
|
$('#fileAdd').on('change', function() { fnChooseFile(this); });
|
|
|
|
|
|
-var fnChooseFile = function(obj) {
|
|
|
+var fnChooseFile = function(obj,fileNo) {
|
|
|
+ console.log($(".pics").length);
|
|
|
// multiple 속성이 있으면 files에는 다수의 객체가 할당됨
|
|
|
var file = obj.files[0];
|
|
|
+
|
|
|
+
|
|
|
|
|
|
if (!gagajf.isNull(file.name)) {
|
|
|
var extension = "\.(jpg|jpeg|png)$";
|
|
|
@@ -811,14 +820,16 @@ var fnChooseFile = function(obj) {
|
|
|
mcxDialog.alertC('이미지는 [jpg, jpeg, png] 파일만 가능합니다.', {
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
- $(obj).parent('.imgUpload').finId('.removes').trigger('click');
|
|
|
+ $(obj).parent('.imgUpload').find('.removes').trigger('click');
|
|
|
+ console.log('file.size1', file.size);
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (!gagajf.isNull(file.size) && Number(file.size) > 10 * 1000000) {
|
|
|
+ console.log('file.size2', file.size);
|
|
|
+ // 이거 왜 안먹히지
|
|
|
+ if (!gagajf.isNull(file.size) && Number(file.size) > (10 * 1000000)) {
|
|
|
mcxDialog.alertC('이미지는 최대 10MB 이하 파일만 가능합니다.', {
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
@@ -829,14 +840,44 @@ var fnChooseFile = function(obj) {
|
|
|
}
|
|
|
|
|
|
// 파일 업로드
|
|
|
- gagajf.ajaxFileUpload('/common/file/upload?subDir=/reply'
|
|
|
+ gagajf.ajaxFileUpload('/common/file/upload?subDir=/reply'
|
|
|
, file
|
|
|
, function(result) {
|
|
|
// 업로드한 파일명 설정
|
|
|
- $('input[name=' + obj.name + 'OrgFileNm]').val(result.oldFileName);
|
|
|
- $('input[name=' + obj.name + 'SysFileNm]').val(result.newFileName);
|
|
|
+ $('#orgFileNm' + fileNo).val(result.oldFileName);
|
|
|
+ $('#sysFileNm' + fileNo).val(result.newFileName);
|
|
|
}
|
|
|
- );
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 댓글 등록 버튼 클릭 시
|
|
|
+var fnReplySave = function() {
|
|
|
+ var content = $('#replyText').val();
|
|
|
+ if (content.length < 2){
|
|
|
+ mcxDialog.alert("최소 2자 이상 입력해주세요.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var yokList = new Array('개새끼','개색기','개색끼','개자식','개년','개걸래','개걸레','씨발','씨팔','씨부랄','씨바랄','시발','씹창','씹탱','씨방세','씨방새','씨펄','시펄','십탱','씨박','썅','쌍놈','쌍넘','싸가지','쓰벌','씁얼','상넘이','상놈의','상놈이','상놈을','좆','좃','존나게','존만한','같은년','넣을년','버릴년','부랄년','바랄년','미친년','니기미','니미씹','니미씨','니미럴','니미랄','호로','후레아들','호로새끼','후레자식','후래자식','후라들년','후라들넘','빠구리','병신');
|
|
|
+ if(yokList.indexOf(content)>=0){
|
|
|
+ mcxDialog.alert("입력 불가한 내용을 포함하고 있습니다.");
|
|
|
+ $('#replyText').val('');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ data = {content : content};
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+
|
|
|
+ mcxDialog.confirm("댓글을 등록 하시겠습니까?", {
|
|
|
+ cancelBtnText : "취소",
|
|
|
+ sureBtnText : "확인",
|
|
|
+ sureBtnClick : function() {
|
|
|
+
|
|
|
+ gagajf.ajaxJsonSubmit('/planning/reply/save', jsonData,function() {
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -954,8 +995,17 @@ $(document).ready( function() {
|
|
|
|
|
|
// 첨부파일 갯수제한
|
|
|
$('.imgUpload .fileAdd').click(function(){
|
|
|
+ if (!cfCheckLogin()) {
|
|
|
+ mcxDialog.alert("로그인 후 참여 가능합니다.");
|
|
|
+ $("#replyText").val('');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
var maxFileLength = 10; /* 최대 파일 갯수를 입력해 주세요 */
|
|
|
var imgFiles=$('.imgUpload .pics');
|
|
|
+ if (imgFiles.length == 10) {
|
|
|
+ $('#fileAdd').hide();
|
|
|
+ }
|
|
|
if (imgFiles.length >= maxFileLength) {
|
|
|
alert('이미지는 최대' + maxFileLength +'장 까지 첨부 가능합니다.');
|
|
|
$('#fileAdd').attr("disabled",true);
|