From f4b8f18a8a48646ff23de6791bbf79d2fcc69b67 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Tue, 17 Jun 2014 09:18:37 -0400 Subject: [PATCH] Make highlighting optional --- .../rest/server/tester/RestfulTesterServlet.java | 4 +++- .../fhir/rest/server/tester/RestfulTester.html | 16 ++++++++++++++-- .../uhn/fhir/rest/server/tester/css/tester.css | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/tester/RestfulTesterServlet.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/tester/RestfulTesterServlet.java index 655c69e119f..bf68879ff17 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/tester/RestfulTesterServlet.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/tester/RestfulTesterServlet.java @@ -493,7 +493,9 @@ public class RestfulTesterServlet extends HttpServlet { requestBody = StringEscapeUtils.escapeHtml4(requestBody); theContext.setVariable("requestBody", requestBody); theContext.setVariable("requestSyntaxHighlighterClass", requestSyntaxHighlighterClass); - theContext.setVariable("resultBody", StringEscapeUtils.escapeHtml4(resultBody)); + String resultBodyText = StringEscapeUtils.escapeHtml4(resultBody); + theContext.setVariable("resultBody", resultBodyText); + theContext.setVariable("resultBodyIsLong", resultBodyText.length() > 1000); theContext.setVariable("resultSyntaxHighlighterClass", resultSyntaxHighlighterClass); theContext.setVariable("requestHeaders", requestHeaders); theContext.setVariable("responseHeaders", responseHeaders); diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/RestfulTester.html b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/RestfulTester.html index 37d880c4ef1..3ad497bcde2 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/RestfulTester.html +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/RestfulTester.html @@ -927,13 +927,25 @@ Result Body + +
...loading...
-
-
{}
+ diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/css/tester.css b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/css/tester.css index 56106d0b1dd..c13b2f5e5fd 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/css/tester.css +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/rest/server/tester/css/tester.css @@ -91,6 +91,7 @@ PRE.resultBodyPre { line-height: 0.9em; font-size: 0.8em; border: none; + background-color: transparent; } /*