Skip to content

Commit

Permalink
Format response json in pretty format on success response.
Browse files Browse the repository at this point in the history
  • Loading branch information
rottmann committed Feb 12, 2016
1 parent c7d78bb commit 1b12909
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ doc/
node_modules/
tmp/
npm-debug.log
.idea
14 changes: 4 additions & 10 deletions template/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,11 @@ pre code {
white-space: pre;
}

/*
pre.language-json {
background: #f5f5f5;
border: #e0e0e0 1px solid;
}
pre.language-json .pln,
pre.language-json .pun {
color: #3a3a3a;
pre code.sample-request-response-json {
white-space: pre-wrap;
max-height: 500px;
overflow: auto;
}
*/

/* ------------------------------------------------------------------------------------------
* Sidenav
Expand Down
5 changes: 3 additions & 2 deletions template/utils/send_sample_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ define([
return queryParms;
}

function displaySuccess(data) {
function displaySuccess(data, status, jqXHR) {
var jsonResponse;
try {
jsonResponse = JSON.stringify(data, null, 4);
jsonResponse = JSON.parse(jqXHR.responseText);
jsonResponse = JSON.stringify(jsonResponse, null, 4);
} catch (e) {
jsonResponse = data;
}
Expand Down

0 comments on commit 1b12909

Please sign in to comment.