|
|
@@ -1,6 +1,6 @@
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="ko"
|
|
|
- xmlns:th="http://www.thymeleaf.org">
|
|
|
+ xmlns:th="http://www.thymeleaf.org">
|
|
|
<!--
|
|
|
*******************************************************************************
|
|
|
* @source : MainContentsPopupForm.html
|
|
|
@@ -14,43 +14,43 @@
|
|
|
* 1.0 2021.2.23 bin2107 최초 작성
|
|
|
*******************************************************************************
|
|
|
-->
|
|
|
- <div class="modalPopup" data-width="1400" >
|
|
|
- <div class="panelStyle">
|
|
|
- <div class="panelTitle">
|
|
|
- <h2 id="popTitle" th:text="${contentsLoc}"></h2>
|
|
|
- <button type="button" class="close" onclick="fnMainContentsPopupFormClose()"><i class="fa fa-times"></i></button>
|
|
|
- </div>
|
|
|
- <div class="panelContent">
|
|
|
- <ul class="panelBar">
|
|
|
- <li class="aL">
|
|
|
- <span class="cBlue">* 상단으로 드래그&드랍하여 순서 변경 가능합니다.</span>
|
|
|
- </li>
|
|
|
- <li class="aR">
|
|
|
- <button type="button" class="btn btn btn-base btn-sm" id="btnPopAddRow">컨텐츠 추가</button>
|
|
|
- <button type="button" class="btn btn btn-dark btn-sm" id="btnPopSave">임시저장</button>
|
|
|
- <input type="hidden" name="uploadDefaultUrlPop" id="uploadDefaultUrlPop" th:value="${@environment.getProperty('upload.image.view') + '/display/contents/'}"/>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <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 class="modalPopup" data-width="1500" >
|
|
|
+ <div class="panelStyle">
|
|
|
+ <div class="panelTitle">
|
|
|
+ <h2 id="popTitle" th:text="${contentsLoc}"></h2>
|
|
|
+ <button type="button" class="close" onclick="fnMainContentsPopupFormClose()"><i class="fa fa-times"></i></button>
|
|
|
</div>
|
|
|
+ <div class="panelContent">
|
|
|
+ <ul class="panelBar">
|
|
|
+ <li class="aL">
|
|
|
+ <span class="cBlue">* 상단으로 드래그&드랍하여 순서 변경 가능합니다.</span>
|
|
|
+ </li>
|
|
|
+ <li class="aR">
|
|
|
+ <button type="button" class="btn btn btn-base btn-sm" id="btnPopAddRow">컨텐츠 추가</button>
|
|
|
+ <button type="button" class="btn btn btn-dark btn-sm" id="btnPopSave">임시저장</button>
|
|
|
+ <input type="hidden" name="uploadDefaultUrlPop" id="uploadDefaultUrlPop" th:value="${@environment.getProperty('upload.image.view') + '/display/contents/'}"/>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <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:1470px; overflow:auto;" id="popSortable">
|
|
|
+ </form>
|
|
|
</div>
|
|
|
+</div>
|
|
|
|
|
|
<script th:inline="javascript">
|
|
|
-/*<![CDATA[*/
|
|
|
+ /*<![CDATA[*/
|
|
|
var cateNo = [[${cateNo}]];
|
|
|
var contentsLoc = [[${contentsLoc}]];
|
|
|
var contentsTitle = [[${contentsTitle}]];
|
|
|
@@ -59,6 +59,8 @@
|
|
|
var tdDeleteWidth = parseInt(tdWidth/11, 10);
|
|
|
tdWidth = tdWidth - tdDeleteWidth;
|
|
|
|
|
|
+ var tableLen = 0; // 테이블 ID
|
|
|
+
|
|
|
// 컨텐츠 미리보기 리스트
|
|
|
var fnGetContentsPreviewList = function() {
|
|
|
$("#popSortable").html('');
|
|
|
@@ -69,12 +71,14 @@
|
|
|
gagajf.ajaxJsonSubmit('/display/contents/preview/list', jsonData, fnCreatePopLayout);
|
|
|
}
|
|
|
|
|
|
+ var createIdx = 0;
|
|
|
var fnCreatePopLayout = function(result) {
|
|
|
var html = '';
|
|
|
for(var i=0; i<result.length; i++){
|
|
|
var dispStdt = result[i].dispStdt.split(" ");
|
|
|
var dispEddt = result[i].dispEddt.split(" ");
|
|
|
- html += '<table class="frmStyle" style="margin-bottom:30px">';
|
|
|
+ html += '<table class="frmStyle mcTable" style="margin-bottom:30px" id="mcTable'+i+'">';
|
|
|
+ html += '<input type="hidden" name="tableIdx" value="'+i+'" data-id="'+i+'">';
|
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
|
@@ -97,19 +101,107 @@
|
|
|
html += '</select>';
|
|
|
html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
|
|
|
html += '</td>';
|
|
|
- html += '<td class="aL"><button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
- if(contentsLoc=='SMM001' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
|
|
|
+ html += '<td class="aL">';
|
|
|
+ if(contentsLoc!='SMM005'){
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
+ }
|
|
|
+ if(contentsLoc=='SMM001' || contentsLoc=='SMM002' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
|
|
|
}
|
|
|
if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
|
|
|
}
|
|
|
- if(contentsLoc!='SBM005' && contentsLoc!='SBMM005'){
|
|
|
+ if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005'){
|
|
|
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!='SMM005') {
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
|
|
|
+ }
|
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
|
|
|
- html += '</tr></thead><tbody>';
|
|
|
+ html += '</tr>';
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>컨텐츠유형</th>';
|
|
|
+ html += ' <td class="planArea" name="planArea" id="planArea'+i+'" colspan="3">';
|
|
|
+ if(result[i].strVar5=='P'){
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+i+'" value="P" onclick="fnChangeContentsType(this,'+i+');" checked="checked"/>기획전</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+i+'" value="E" onclick="fnChangeContentsType(this,'+i+');"/>이벤트</label>';
|
|
|
+ }else{
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+i+'" value="P" onclick="fnChangeContentsType(this,'+i+');" />기획전</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+i+'" value="E" onclick="fnChangeContentsType(this,'+i+');" checked="checked"/>이벤트</label>';
|
|
|
+ }
|
|
|
+ if(result[i].strVar5=='P') {
|
|
|
+ html += ' <input type="text" class="w100 inputPlan" name="planSq' + i + '" value="' + result[i].strVar6 + '"/>';
|
|
|
+ html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan(' + i + ');">기획전검색</button>';
|
|
|
+ }else{
|
|
|
+ html += ' <input type="text" class="w100 inputPlan" name="planSq' + i + '" value="" style="display: none;"/>';
|
|
|
+ html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan(' + i + ');" style="display: none;">기획전검색</button>';
|
|
|
+ }
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>썸네일 <br>글자 색상</th>';
|
|
|
+ html += ' <td colspan="3">';
|
|
|
+ if(result[i].strVar7='BLACK'){
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+i+'" value="BLACK" checked="checked"/>BLACK</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+i+'" value="WHITE" />WHITE</label>';
|
|
|
+ }else{
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+i+'" value="BLACK" />BLACK</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+i+'" value="WHITE" checked="checked"/>WHITE</label>';
|
|
|
+ }
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ }
|
|
|
+ if(contentsLoc=='SMM005'){
|
|
|
+ if(contentsLoc=='SMM005'){
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>배너유형</th>';
|
|
|
+ html += ' <td class="bannerArea" id="bannerArea'+i+'">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="1" onclick="fnChangeBannerType(this,1);">1단</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="2" onclick="fnChangeBannerType(this,2);">2단</label>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr id="bannerImgTr1" name="imgPopRow">';
|
|
|
+ html += ' <th>이미지1</th>';
|
|
|
+ html += ' <td>';
|
|
|
+ html += ' <div id="ImageArea1" style="height:33px;">';
|
|
|
+ html += ' <span className="uFile w300">';
|
|
|
+ html += ' <input id="file_1" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 1)"/>';
|
|
|
+ html += ' <label htmlFor="file_1" className="uFileLabel"></label>';
|
|
|
+ html += ' <input type="hidden" name="imgPath" value="'+result[i].imgPath1+'"/>';
|
|
|
+ html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
+ html += ' </span>';
|
|
|
+ html += ' <span className="memAdd off" id="imgFileNm1"></span>';
|
|
|
+ html += ' </div>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr id="bannerLinkTr1" name="linkRow">';
|
|
|
+ html += ' <th>링크1</th>';
|
|
|
+ html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="'+result[i].strVar1+'"/></td>';
|
|
|
+ html += '</tr>';
|
|
|
+ if(result[i].contentsType==2){
|
|
|
+ html += '<tr id="bannerImgTr2" name="imgPopRow">';
|
|
|
+ html += ' <th>이미지2</th>';
|
|
|
+ html += ' <td>';
|
|
|
+ html += ' <div id="ImageArea2" style="height:33px;">';
|
|
|
+ html += ' <span className="uFile w300">';
|
|
|
+ html += ' <input id="file_2" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 2)"/>';
|
|
|
+ html += ' <label htmlFor="file_2" className="uFileLabel"></label>';
|
|
|
+ html += ' <input type="hidden" name="imgPath" value="'+result[i].imgPath2+'"/>';
|
|
|
+ html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
+ html += ' </span>';
|
|
|
+ html += ' <span className="memAdd off" id="imgFileNm2"></span>';
|
|
|
+ html += ' </div>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr id="bannerLinkTr2" name="linkRow" >';
|
|
|
+ html += ' <th>링크2</th>';
|
|
|
+ html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="'+result[i].strVar2+'"/></td>';
|
|
|
+ html += '</tr>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ html += '</thead><tbody>';
|
|
|
for(var j=1; j<5; j++){
|
|
|
var strTitle = eval("result["+i+"].strTitle" + j);
|
|
|
var imgPath = eval("result["+i+"].imgPath" + j);
|
|
|
@@ -138,12 +230,19 @@
|
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
|
+
|
|
|
+ tableLen = $(".mcTable").length;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 컨텐츠 추가 버튼
|
|
|
*/
|
|
|
+ var dataIdx=0;
|
|
|
$("#btnPopAddRow").on("click", function (){
|
|
|
- var html = '<table class="frmStyle" style="margin-bottom:30px">';
|
|
|
+ dataIdx = tableLen;
|
|
|
+
|
|
|
+ var html = '<table class="frmStyle mcTable" style="margin-bottom:30px" id="mcTable'+dataIdx+'">';
|
|
|
+ html += '<input type="hidden" name="tableIdx" value="'+dataIdx+'" data-id="'+dataIdx+'">';
|
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
|
@@ -166,19 +265,89 @@
|
|
|
html += '</select>';
|
|
|
html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
|
|
|
html += '</td>';
|
|
|
- html += '<td class="aL"><button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
- if(contentsLoc=='SMM001' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
|
|
|
+ html += '<td class="aL">';
|
|
|
+ if(contentsLoc!='SMM005'){
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
+ }
|
|
|
+ if(contentsLoc=='SMM001' || contentsLoc=='SMM002' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
|
|
|
}
|
|
|
if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
|
|
|
}
|
|
|
- if(contentsLoc!='SBM005' && contentsLoc!='SBMM005') {
|
|
|
+ if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005') {
|
|
|
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!='SMM005') {
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
|
|
|
+ }
|
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
|
|
|
- html += '</tr></thead><tbody></tbody></table>';
|
|
|
+ html += '</tr>';
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>컨텐츠유형</th>';
|
|
|
+ html += ' <td class="planArea" name="planArea" id="planArea'+dataIdx+'" colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+dataIdx+'" value="P" onclick="fnChangeContentsType(this,'+dataIdx+');" checked="checked"/>기획전</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+dataIdx+'" value="E" onclick="fnChangeContentsType(this,'+dataIdx+');"/>이벤트</label>';
|
|
|
+ html += ' <input type="text" class="w100 inputPlan" name="planSq'+dataIdx+'" value=""/>';
|
|
|
+ html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan('+dataIdx+');">기획전검색</button>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>썸네일 <br>글자 색상</th>';
|
|
|
+ html += ' <td colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+dataIdx+'" value="BLACK" checked="checked"/>BLACK</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+dataIdx+'" value="WHITE" />WHITE</label>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ }
|
|
|
+ if(contentsLoc=='SMM005'){
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>배너유형</th>';
|
|
|
+ html += ' <td class="bannerArea" id="bannerArea'+dataIdx+'">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="bannerType'+dataIdx+'" value="1" onclick="fnChangeBannerType(this,1);">1단</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="bannerType'+dataIdx+'" value="2" onclick="fnChangeBannerType(this,2);">2단</label>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr id="bannerImgTr1" name="imgPopRow" style="display: none;">';
|
|
|
+ html += ' <th>이미지1</th>';
|
|
|
+ html += ' <td>';
|
|
|
+ html += ' <div id="ImageArea1" style="height:33px;">';
|
|
|
+ html += ' <span className="uFile w300">';
|
|
|
+ html += ' <input id="file_1" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 1)"/>';
|
|
|
+ html += ' <label htmlFor="file_1" className="uFileLabel"></label>';
|
|
|
+ html += ' <input type="hidden" name="imgPath" value=""/>';
|
|
|
+ html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
+ html += ' </span>';
|
|
|
+ html += ' <span className="memAdd off" id="imgFileNm1"></span>';
|
|
|
+ html += ' </div>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr id="bannerLinkTr1" name="linkRow" style="display: none;">';
|
|
|
+ html += ' <th>링크1</th>';
|
|
|
+ html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="#"/></td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr id="bannerImgTr2" name="imgPopRow" style="display: none;">';
|
|
|
+ html += ' <th>이미지2</th>';
|
|
|
+ html += ' <td>';
|
|
|
+ html += ' <div id="ImageArea2" style="height:33px;">';
|
|
|
+ html += ' <span className="uFile w300">';
|
|
|
+ html += ' <input id="file_2" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 2)"/>';
|
|
|
+ html += ' <label htmlFor="file_2" className="uFileLabel"></label>';
|
|
|
+ html += ' <input type="hidden" name="imgPath" value=""/>';
|
|
|
+ html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
+ html += ' </span>';
|
|
|
+ html += ' <span className="memAdd off" id="imgFileNm2"></span>';
|
|
|
+ html += ' </div>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr id="bannerLinkTr2" name="linkRow" style="display: none;">';
|
|
|
+ html += ' <th>링크2</th>';
|
|
|
+ html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="#"/></td>';
|
|
|
+ html += '</tr>';
|
|
|
+ }
|
|
|
+ html += '</thead><tbody>';
|
|
|
+ html += '</tbody></table>';
|
|
|
$("#popSortable").prepend(html);
|
|
|
$("#popSortable").sortable();
|
|
|
$('.schDate').datepicker("destroy");
|
|
|
@@ -187,8 +356,113 @@
|
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
|
+
|
|
|
+ tableLen = tableLen+1;
|
|
|
});
|
|
|
|
|
|
+ var fnChangeBannerType = function (obj, idx){
|
|
|
+ if(idx==1){
|
|
|
+ $(obj).closest("table").find("[id=bannerImgTr1]").show();
|
|
|
+ $(obj).closest("table").find("[id=bannerLinkTr1]").show();
|
|
|
+ $(obj).closest("table").find("[id=bannerImgTr2]").hide();
|
|
|
+ $(obj).closest("table").find("[id=bannerLinkTr2]").hide();
|
|
|
+ }else{
|
|
|
+ $(obj).closest("table").find("[id=bannerImgTr1]").show();
|
|
|
+ $(obj).closest("table").find("[id=bannerLinkTr1]").show();
|
|
|
+ $(obj).closest("table").find("[id=bannerImgTr2]").show();
|
|
|
+ $(obj).closest("table").find("[id=bannerLinkTr2]").show();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 몰메인>메인롤링배너 컨텐츠유형 선택시
|
|
|
+ var fnChangeContentsType = function (obj, idx){
|
|
|
+ var radioVal = $(obj).closest("td").find("input[name=contentsType"+idx+"]:checked").val();
|
|
|
+ if(radioVal=='P'){
|
|
|
+ $("#planArea"+idx+" .inputPlan").show();
|
|
|
+ $("#planArea"+idx+" .btnPlan").show();
|
|
|
+ }else{
|
|
|
+ $("#planArea"+idx).find("input[name=planSq"+idx+"]").val('');
|
|
|
+ $("#planArea"+idx+" .inputPlan").hide();
|
|
|
+ $("#planArea"+idx+" .btnPlan").hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // SMM005 배너유형 이미지/링크
|
|
|
+ var fnAddSmm005ImgRow = function (param , idx){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 몰메인>메인롤링배너 기획전 조회
|
|
|
+ var tableDataId = 0;
|
|
|
+ var fnSearchPlan = function (idx){
|
|
|
+ cfnOpenPlanPopup('callbackPlanPopup');
|
|
|
+ tableDataId = idx;
|
|
|
+ }
|
|
|
+
|
|
|
+ var callbackPlanPopup = function (result){
|
|
|
+ $("#mcTable"+tableDataId+" .planArea").find("input[name=planSq"+tableDataId+"]").val(result[0].planSq);
|
|
|
+ }
|
|
|
+
|
|
|
+ // SMM005 데이터 validation 체크
|
|
|
+ function smm005DataValidation(){
|
|
|
+ $(".mcTable").each(function(i){
|
|
|
+ var thisIdx = $(this).find("input[name=tableIdx]").val();
|
|
|
+ var contentsType = $(this).find("input:radio[name=bannerType"+thisIdx+"]:checked").val();
|
|
|
+
|
|
|
+ var imgPath1 = $(this).find("[id=ImageArea1]").find("input[name=imgPath]").val();
|
|
|
+ var imgPath2 = $(this).find("[id=ImageArea2]").find("input[name=imgPath]").val();
|
|
|
+ var link1 = $(this).find("[id=bannerLinkTr1]").find("input[name=linkUrl]").val();
|
|
|
+ var link2 = $(this).find("[id=bannerLinkTr2]").find("input[name=linkUrl]").val();
|
|
|
+
|
|
|
+ if(gagajf.isNull(imgPath1)){
|
|
|
+ mcxDialog.alert('배너1 이미지를 선택해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(gagajf.isNull(link1)){
|
|
|
+ mcxDialog.alert('배너1 링크를 선택해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(contentsType==2){
|
|
|
+ if(gagajf.isNull(imgPath2)){
|
|
|
+ mcxDialog.alert('배너2 이미지를 선택해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(gagajf.isNull(link2)){
|
|
|
+ mcxDialog.alert('배너2 링크를 선택해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // SMM001 데이터 validation 체크
|
|
|
+ function smm001DataValidation(){
|
|
|
+ $(".mcTable").each(function(i){
|
|
|
+ var thisIdx = $(this).find("input[name=tableIdx]").val();
|
|
|
+ var contentsTypeVal = $(this).find("input:radio[name=contentsType"+thisIdx+"]:checked").val();
|
|
|
+ var textColorVal = $(this).find("input:radio[name=thumTextColor"+thisIdx+"]:checked").val();
|
|
|
+
|
|
|
+ if(gagajf.isNull(contentsTypeVal)){
|
|
|
+ mcxDialog.alert('컨텐츠 유형을 선택해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(contentsTypeVal=='P'){
|
|
|
+ if(gagajf.isNull($(this).find("input[name=planSq"+thisIdx+"]").val())){
|
|
|
+ mcxDialog.alert('기획전 번호를 입력해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(gagajf.isNull(textColorVal)){
|
|
|
+ mcxDialog.alert('썸네일 글자 색상을 선택해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 임시저장
|
|
|
*/
|
|
|
@@ -205,6 +479,18 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ if(!smm001DataValidation()){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(contentsLoc=='SMM005'){
|
|
|
+ if(!smm005DataValidation()){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var titleBool = true;
|
|
|
$("#popSortable").find('input[name=title]').each(function(idx, title) {
|
|
|
if ($(title).val()==''){
|
|
|
@@ -228,6 +514,10 @@
|
|
|
var strVar2 = '';
|
|
|
var strVar3 = '';
|
|
|
var strVar4 = '';
|
|
|
+ var strVar5 = '';
|
|
|
+ var strVar6 = '';
|
|
|
+ var strVar7 = '';
|
|
|
+ var strVar8 = '';
|
|
|
var strTitle1 = '';
|
|
|
var strTitle2 = '';
|
|
|
var strTitle3 = '';
|
|
|
@@ -236,6 +526,7 @@
|
|
|
var subText2 = '';
|
|
|
var subText3 = '';
|
|
|
var subText4 = '';
|
|
|
+ var contentsType = '';
|
|
|
var i = 1;
|
|
|
$(this).find('input[name=imgPath]').each(function(){
|
|
|
eval("imgPath" + i + "='"+$(this).val()+"'");
|
|
|
@@ -272,8 +563,25 @@
|
|
|
|
|
|
var dispOrd = $(this).find("[name=dispOrd]").val();
|
|
|
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ var thisIdx = $(this).find("input[name=tableIdx]").val();
|
|
|
+ strVar5 = $(this).find("input:radio[name=contentsType"+thisIdx+"]:checked").val();
|
|
|
+ strVar6 = $(this).find("input[name=planSq"+thisIdx+"]").val();
|
|
|
+ strVar7 = $(this).find("input:radio[name=thumTextColor"+thisIdx+"]:checked").val();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(contentsLoc=='SMM005'){
|
|
|
+ var thisIdx = $(this).find("input[name=tableIdx]").val();
|
|
|
+ contentsType = $(this).find("input:radio[name=bannerType1"+thisIdx+"]:checked").val();
|
|
|
+ imgPath1 = $(this).find("#ImageArea1").find("input[name=imgPath]").val();
|
|
|
+ strVar1 = $(this).find("#bannerLinkTr1").find("input[name=linkUrl]").val();
|
|
|
+ imgPath2 = $(this).find("#ImageArea2").find("input[name=imgPath]").val();
|
|
|
+ strVar2 = $(this).find("#bannerLinkTr2").find("input[name=linkUrl]").val();
|
|
|
+ }
|
|
|
+
|
|
|
var data = {cateNo : cateNo
|
|
|
, contentsLoc : contentsLoc
|
|
|
+ , contentsType : contentsType
|
|
|
, dispStdt : dispStdt
|
|
|
, dispEddt : dispEddt
|
|
|
, newImgFileArr : newImgFileArr
|
|
|
@@ -285,6 +593,10 @@
|
|
|
, strVar2 : strVar2
|
|
|
, strVar3 : strVar3
|
|
|
, strVar4 : strVar4
|
|
|
+ , strVar5 : strVar5
|
|
|
+ , strVar6 : strVar6
|
|
|
+ , strVar7 : strVar7
|
|
|
+ , strVar8 : strVar8
|
|
|
, strTitle1 : strTitle1
|
|
|
, strTitle2 : strTitle2
|
|
|
, strTitle3 : strTitle3
|
|
|
@@ -371,7 +683,7 @@
|
|
|
return;
|
|
|
}
|
|
|
// 파일 업로드
|
|
|
- gagajf.ajaxFileUpload('/common/file/upload?subDir=/display/contents'
|
|
|
+ gagajf.ajaxFileUpload('/common/file/upload?subDir=/contents'
|
|
|
, file
|
|
|
, function(result) {
|
|
|
$(obj).closest('div').find('input:hidden[name=newImgFile]').val(result.newFileName);
|
|
|
@@ -565,7 +877,7 @@
|
|
|
$("#popSortable").disableSelection();
|
|
|
fnGetContentsPreviewList();
|
|
|
});
|
|
|
-/*]]>*/
|
|
|
+ /*]]>*/
|
|
|
</script>
|
|
|
|
|
|
</html>
|