mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-27 23:24:26 +00:00
post formatting for DM snippets
This commit is contained in:
parent
fb67d7a04d
commit
b2824aced9
@ -8,7 +8,7 @@ var _htmlFormatMsgLinkTemplateUser;
|
|||||||
var _htmlFormatMsgLinkTemplateHashtag;
|
var _htmlFormatMsgLinkTemplateHashtag;
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// we're setting it here for perfomance improvement purpose // to not search and prepare it for for every post
|
// we're setting it here for perfomance improvement purpose // to not search and prepare it for for every post every time
|
||||||
_htmlFormatMsgLinkTemplateExternal = $('#external-page-link-template')[0].cloneNode();
|
_htmlFormatMsgLinkTemplateExternal = $('#external-page-link-template')[0].cloneNode();
|
||||||
_htmlFormatMsgLinkTemplateExternal.removeAttribute('id');
|
_htmlFormatMsgLinkTemplateExternal.removeAttribute('id');
|
||||||
_htmlFormatMsgLinkTemplateUser = $('#msg-user-link-template')[0].cloneNode();
|
_htmlFormatMsgLinkTemplateUser = $('#msg-user-link-template')[0].cloneNode();
|
||||||
@ -185,7 +185,7 @@ function dmDataToSnippetItem(dmData, remoteUser) {
|
|||||||
getGroupChatName( remoteUser, dmItem.find("a.post-info-name") );
|
getGroupChatName( remoteUser, dmItem.find("a.post-info-name") );
|
||||||
else
|
else
|
||||||
getFullname( remoteUser, dmItem.find("a.post-info-name") );
|
getFullname( remoteUser, dmItem.find("a.post-info-name") );
|
||||||
dmItem.find(".post-text").html(escapeHtmlEntities(dmData.text));
|
dmItem.find(".post-text").html(htmlFormatMsg(dmData.text));
|
||||||
dmItem.find(".post-info-time").text(timeGmtToText(dmData.time)).attr("title",timeSincePost(dmData.time));
|
dmItem.find(".post-info-time").text(timeGmtToText(dmData.time)).attr("title",timeSincePost(dmData.time));
|
||||||
|
|
||||||
return dmItem;
|
return dmItem;
|
||||||
@ -652,4 +652,3 @@ function reverseHtmlEntities(str) {
|
|||||||
.replace(/'/g, "'")
|
.replace(/'/g, "'")
|
||||||
.replace(/&/g, '&');
|
.replace(/&/g, '&');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user