메시지 자동 링크

This commit is contained in:
2019-02-03 00:28:29 +09:00
parent d37b9c3c26
commit a2ab0a1173
6 changed files with 11 additions and 2 deletions
+2
View File
@@ -89,6 +89,8 @@ $mapTheme = $admin['map_theme'];
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
<?=WebUtil::printJS('../e_lib/linkify/linkify.min.js')?>
<?=WebUtil::printJS('../e_lib/linkify/linkify-string.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/main.js')?>
+5
View File
@@ -123,6 +123,10 @@ function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function linkifyStrWithOpt(text){
return linkifyStr(text, {});
}
/**
* 단순한 Template 함수. <%변수명%>으로 template 가능
* @see https://github.com/krasimir/absurd/blob/master/lib/processors/html/helpers/TemplateEngine.js
@@ -143,6 +147,7 @@ var TemplateEngine = function (html, options) {
return add;
}
options.e = escapeHtml;
options.linkifyStr = linkifyStrWithOpt;
while (match = re.exec(html)) {
add(html.slice(cursor, match.index))(match[1], true);
cursor = match.index + match[0].length;
+1 -1
View File
@@ -504,7 +504,7 @@ function activateMessageForm(){
jQuery(function($){
//tmp_template.html은 추후 msg.js에 통합될 수 있음
var getTemplate = $.get('js/templates/message.html?10',function(obj){
var getTemplate = $.get('js/templates/message.html?11',function(obj){
messageTemplate = obj;
});
+1 -1
View File
@@ -41,7 +41,7 @@
<%} %>
<span class="msg_time">&lt;<%e(time)%>&gt;</span>
</div>
<div class="msg_content <%invalidType%>"><%e(text)%></div>
<div class="msg_content <%invalidType%>"><%linkifyStr(text)%></div>
<%if(this.option && this.option.action) {%>
<div class="msg_prompt">
<button class="prompt_yes btn_prompt" <%allowButton?'':'disabled="disabled"'%>>>수락</button> <button class="prompt_no btn_prompt" <%allowButton?'':'disabled="disabled"'%>>거절</button>