|
|
|
@ -4,6 +4,17 @@
|
|
|
|
|
<script src="${URL_STATIC_ROOT}/m/js/swiper.min.js"></script>
|
|
|
|
|
<script src="${URL_STATIC_ROOT}/m/js/jquery_popupoverlay.js"></script>
|
|
|
|
|
<script src="${URL_STATIC_ROOT}/m/js/design.js"></script>
|
|
|
|
|
<style>
|
|
|
|
|
#copy {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 1px;
|
|
|
|
|
height: 1px;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
border: 0;
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<!-- wrap -->
|
|
|
|
@ -22,6 +33,7 @@
|
|
|
|
|
<input type="hidden" id="bd_tp" name="bd_tp" value="${model['bd_tp']!}" />
|
|
|
|
|
<input type="hidden" id="pick_img_index" name="pick_img_index" value=""/>
|
|
|
|
|
<input type="hidden" id="list_tag" name="list_tag" value=""/>
|
|
|
|
|
<input type="text" id="copy" name="copy" value=""/>
|
|
|
|
|
|
|
|
|
|
<!-- content -->
|
|
|
|
|
<div class="community_view01">
|
|
|
|
@ -73,11 +85,15 @@
|
|
|
|
|
<div class="profile_cont">
|
|
|
|
|
<!-- 프로필 사진 -->
|
|
|
|
|
<div class="profile_img">
|
|
|
|
|
<img src="${URL_STATIC_ROOT}/m/img/community/community_writer_img.png" alt="프로필 사진">
|
|
|
|
|
<#if model['rm']['profile_path']?if_exists>
|
|
|
|
|
<img src="${URL_ROOT}/file/get_img.do?mt_file_seq=${model['rm']['profile_path']!}" alt="프로필 사진">
|
|
|
|
|
<#else>
|
|
|
|
|
<img src="${URL_ROOT}/m/img/community/person-fill.svg" alt="프로필 사진">
|
|
|
|
|
</#if>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile_info">
|
|
|
|
|
<!-- 닉네임 -->
|
|
|
|
|
<p>${model ['rm']['name']!}</p>
|
|
|
|
|
<p>${model ['rm']['nickname']!}</p>
|
|
|
|
|
<!-- 작성시각 . 조회수 -->
|
|
|
|
|
<p>${model ['rm']['reg_tm']!} · 조회 ${model ['rm']['h_nt']!}</p>
|
|
|
|
|
</div>
|
|
|
|
@ -148,7 +164,8 @@
|
|
|
|
|
<!-- 댓글 -->
|
|
|
|
|
<div class="comment_header">
|
|
|
|
|
<p>댓글</p>
|
|
|
|
|
<button type="button" id="" name="" class="refresh">
|
|
|
|
|
<button type="button" class="btn_reply" data-ct_no="">댓글쓰기</button>
|
|
|
|
|
<button type="button" id="" name="" class="refresh" onclick="window.location.reload();">
|
|
|
|
|
<span class="hidden">아이콘</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
@ -158,17 +175,25 @@
|
|
|
|
|
<!-- 댓글 -->
|
|
|
|
|
<#if model['lm_comment']?has_content >
|
|
|
|
|
<#list model['lm_comment'] as item>
|
|
|
|
|
<div class="comment">
|
|
|
|
|
<div class="comment" <#if item['p_ct_no']?has_content>style="padding-left:${item['lv']!}rem"</#if>" >
|
|
|
|
|
<!-- profile & option box -->
|
|
|
|
|
<div class="comment_profile">
|
|
|
|
|
<!-- profile -->
|
|
|
|
|
<div class="profile_cont">
|
|
|
|
|
<div class="profile_img">
|
|
|
|
|
<img src="${URL_ROOT}/m/img/community/community_writer_img.png" alt="프로필 사진">
|
|
|
|
|
<#if item['profile_path']?if_exists>
|
|
|
|
|
<img src="${URL_ROOT}/file/get_img.do?mt_file_seq=${item['profile_path']!}" alt="프로필 사진">
|
|
|
|
|
<#else>
|
|
|
|
|
<img src="${URL_ROOT}/m/img/community/person-fill.svg" alt="프로필 사진">
|
|
|
|
|
</#if>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile_info">
|
|
|
|
|
<p>${item['name']!}</p>
|
|
|
|
|
<p>${item['nickname']!}</p>
|
|
|
|
|
<div>
|
|
|
|
|
<p>${item['reg_tm']!}</p>
|
|
|
|
|
<p> · </p>
|
|
|
|
|
<button type="button" class="btn_reply" data-ct_no="${item['ct_no']!}">답글쓰기</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<#if item['member_id']! == model ['rm']['member_id']!>
|
|
|
|
@ -194,11 +219,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="comment_input_cont">
|
|
|
|
|
|
|
|
|
|
<div class="reply_cont">
|
|
|
|
|
<div class="reply_to">
|
|
|
|
|
닉네임 님에게 답글쓰는 중
|
|
|
|
|
</div>
|
|
|
|
|
<button class="reply_del">
|
|
|
|
|
<img src="${URL_ROOT}/m/img/close_ico.png" alt="취소 버튼">
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input">
|
|
|
|
|
<!--
|
|
|
|
|
<label class="file_icon" for="image-upload"></label>
|
|
|
|
|
<input type="file" accept="image/*;capture=camera" id="image-upload" style="display:none;">
|
|
|
|
|
-->
|
|
|
|
|
<textarea placeholder="댓글 남기기" id="reply" name="reply" ></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="submit">
|
|
|
|
@ -221,7 +252,6 @@
|
|
|
|
|
<div class="content">
|
|
|
|
|
<!-- 옵션 모달 -->
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
<a id="edit_board">
|
|
|
|
|
<div class="edit_icon"></div>
|
|
|
|
@ -245,6 +275,12 @@
|
|
|
|
|
<div class="content">
|
|
|
|
|
<!-- 옵션 모달 -->
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
<a id="edit_copy">
|
|
|
|
|
<div class="copy_icon"></div>
|
|
|
|
|
복사하기
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a id="edit_reply">
|
|
|
|
|
<div class="edit_icon reply"></div>
|
|
|
|
@ -297,6 +333,7 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
var $ct_no ;
|
|
|
|
|
var $reply_new_yn = "Y" ;
|
|
|
|
|
function fncRemove(e) {
|
|
|
|
|
$(e).parent().remove();
|
|
|
|
|
}
|
|
|
|
@ -355,6 +392,7 @@
|
|
|
|
|
var data = {
|
|
|
|
|
bd_no : ${model ['rm']['bd_no']!}
|
|
|
|
|
,ct_no : $ct_no
|
|
|
|
|
,reply_new : $reply_new_yn
|
|
|
|
|
,comment : $("#reply").val()
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
@ -366,45 +404,8 @@
|
|
|
|
|
Swal.fire({text:"등록되지 않았습니다"})
|
|
|
|
|
},
|
|
|
|
|
success:function(result){
|
|
|
|
|
if($ct_no == null) {
|
|
|
|
|
var tag ="<div class=\"comment\">";
|
|
|
|
|
tag +=" <div class=\"comment_profile\">";
|
|
|
|
|
tag +=" <!-- profile -->";
|
|
|
|
|
tag +=" <div class=\"profile_cont\">";
|
|
|
|
|
tag +=" <div class=\"profile_img\">";
|
|
|
|
|
tag +=" <img src=\"${URL_ROOT}/m/img/community/community_writer_img.png\" alt=\"프로필 사진\">";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <div class=\"profile_info\">";
|
|
|
|
|
tag +=" <p>"+result.reply.replyer+"</p>";
|
|
|
|
|
tag +=" <p>"+result.reply.reg_tm+"</p>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <!-- option -->";
|
|
|
|
|
tag +=" <div class=\"option2_btn\" data-ctno ="+result.reply.ct_no+">";
|
|
|
|
|
tag +=" <div href=\"#\" class=\"option\"></div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <div class=\"comment_text\" data-ctno="+result.reply.ct_no+">";
|
|
|
|
|
tag += result.reply.comment;
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +="</div>";
|
|
|
|
|
$(".community_comment").prepend(tag);
|
|
|
|
|
} else {
|
|
|
|
|
$(".comment_text").each( function(idx,ele) {
|
|
|
|
|
if(ele.dataset.ctno == $ct_no) {
|
|
|
|
|
ele.innerText = $("#reply").val() ;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$ct_no = null;
|
|
|
|
|
$("#reply").val('');
|
|
|
|
|
Swal.fire({text:"처리 되었습니다"}) ;
|
|
|
|
|
|
|
|
|
|
$(".option2_btn").on("click", function() {
|
|
|
|
|
$("#option2").toggleClass("open");
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// location.href = '${URL_ROOT}/m/bf_board/view_bf_detail_board.do?bd_no=${model ['rm']['bd_no']!}';
|
|
|
|
|
window.location.reload();
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -436,58 +437,6 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*********사진 추가*********/
|
|
|
|
|
$(function() {
|
|
|
|
|
// File Upload + Preview
|
|
|
|
|
$(document).on('click', '.input_file_upload .btn_upfile', function(){
|
|
|
|
|
$(this).siblings('.upfile').trigger('click');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '.input_file_upload .ibtn_x', function(){
|
|
|
|
|
$(this).parent().parent().remove();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).on('change', ".input_file_upload input[type=file]", function(){
|
|
|
|
|
var file = $(this)[0].files[0];
|
|
|
|
|
//console.log(file.name + "\n" + file.type + "\n" + file.size + "\n" + file.lastModifiedDate); // upfile var
|
|
|
|
|
if ($(this).hasClass('file_mypage')) {
|
|
|
|
|
$(this).talkImage(file, '.add_thumb');
|
|
|
|
|
}else{
|
|
|
|
|
$(this).displayImage(file, '.add_thumb');
|
|
|
|
|
} $(this).siblings('.add_thumb').removeClass('off').siblings('.ibtn_x').removeClass('off');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.fn.extend({
|
|
|
|
|
// Upload preview Function
|
|
|
|
|
displayImage : function(file, classname) {
|
|
|
|
|
if (typeof FileReader !== "undefined") {
|
|
|
|
|
// var container = document.getElementsByClassName(classname),
|
|
|
|
|
// img = document.createElement("img"),
|
|
|
|
|
// reader;
|
|
|
|
|
|
|
|
|
|
$(this).siblings(classname).find('img').remove();
|
|
|
|
|
|
|
|
|
|
var container = $(this).siblings(classname),
|
|
|
|
|
img = document.createElement("img"),
|
|
|
|
|
reader;
|
|
|
|
|
img.setAttribute('width', '100%'),
|
|
|
|
|
img.setAttribute('height', '100%'),
|
|
|
|
|
|
|
|
|
|
container.append(img);
|
|
|
|
|
reader = new FileReader();
|
|
|
|
|
reader.onload = (function (theImg) {
|
|
|
|
|
return function (evt) {
|
|
|
|
|
theImg.src = evt.target.result;
|
|
|
|
|
};
|
|
|
|
|
}(img));
|
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 셀렉트박스 보이게 하기 */
|
|
|
|
|
$("body").on("click", ".selectbox", function() {
|
|
|
|
|
$(this).siblings();
|
|
|
|
@ -539,7 +488,55 @@
|
|
|
|
|
</#if>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********사진 추가*********/
|
|
|
|
|
$(function() {
|
|
|
|
|
// File Upload + Preview
|
|
|
|
|
$(document).on('click', '.input_file_upload .btn_upfile', function(){
|
|
|
|
|
$(this).siblings('.upfile').trigger('click');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '.input_file_upload .ibtn_x', function(){
|
|
|
|
|
$(this).parent().parent().remove();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).on('change', ".input_file_upload input[type=file]", function(){
|
|
|
|
|
var file = $(this)[0].files[0];
|
|
|
|
|
//console.log(file.name + "\n" + file.type + "\n" + file.size + "\n" + file.lastModifiedDate); // upfile var
|
|
|
|
|
if ($(this).hasClass('file_mypage')) {
|
|
|
|
|
$(this).talkImage(file, '.add_thumb');
|
|
|
|
|
}else{
|
|
|
|
|
$(this).displayImage(file, '.add_thumb');
|
|
|
|
|
} $(this).siblings('.add_thumb').removeClass('off').siblings('.ibtn_x').removeClass('off');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.fn.extend({
|
|
|
|
|
// Upload preview Function
|
|
|
|
|
displayImage : function(file, classname) {
|
|
|
|
|
if (typeof FileReader !== "undefined") {
|
|
|
|
|
// var container = document.getElementsByClassName(classname),
|
|
|
|
|
// img = document.createElement("img"),
|
|
|
|
|
// reader;
|
|
|
|
|
|
|
|
|
|
$(this).siblings(classname).find('img').remove();
|
|
|
|
|
|
|
|
|
|
var container = $(this).siblings(classname),
|
|
|
|
|
img = document.createElement("img"),
|
|
|
|
|
reader;
|
|
|
|
|
img.setAttribute('width', '100%'),
|
|
|
|
|
img.setAttribute('height', '100%'),
|
|
|
|
|
|
|
|
|
|
container.append(img);
|
|
|
|
|
reader = new FileReader();
|
|
|
|
|
reader.onload = (function (theImg) {
|
|
|
|
|
return function (evt) {
|
|
|
|
|
theImg.src = evt.target.result;
|
|
|
|
|
};
|
|
|
|
|
}(img));
|
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
$(".community_header ul li a").on("click", function() {
|
|
|
|
|
$(this).addClass("active")
|
|
|
|
|
.parents(".community_header ul li").siblings().find("a").removeClass("active")
|
|
|
|
@ -568,6 +565,7 @@
|
|
|
|
|
});
|
|
|
|
|
$(".option2_btn").on("click", function() {
|
|
|
|
|
$ct_no = this.dataset.ctno;
|
|
|
|
|
$reply_new_yn ="N";
|
|
|
|
|
$("#option2").toggleClass("open");
|
|
|
|
|
})
|
|
|
|
|
$(".shared_btn").on("click", function() {
|
|
|
|
@ -594,9 +592,26 @@
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#edit_copy").on("click", function(e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var target = $("#copy");
|
|
|
|
|
$(".comment_text").each( function(idx,ele) {
|
|
|
|
|
if(ele.dataset.ctno == $ct_no) {
|
|
|
|
|
target.val(ele.innerText);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
var urlbox = document.getElementById( 'copy' );
|
|
|
|
|
urlbox.select();
|
|
|
|
|
document.execCommand('copy');
|
|
|
|
|
alert( '댓글 이 복사 되었습니다.' );
|
|
|
|
|
|
|
|
|
|
$("#option2").removeClass("open");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#edit_reply").on("click", function() {
|
|
|
|
|
$("#option2").removeClass("open");
|
|
|
|
|
debugger;
|
|
|
|
|
$(".comment_input_cont").show();
|
|
|
|
|
$(".comment_text").each( function(idx,ele) {
|
|
|
|
|
if(ele.dataset.ctno == $ct_no) {
|
|
|
|
|
$("#reply").val(ele.innerText);
|
|
|
|
@ -641,10 +656,24 @@
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".btn_reply").on("click", function() {
|
|
|
|
|
$(".comment_input_cont").show();
|
|
|
|
|
var nickName = this.parentNode.parentNode.childNodes[1].textContent;
|
|
|
|
|
$(".reply_to").text(nickName+'에게 답글을 쓰는중...');
|
|
|
|
|
$(".reply_cont").addClass("active");
|
|
|
|
|
$reply_new_yn ="Y";
|
|
|
|
|
$ct_no = this.dataset.ct_no;
|
|
|
|
|
});
|
|
|
|
|
$(".reply_del").on("click", function() {
|
|
|
|
|
$(".reply_cont").removeClass("active");
|
|
|
|
|
$(".comment_input_cont").hide();
|
|
|
|
|
$ct_no = "";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.submit').on('click', function () {
|
|
|
|
|
insert_reply();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".comment_input_cont").hide();
|
|
|
|
|
<#if model['bd_tp']! =='BF_CT_TP_3'>
|
|
|
|
|
$(".community_write_review").show();
|
|
|
|
|
<#else>
|
|
|
|
|