|
|
@@ -14,7 +14,7 @@
|
|
|
* 1.0 2021.2.23 bin2107 최초 작성
|
|
|
*******************************************************************************
|
|
|
-->
|
|
|
- <div class="modalPopup" data-width="1200" >
|
|
|
+ <div class="modalPopup" data-width="1400" >
|
|
|
<div class="panelStyle">
|
|
|
<div class="panelTitle">
|
|
|
<h2 id="popTitle" th:text="${contentsLoc}"></h2>
|
|
|
@@ -32,7 +32,19 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
- <form style="height:600px; width:1100px; overflow:auto; margin-left:40px; border-style: solid; border-width: 1px;" id="popSortable">
|
|
|
+ <form name="contentsTitleForm" id="contentsTitleForm" style="width:1170px; overflow:auto; display: none;">
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:90%;"/>
|
|
|
+ </colgroup>
|
|
|
+ <tr>
|
|
|
+ <th>컨텐츠 타이틀</th>
|
|
|
+ <td><input type="text" name="contentsTitle" style="width:50%;" maxlength="40" required="required" data-valid-name="컨텐츠타이틀" th:value="${contentsTitle}"></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </form>
|
|
|
+ <form style="height:600px; width:1370px; overflow:auto;" id="popSortable">
|
|
|
</form>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -41,6 +53,7 @@
|
|
|
/*<![CDATA[*/
|
|
|
var cateNo = [[${cateNo}]];
|
|
|
var contentsLoc = [[${contentsLoc}]];
|
|
|
+ var contentsTitle = [[${contentsTitle}]];
|
|
|
var contentsLocArr = gagajf.convertToArray([[${contentsLocList}]]);
|
|
|
var tdWidth = $("#sortable").find("td").width();
|
|
|
var tdDeleteWidth = parseInt(tdWidth/11, 10);
|
|
|
@@ -87,12 +100,16 @@
|
|
|
html += '<td class="aL"><button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
|
|
|
+ }
|
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
|
|
|
html += '</tr></thead><tbody>';
|
|
|
for(var j=1; j<5; j++){
|
|
|
var strTitle = eval("result["+i+"].strTitle" + j);
|
|
|
var imgPath = eval("result["+i+"].imgPath" + j);
|
|
|
var strVar = eval("result["+i+"].strVar" + j);
|
|
|
+ var subText = eval("result["+i+"].subText" + j);
|
|
|
if(strTitle!=null && strTitle!='null' && strTitle!='' ){
|
|
|
html += fnAddTitlePopRow(strTitle);
|
|
|
}
|
|
|
@@ -102,6 +119,9 @@
|
|
|
if(strVar!=null && strVar!='null' && strVar!='' ){
|
|
|
html += fnAddLinkPopRow(strVar);
|
|
|
}
|
|
|
+ if(subText!=null && subText!='null' && subText!='' ){
|
|
|
+ html += fnAddSubTextPopRow(subText);
|
|
|
+ }
|
|
|
}
|
|
|
html += '</tbody></table>';
|
|
|
}
|
|
|
@@ -144,6 +164,9 @@
|
|
|
html += '<td class="aL"><button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
|
|
|
+ }
|
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
|
|
|
html += '</tr></thead><tbody></tbody></table>';
|
|
|
$("#popSortable").prepend(html);
|
|
|
@@ -164,6 +187,14 @@
|
|
|
if(!gagajf.checkRequired("#popSortable")){
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
|
|
|
+ ||contentsLoc=='SMM010' ||contentsLoc=='SMM012'||contentsLoc=='SMM013'){
|
|
|
+ if(!gagajf.checkRequired("#contentsTitleForm")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var titleBool = true;
|
|
|
$("#popSortable").find('input[name=title]').each(function(idx, title) {
|
|
|
if ($(title).val()==''){
|
|
|
@@ -191,6 +222,10 @@
|
|
|
var strTitle2 = '';
|
|
|
var strTitle3 = '';
|
|
|
var strTitle4 = '';
|
|
|
+ var subText1 = '';
|
|
|
+ var subText2 = '';
|
|
|
+ var subText3 = '';
|
|
|
+ var subText4 = '';
|
|
|
var i = 1;
|
|
|
$(this).find('input[name=imgPath]').each(function(){
|
|
|
eval("imgPath" + i + "='"+$(this).val()+"'");
|
|
|
@@ -215,6 +250,12 @@
|
|
|
eval("strVar" + i + "='"+val+"'");
|
|
|
i++;
|
|
|
});
|
|
|
+ i = 1;
|
|
|
+ $(this).find('input[name=subText]').each(function(){
|
|
|
+ var subText = $(this).val().replace(/[\']/gi, "\\'");
|
|
|
+ eval("subText" + i + "='"+subText+"'");
|
|
|
+ i++;
|
|
|
+ });
|
|
|
|
|
|
var dispStdt = $(this).find("[name=dispStdt]").val().replace(/[^0-9]/g, '') + "" +$(this).find("[name=stTimeHour]").val().replace('시', '') + "" +$(this).find("[name=stTimeMin]").val().replace('분', '') + "00";
|
|
|
var dispEddt = $(this).find("[name=dispEddt]").val().replace(/[^0-9]/g, '') + "" +$(this).find("[name=edTimeHour]").val().replace('시', '') + "" +$(this).find("[name=edTimeMin]").val().replace('분', '') + "59";
|
|
|
@@ -238,12 +279,17 @@
|
|
|
, strTitle2 : strTitle2
|
|
|
, strTitle3 : strTitle3
|
|
|
, strTitle4 : strTitle4
|
|
|
+ , subText1 : subText1
|
|
|
+ , subText2 : subText2
|
|
|
+ , subText3 : subText3
|
|
|
+ , subText4 : subText4
|
|
|
, useYn : 'Y'
|
|
|
, dispOrd : dispOrd
|
|
|
};
|
|
|
|
|
|
dataArr.push(data);
|
|
|
});
|
|
|
+
|
|
|
if(dataArr.length==0){
|
|
|
var data = {cateNo : cateNo
|
|
|
, contentsLoc : contentsLoc
|
|
|
@@ -285,6 +331,16 @@
|
|
|
dataArr = dataArrSort;
|
|
|
}
|
|
|
|
|
|
+ if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
|
|
|
+ ||contentsLoc=='SMM010' ||contentsLoc=='SMM012'||contentsLoc=='SMM013'){
|
|
|
+ var data = {
|
|
|
+ cateNo : cateNo
|
|
|
+ , contentsLoc : contentsLoc
|
|
|
+ , contentsTitle : $("#contentsTitleForm input[name=contentsTitle]").val()
|
|
|
+ }
|
|
|
+ dataArr.push(data);
|
|
|
+ }
|
|
|
+
|
|
|
var jsonData = JSON.stringify(dataArr);
|
|
|
mcxDialog.confirm('컨텐츠를 저장 하시겠습니까?', {
|
|
|
cancelBtnText: "취소",
|
|
|
@@ -337,6 +393,27 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 서브텍스트추가
|
|
|
+ */
|
|
|
+ var fnAddSubTextPopRow = function (param){
|
|
|
+ var val = typeof param=='object'?'':param;
|
|
|
+ var html = '<tr name="subTextPopRow">'
|
|
|
+ html += '<th>서브텍스트</th>';
|
|
|
+ html += '<td><input type="text" name="subText" maxlength="200" value="'+val+'"/></td>';
|
|
|
+ html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
|
|
|
+ html += '</tr>';
|
|
|
+ if(typeof param == 'object'){
|
|
|
+ if($(param).closest("table").find("tbody").find("tr[name=subTextPopRow]").length>3){
|
|
|
+ mcxDialog.alert("서브텍스트는 4개까지 등록 가능합니다");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $(param).closest("table").find("tbody").append(html);
|
|
|
+ }else{
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 이미지 추가
|
|
|
*/
|
|
|
@@ -446,6 +523,14 @@
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
$("#popTitle").text("["+contentsLoc+"] "+gagaAgGrid.lookupValue(contentsLocArr, contentsLoc));
|
|
|
+
|
|
|
+ if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
|
|
|
+ ||contentsLoc=='SMM010' ||contentsLoc=='SMM012'||contentsLoc=='SMM013'){
|
|
|
+ $("#contentsTitleForm").show();
|
|
|
+ }else{
|
|
|
+ $("#contentsTitleForm").hide();
|
|
|
+ }
|
|
|
+
|
|
|
$("#popSortable").disableSelection();
|
|
|
fnGetContentsPreviewList();
|
|
|
});
|