Add syntax highlighting styles & highlight threshold.

Previously, highlighting classes were being added to the DOM but had no CSS
so the user just saw black - a lot of CPU usage for nothing.

These styles now attractively and minimally style resposes so long as
they are below a certain threshold, as well as model schemas.

The highlightSizeThreshold fixes the long hang users would
see when large responses were returned.
This commit is contained in:
Samuel Reed 2014-10-07 11:07:41 +02:00
parent 64c25a8c3c
commit ad68695009
2 changed files with 15 additions and 1 deletions

View File

@ -21,6 +21,19 @@
bottom: -30px; bottom: -30px;
} }
/* JSON syntax highlighting */
.json, .json .attribute {
color: black;
}
.json .value .string {
color: #800;
}
.json .value .number, .json .value .literal {
color: #080;
}
/* /*
FIXME: Separate the overrides from the rest of the styles, rather than override screen.css entirely. FIXME: Separate the overrides from the rest of the styles, rather than override screen.css entirely.
*/ */

View File

@ -26,7 +26,8 @@ $(function() {
log('Unable to Load SwaggerUI'); log('Unable to Load SwaggerUI');
log(data); log(data);
}, },
docExpansion: 'none' docExpansion: 'none',
highlightSizeThreshold: 16384
}); });
$('#explore').click(setAccessToken); $('#explore').click(setAccessToken);