From 8ad9c529b68d1502ba055225da43d60e9f2da0f4 Mon Sep 17 00:00:00 2001 From: jendib Date: Sat, 9 Apr 2016 21:23:55 +0200 Subject: [PATCH] #79: Resource to generate a dynamic CSS --- .../docs/rest/resource/ThemeResource.java | 29 +++++++++++++++++++ docs-web/src/main/webapp/src/index.html | 1 + docs-web/src/main/webapp/src/share.html | 1 + .../sismics/docs/rest/TestThemeResource.java | 21 ++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java create mode 100644 docs-web/src/test/java/com/sismics/docs/rest/TestThemeResource.java diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java new file mode 100644 index 00000000..a8f72deb --- /dev/null +++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java @@ -0,0 +1,29 @@ +package com.sismics.docs.rest.resource; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Response; + +/** + * Theme REST resources. + * + * @author bgamard + */ +@Path("/theme") +public class ThemeResource extends BaseResource { + /** + * Returns custom CSS stylesheet. + * + * @return Response + */ + @GET + @Path("/stylesheet") + @Produces("text/css") + public Response stylesheet() { + StringBuilder sb = new StringBuilder(); + sb.append("body {\n"); + sb.append("}"); + return Response.ok().entity(sb.toString()).build(); + } +} diff --git a/docs-web/src/main/webapp/src/index.html b/docs-web/src/main/webapp/src/index.html index 7772ef24..15e59c41 100644 --- a/docs-web/src/main/webapp/src/index.html +++ b/docs-web/src/main/webapp/src/index.html @@ -10,6 +10,7 @@ +