/** * 알림톡 템플릿 내용 글자수 체크 및 표시, 미리보기 내용 표시 * * */ function setContentsLeng(contents){ var conLeng = strMaxCharacterCnt(contents); if(conLeng > 1000){ alert("알림톡 내용은 1000자를 넘을 수 없습니다."); var splicecon = strMaxLengthSubstring(contents, 999); $('#inputTemplateContent').val(splicecon); return false; }else{//현재 입력한 글자수 우측 하단에 표시해 주기 var repContent = ""; repContent = contents.replace(/(?:\r\n|\r|\n)/g, '
'); $('.nowChar').text(conLeng + " /"); $('.template_text').show(); if(repContent != ''){ $('.template_text').text(repContent); }else{ $('.template_text').text("내용 미리보기"); } } } /** * 친구톡 템플릿 내용 글자수 체크 및 표시, 미리보기 내용 표시 * * */ function setContentsLengForFriends(contents){ var conLeng = strMaxCharacterCnt(contents); var imageType = $("input[name=img_file_add]:checked").val(); var limitLeng = 1000; if(imageType == 'I'){ limitLeng = 400; if(conLeng > limitLeng){ alert("일반 이미지 첨부시 친구톡 내용은 400자를 넘을 수 없습니다."); } }else if(imageType == 'W'){ limitLeng = 76; if(conLeng > limitLeng){ alert("와이드 이미지 첨부시 친구톡 내용은 76자를 넘을 수 없습니다."); } }else if(conLeng > 1000){ alert("친구톡 내용은 1000자를 넘을 수 없습니다."); } if(conLeng > limitLeng){ var splicecon = strMaxLengthSubstring(contents, limitLeng-1); $('#inputTemplateContent').val(splicecon); return false; }else{//현재 입력한 글자수 우측 하단에 표시해 주기 var repContent = ""; repContent = contents.replace(/(?:\r\n|\r|\n)/g, '
'); $('.nowChar').text(conLeng + " /"); $('.totChar').text(" "+limitLeng); $('.template_text').show(); if(repContent != ''){ $('.template_text').html(repContent); }else{ $('.template_text').html("내용 미리보기"); } } }