Commit ebbce32e by Matthew Mongeau

Add highlighting back in

parent 7183991f
...@@ -429,13 +429,13 @@ if Backbone? ...@@ -429,13 +429,13 @@ if Backbone?
display_body: -> display_body: ->
if @has("highlighted_body") if @has("highlighted_body")
@get("highlighted_body") String(@get("highlighted_body")).replace(/<highlight>/g, '<mark>').replace(/<\/highlight>/g, '</mark>')
else else
@get("body") @get("body")
display_title: -> display_title: ->
if @has("highlighted_title") if @has("highlighted_title")
@get("highlighted_title") String(@get("highlighted_title")).replace(/<highlight>/g, '<mark>').replace(/<\/highlight>/g, '</mark>')
else else
@get("title") @get("title")
......
...@@ -64,9 +64,7 @@ class @DiscussionThreadListView extends Backbone.View ...@@ -64,9 +64,7 @@ class @DiscussionThreadListView extends Backbone.View
url: url url: url
type: "GET" type: "GET"
success: (response, textStatus) => success: (response, textStatus) =>
console.log textStatus
if textStatus == 'success' if textStatus == 'success'
@collection.reset(response.discussion_data) @collection.reset(response.discussion_data)
console.log(@collection)
@delay(callback, 300) @delay(callback, 300)
...@@ -6,6 +6,7 @@ class @DiscussionThreadView extends Backbone.View ...@@ -6,6 +6,7 @@ class @DiscussionThreadView extends Backbone.View
template: _.template($("#thread-template").html()) template: _.template($("#thread-template").html())
render: -> render: ->
console.log(@model)
@$el.html(@template(@model.toJSON())) @$el.html(@template(@model.toJSON()))
@model.bind "change", @updateModelDetails @model.bind "change", @updateModelDetails
if window.user.following(@model) if window.user.following(@model)
...@@ -24,7 +25,7 @@ class @DiscussionThreadView extends Backbone.View ...@@ -24,7 +25,7 @@ class @DiscussionThreadView extends Backbone.View
convertMath: -> convertMath: ->
element = @$(".post-body") element = @$(".post-body")
element.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight element.html() element.html DiscussionUtil.postMathJaxProcessor(element.html())
MathJax.Hub.Queue ["Typeset", MathJax.Hub, element.attr("id")] MathJax.Hub.Queue ["Typeset", MathJax.Hub, element.attr("id")]
renderResponses: -> renderResponses: ->
......
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