--- src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp
... | ... | @@ -206,13 +206,18 @@ |
| 206 | 206 |
$("#imageFileName").val(""); //이미지 파일명 삭제
|
| 207 | 207 |
|
| 208 | 208 |
} |
| 209 |
- |
|
| 209 |
+/* |
|
| 210 | 210 |
function validateButtons() {
|
| 211 | 211 |
var isValid = true; |
| 212 |
- |
|
| 212 |
+ |
|
| 213 |
+ console.log($('#buttonAddWrap').html());
|
|
| 214 |
+ var val = ''; |
|
| 213 | 215 |
// button_add_wrap 하위 input들 중에서 비어있는 항목이 있는지 확인 |
| 214 | 216 |
$('#buttonAddWrap').find('input[type="text"]').each(function() {
|
| 215 |
- if ($(this).val().trim() === '') {
|
|
| 217 |
+ |
|
| 218 |
+ var val = $(this).val().trim(); |
|
| 219 |
+ if (val === '') {
|
|
| 220 |
+ console.log($(this).prop('outerHTML'));
|
|
| 216 | 221 |
isValid = false; |
| 217 | 222 |
return false; // .each 루프 중단 |
| 218 | 223 |
} |
... | ... | @@ -221,9 +226,55 @@ |
| 221 | 226 |
if (!isValid) {
|
| 222 | 227 |
alert('버튼명 및 링크를 입력해주세요.');
|
| 223 | 228 |
return false; |
| 229 |
+ }else if (!val.startsWith('http://') && !val.startsWith('https://') ) {
|
|
| 230 |
+ alert('버튼의 링크는 http:// 또는 https:// 형식으로 입력해주세요.');
|
|
| 231 |
+ $(this).focus(); |
|
| 232 |
+ return false; |
|
| 224 | 233 |
} |
| 225 | 234 |
|
| 226 | 235 |
return true; |
| 236 |
+} */ |
|
| 237 |
+ |
|
| 238 |
+function validateButtons() {
|
|
| 239 |
+ var isValid = true; |
|
| 240 |
+ |
|
| 241 |
+ $('.kakaoBtnNmList').each(function() {
|
|
| 242 |
+ var val = $(this).val().trim(); |
|
| 243 |
+ |
|
| 244 |
+ // 빈 값 체크 |
|
| 245 |
+ if (val === '') {
|
|
| 246 |
+ alert('버튼명을 모두 입력해주세요.');
|
|
| 247 |
+ $(this).focus(); |
|
| 248 |
+ isValid = false; |
|
| 249 |
+ return false; // .each 루프 중단 |
|
| 250 |
+ } |
|
| 251 |
+ |
|
| 252 |
+ }); |
|
| 253 |
+ |
|
| 254 |
+ if(isValid){
|
|
| 255 |
+ $('.kakaoBtnList').each(function() {
|
|
| 256 |
+ var val = $(this).val().trim(); |
|
| 257 |
+ |
|
| 258 |
+ // 빈 값 체크 |
|
| 259 |
+ if (val === '') {
|
|
| 260 |
+ alert('링크를 모두 입력해주세요.');
|
|
| 261 |
+ $(this).focus(); |
|
| 262 |
+ isValid = false; |
|
| 263 |
+ return false; // .each 루프 중단 |
|
| 264 |
+ } |
|
| 265 |
+ |
|
| 266 |
+ // http 형식 체크 |
|
| 267 |
+ if (!val.startsWith('http://') && !val.startsWith('https://')) {
|
|
| 268 |
+ alert('버튼의 링크는 http:// 또는 https:// 형식으로 입력해주세요.');
|
|
| 269 |
+ $(this).focus(); |
|
| 270 |
+ isValid = false; |
|
| 271 |
+ return false; // .each 루프 중단 |
|
| 272 |
+ } |
|
| 273 |
+ }); |
|
| 274 |
+ } |
|
| 275 |
+ |
|
| 276 |
+ |
|
| 277 |
+ return isValid; |
|
| 227 | 278 |
} |
| 228 | 279 |
|
| 229 | 280 |
//최근 전송내역 |
... | ... | @@ -483,14 +534,12 @@ |
| 483 | 534 |
//이미지 선택시 링크 정보 및 url 패턴 검사 |
| 484 | 535 |
console.log('link: ', link);
|
| 485 | 536 |
if (!link) {
|
| 486 |
- |
|
| 487 |
- |
|
| 488 | 537 |
if(!confirm("먼저 URL을 입력하지 않으면 이미지에 URL이 저장되지 않습니다. 계속하시겠습니까?")){
|
| 489 | 538 |
return false; |
| 490 | 539 |
} |
| 491 |
- |
|
| 492 |
- |
|
| 493 |
- |
|
| 540 |
+ }else if(!link.startsWith('http://') && !link.startsWith('https://')){
|
|
| 541 |
+ alert('이동할 URL은 http:// 또는 https:// 형식으로 입력해주세요.');
|
|
| 542 |
+ return false; |
|
| 494 | 543 |
} |
| 495 | 544 |
/* |
| 496 | 545 |
else if(link.search("http://") == -1 && link.search("https://") == -1){
|
... | ... | @@ -969,6 +1018,12 @@ |
| 969 | 1018 |
//친구톡 데이터 전송 처리 |
| 970 | 1019 |
function fn_sendMsgData(){
|
| 971 | 1020 |
|
| 1021 |
+ // 유효성 검사 실패 시 저장 동작 중단 |
|
| 1022 |
+/* if (!validateLinks()) {
|
|
| 1023 |
+ return false; |
|
| 1024 |
+ } |
|
| 1025 |
+ */ |
|
| 1026 |
+ |
|
| 972 | 1027 |
var senderKey = $("#selectAgentCode option:checked").val();
|
| 973 | 1028 |
|
| 974 | 1029 |
if(senderKey == ''){
|
... | ... | @@ -1341,6 +1396,28 @@ |
| 1341 | 1396 |
|
| 1342 | 1397 |
function fn_insertErrorYN(val){
|
| 1343 | 1398 |
$('#errorChk').val(val);
|
| 1399 |
+} |
|
| 1400 |
+ |
|
| 1401 |
+//링크 유효성 검증 함수 |
|
| 1402 |
+function validateLinks() {
|
|
| 1403 |
+ |
|
| 1404 |
+ console.log('검사 대상 수:', $('.kakaoBtnList').length);
|
|
| 1405 |
+ |
|
| 1406 |
+ let isValid = true; |
|
| 1407 |
+ |
|
| 1408 |
+ $('.kakaoBtnList').each(function () {
|
|
| 1409 |
+ const val = $(this).val().trim(); |
|
| 1410 |
+ |
|
| 1411 |
+ console.log('val : ', val);
|
|
| 1412 |
+ if (val !== '' && !val.startsWith('http://') && !val.startsWith('https://')) {
|
|
| 1413 |
+ alert(`"${val}" 은(는) http:// 또는 https:// 로 시작해야 합니다.`);
|
|
| 1414 |
+ $(this).focus(); |
|
| 1415 |
+ isValid = false; |
|
| 1416 |
+ return false; // each 루프 중단 |
|
| 1417 |
+ } |
|
| 1418 |
+ }); |
|
| 1419 |
+ |
|
| 1420 |
+ return isValid; |
|
| 1344 | 1421 |
} |
| 1345 | 1422 |
|
| 1346 | 1423 |
|
... | ... | @@ -2020,7 +2097,7 @@ |
| 2020 | 2097 |
<div class="clearfix receipt_num"> |
| 2021 | 2098 |
<div class="receipt_num_top"> |
| 2022 | 2099 |
<label for="callTo" class="label">받는 번호입력</label> |
| 2023 |
- <input type="text" placeholder="번호를 입력하세요" id="callTo" name="callTo" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;"> |
|
| 2100 |
+ <input type="text" value="01012341234" placeholder="번호를 입력하세요" id="callTo" name="callTo" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;"> |
|
| 2024 | 2101 |
<button type="button" class="btnType btnType6 addCallToF">번호추가</button> |
| 2025 | 2102 |
<span><span class="vMiddle">*</span> 중복번호는 한번만 발송됩니다.</span> |
| 2026 | 2103 |
</div> |
--- src/main/webapp/publish/js/content.js
+++ src/main/webapp/publish/js/content.js
... | ... | @@ -1662,27 +1662,41 @@ |
| 1662 | 1662 |
} |
| 1663 | 1663 |
var buttonText; |
| 1664 | 1664 |
var buttonView; |
| 1665 |
- //템플릿 버튼은 buttonVO의 buttonVOList 변수에 셋팅해서 넘겨주게 만들었음 |
|
| 1665 |
+ //템플릿 버튼은 buttonVO의 buttonVOList 변수에 셋팅해서 넘겨주게 만들었음 |
|
| 1666 | 1666 |
if (buttonType == "button_type_1") {
|
| 1667 |
- buttonText = '<dl class="button_type_wrap type1"><dt>배송조회</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeDeliv" name="buttonVOList[' + buttonCnt + '].linkType" value="DS"/><input type="text" id="btnNmDeliv" name="buttonVOList[' + buttonCnt + '].name" value="배송조회" placeholder="버튼명 입력(최대 14자)" readonly><p class="cf_text">*이용가능 택배사 : KG로지스, 우체국택배,일양로지스, GTX로지스, FedEx, 경동택배, 합동택배, 롯데택배</p></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1667 |
+ buttonText = '<dl class="button_type_wrap type1"><dt>배송조회</dt><dd class="button_type_input">' |
|
| 1668 |
+ +'<input type="hidden" id="buttonLikeTypeDeliv" name="buttonVOList[' + buttonCnt + '].linkType" value="DS"/>' |
|
| 1669 |
+ +'<input type="text" id="btnNmDeliv" name="buttonVOList[' + buttonCnt + '].name" value="배송조회" placeholder="버튼명 입력(최대 14자)" readonly><p class="cf_text">*이용가능 택배사 : KG로지스, 우체국택배,일양로지스, GTX로지스, FedEx, 경동택배, 합동택배, 롯데택배</p></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1668 | 1670 |
buttonView = '<button type="button" class="btn_kakao_type btnEmpty" id="btnViewDS">배송조회</button>'; |
| 1669 | 1671 |
} else if (buttonType == "button_type_2") {
|
| 1670 |
- buttonText = '<dl class="button_type_wrap type2"><dt>웹링크</dt><dd class="button_type_input"><ul><li><input type="hidden" id="buttonLikeTypeWeb" name="buttonVOList[' + buttonCnt + '].linkType" value="WL"/><input type="text" id="btnNmWeb" name="buttonVOList[' + buttonCnt + '].name" value="" maxlength="14" placeholder="버튼명 입력(최대 14자)"></li><li><input type="text" id="buttonLinkMo" name="buttonVOList[' + buttonCnt + '].linkMo" value="" placeholder="모바일 링크 입력"></li><li><input type="text" id="buttonLinkPc" name="buttonVOList[' + buttonCnt + '].linkPc" value="" placeholder="PC 링크 입력"></li></ul></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1672 |
+ buttonText = '<dl class="button_type_wrap type2"><dt>웹링크</dt><dd class="button_type_input"> ' |
|
| 1673 |
+ +'<ul><li><input type="hidden" id="buttonLikeTypeWeb" name="buttonVOList[' + buttonCnt + '].linkType" value="WL"/>' |
|
| 1674 |
+ +'<input type="text" class="kakaoBtnNmList" id="btnNmWeb" name="buttonVOList[' + buttonCnt + '].name" value="" maxlength="14" placeholder="버튼명 입력(최대 14자)"></li>' |
|
| 1675 |
+ +'<li><input type="text" class="kakaoBtnList" id="buttonLinkMo" name="buttonVOList[' + buttonCnt + '].linkMo" value="" placeholder="모바일 링크 입력"></li>' |
|
| 1676 |
+ +'<li><input type="text" class="kakaoBtnList" id="buttonLinkPc" name="buttonVOList[' + buttonCnt + '].linkPc" value="" placeholder="PC 링크 입력"></li></ul></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1671 | 1677 |
buttonView = '<button type="button" class="btn_kakao_type btnEmpty" id="btnViewWL">웹링크</button>'; |
| 1672 | 1678 |
} else if (buttonType == "button_type_3") {
|
| 1673 |
- buttonText = '<dl class="button_type_wrap type3"><dt>앱링크</dt><dd class="button_type_input"><ul><li><input type="hidden" id="buttonLikeTypeApp" name="buttonVOList[' + buttonCnt + '].linkType" value="AL"/><input type="text" id="btnNmApp" name="buttonVOList[' + buttonCnt + '].name" value="" maxlength="14" placeholder="버튼명 입력(최대 14자)"></li><li><input type="text" id="buttonLinkAnd" name="buttonVOList[' + buttonCnt + '].linkAnd" value="" placeholder="Android 링크 입력"></li><li><input type="text" id="buttonLinkIos" name="buttonVOList[' + buttonCnt + '].linkIos" value="" placeholder="IOS 링크 입력"></li></ul></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1679 |
+ buttonText = '<dl class="button_type_wrap type3"><dt>앱링크</dt><dd class="button_type_input">' |
|
| 1680 |
+ +'<ul><li><input type="hidden" id="buttonLikeTypeApp" name="buttonVOList[' + buttonCnt + '].linkType" value="AL"/>' |
|
| 1681 |
+ +'<input type="text" class="kakaoBtnNmList" id="btnNmApp" name="buttonVOList[' + buttonCnt + '].name" value="" maxlength="14" placeholder="버튼명 입력(최대 14자)"></li>' |
|
| 1682 |
+ +'<li><input type="text" class="kakaoBtnList" id="buttonLinkAnd" name="buttonVOList[' + buttonCnt + '].linkAnd" value="" placeholder="Android 링크 입력"></li> ' |
|
| 1683 |
+ +'<li><input type="text" class="kakaoBtnList" id="buttonLinkIos" name="buttonVOList[' + buttonCnt + '].linkIos" value="" placeholder="IOS 링크 입력"></li></ul></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1674 | 1684 |
buttonView = '<button type="button" class="btn_kakao_type btnEmpty" id="btnViewAL">앱링크</button>'; |
| 1675 | 1685 |
} else if (buttonType == "button_type_4") {
|
| 1676 |
- buttonText = '<dl class="button_type_wrap type4"><dt>봇키워드</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeBot" name="buttonVOList[' + buttonCnt + '].linkType" value="BK"/><input type="text" id="btnNmBot" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1686 |
+ buttonText = '<dl class="button_type_wrap type4"><dt>봇키워드</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeBot" name="buttonVOList[' + buttonCnt + '].linkType" value="BK"/>' |
|
| 1687 |
+ +'<input type="text" id="btnNmBot" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1677 | 1688 |
buttonView = '<button type="button" class="btn_kakao_type btnEmpty" id="btnViewBK">봇키워드</button>'; |
| 1678 | 1689 |
} else if (buttonType == "button_type_5") {
|
| 1679 |
- buttonText = '<dl class="button_type_wrap type5"><dt>메시지전달</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeMsg" name="buttonVOList[' + buttonCnt + '].linkType" value="MD"/><input type="text" id="btnNmMsg" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1690 |
+ buttonText = '<dl class="button_type_wrap type5"><dt>메시지전달</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeMsg" name="buttonVOList[' + buttonCnt + '].linkType" value="MD"/>' |
|
| 1691 |
+ +'<input type="text" id="btnNmMsg" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1680 | 1692 |
buttonView = '<button type="button" class="btn_kakao_type btnEmpty" id="btnViewMD">메시지전달</button>'; |
| 1681 | 1693 |
} else if (buttonType == "button_type_6") {
|
| 1682 |
- buttonText = '<dl class="button_type_wrap type6"><dt>상담톡전환</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeCons" name="buttonVOList[' + buttonCnt + '].linkType" value="BC"/><input type="text" id="btnNmCons" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1694 |
+ buttonText = '<dl class="button_type_wrap type6"><dt>상담톡전환</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeCons" name="buttonVOList[' + buttonCnt + '].linkType" value="BC"/>' |
|
| 1695 |
+ +'<input type="text" id="btnNmCons" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1683 | 1696 |
buttonView = '<button type="button" class="btn_kakao_type btnEmpty" id="btnViewBC">상담톡전환</button>'; |
| 1684 | 1697 |
} else if (buttonType == "button_type_7") {
|
| 1685 |
- buttonText = '<dl class="button_type_wrap type7"><dt>챗봇전환</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeBotChg" name="buttonVOList[' + buttonCnt + '].linkType" value="BT"/><input type="text" id="btnNmBotChg" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1698 |
+ buttonText = '<dl class="button_type_wrap type7"><dt>챗봇전환</dt><dd class="button_type_input"><input type="hidden" id="buttonLikeTypeBotChg" name="buttonVOList[' + buttonCnt + '].linkType" value="BT"/>' |
|
| 1699 |
+ +'<input type="text" id="btnNmBotChg" name="buttonVOList[' + buttonCnt + '].name" value="" placeholder="버튼명 입력(최대 14자)"></dd><dd><button type="button" class="btn_del" onclick="buttonTypeDel(this);"><img src="/publish/images/btn_delete.png" alt=""></button></dd></dl>'; |
|
| 1686 | 1700 |
buttonView = '<button type="button" class="btn_kakao_type btnEmpty" id="btnViewBT">챗봇전환</button>'; |
| 1687 | 1701 |
} else {}
|
| 1688 | 1702 |
$(".button_add_wrap").prepend(buttonText);
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?