mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-04 14:55:45 +01:00
Add basic support for plugins including help data.
This commit is contained in:
@@ -50,8 +50,8 @@
|
||||
<xsl:variable name="tag" select="concat('h', $level)"/>
|
||||
<xsl:variable name="lasttag" select="concat('h', $level - 1)"/>
|
||||
|
||||
<xsl:variable name="nodes" select="//liberator:document/liberator:*[
|
||||
local-name() = $tag and preceding-sibling::*[local-name() = $lasttag][position() = 1 and . = $context]]"/>
|
||||
<xsl:variable name="nodes" select="//liberator:*[
|
||||
local-name() = $tag and preceding::*[local-name() = $lasttag][position() = 1 and . = $context]]"/>
|
||||
|
||||
<xsl:if test="$nodes">
|
||||
<html:ol liberator:highlight="HelpOrderedList">
|
||||
@@ -139,7 +139,7 @@
|
||||
</xsl:template>
|
||||
<xsl:template match="liberator:tag|@tag" mode="pass-2">
|
||||
<xsl:call-template name="parse-tags">
|
||||
<xsl:with-param name="text"><xsl:value-of select="."/></xsl:with-param>
|
||||
<xsl:with-param name="text" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:template name="parse-tags">
|
||||
|
||||
@@ -1436,22 +1436,27 @@ const liberator = (function () //{{{
|
||||
|
||||
XML.ignoreWhiteSpace = false;
|
||||
XML.prettyPrinting = false;
|
||||
XML.prettyPrinting = true; // Should be false, but ignoreWhiteSpace=false doesn't work correctly. This is the lesser evil.
|
||||
XML.prettyIndent = 4;
|
||||
let body = XML();
|
||||
for (let [, context] in Iterator(plugins.contexts))
|
||||
if (context.INFO instanceof XML)
|
||||
body += context.INFO;
|
||||
body += <h2 xmlns={NS.uri} tag={context.INFO.@name + '-plugin'}>{context.INFO.@summary}</h2> +
|
||||
context.INFO;
|
||||
|
||||
let help = '<?xml version="1.0"?>\n' +
|
||||
'<?xml-stylesheet type="text/xsl" href="chrome://liberator/content/overlay.xsl"?>\n' +
|
||||
'<?xml-stylesheet type="text/xsl" href="chrome://liberator/content/help.xsl"?>\n' +
|
||||
'<!DOCTYPE document SYSTEM "chrome://liberator/content/liberator.dtd">' +
|
||||
<document
|
||||
name="plugins"
|
||||
title={config.name + " Plugins"}
|
||||
xmlns="http://vimperator.org/namespaces/liberator">
|
||||
<h2 tag="using-plugins">Using Plugins</h2>
|
||||
<h1 tag="using-plugins">Using Plugins</h1>
|
||||
|
||||
{body}
|
||||
</document>.toXMLString();
|
||||
fileMap['plugins'] = function () ['application/xml;charset=UTF-8', help];
|
||||
fileMap["plugins"] = function () ['text/xml;charset=UTF-8', help];
|
||||
addTags("plugins", util.httpGet("liberator://help/plugins").responseXML);
|
||||
|
||||
services.get("liberator:").init({
|
||||
HELP_TAGS: tagMap, FILE_MAP: fileMap,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="chrome://liberator/content/overlay.xsl"?>
|
||||
<?xml-stylesheet type="text/xsl" href="chrome://liberator/content/help.xsl"?>
|
||||
|
||||
<!DOCTYPE document SYSTEM "chrome://liberator/content/liberator.dtd">
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<include href="message" tag="message.html"/>
|
||||
<include href="developer" tag="developer.html"/>
|
||||
<include href="various" tag="various.html"/>
|
||||
<include href="plugins" tag="plugins.html"/>
|
||||
<include href="index" tag="index.html"/>
|
||||
|
||||
</document>
|
||||
|
||||
Reference in New Issue
Block a user