Commit 0129be36 by Matthew Mongeau

Get highlighting working.

parent ffab52be
......@@ -23,6 +23,8 @@ class @DiscussionThreadView extends DiscussionContentView
Markdown.makeWmdEditor @$(".reply-body"), "", DiscussionUtil.urlFor("upload"), (text) -> DiscussionUtil.postMathJaxProcessor(text)
@convertMath()
@renderResponses()
@highlight @$(".post-body")
@highlight @$("h1")
@
renderDogear: ->
......@@ -151,3 +153,6 @@ class @DiscussionThreadView extends DiscussionContentView
type: "POST"
success: (response, textStatus) =>
@model.set('endorsed', not endorsed)
highlight: (el) ->
el.html(el.html().replace(/&lt;mark&gt;/g, "<mark>").replace(/&lt;\/mark&gt;/g, "</mark>"))
......@@ -12,6 +12,7 @@ class @ThreadListItemView extends Backbone.View
@$el.html(@template(@model.toJSON()))
if window.user.following(@model)
@follow()
@highlight @$(".title")
@
threadSelected: (event) ->
event.preventDefault()
......@@ -25,3 +26,6 @@ class @ThreadListItemView extends Backbone.View
addComment: =>
@$(".comments-count").html(parseInt(@$(".comments-count").html()) + 1)
highlight: (el) ->
el.html(el.html().replace(/&lt;mark&gt;/g, "<mark>").replace(/&lt;\/mark&gt;/g, "</mark>"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment