mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 12:35:53 +01:00
Fix Xulmus, etc.
--HG-- branch : xslt
This commit is contained in:
@@ -702,7 +702,6 @@ function Bookmarks() //{{{
|
||||
// if the search also requires a postData, [url, postData] is returned
|
||||
getSearchURL: function getSearchURL(text, useDefsearch)
|
||||
{
|
||||
let url = null;
|
||||
let searchString = (useDefsearch ? options["defsearch"] + " " : "") + text;
|
||||
|
||||
// we need to make sure our custom alias have been set, even if the user
|
||||
|
||||
@@ -1193,7 +1193,7 @@ function Commands() //{{{
|
||||
let [, prefix, junk] = context.filter.match(/^(:*\d*)\w*(.?)/) || [];
|
||||
context.advance(prefix.length);
|
||||
if (!junk)
|
||||
return context.fork("", 0, this, "command");
|
||||
return void context.fork("", 0, this, "command");
|
||||
|
||||
// dynamically get completions as specified with the command's completer function
|
||||
let command = commands.get(cmd);
|
||||
|
||||
@@ -185,6 +185,7 @@ function CompletionContext(editor, name, offset) //{{{
|
||||
this.getKey = function (item, key) (typeof self.keys[key] == "function") ? self.keys[key].call(this, item.item) :
|
||||
key in self.keys ? item.item[self.keys[key]]
|
||||
: item.item[key];
|
||||
return this;
|
||||
}
|
||||
|
||||
CompletionContext.Sort = {
|
||||
@@ -453,13 +454,13 @@ CompletionContext.prototype = {
|
||||
let filter = fixCase(this.filter);
|
||||
if (this.anchored)
|
||||
{
|
||||
function compare(text, s) text.substr(0, s.length) == s;
|
||||
var compare = function compare(text, s) text.substr(0, s.length) == s;
|
||||
substrings = util.map(util.range(filter.length, text.length + 1),
|
||||
function (end) text.substring(0, end));
|
||||
}
|
||||
else
|
||||
{
|
||||
function compare(text, s) text.indexOf(s) >= 0;
|
||||
var compare = function compare(text, s) text.indexOf(s) >= 0;
|
||||
substrings = [];
|
||||
let start = 0;
|
||||
let idx;
|
||||
@@ -1156,12 +1157,12 @@ function Completion() //{{{
|
||||
// Yes. If the [ starts at the beginning of a logical
|
||||
// statement, we're in an array literal, and we're done.
|
||||
if (get(-3, 0, STATEMENTS) == get(-2)[OFFSET])
|
||||
return;
|
||||
return null;
|
||||
|
||||
// Beginning of the statement upto the opening [
|
||||
let obj = getObj(-3, get(-2)[OFFSET]);
|
||||
|
||||
return complete.call(this, obj, getKey(), null, string, last);
|
||||
return void complete.call(this, obj, getKey(), null, string, last);
|
||||
}
|
||||
|
||||
// Is this a function call?
|
||||
@@ -1211,7 +1212,7 @@ function Completion() //{{{
|
||||
};
|
||||
|
||||
obj[0][1] += "." + func + "(... [" + args.length + "]";
|
||||
return complete.call(this, obj, key, compl, string, last);
|
||||
return void complete.call(this, obj, key, compl, string, last);
|
||||
}
|
||||
|
||||
// In a string that's not an obj key or a function arg.
|
||||
@@ -1246,7 +1247,7 @@ function Completion() //{{{
|
||||
{ // FIXME
|
||||
var o = top[OFFSET];
|
||||
top[OFFSET] = offset;
|
||||
return complete.call(this, obj, key);
|
||||
return void complete.call(this, obj, key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -178,10 +178,7 @@ function Editor() //{{{
|
||||
{
|
||||
let matches = args.string.match(RegExp("^\\s*($|" + abbrevmatch + ")(?:\\s*$|\\s+(.*))"));
|
||||
if (!matches)
|
||||
{
|
||||
liberator.echoerr("E474: Invalid argument");
|
||||
return false;
|
||||
}
|
||||
return void liberator.echoerr("E474: Invalid argument");
|
||||
let [, lhs, rhs] = matches;
|
||||
if (rhs)
|
||||
editor.addAbbreviation(mode, lhs, rhs);
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
</html:html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="liberator:include">
|
||||
<xsl:template match="liberator:include" mode="pass-2">
|
||||
<xsl:apply-templates select="document(@href)/liberator:document/node()"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="liberator:dl">
|
||||
<xsl:template match="liberator:dl" mode="pass-2">
|
||||
<xsl:copy>
|
||||
<column/>
|
||||
<column/>
|
||||
@@ -48,7 +48,7 @@
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="liberator:tags">
|
||||
<xsl:template match="liberator:tags" mode="pass-2">
|
||||
<xsl:call-template name="parse-tags">
|
||||
<xsl:with-param name="text" select="."/>
|
||||
</xsl:call-template>
|
||||
@@ -63,7 +63,7 @@
|
||||
</tags>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="liberator:default[not(@type='plain')]">
|
||||
<xsl:template match="liberator:default[not(@type='plain')]" mode="pass-2">
|
||||
<xsl:variable name="type" select="preceding-sibling::liberator:type[1] | following-sibling::liberator:type[1]"/>
|
||||
<xsl:copy>
|
||||
<xsl:choose>
|
||||
@@ -103,28 +103,28 @@
|
||||
<xsl:value-of select="$contents"/>
|
||||
</html:a>
|
||||
</xsl:template>
|
||||
<xsl:template match="liberator:o">
|
||||
<xsl:template match="liberator:o" mode="pass-2">
|
||||
<xsl:copy>
|
||||
<xsl:call-template name="linkify-tag">
|
||||
<xsl:with-param name="contents" select='concat("'", text(), "'")'/>
|
||||
</xsl:call-template>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<xsl:template match="liberator:k|liberator:t">
|
||||
<xsl:template match="liberator:k|liberator:t" mode="pass-2">
|
||||
<xsl:copy>
|
||||
<xsl:call-template name="linkify-tag">
|
||||
<xsl:with-param name="contents" select="text()"/>
|
||||
</xsl:call-template>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<xsl:template match="liberator:k[@name]">
|
||||
<xsl:template match="liberator:k[@name]" mode="pass-2">
|
||||
<xsl:copy>
|
||||
<xsl:call-template name="linkify-tag">
|
||||
<xsl:with-param name="contents" select="concat('<', @name, '>', .)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<xsl:template match="liberator:ex">
|
||||
<xsl:template match="liberator:ex" mode="pass-2">
|
||||
<xsl:copy>
|
||||
<xsl:call-template name="linkify-tag">
|
||||
<xsl:with-param name="contents" select="."/>
|
||||
@@ -132,11 +132,11 @@
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="liberator:link">
|
||||
<xsl:template match="liberator:link" mode="pass-2">
|
||||
<html:a href="{@topic}"><xsl:apply-templates select="@*|node()"/></html:a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="liberator:tag|@tag">
|
||||
<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:call-template>
|
||||
@@ -151,12 +151,12 @@
|
||||
<xsl:choose>
|
||||
<xsl:when test="$localdoc/*[@replace=$tag] and not($elem[@replace])">
|
||||
<xsl:for-each select="$localdoc/*[@replace=$tag]">
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:apply-templates select="." mode="pass-2"/>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:for-each select="$elem">
|
||||
<xsl:copy><xsl:apply-templates select="node()"/></xsl:copy>
|
||||
<xsl:apply-templates select="." mode="pass-2"/>
|
||||
</xsl:for-each>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
@@ -184,11 +184,14 @@
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:template match="@*|node()" mode="pass-2">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:apply-templates select="." mode="pass-2"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
<!-- vim:se ft=xslt sts=4 sw=4 et: -->
|
||||
|
||||
@@ -215,7 +215,7 @@ const liberator = (function () //{{{
|
||||
|
||||
options.add(["helpfile", "hf"],
|
||||
"Name of the main help file",
|
||||
"string", "intro");
|
||||
"string", "intro.html");
|
||||
|
||||
options.add(["loadplugins", "lpl"],
|
||||
"Load plugin scripts when starting up",
|
||||
@@ -1389,7 +1389,7 @@ const liberator = (function () //{{{
|
||||
{
|
||||
let helpFile = options["helpfile"];
|
||||
if (config.helpFiles.indexOf(helpFile) != -1)
|
||||
liberator.open("liberator://help/" + helpFile, { from: "help" });
|
||||
liberator.open("liberator://help/" + helpFile.replace(/\.html$/, ""), { from: "help" });
|
||||
else
|
||||
liberator.echomsg("Sorry, help file " + helpFile.quote() + " not found");
|
||||
return;
|
||||
|
||||
@@ -176,11 +176,10 @@ Highlights.prototype.CSS = <![CDATA[
|
||||
|
||||
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;
|
||||
HelpTabColumn1,liberator|column:nth-of-type(1) display: table-column; width: 25%;
|
||||
HelpTabColumn2,liberator|column:nth-of-type(2) display: table-column; width: 75%;
|
||||
HelpTabColumn:first-child width: 25%;
|
||||
HelpTabTitle,liberator|dt display: table-cell; padding: .1ex 1ex; font-weight: bold;
|
||||
HelpTabDescription,liberator|dd display: table-cell; padding: .1ex 1ex;
|
||||
HelpTabRow,liberator|dl>* display: table-row;
|
||||
HelpTabRow,liberator|dl>tr display: table-row;
|
||||
|
||||
HelpTag,liberator|tag display: inline-block; color: #527BBD; margin-left: 1ex; font-size: 8pt; font-weight: bold;
|
||||
HelpTags,liberator|tags display: block; float: right; clear: right;
|
||||
@@ -277,7 +276,7 @@ function Highlights(name, store)
|
||||
this.selector = function (class)
|
||||
{
|
||||
let [, hl, rest] = class.match(/^(\w*)(.*)/);
|
||||
let class = "[liberator|highlight~=" + hl + "]"
|
||||
class = "[liberator|highlight~=" + hl + "]"
|
||||
if (highlight[hl] && highlight[hl].class != class)
|
||||
class = highlight[hl].selector;
|
||||
return class + rest;
|
||||
|
||||
Reference in New Issue
Block a user