Sha256: be795587be84846f10b99c37ce6f3eaffa6b8dfacc33a406530ef10f31a485a7

Contents?: true

Size: 604 Bytes

Versions: 6

Compression:

Stored size: 604 Bytes

Contents

jQuery ($)->
  commentNode = (comment) ->
    container = $("<div>").addClass("comment-container")
    container.append $("<div>").addClass("comment-author").text(comment.user.login)
    container.append $("<abbr>").addClass("comment-time").prop("title", comment.updated_at).timeago()
    container.append $("<div>").addClass("comment-content").html(markdown.toHTML(comment.body))
  $.ajax
    dataType: 'jsonp',
    url: $('#post-view').data('comments-url')
    success: (response) ->
      $("#comments").text("")
      for comment in response.data
        $("#comments").append(commentNode(comment))

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
write-0.2.5 app/assets/javascripts/write/comments.js.coffee
write-0.2.4 app/assets/javascripts/write/comments.js.coffee
write-0.2.3 app/assets/javascripts/write/comments.js.coffee
write-0.2.2 app/assets/javascripts/write/comments.js.coffee
write-0.2.1 app/assets/javascripts/write/comments.js.coffee
write-0.2.0 app/assets/javascripts/write/comments.js.coffee