r9513 - in apps/gobi/trunk/code/Page: . skins

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <[email protected]>
Author: hannes
Date: 2009-02-17 20:54:14 +0100 (Tue, 17 Feb 2009)
New Revision: 9513

Modified:
   apps/gobi/trunk/code/Page/PageMacros.js
   apps/gobi/trunk/code/Page/skins/stylesheet.skin
   apps/gobi/trunk/code/Page/skins/toc.skin
Log:
Make TOC list type configurable in toc_macro, and give consistent style to TOC links.

Details at http://dev.helma.org/trac/helma/changeset/9513

Modified: apps/gobi/trunk/code/Page/PageMacros.js
===================================================================
--- apps/gobi/trunk/code/Page/PageMacros.js	2009-02-17 19:11:40 UTC (rev 9512)
+++ apps/gobi/trunk/code/Page/PageMacros.js	2009-02-17 19:54:14 UTC (rev 9513)
@@ -496,16 +496,17 @@
     }
     var headers = res.data["headers_" + this._id];
     if (headers.length > 1) {
-        var itemPrefix = "<li>";
-        var itemSuffix = param.itemprefix || "</li>";
-        var listType = headers.min;
+        var listtype = param.listtype || "ul";
+        var starttag = "<" + listtype +">";
+        var endtag = "</" + listtype + ">"
+        var listlevel = headers.min;
         for (var i = 0; i < headers.length; i++) {
             var header = headers[i];
-            for (var j = header.type; j > listType; j--)
-                res.write("<ul>");
-            for (var j = header.type; j < listType; j++)
-                res.write("</ul>");
-            listType = header.type;
+            for (var j = header.type; j > listlevel; j--)
+                res.write(starttag);
+            for (var j = header.type; j < listlevel; j++)
+                res.write(endtag);
+            listlevel = header.type;
             res.write("<li>");
             res.write("<a href='#");
             res.write(header.anchorName);
@@ -514,8 +515,8 @@
             res.write("</a>")
             res.write("</li>");
         }
-        for (var j = listType; j > headers.min; j--)
-            res.write("</ul>");
+        for (var j = listlevel; j > headers.min; j--)
+            res.write(endtag);
         if (param.prefix && param.prefix.indexOf("<%") > -0) {
             param.prefix = renderSkinAsString(createSkin(param.prefix));
         }

Modified: apps/gobi/trunk/code/Page/skins/stylesheet.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/stylesheet.skin	2009-02-17 19:11:40 UTC (rev 9512)
+++ apps/gobi/trunk/code/Page/skins/stylesheet.skin	2009-02-17 19:54:14 UTC (rev 9513)
@@ -415,6 +415,7 @@
 
   .toc a {
       color: #669;
+      text-decoration: none;
   }
 
   .comments {
@@ -458,7 +459,7 @@
      white-space:nowrap;
   }
 
-  ul li div.marker {
+  ul.files li div.marker {
      float:left;
      border:1px solid #999;
      width:0.8em;
@@ -466,17 +467,17 @@
      margin:5px 5px 0 0;
      overflow:hidden;
   }
-  ul li div.added {
+  ul.files li div.added {
      background-color:#339933;
   }
-  ul li div.deleted {
+  ul.files li div.deleted {
      background-color:#dd0033;
   }
-  ul li div.modified {
+  ul.files li div.modified {
      background-color:#ffcc00;
   }
 
-  ul li a {
+  ul.files li a {
      text-decoration:none;
   }
 

Modified: apps/gobi/trunk/code/Page/skins/toc.skin
===================================================================
--- apps/gobi/trunk/code/Page/skins/toc.skin	2009-02-17 19:11:40 UTC (rev 9512)
+++ apps/gobi/trunk/code/Page/skins/toc.skin	2009-02-17 19:54:14 UTC (rev 9513)
@@ -1,4 +1,5 @@
 <% this.toc
+    listtype="ol"
     prefix="<div class='toc'><h3>Contents <span class='editlink'>[<% toggleLink id='toclist' %>]</span></h3><ol id='toclist'>"
     suffix="</ol></div>"
 %>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.