From 7449d40f73157f2c3e861311c9b5a1ad99d8b4f5 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 30 Oct 2009 02:04:15 -0400 Subject: [PATCH] Add TOC to help pages. --- common/content/help.xsl | 46 ++++++++++++++++++++++++++++++++++++++++- common/content/style.js | 13 +++++++----- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/common/content/help.xsl b/common/content/help.xsl index 41f53329..270d1674 100644 --- a/common/content/help.xsl +++ b/common/content/help.xsl @@ -32,6 +32,47 @@ + + + + + +

Contents

+ + + +
+
+ + + + + + + + + + + + +
  • + + + + + + + + + + +
  • +
    +
    +
    +
    + @@ -145,8 +186,11 @@ + + + - + diff --git a/common/content/style.js b/common/content/style.js index 0fc4779b..d006ce02 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -154,9 +154,9 @@ Highlights.prototype.CSS = html|a text-decoration: none; HelpLink:hover text-decoration: underline; - HelpList,liberator|ul display: block; list-style: outside disc; - HelpOrderedList,liberator|*>html:ol display: block; list-style: outside decimal; - HelpListItem,liberator|li display: list-item; margin-left: 1.5em; + HelpList display: block; list-style: outside disc; + HelpOrderedList display: block; list-style: outside decimal; + HelpListItem,liberator|li display: list-item; HelpNote,liberator|note display: block; margin: 1em 0em; HelpNote::before content: "Note: "; color: red; font-weight: bold; @@ -175,6 +175,9 @@ Highlights.prototype.CSS = ol ol margin-left: -1em; + HelpTab,liberator|dl display: table; width: 100%; margin: 1em 0; border-bottom-width: 1px; border-top-width: 1px; padding: .5ex 0; table-layout: fixed; HelpTabColumn,liberator|column display: table-column; HelpTabColumn:first-child width: 25%; @@ -304,7 +307,7 @@ function Highlights(name, store) .split("\n").filter(function (s) /\S/.test(s)) .forEach(function (style) { - style = Highlight.apply(Highlight, Array.slice(style.match(/^\s*([^,\s]+)(?:,([^,\s]+)?)?(?:,([^,\s]+))?\s*(.*)$/), 1)); + style = Highlight.apply(Highlight, Array.slice(style.match(/^\s*((?:[^,\s]|\s\S)+)(?:,((?:[^,\s]|\s\S)+)?)?(?:,((?:[^,\s]|\s\S)+))?\s*(.*)$/), 1)); if (/^[>+ ]/.test(style.selector)) style.selector = self.selector(style.class) + style.selector; @@ -785,7 +788,7 @@ liberator.registerObserver("load_commands", function () { args.completeArg = args.completeArg > 1 ? -1 : 0; if (args.completeArg == 0) - context.completions = [[v.class, ""] for (v in highlight)]; + context.completions = [[v.class, v.value] for (v in highlight)]; else if (args.completeArg == 1) { let hl = highlight.get(args[0]);