Add highlighting back in

This commit is contained in:
Matthew Mongeau
2012-08-30 17:46:23 -04:00
parent 88100bf79f
commit 3521d42175
3 changed files with 4 additions and 5 deletions

View File

@@ -429,13 +429,13 @@ if Backbone?
display_body: ->
if @has("highlighted_body")
@get("highlighted_body")
String(@get("highlighted_body")).replace(/<highlight>/g, '<mark>').replace(/<\/highlight>/g, '</mark>')
else
@get("body")
display_title: ->
if @has("highlighted_title")
@get("highlighted_title")
String(@get("highlighted_title")).replace(/<highlight>/g, '<mark>').replace(/<\/highlight>/g, '</mark>')
else
@get("title")

View File

@@ -64,9 +64,7 @@ class @DiscussionThreadListView extends Backbone.View
url: url
type: "GET"
success: (response, textStatus) =>
console.log textStatus
if textStatus == 'success'
@collection.reset(response.discussion_data)
console.log(@collection)
@delay(callback, 300)

View File

@@ -6,6 +6,7 @@ class @DiscussionThreadView extends Backbone.View
template: _.template($("#thread-template").html())
render: ->
console.log(@model)
@$el.html(@template(@model.toJSON()))
@model.bind "change", @updateModelDetails
if window.user.following(@model)
@@ -24,7 +25,7 @@ class @DiscussionThreadView extends Backbone.View
convertMath: ->
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")]
renderResponses: ->