[freenet-cvs] r14738 - in trunk/plugins/Echo/src: plugins/echo resources

fred at freenetproject.org fred at freenetproject.org
Fri Aug 17 09:00:04 UTC 2007


Author: fred
Date: 2007-08-17 09:00:02 +0000 (Fri, 17 Aug 2007)
New Revision: 14738

Added:
   trunk/plugins/Echo/src/resources/style.css
Modified:
   trunk/plugins/Echo/src/plugins/echo/Echo.java
   trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java
Log:
extract the css style sheet in the output dir

Modified: trunk/plugins/Echo/src/plugins/echo/Echo.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/Echo.java	2007-08-17 00:27:51 UTC (rev 14737)
+++ trunk/plugins/Echo/src/plugins/echo/Echo.java	2007-08-17 09:00:02 UTC (rev 14738)
@@ -265,17 +265,18 @@
 			Element pub = new Element("publish");
 			page = new Page(pub);
 			
-// 			page.setTitle(i18n.getString("echo.action.publish"));
+			page.setTitle(i18n.getString("echo.action.publish"));
 			
-// 			try {
-// 				SiteGenerator test = new SiteGenerator();
-// 				test.generate();
-// 
-// 				pub.addAttribute(new Attribute("outputdir",(new File(BASE_DIR.getPath() + File.separator + "out")).getAbsolutePath() + "/"));
-// 				
-// 			} catch (Exception e) {
-// 				page.appendError(e.getMessage());
-// 			}
+			try {
+				SiteGenerator test = new SiteGenerator();
+				test.generate();
+
+				pub.addAttribute(new Attribute("outputdir",(new File(BASE_DIR.getPath() + File.separator + "out")).getAbsolutePath() + "/"));
+				
+			} catch (Exception e) {
+				e.printStackTrace();
+				page.appendError(e.getMessage());
+			}
 		} else if ("configure".equals(fileName)) {
 			
 			Element configure = new Element("configure");

Modified: trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java	2007-08-17 00:27:51 UTC (rev 14737)
+++ trunk/plugins/Echo/src/plugins/echo/SiteGenerator.java	2007-08-17 09:00:02 UTC (rev 14738)
@@ -80,5 +80,18 @@
 			writeToFile(transform.transform(new Document(index)), "category-" + category + ".html");
 		}
 		
+		
+		InputStream in = getClass().getResourceAsStream("/style.css");
+		FileOutputStream cssFile = new FileOutputStream(OUT_DIR.getPath() + File.separator + "style.css");
+		
+		byte[] buffer = new byte[1024];
+		int read;
+		while((read = in.read(buffer)) != -1) {
+			cssFile.write(buffer, 0, read);
+		}
+		
+		in.close();
+		cssFile.close();
+		
 	}
 }
\ No newline at end of file

Added: trunk/plugins/Echo/src/resources/style.css
===================================================================
--- trunk/plugins/Echo/src/resources/style.css	                        (rev 0)
+++ trunk/plugins/Echo/src/resources/style.css	2007-08-17 09:00:02 UTC (rev 14738)
@@ -0,0 +1,90 @@
+
+html {
+	font-family: Tahoma, sans-serif;
+}
+
+body {
+	margin:0;
+	background-color: #ddd;
+	font-size:0.9em;
+}
+
+h1, h2, h3{
+}
+
+a {
+	text-decoration: none;
+	color:#6da0de;
+}
+
+a:hover {
+	text-decoration: underline;
+}
+
+h2 a {
+	color:black;
+}
+
+#container {
+	width: 760px;
+	margin: 0 auto;
+	background-color:white;
+	padding-top:20px;
+	padding-bottom:10px;
+}
+
+#header {
+	color:white;
+	background-color: #3371a3;
+	padding:30px;
+	margin-bottom: 20px;
+}
+
+#main {
+	float: left;
+	width: 550px;
+	padding-left:10px;
+}
+
+#right {
+	margin: 0;
+	padding: 0;
+	width: 180px;
+	float: right;
+}
+
+
+#footer {
+	clear: both;
+	background-color: #ddd;
+}
+
+h1#blog-title {
+	margin:0;
+}
+
+h1#blog-title a {
+	color:white;
+}
+
+ul.block {
+	list-style-type: none;
+	margin: 0;
+	padding: 0;
+}
+
+div.meta {
+
+	
+}
+
+div.meta ul.categories {
+	list-style-type: none;
+	display:inline;
+	padding:0;
+}
+
+div.meta ul.categories li {
+	display: inline;
+	padding-right: 0.5em;
+}
\ No newline at end of file




More information about the cvs mailing list