Browse Source

post formatting for DM snippets

master
Simon Grim 9 years ago
parent
commit
b2824aced9
  1. 5
      js/twister_formatpost.js

5
js/twister_formatpost.js

@ -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…
Cancel
Save