post.js 768 B

12345678910111213141516171819202122
  1. (function (post, thread, index) {
  2. var seen =
  3. thread && (index === Number(index)) &&
  4. $.state.lastSeenPosts()[thread.id] > index;
  5. var media = post.media ? $.h(".postMedia", _.media(post.media)) : null
  6. , body = $.h(".postBody",
  7. [ //$.h("img.postUserPic", { src: "http://www.placecage.com/c/32/32" })
  8. , $.h(".postInfo",
  9. [ $.h(".postUserName", post.user || $.h("em", "onanimus"))
  10. , $.h("a.postDate", { href: "#post_" + post.id }, String(post.time))
  11. , post.trip ? " - " : null
  12. , post.trip ? $.h("span.postTripCode", post.trip) : null ])
  13. , $.h(".postText", { innerHTML: $.util.markdown(post.text) })
  14. ])
  15. return $.h(".post#post_" + post.id + (seen ? "" : ".notSeen"),
  16. [media, body]);
  17. })