Sam Adams avatar Sam Adams committed 73122bd

Made css pluggable

Comments (0)

Files changed (5)

crystallography-handler/src/main/java/net/chempound/crystal/CrystalCssPlugin.java

+package net.chempound.crystal;
+
+import net.chempound.webapp.plugins.CssPlugin;
+
+/**
+ * @author Sam Adams
+ */
+public class CrystalCssPlugin extends CssPlugin {
+
+    public CrystalCssPlugin() {
+        super("crystal", CrystalCssPlugin.class, "/net/chempound/crystal/css/");
+    }
+
+}

crystallography-handler/src/main/java/net/chempound/crystal/CrystallographyModule.java

     protected void configure() {
         bindContentHandler(CrystalContentType.class);
         bindSearchProvider(CrystalSearchProvider.class);
+        bindCssPlugin(CrystalCssPlugin.class);
     }
 
 }

crystallography-handler/src/main/java/net/chempound/crystal/display/CrystalStructureSplashPageWriter.java

  */
 public class CrystalStructureSplashPageWriter extends AbstractSplashPageWriter {
 
-    private static final String style;
     private static final String headers;
 
     static {
-        style = read("/net/chempound/crystal/includes/style.css");
         headers = read("/net/chempound/crystal/includes/headers.html");
     }
 
 
     @Override
     public String write(final Model model, final URI aggregationUri, final Map<String, Object> map) throws IOException, TemplateException {
-        map.put("style", style);
         map.put("headers", headers);
 
         final BeansWrapper wrapper = BeansWrapper.getDefaultInstance();

crystallography-handler/src/main/resources/net/chempound/crystal/css/crystal.css

+    div.data {
+        width: 580px;
+    }
+
+    div.data dl {
+        margin: 0.5em 0;
+        float:left;
+        width: 520px;
+        padding: 0;
+        clear: left;
+    }
+
+    dl.bib dt {
+        clear: left;
+        float: left;
+        font-weight: bold;
+        width: 140px;
+        margin: 0;
+        padding: 5px;
+    }
+    dl.bib dd {
+        float: left;
+        width: 360px;
+        margin: 0;
+        padding: 5px;
+    }
+
+    dl.data dt {
+        clear: left;
+        float: left;
+        font-weight: bold;
+        width: 220px;
+        margin: 0;
+        padding: 5px;
+    }
+    dl.data dd {
+        float: left;
+        width: 280px;
+        margin: 0;
+        padding: 5px;
+    }
+
+    .data h2 {
+        clear:left;
+    }
+
+
+    dl.identifier dt {
+        clear: left;
+        float: left;
+        font-weight: bold;
+        width: 100px;
+        margin: 0;
+        padding: 5px;
+    }
+    dl.identifier dd {
+        float: left;
+        width: 800px;
+        margin: 0;
+        padding: 5px;
+        word-wrap: break-word;
+    }
+
+    #body h1 {
+        font-size: 140%;
+        padding: 0.2em 0.2em;
+        margin: 0.2em;
+    }
+
+    #body h2 {
+        padding: 0.75em 0 0.25em 0;
+        margin: 0.5em 0 0.25em 0;
+        font-size: 125%;
+        clear: left;
+    }
+
+    dl.identifier dt {
+        color: #808080;
+        font-size: small;
+    }
+
+    dl.identifier dd {
+        color: #a0a0a0;
+        font-size: small;
+    }
+
+    div.jmol {
+        float: right;
+        width: 400px;
+        padding: 0;
+        margin: 0;
+    }
+    div #jmol {
+        height: 400px;
+        background: #d0d0d0;
+    }
+
+    div#jmol img {
+        width: 400px;
+        height: 400px;
+        margin: 0;
+        padding: 0;
+    }

crystallography-handler/src/main/resources/net/chempound/crystal/includes/style.css

-    div.data {
-        width: 580px;
-    }
-
-    div.data dl {
-        margin: 0.5em 0;
-        float:left;
-        width: 520px;
-        padding: 0;
-        clear: left;
-    }
-
-    dl.bib dt {
-        clear: left;
-        float: left;
-        font-weight: bold;
-        width: 140px;
-        margin: 0;
-        padding: 5px;
-    }
-    dl.bib dd {
-        float: left;
-        width: 360px;
-        margin: 0;
-        padding: 5px;
-    }
-
-    dl.data dt {
-        clear: left;
-        float: left;
-        font-weight: bold;
-        width: 220px;
-        margin: 0;
-        padding: 5px;
-    }
-    dl.data dd {
-        float: left;
-        width: 280px;
-        margin: 0;
-        padding: 5px;
-    }
-
-    .data h2 {
-        clear:left;
-    }
-
-
-    dl.identifier dt {
-        clear: left;
-        float: left;
-        font-weight: bold;
-        width: 100px;
-        margin: 0;
-        padding: 5px;
-    }
-    dl.identifier dd {
-        float: left;
-        width: 800px;
-        margin: 0;
-        padding: 5px;
-        word-wrap: break-word;
-    }
-
-    #body h1 {
-        font-size: 140%;
-        padding: 0.2em 0.2em;
-        margin: 0.2em;
-    }
-
-    #body h2 {
-        padding: 0.75em 0 0.25em 0;
-        margin: 0.5em 0 0.25em 0;
-        font-size: 125%;
-        clear: left;
-    }
-
-    dl.identifier dt {
-        color: #808080;
-        font-size: small;
-    }
-
-    dl.identifier dd {
-        color: #a0a0a0;
-        font-size: small;
-    }
-
-    div.jmol {
-        float: right;
-        width: 400px;
-        padding: 0;
-        margin: 0;
-    }
-    div #jmol {
-        height: 400px;
-        background: #d0d0d0;
-    }
-
-    div#jmol img {
-        width: 400px;
-        height: 400px;
-        margin: 0;
-        padding: 0;
-    }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.