]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Display rendered HTML for a notice
authorEvan Prodromou <evan@controlyourself.ca>
Mon, 27 Apr 2009 00:50:39 +0000 (20:50 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Mon, 27 Apr 2009 00:50:39 +0000 (20:50 -0400)
Display the rendered HTML for a notice

plugins/Comet/CometPlugin.php
plugins/Comet/updatetimeline.js

index cff0d4c9d63fc2e52f2511a09d2a2d8985cbc286..2e0bb40a46ce3ffeb0b1baab1495a16fa982776f 100644 (file)
@@ -143,6 +143,7 @@ class CometPlugin extends Plugin
 
         $arr = $act->twitter_status_array($notice, true);
         $arr['url'] = $notice->bestUrl();
+        $arr['html'] = htmlspecialchars($notice->rendered);
 
         $profile = $notice->getProfile();
         $arr['user']['profile_url'] = $profile->profileurl;
index c6eefb4475bf2cd1f247b956e10fbcda92452e77..55511d35ff08485ba50849981e139549ad831ad2 100644 (file)
@@ -34,6 +34,8 @@ var updater = function()
      function makeNoticeItem(data)
      {
           user = data['user'];
+          html = data['html'].replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+
           ni = "<li class=\"hentry notice\" id=\"notice-"+data['id']+"\">"+
                "<div class=\"entry-title\">"+
                "<span class=\"vcard author\">"+
@@ -42,7 +44,7 @@ var updater = function()
                "<span class=\"nickname fn\">"+user['screen_name']+"</span>"+
                "</a>"+
                "</span>"+
-               "<p class=\"entry-content\">"+data['text']+"</p>"+
+               "<p class=\"entry-content\">"+html+"</p>"+
                "</div>"+
                "<div class=\"entry-content\">"+
                "<dl class=\"timestamp\">"+