You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bval.apache.org by mb...@apache.org on 2012/03/09 23:52:21 UTC

svn commit: r1299091 - /bval/cms-site/trunk/content/resources/blog.js

Author: mbenson
Date: Fri Mar  9 22:52:21 2012
New Revision: 1299091

URL: http://svn.apache.org/viewvc?rev=1299091&view=rev
Log:
attempt to finish script

Modified:
    bval/cms-site/trunk/content/resources/blog.js

Modified: bval/cms-site/trunk/content/resources/blog.js
URL: http://svn.apache.org/viewvc/bval/cms-site/trunk/content/resources/blog.js?rev=1299091&r1=1299090&r2=1299091&view=diff
==============================================================================
--- bval/cms-site/trunk/content/resources/blog.js (original)
+++ bval/cms-site/trunk/content/resources/blog.js Fri Mar  9 22:52:21 2012
@@ -11,27 +11,19 @@ function getBlogEntries(root, space, lim
         if (detailLink) {
           successCount++;
           item = $(prototype).clone();
-          // TODO make sure item is visible
-          var body;
           $.getJSON(detailLink.href, function(data) {
-            body = data.body;
+            $(".detail", item).text(data.body);
           });
 
-          /*
- TODO from item, find elements of specified classes and set text:
-
-  .date : entry.createdDate.friendly
-  .detail : body
-  .title : entry.title
-
-  I wanted to include the blog poster, but I can't find a Confluence API to let me do it
-
-finally, add item to targetElement
-           */
-          
+          $(".date", item).text(entry.createdDate.friendly);
+          $(".title", item).text(entry.title);
+          $(item).show();
+          $(item).appendTo(targetContainer);
         }
       }
-      // TODO if successCount > 0, make sure targetElement is visible
+      if (successCount > 0) {
+        $(targetContainer).show();
+      }
     }
   );
 }