|
|
@@ -59,6 +59,8 @@
|
|
|
var tdDeleteWidth = parseInt(tdWidth/11, 10);
|
|
|
tdWidth = tdWidth - tdDeleteWidth;
|
|
|
|
|
|
+ var tableLen = 0; // 테이블 ID
|
|
|
+
|
|
|
// 컨텐츠 미리보기 리스트
|
|
|
var fnGetContentsPreviewList = function() {
|
|
|
$("#popSortable").html('');
|
|
|
@@ -69,13 +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 mcTable" style="margin-bottom:30px" id="mcTable'+i+'">';
|
|
|
- html += '<input type="hidden" name="tableIdx" value="'+i+'" >';
|
|
|
+ html += '<input type="hidden" name="tableIdx" value="'+i+'" data-id="'+i+'">';
|
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
|
@@ -98,38 +101,106 @@
|
|
|
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>';
|
|
|
+ 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>';
|
|
|
if(contentsLoc=='SMM001'){
|
|
|
- //html += fnMainBannerArea(i);
|
|
|
html += '<tr>';
|
|
|
html += ' <th>컨텐츠유형</th>';
|
|
|
- html += ' <td class="planArea" name="planArea" colspan="3">';
|
|
|
- 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>';
|
|
|
- html += ' <input type="text" class="w100 inputPlan" name="planSq'+i+'" value=""/>';
|
|
|
- html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan('+i+');">기획전검색</button>';
|
|
|
+ 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">';
|
|
|
- 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>';
|
|
|
+ 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);
|
|
|
@@ -159,30 +230,8 @@
|
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
|
- fnResetIdx();
|
|
|
- }
|
|
|
-
|
|
|
- var fnResetIdx = function (){
|
|
|
- $(".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();
|
|
|
- console.log(i+ '::contentsTypeVal::'+contentsTypeVal);
|
|
|
- console.log(i+ '::textColorVal::'+textColorVal);
|
|
|
-
|
|
|
- $(this).find("input:radio[name=contentsType"+thisIdx+"]").removeAttr("onclick");
|
|
|
- $(this).find("input:radio[name=contentsType"+thisIdx+"]").attr("onclick", "fnChangeContentsType(this,"+i+");");
|
|
|
- $(this).find("input:radio[name=contentsType"+thisIdx+"]").val(contentsTypeVal);
|
|
|
- $(this).find("input[name=planSq"+thisIdx+"]").removeAttr("onclick");
|
|
|
- $(this).find("input[name=planSq"+thisIdx+"]").attr("onclick", "fnSearchPlan("+i+");");
|
|
|
- $(this).find("input[name=contentsType"+thisIdx+"]").attr('name','contentsType'+i);
|
|
|
- $(this).find("input[name=planSq"+thisIdx+"]").attr('name','planSq'+i);
|
|
|
- $(this).find("input:radio[name=thumTextColor"+thisIdx+"]").attr('name','thumTextColor'+i);
|
|
|
- $(this).find("input:radio[name=thumTextColor"+thisIdx+"]").val(textColorVal);
|
|
|
- $(this).attr('id','mcTable'+i);
|
|
|
- $(this).find("input[name=tableIdx]").val(i);
|
|
|
- });
|
|
|
|
|
|
+ tableLen = $(".mcTable").length;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -190,8 +239,10 @@
|
|
|
*/
|
|
|
var dataIdx=0;
|
|
|
$("#btnPopAddRow").on("click", function (){
|
|
|
+ dataIdx = tableLen;
|
|
|
+
|
|
|
var html = '<table class="frmStyle mcTable" style="margin-bottom:30px" id="mcTable'+dataIdx+'">';
|
|
|
- html += '<input type="hidden" name="tableIdx" value="'+dataIdx+'">';
|
|
|
+ html += '<input type="hidden" name="tableIdx" value="'+dataIdx+'" data-id="'+dataIdx+'">';
|
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
|
@@ -214,24 +265,28 @@
|
|
|
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>';
|
|
|
+ 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>';
|
|
|
if(contentsLoc=='SMM001'){
|
|
|
- //html += fnMainBannerArea();
|
|
|
html += '<tr>';
|
|
|
html += ' <th>컨텐츠유형</th>';
|
|
|
- html += ' <td class="planArea" name="planArea" colspan="3">';
|
|
|
+ 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=""/>';
|
|
|
@@ -246,7 +301,53 @@
|
|
|
html += ' </td>';
|
|
|
html += '</tr>';
|
|
|
}
|
|
|
- html += '</thead><tbody></tbody></table>';
|
|
|
+ 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");
|
|
|
@@ -255,45 +356,42 @@
|
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
|
- fnResetIdx();
|
|
|
+
|
|
|
+ tableLen = tableLen+1;
|
|
|
});
|
|
|
|
|
|
- var mbIdx = 0;
|
|
|
- var fnMainBannerArea = function (param){
|
|
|
- var html = '';
|
|
|
- html += '<tr>';
|
|
|
- html += ' <th>컨텐츠유형</th>';
|
|
|
- html += ' <td class="planArea" name="planArea" colspan="3">';
|
|
|
- html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+mbIdx+'" value="P" onclick="fnChangeContentsType(this,'+mbIdx+');" checked="checked"/>기획전</label>';
|
|
|
- html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+mbIdx+'" value="E" onclick="fnChangeContentsType(this,'+mbIdx+');"/>이벤트</label>';
|
|
|
- html += ' <input type="text" class="w100 inputPlan" name="planSq'+mbIdx+'" value=""/>';
|
|
|
- html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan('+mbIdx+');">기획전검색</button>';
|
|
|
- html += ' </td>';
|
|
|
- html += '</tr>';
|
|
|
- html += '<tr>';
|
|
|
- html += ' <th>썸네일 <br>글자 색상</th>';
|
|
|
- html += ' <td colspan="3">';
|
|
|
- html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+mbIdx+'" value="BLACK" checked="checked"/>BLACK</label>';
|
|
|
- html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+mbIdx+'" value="WHITE" />WHITE</label>';
|
|
|
- html += ' </td>';
|
|
|
- html += '</tr>';
|
|
|
- mbIdx++;
|
|
|
- return html;
|
|
|
+ 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'){
|
|
|
- $(obj).find(".planArea .inputPlan").show();
|
|
|
- $(obj).find(".planArea .btnPlan").show();
|
|
|
+ $("#planArea"+idx+" .inputPlan").show();
|
|
|
+ $("#planArea"+idx+" .btnPlan").show();
|
|
|
}else{
|
|
|
- $(obj).find(".planArea").find("input[name=planSq"+idx+"]").val('');
|
|
|
- $(obj).find(".planArea .inputPlan").hide();
|
|
|
- $(obj).find(".planArea .btnPlan").hide();
|
|
|
+ $("#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){
|
|
|
@@ -305,6 +403,66 @@
|
|
|
$("#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;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 임시저장
|
|
|
*/
|
|
|
@@ -321,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()==''){
|
|
|
@@ -344,6 +514,10 @@
|
|
|
var strVar2 = '';
|
|
|
var strVar3 = '';
|
|
|
var strVar4 = '';
|
|
|
+ var strVar5 = '';
|
|
|
+ var strVar6 = '';
|
|
|
+ var strVar7 = '';
|
|
|
+ var strVar8 = '';
|
|
|
var strTitle1 = '';
|
|
|
var strTitle2 = '';
|
|
|
var strTitle3 = '';
|
|
|
@@ -352,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()+"'");
|
|
|
@@ -388,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
|
|
|
@@ -401,6 +593,10 @@
|
|
|
, strVar2 : strVar2
|
|
|
, strVar3 : strVar3
|
|
|
, strVar4 : strVar4
|
|
|
+ , strVar5 : strVar5
|
|
|
+ , strVar6 : strVar6
|
|
|
+ , strVar7 : strVar7
|
|
|
+ , strVar8 : strVar8
|
|
|
, strTitle1 : strTitle1
|
|
|
, strTitle2 : strTitle2
|
|
|
, strTitle3 : strTitle3
|
|
|
@@ -487,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);
|