[ease/inspector: 2/4] Cleaned up some HTML output code in Document.vala



commit 05cac06f35a4380ec34f7861ee1d3f57bc0a42aa
Author: Nate Stedman <natesm gmail com>
Date:   Wed Jun 2 22:26:19 2010 -0400

    Cleaned up some HTML output code in Document.vala

 src/Document.vala |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)
---
diff --git a/src/Document.vala b/src/Document.vala
index 101c5f4..7873314 100644
--- a/src/Document.vala
+++ b/src/Document.vala
@@ -103,18 +103,30 @@ public class Ease.Document : GLib.Object
 		}
 	
 		// intialize the html string
-		var html = "<!DOCTYPE html>\n<html>\n";
-		
-		// make the header
-		html += "<head>\n<title>Presentation</title>\n" + HTMLExporter.js;
-		html += "<style>\n.slide {\ndisplay:none;\nwidth:" + width.to_string() +
-		        "px;\noverflow:hidden;height:" + height.to_string() +
-		        "px; position: relative;margin: 20px auto 20px auto}\n" + 
-		        "html { padding: 0px; margin: 0px; background-color:" +
-		        "black;}\n</style>\n</head>\n";
-		
-		// make the body
-		html += "<body onload=\"load()\">\n";
+		var html = """<!DOCTYPE html>
+<html>
+<head>
+	<title>Presentation</title>
+	%s
+	<style>
+		.slide {
+			width: %ipx;
+			height: %ipx;
+			display: none;
+			overflow: hidden;
+			position: relative;
+			margin: 20px auto 20px auto;
+		}
+		html {
+			padding: 0px;
+			margin: 0px;
+			background-color: black;
+		}
+	</style>
+</head>
+<body onload=load()>""".printf(exporter.js, width, height);
+	
+		// substitute in the values
 		
 		// add each slide
 		for (var i = 0; i < slides.size; i++)
@@ -123,7 +135,7 @@ public class Ease.Document : GLib.Object
 		}
 		
 		// finish the document
-		html += "</body>\n</html>\n";
+		html += "\n</body>\n</html>\n";
 		
 		// write the document to file
 		try



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]