Added proper formatting for hal+json Content-Type responses in coffeescript source file

This commit is contained in:
tomrac87
2013-09-02 10:02:26 +02:00
parent 5f4eec1b8a
commit ff05f9113b

View File

@@ -192,7 +192,7 @@ class OperationView extends Backbone.View
if content == undefined if content == undefined
code = $('<code />').text("no content") code = $('<code />').text("no content")
pre = $('<pre class="json" />').append(code) pre = $('<pre class="json" />').append(code)
else if contentType.indexOf("application/json") == 0 else if contentType.indexOf("application/json") == 0 || contentType.indexOf("application/hal+json") == 0
code = $('<code />').text(JSON.stringify(JSON.parse(content), null, 2)) code = $('<code />').text(JSON.stringify(JSON.parse(content), null, 2))
pre = $('<pre class="json" />').append(code) pre = $('<pre class="json" />').append(code)
else if contentType.indexOf("application/xml") == 0 else if contentType.indexOf("application/xml") == 0