atuttle/Taffy — pull request #230 by MWers (2014-09-11 05:50:53+00:00)
Title: Dashboard JSON response syntax highlighting

Pull request for issue atuttle/Taffy#229.

A quick overview of the changes:

1. Within `dashboard/dashboard.cfm`, I added lines to import the highlight.js javascript and css files. I also added a line to initialize highlight.js at the top of the jQuery ready function.

2. Within `dashboard/dash.js`, I check to see if highlight.js (aka `hljs`) is available and if so, I syntax highlight the JSON, convert newlines to `
`, and convert leading spaces to ` `. I convert only leading spaces rather than all spaces to ` ` to avoid interfering with html generated in syntax highlighting.

3. Also in `dashboard/dashboard.cfm`, I needed to modify lines 469, 475-477 to get Taffy v3.0.0-alpha to properly issue requests from my dashboard. My dev instance runs at port `:7024` and the previous code resulted in the request url being something like this: `http://my.dev.instance.com:7024:7024:7024/...`. `window.location.host` should already contain the port if it's non-standard so the extra `window.location.port` code shouldn't be necessary.

Thanks!