community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1663766 - /comdev/reporter.apache.org/site/render.js
Date Tue, 03 Mar 2015 19:08:24 GMT
Author: humbedooh
Date: Tue Mar  3 19:08:24 2015
New Revision: 1663766

URL: http://svn.apache.org/r1663766
Log:
wrap lines to 80 chars, reflow if needed

Modified:
    comdev/reporter.apache.org/site/render.js

Modified: comdev/reporter.apache.org/site/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/render.js?rev=1663766&r1=1663765&r2=1663766&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/render.js (original)
+++ comdev/reporter.apache.org/site/render.js Tue Mar  3 19:08:24 2015
@@ -149,7 +149,23 @@ function buildPanel(pmc, title) {
 }
 
 function addLine(pmc, line) {
-    templates[pmc] += (line ? line : "") + "\n"
+	line = line ? line : "  "
+	var lines = line.split(/\n/)
+	for (x in lines) {
+		var xline = lines[x]
+		var words = xline.split(" ")
+		var len = 0;
+		var out = ""
+		for (i in words) {
+			len += words[i].length + (i == words.length-1 ? 0 : 1)
+			if (len >= 80) {
+				out += "\n  "
+				len = words[i].length + (i == words.length-1 ? 0 : 1)
+			}
+			out += words[i] + " "
+		}
+		templates[pmc] += out + "\n"
+    }
 }
 
 function renderFrontPage(json) {



Mime
View raw message