메시지 자동 링크
This commit is contained in:
1 parent
d37b9c3c26
commit
a2ab0a1173
6 files changed
+11
-2
No files matched your search
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
"use strict";!function(t,r){var n=function(t){function r(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function n(t){return t.replace(/"/g,""")}function e(t){if(!t)return"";var r=[];for(var e in t){var i=t[e]+"";r.push(e+'="'+n(i)+'"')}return r.join(" ")}function i(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i=new a(i);for(var f=o(t),u=[],c=0;c<f.length;c++){var p=f[c];if("nl"===p.type&&i.nl2br)u.push("<br>\n");else if(p.isLink&&i.check(p)){var l=i.resolve(p),s=l.formatted,g=l.formattedHref,y=l.tagName,h=l.className,v=l.target,k=l.attributes,S="<"+y+' href="'+n(g)+'"';h&&(S+=' class="'+n(h)+'"'),v&&(S+=' target="'+n(v)+'"'),k&&(S+=" "+e(k)),S+=">"+r(s)+"</"+y+">",u.push(S)}else u.push(r(p.toString()))}return u.join("")}var o=t.tokenize,f=t.options,a=f.Options;if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{a:function(){},get:function(){return function(t){return i(this,t)}}})}catch(u){String.prototype.linkify||(String.prototype.linkify=function(t){return i(this,t)})}return i}(r);t.linkifyStr=n}(window,linkify);
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
!function(){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};!function(e){function a(n,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=Object.create(n.prototype);for(var o in a)t[o]=a[o];return t.constructor=e,e.prototype=t,e}function t(n){n=n||{},this.defaultProtocol=n.hasOwnProperty("defaultProtocol")?n.defaultProtocol:h.defaultProtocol,this.events=n.hasOwnProperty("events")?n.events:h.events,this.format=n.hasOwnProperty("format")?n.format:h.format,this.formatHref=n.hasOwnProperty("formatHref")?n.formatHref:h.formatHref,this.nl2br=n.hasOwnProperty("nl2br")?n.nl2br:h.nl2br,this.tagName=n.hasOwnProperty("tagName")?n.tagName:h.tagName,this.target=n.hasOwnProperty("target")?n.target:h.target,this.validate=n.hasOwnProperty("validate")?n.validate:h.validate,this.ignoreTags=[],this.attributes=n.attributes||n.linkAttributes||h.attributes,this.className=n.hasOwnProperty("className")?n.className:n.linkClass||h.className;for(var e=n.hasOwnProperty("ignoreTags")?n.ignoreTags:h.ignoreTags,a=0;a<e.length;a++)this.ignoreTags.push(e[a].toUpperCase())}function o(n,e){for(var a=0;a<n.length;a++)if(n[a]===e)return!0;return!1}function r(n){return n}function i(n,e){return"url"===e?"_blank":null}function s(){return function(n){this.j=[],this.T=n||null}}function c(n,e,a,t){for(var o=0,r=n.length,i=e,s=[],cLine truncated
|
||||||
@@ -89,6 +89,8 @@ $mapTheme = $admin['map_theme'];
|
|||||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/moment.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('../d_shared/common_path.js')?>
|
||||||
<?=WebUtil::printJS('js/common.js')?>
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
<?=WebUtil::printJS('js/main.js')?>
|
<?=WebUtil::printJS('js/main.js')?>
|
||||||
|
|||||||
@@ -123,6 +123,10 @@ function numberWithCommas(x) {
|
|||||||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function linkifyStrWithOpt(text){
|
||||||
|
return linkifyStr(text, {});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 단순한 Template 함수. <%변수명%>으로 template 가능
|
* 단순한 Template 함수. <%변수명%>으로 template 가능
|
||||||
* @see https://github.com/krasimir/absurd/blob/master/lib/processors/html/helpers/TemplateEngine.js
|
* @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;
|
return add;
|
||||||
}
|
}
|
||||||
options.e = escapeHtml;
|
options.e = escapeHtml;
|
||||||
|
options.linkifyStr = linkifyStrWithOpt;
|
||||||
while (match = re.exec(html)) {
|
while (match = re.exec(html)) {
|
||||||
add(html.slice(cursor, match.index))(match[1], true);
|
add(html.slice(cursor, match.index))(match[1], true);
|
||||||
cursor = match.index + match[0].length;
|
cursor = match.index + match[0].length;
|
||||||
|
|||||||
+1
-1
@@ -504,7 +504,7 @@ function activateMessageForm(){
|
|||||||
jQuery(function($){
|
jQuery(function($){
|
||||||
|
|
||||||
//tmp_template.html은 추후 msg.js에 통합될 수 있음
|
//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;
|
messageTemplate = obj;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<%} %>
|
<%} %>
|
||||||
<span class="msg_time"><<%e(time)%>></span>
|
<span class="msg_time"><<%e(time)%>></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="msg_content <%invalidType%>"><%e(text)%></div>
|
<div class="msg_content <%invalidType%>"><%linkifyStr(text)%></div>
|
||||||
<%if(this.option && this.option.action) {%>
|
<%if(this.option && this.option.action) {%>
|
||||||
<div class="msg_prompt">
|
<div class="msg_prompt">
|
||||||
<button class="prompt_yes btn_prompt" <%allowButton?'':'disabled="disabled"'%>>>수락</button> <button class="prompt_no btn_prompt" <%allowButton?'':'disabled="disabled"'%>>거절</button>
|
<button class="prompt_yes btn_prompt" <%allowButton?'':'disabled="disabled"'%>>>수락</button> <button class="prompt_no btn_prompt" <%allowButton?'':'disabled="disabled"'%>>거절</button>
|
||||||
|
|||||||
Reference in new issue
Block a user