Permalink
Browse files

Correctly escape displayed json values and put response in window.API…

…_RESPONSE

Summary: add window.API_RESPONSE variable which contains the preformated api response and some helpful tips on the homepage about it. The original rationale behind escaping the displayed json was that it's probably not so unfathomable that a person using the explorer would try to parse the #response_body variable, but it's actually not encoded correctly. In any way, to discourage that (and to encourage actually poking of the api) i'm exposing the response json in a variable which gets set after each call is made.

Test Plan:
$.parseJSON($("#response_body").text()) works.
additionally, and more usefully, window.API_RESPONSE is available for perusing rather than mucking with #response_body.

Reviewers: kamens

Reviewed By: kamens

Differential Revision: http://phabricator.khanacademy.org/D975
  • Loading branch information...
1 parent 080c67e commit f116c917c37915957e5e34640311b05f1686d82d @nsfmc nsfmc committed Dec 9, 2012
Showing with 194 additions and 183 deletions.
  1. +1 −0 .gitignore
  2. +138 −136 explorer/static/js/api_explorer.js
  3. +30 −26 explorer/static/js/pretty_json.js
  4. +25 −21 explorer/templates/index.html
View
@@ -1 +1,2 @@
*.pyc
+secrets.py
Oops, something went wrong.

0 comments on commit f116c91

Please sign in to comment.