1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 13:32:27 +01:00
This commit is contained in:
Kris Maglione
2009-10-31 13:36:46 -04:00
10 changed files with 216 additions and 154 deletions

View File

@@ -4,6 +4,7 @@ TOP = $(shell pwd)
OS = $(shell uname -s) OS = $(shell uname -s)
BUILD_DATE = $(shell date "+%Y/%m/%d %H:%M:%S") BUILD_DATE = $(shell date "+%Y/%m/%d %H:%M:%S")
BASE = $(TOP)/../common BASE = $(TOP)/../common
GOOGLE_PROJ = vimperator-labs
LOCALEDIR = locale LOCALEDIR = locale
DOC_FILES = $(wildcard $(LOCALEDIR)/*/*.xml) DOC_FILES = $(wildcard $(LOCALEDIR)/*/*.xml)
@@ -56,6 +57,7 @@ help:
@echo " make jar - build a JAR ($(JAR))" @echo " make jar - build a JAR ($(JAR))"
@echo " make xpi - build an XPI ($(XPI_NAME))" @echo " make xpi - build an XPI ($(XPI_NAME))"
@echo " make release - updates update.rdf (this is not for you)" @echo " make release - updates update.rdf (this is not for you)"
@echo " make release - uploads to Google Code (this is not for you)"
@echo " make clean - clean up" @echo " make clean - clean up"
@echo " make distclean - clean up more" @echo " make distclean - clean up more"
@echo @echo
@@ -72,6 +74,19 @@ jar: $(JAR)
release: $(XPI) $(RDF) release: $(XPI) $(RDF)
# This is not for you!
dist: $(XPI)
[ -n "$(featured)" ] && labels="$$labels,Featured"; \
proj=$$(echo -n $(NAME) | sed 's/\(.\).*/\1/' | tr a-z A-Z); \
proj="$$proj$$(echo $(NAME) | sed 's/.//')"; \
[ -z "$$description" ] && description="$$proj $(VERSION) Release"; \
\
labels=$$(echo -n "$$labels,Project-$$proj" | sed 's/^,*//g'); \
\
googlecode_upload -s "$$description" -l "$$labels" \
-p "$(GOOGLE_PROJ)" -u "$(GOOGLE_USER)" -w "$(GOOGLE_PASS)" \
-- "$(XPI)"
$(RDF): $(RDF_IN) Makefile $(RDF): $(RDF_IN) Makefile
@echo "Preparing release..." @echo "Preparing release..."
$(SED) -e "s,###VERSION###,$(VERSION),g" \ $(SED) -e "s,###VERSION###,$(VERSION),g" \

View File

@@ -249,7 +249,7 @@ function Bookmarks() //{{{
statusline.updateUrl(); statusline.updateUrl();
}; };
var cache = storage.newObject("bookmark-cache", Cache, false); var cache = storage.newObject("bookmark-cache", Cache, { store: false });
storage.addObserver("bookmark-cache", bookmarkObserver, window); storage.addObserver("bookmark-cache", bookmarkObserver, window);
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}

View File

@@ -99,7 +99,7 @@ function Browser() //{{{
} }
} }
}).init(); }).init();
}, false); }, { store: false });
storage.addObserver("private-mode", storage.addObserver("private-mode",
function (key, event, value) { function (key, event, value) {
autocommands.trigger("PrivateMode", { state: value }); autocommands.trigger("PrivateMode", { state: value });

View File

@@ -1,15 +1,28 @@
<!DOCTYPE document SYSTEM "chrome://liberator/content/liberator.dtd"> <!DOCTYPE document SYSTEM "chrome://liberator/content/liberator.dtd">
<!-- Header {{{1 -->
<xsl:stylesheet version="1.0" <xsl:stylesheet version="1.0"
xmlns="http://vimperator.org/namespaces/liberator" xmlns="http://vimperator.org/namespaces/liberator"
xmlns:liberator="http://vimperator.org/namespaces/liberator" xmlns:liberator="http://vimperator.org/namespaces/liberator"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings" xmlns:str="http://exslt.org/strings"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="str"> extension-element-prefixes="str">
<xsl:output method="xml" indent="no"/> <xsl:output method="xml" indent="no"/>
<!-- Variable Definitions {{{1 -->
<xsl:variable name="tags">
<xsl:text> </xsl:text>
<xsl:for-each select="//@tag|//liberator:tags/text()|//liberator:tag/text()">
<xsl:value-of select="concat(., ' ')"/>
</xsl:for-each>
</xsl:variable>
<!-- Root {{{1 -->
<xsl:template match="liberator:document"> <xsl:template match="liberator:document">
<html:html liberator:highlight="Help"> <html:html liberator:highlight="Help">
<html:head> <html:head>
@@ -28,42 +41,51 @@
</html:html> </html:html>
</xsl:template> </xsl:template>
<xsl:template match="liberator:include" mode="pass-2"> <!-- Table of Contents {{{1 -->
<xsl:apply-templates select="document(@href)/liberator:document/node()"/>
</xsl:template>
<xsl:template match="liberator:dl" mode="pass-2"> <xsl:template name="toc">
<xsl:param name="level"/>
<xsl:param name="context"/>
<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:if test="$nodes">
<html:ol liberator:highlight="HelpOrderedList">
<xsl:for-each select="$nodes">
<li>
<html:a>
<xsl:if test="@tag">
<xsl:attribute name="href"><xsl:value-of select="concat('#', substring-before(concat(@tag, ' '), ' '))"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates select="node()"/>
</html:a>
<xsl:call-template name="toc">
<xsl:with-param name="level" select="$level + 1"/>
<xsl:with-param name="context" select="."/>
</xsl:call-template>
</li>
</xsl:for-each>
</html:ol>
</xsl:if>
</xsl:template>
<xsl:template match="liberator:h1" mode="pass-2">
<xsl:copy> <xsl:copy>
<column/> <xsl:apply-templates select="@*|node()"/>
<column/>
<xsl:for-each select="liberator:dt">
<tr>
<xsl:apply-templates select="."/>
<xsl:apply-templates select="following-sibling::liberator:dd[position()=1]"/>
</tr>
</xsl:for-each>
</xsl:copy> </xsl:copy>
<html:div liberator:highlight="HelpTOC">
<h2>Contents</h2>
<xsl:call-template name="toc">
<xsl:with-param name="level" select="2"/>
<xsl:with-param name="context" select="."/>
</xsl:call-template>
</html:div>
</xsl:template> </xsl:template>
<xsl:template match="liberator:tags" mode="pass-2"> <!-- Items {{{1 -->
<html:div style="clear: right"/>
<xsl:call-template name="parse-tags">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
</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:call-template>
</xsl:template>
<xsl:template name="parse-tags">
<xsl:param name="text"/>
<tags>
<xsl:for-each select="str:tokenize($text)">
<html:a id="{.}"><tag><xsl:value-of select="."/></tag></html:a>
</xsl:for-each>
</tags>
</xsl:template>
<xsl:template match="liberator:item" mode="pass-2"> <xsl:template match="liberator:item" mode="pass-2">
<xsl:copy> <xsl:copy>
@@ -93,17 +115,13 @@
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<span> <span>
<xsl:choose> <xsl:attribute name="highlight" namespace="http://vimperator.org/namespaces/liberator">
<xsl:when test="$type = 'boolean'"> <xsl:choose>
<xsl:attribute name="highlight" namespace="http://vimperator.org/namespaces/liberator">Boolean</xsl:attribute> <xsl:when test="$type = 'boolean'">Boolean</xsl:when>
</xsl:when> <xsl:when test="$type = 'number'">Number</xsl:when>
<xsl:when test="$type = 'number'"> <xsl:when test="$type = 'charlist'">String</xsl:when>
<xsl:attribute name="highlight" namespace="http://vimperator.org/namespaces/liberator">Number</xsl:attribute> </xsl:choose>
</xsl:when> </xsl:attribute>
<xsl:when test="$type = 'charlist'">
<xsl:attribute name="highlight" namespace="http://vimperator.org/namespaces/liberator">String</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:apply-templates/> <xsl:apply-templates/>
</span> </span>
</xsl:otherwise> </xsl:otherwise>
@@ -111,19 +129,41 @@
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<!-- Tag Definitions {{{1 -->
<xsl:template match="liberator:tags" mode="pass-2">
<html:div style="clear: right"/>
<xsl:call-template name="parse-tags">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
</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:call-template>
</xsl:template>
<xsl:template name="parse-tags">
<xsl:param name="text"/>
<tags>
<xsl:for-each select="str:tokenize($text)">
<html:a id="{.}"><tag><xsl:value-of select="."/></tag></html:a>
</xsl:for-each>
</tags>
</xsl:template>
<!-- Tag Links {{{1 -->
<xsl:template name="linkify-tag"> <xsl:template name="linkify-tag">
<xsl:param name="contents"/> <xsl:param name="contents"/>
<xsl:variable name="tag" select="str:tokenize($contents, ' [')[1]"/> <xsl:variable name="tag" select="str:tokenize($contents, ' [')[1]"/>
<html:a href="liberator://help-tag/{$tag}" style="color: inherit;"> <html:a href="liberator://help-tag/{$tag}" style="color: inherit;">
<xsl:if test=" <xsl:if test="contains($tags, concat(' ', $tag, ' '))">
//liberator:tags[contains(concat(' ', ., ' '), concat(' ', $tag, ' '))] |
//liberator:tag[contains(concat(' ', ., ' '), concat(' ', $tag, ' '))] |
//@tag[contains(concat(' ', ., ' '), concat(' ', $tag, ' '))]">
<xsl:attribute name="href">#<xsl:value-of select="$tag"/></xsl:attribute> <xsl:attribute name="href">#<xsl:value-of select="$tag"/></xsl:attribute>
</xsl:if> </xsl:if>
<xsl:value-of select="$contents"/> <xsl:value-of select="$contents"/>
</html:a> </html:a>
</xsl:template> </xsl:template>
<xsl:template match="liberator:o" mode="pass-2"> <xsl:template match="liberator:o" mode="pass-2">
<xsl:copy> <xsl:copy>
<xsl:call-template name="linkify-tag"> <xsl:call-template name="linkify-tag">
@@ -145,8 +185,14 @@
</xsl:call-template> </xsl:call-template>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<!-- HTML-ish elements {{{1 -->
<xsl:template match="liberator:ul" mode="pass-2">
<html:ul liberator:highlight="HelpList"><xsl:apply-templates select="@*|node()"/></html:ul>
</xsl:template>
<xsl:template match="liberator:ol" mode="pass-2"> <xsl:template match="liberator:ol" mode="pass-2">
<html:ol><xsl:apply-templates select="@*|node()"/></html:ol> <html:ol liberator:highlight="HelpOrderedList"><xsl:apply-templates select="@*|node()"/></html:ol>
</xsl:template> </xsl:template>
<xsl:template match="liberator:ex" mode="pass-2"> <xsl:template match="liberator:ex" mode="pass-2">
<xsl:copy> <xsl:copy>
@@ -156,23 +202,43 @@
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<xsl:template match="liberator:dl" mode="pass-2">
<xsl:copy>
<column/>
<column/>
<xsl:for-each select="liberator:dt">
<tr>
<xsl:apply-templates select="."/>
<xsl:apply-templates select="following-sibling::liberator:dd[position()=1]"/>
</tr>
</xsl:for-each>
</xsl:copy>
</xsl:template>
<xsl:template match="liberator:link" mode="pass-2"> <xsl:template match="liberator:link" mode="pass-2">
<html:a href="{@topic}"><xsl:apply-templates select="@*|node()"/></html:a> <html:a href="{@topic}"><xsl:apply-templates select="@*|node()"/></html:a>
</xsl:template> </xsl:template>
<!-- Special Element Templates {{{1 -->
<xsl:template match="liberator:pan[liberator:handle]"> <xsl:template match="liberator:pan[liberator:handle]">
<form style="text-align:center" xmlns="http://www.w3.org/1999/xhtml" <form style="text-align:center" xmlns="http://www.w3.org/1999/xhtml"
action="https://www.paypal.com/cgi-bin/webscr" method="post"> action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick"/> <input type="hidden" name="cmd" value="_s-xclick"/>
<input type="image" src="chrome://liberator/content/x-click-but21.gif" border="0" name="submit" alt="Donate with PayPal"/> <input type="image" src="chrome://liberator/content/x-click-but21.png" border="0" name="submit" alt="Donate with PayPal"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC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3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA4MDYwNTE0NDk1OFowIwYJKoZIhvcNAQkEMRYEFBpY8FafLq7i3V0czWS9TbR/RjyQMA0GCSqGSIb3DQEBAQUABIGAPvYR9EC2ynooWAvX0iw9aZYTrpX2XrTl6lYkZaLrhM1zKn4RuaiL33sPtq0o0uSKm98gQHzh4P6wmzES0jzHucZjCU4VlpW0fC+/pJxswbW7Qux+ObsNx3f45OcvprqMMZyJiEOULcNhxkm9pCeXQMUGwlHoRRtAxYK2T8L/rQQ=-----END PKCS7-----
"/> "/>
</form> </form>
</xsl:template> </xsl:template>
<!-- This does't work. Why? <!-- Process Inclusions {{{1 -->
<xsl:include href="chrome://liberator/content/overlay.xsl"/>
--> <xsl:template match="liberator:include" mode="pass-2">
<xsl:apply-templates select="document(@href)/liberator:document/node()"/>
</xsl:template>
<!-- Process Overlays {{{1 -->
<xsl:variable name="overlay" select="concat('liberator://help-overlay/', /liberator:document/@name)"/> <xsl:variable name="overlay" select="concat('liberator://help-overlay/', /liberator:document/@name)"/>
<xsl:variable name="overlaydoc" select="document($overlay)/liberator:overlay"/> <xsl:variable name="overlaydoc" select="document($overlay)/liberator:overlay"/>
@@ -218,6 +284,8 @@
</xsl:call-template> </xsl:call-template>
</xsl:template> </xsl:template>
<!-- Process Tree {{{1 -->
<xsl:template match="@*|node()" mode="pass-2"> <xsl:template match="@*|node()" mode="pass-2">
<xsl:copy> <xsl:copy>
<xsl:apply-templates select="@*|node()"/> <xsl:apply-templates select="@*|node()"/>
@@ -228,4 +296,4 @@
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
<!-- vim:se ft=xslt sts=4 sw=4 et: --> <!-- vim:se ft=xslt sts=4 sw=4 et fdm=marker: -->

View File

@@ -9,7 +9,7 @@
* @constant * @constant
* @property {string} The default highlighting rules. They have the * @property {string} The default highlighting rules. They have the
* form: * form:
* rule ::= selector space css * rule ::= selector space space+ css
* selector ::= group * selector ::= group
* | group "," css-selector * | group "," css-selector
* | group "," css-selector "," scope * | group "," css-selector "," scope
@@ -44,21 +44,21 @@ Highlights.prototype.CSS = <![CDATA[
CmdOutput white-space: pre; CmdOutput white-space: pre;
CompGroup CompGroup
CompGroup:not(:first-of-type) margin-top: .5em; CompGroup:not(:first-of-type) margin-top: .5em;
CompTitle color: magenta; background: white; font-weight: bold; CompTitle color: magenta; background: white; font-weight: bold;
CompTitle>* padding: 0 .5ex; CompTitle>* padding: 0 .5ex;
CompMsg font-style: italic; margin-left: 16px; CompMsg font-style: italic; margin-left: 16px;
CompItem CompItem
CompItem[selected] background: yellow; CompItem[selected] background: yellow;
CompItem>* padding: 0 .5ex; CompItem>* padding: 0 .5ex;
CompIcon width: 16px; min-width: 16px; display: inline-block; margin-right: .5ex; CompIcon width: 16px; min-width: 16px; display: inline-block; margin-right: .5ex;
CompIcon>img max-width: 16px; max-height: 16px; vertical-align: middle; CompIcon>img max-width: 16px; max-height: 16px; vertical-align: middle;
CompResult width: 45%; overflow: hidden; CompResult width: 45%; overflow: hidden;
CompDesc color: gray; width: 50%; CompDesc color: gray; width: 50%;
CompLess text-align: center; height: 0; line-height: .5ex; padding-top: 1ex; CompLess text-align: center; height: 0; line-height: .5ex; padding-top: 1ex;
CompLess::after content: "\2303" /* Unicode up arrowhead */ CompLess::after content: "\2303" /* Unicode up arrowhead */
CompMore text-align: center; height: .5ex; line-height: .5ex; margin-bottom: -.5ex; CompMore text-align: center; height: .5ex; line-height: .5ex; margin-bottom: -.5ex;
CompMore::after content: "\2304" /* Unicode down arrowhead */ CompMore::after content: "\2304" /* Unicode down arrowhead */
Gradient height: 1px; margin-bottom: -1px; margin-top: -1px; Gradient height: 1px; margin-bottom: -1px; margin-top: -1px;
GradientLeft background-color: magenta; GradientLeft background-color: magenta;
@@ -73,10 +73,10 @@ Highlights.prototype.CSS = <![CDATA[
LineNr color: orange; background: white; LineNr color: orange; background: white;
Question color: green; background: white; font-weight: bold; Question color: green; background: white; font-weight: bold;
StatusLine color: white; background: black; StatusLine color: white; background: black;
StatusLineBroken color: black; background: #FFa0a0 /* light-red */ StatusLineBroken color: black; background: #FFa0a0 /* light-red */
StatusLineSecure color: black; background: #a0a0FF /* light-blue */ StatusLineSecure color: black; background: #a0a0FF /* light-blue */
StatusLineExtended color: black; background: #a0FFa0 /* light-green */ StatusLineExtended color: black; background: #a0FFa0 /* light-green */
TabClose,.tab-close-button TabClose,.tab-close-button
TabIcon,.tab-icon TabIcon,.tab-icon
@@ -154,9 +154,9 @@ Highlights.prototype.CSS = <![CDATA[
HelpLink,liberator|*>html|a text-decoration: none; HelpLink,liberator|*>html|a text-decoration: none;
HelpLink:hover text-decoration: underline; HelpLink:hover text-decoration: underline;
HelpList,liberator|ul display: block; list-style: outside disc; HelpList display: block; list-style: outside disc;
HelpOrderedList,liberator|*>html:ol display: block; list-style: outside decimal; HelpOrderedList display: block; list-style: outside decimal;
HelpListItem,liberator|li display: list-item; margin-left: 1.5em; HelpListItem,liberator|li display: list-item;
HelpNote,liberator|note display: block; margin: 1em 0em; HelpNote,liberator|note display: block; margin: 1em 0em;
HelpNote::before content: "Note: "; color: red; font-weight: bold; HelpNote::before content: "Note: "; color: red; font-weight: bold;
@@ -175,6 +175,9 @@ Highlights.prototype.CSS = <![CDATA[
HelpSubhead,liberator|h2 display: block; margin: 1em 0; padding-bottom: .2ex; border-bottom-width: 1px; font-size: 1.2em; font-weight: bold; color: #527BBD; clear: both; HelpSubhead,liberator|h2 display: block; margin: 1em 0; padding-bottom: .2ex; border-bottom-width: 1px; font-size: 1.2em; font-weight: bold; color: #527BBD; clear: both;
HelpSubsubhead,liberator|h3 display: block; margin: 1em 0; padding-bottom: .2ex; font-size: 1.1em; font-weight: bold; color: #527BBD; clear: both; HelpSubsubhead,liberator|h3 display: block; margin: 1em 0; padding-bottom: .2ex; font-size: 1.1em; font-weight: bold; color: #527BBD; clear: both;
HelpTOC
HelpTOC>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; 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,liberator|column display: table-column;
HelpTabColumn:first-child width: 25%; HelpTabColumn:first-child width: 25%;
@@ -300,11 +303,11 @@ function Highlights(name, store)
*/ */
this.loadCSS = function (css) this.loadCSS = function (css)
{ {
css.replace(/^(\s*\S*\s+)\{((?:.|\n)*?)\}\s*$/gm, function (_, _1, _2) _1 + _2.replace(/\n\s*/g, " ")) css.replace(/^(\s*\S*\s+)\{((?:.|\n)*?)\}\s*$/gm, function (_, _1, _2) _1 + " " + _2.replace(/\n\s*/g, " "))
.split("\n").filter(function (s) /\S/.test(s)) .split("\n").filter(function (s) /\S/.test(s))
.forEach(function (style) .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)) if (/^[>+ ]/.test(style.selector))
style.selector = self.selector(style.class) + style.selector; style.selector = self.selector(style.class) + style.selector;
@@ -581,12 +584,12 @@ let (array = util.Array)
/** /**
* @property {Styles} * @property {Styles}
*/ */
const styles = storage.newObject("styles", Styles, false); const styles = storage.newObject("styles", Styles, { store: false });
/** /**
* @property {Highlights} * @property {Highlights}
*/ */
const highlight = storage.newObject("highlight", Highlights, false); const highlight = storage.newObject("highlight", Highlights, { store: false });
if (highlight.CSS != Highlights.prototype.CSS) if (highlight.CSS != Highlights.prototype.CSS)
{ {
@@ -785,7 +788,7 @@ liberator.registerObserver("load_commands", function () {
args.completeArg = args.completeArg > 1 ? -1 : 0; args.completeArg = args.completeArg > 1 ? -1 : 0;
if (args.completeArg == 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) else if (args.completeArg == 1)
{ {
let hl = highlight.get(args[0]); let hl = highlight.get(args[0]);

View File

@@ -671,7 +671,7 @@ function Tabs() //{{{
context.anchored = false; context.anchored = false;
context.compare = CompletionContext.Sort.unsorted; context.compare = CompletionContext.Sort.unsorted;
context.filters = [CompletionContext.Filter.textDescription]; context.filters = [CompletionContext.Filter.textDescription];
context.keys = { text: function ([i, item]) (i + 1) + ": " + item.state.entries[item.state.index - 1].url, description: "[1].title", icon: "[1].image" }; context.keys = { text: function ([i, { state: s }]) (i + 1) + ": " + s.entries[s.index - 1].url, description: "[1].title", icon: "[1].image" };
context.completions = Iterator(tabs.closedTabs); context.completions = Iterator(tabs.closedTabs);
}, },
count: true, count: true,

View File

@@ -56,7 +56,7 @@ function CommandLine() //{{{
} }
} }
}).init(); }).init();
}, false); }, { store: false });
storage.addObserver("sanitize", storage.addObserver("sanitize",
function (key, event, value) { function (key, event, value) {
autocommands.trigger("Sanitize", {}); autocommands.trigger("Sanitize", {});
@@ -2174,8 +2174,8 @@ function StatusLine() //{{{
} }
else else
{ {
url = url.replace(RegExp("^chrome://liberator/locale/(\\S+\\.html)#(.*)"), function (m, n1, n2) n1 + " " + decodeURIComponent(n2) + " [Help]"); url = url.replace(RegExp("^liberator://help/(\\S+)#(.*)"), function (m, n1, n2) n1 + " " + decodeURIComponent(n2) + " [Help]")
url = url.replace(RegExp("^chrome://liberator/locale/(\\S+\\.html)"), "$1 [Help]"); .replace(RegExp("^liberator://help/(\\S+)"), "$1 [Help]");
} }
// when session information is available, add [+] when we can go // when session information is available, add [+] when we can go
@@ -2184,9 +2184,9 @@ function StatusLine() //{{{
if (window.getWebNavigation) if (window.getWebNavigation)
{ {
let sh = window.getWebNavigation().sessionHistory; let sh = window.getWebNavigation().sessionHistory;
if (sh.index > 0) if (sh && sh.index > 0)
modified += "+"; modified += "+";
if (sh.index < sh.count -1) if (sh && sh.index < sh.count -1)
modified += "-"; modified += "-";
} }
if (liberator.has("bookmarks")) if (liberator.has("bookmarks"))

View File

@@ -276,60 +276,46 @@ const util = { //{{{
/** /**
* Generates an Asciidoc help entry. * Generates an Asciidoc help entry.
* *
* @param {Command|Mapping|Option} obj A liberator <b>Command</b>, * @param {Command|Map|Option} obj A liberator <b>Command</b>,
* <b>Mapping</b> or <b>Option</b> object * <b>Map</b> or <b>Option</b> object
* @param {string} extraHelp Extra help text beyond the description. * @param {XMLList} extraHelp Extra help text beyond the description.
* @returns {string} * @returns {string}
*/ */
generateHelp: function generateHelp(obj, extraHelp) generateHelp: function generateHelp(obj, extraHelp)
{ {
let start = "", end = ""; let spec = util.identity;
let tag = util.identity;
if (obj instanceof Command) if (obj instanceof Command)
start = ":"; tag = spec = function (cmd) <>:{cmd}</>;
else if (obj instanceof Map && obj.count)
spec = function (map) <><oa xmlns="">count</oa>{map}</>;
else if (obj instanceof Option) else if (obj instanceof Option)
start = end = "'";
let ret = "";
let longHelp = false;
if ((obj.help && obj.description) && (obj.help.length + obj.description.length) > 50)
longHelp = true;
// the tags which are printed on the top right
for (let j = obj.names.length - 1; j >= 0; j--)
ret += "|" + start + obj.names[j] + end + "| ";
if (longHelp)
ret += "+";
ret += "\n";
// the usage information
let usage = obj.names[0];
if (obj.specs) // for :commands
usage = obj.specs[0];
usage = usage.replace(/{/, "\\\\{").replace(/}/, "\\\\}");
usage = usage.replace(/'/, "\\'").replace(/`/, "\\`");
ret += "||" + start + usage + end + "||";
if (usage.length > 15)
ret += " +";
ret += "\n________________________________________________________________________________\n";
// the actual help text
if (obj.description)
{ {
ret += obj.description + "."; // the help description spec = function (opt) <o xmlns="">{opt}</o>;
if (extraHelp) tag = function (opt) <>'{opt}'</>;
ret += " +\n" + extraHelp;
} }
else
ret += "Sorry, no help available";
// add more space between entries // E4X has its warts.
ret += "\n________________________________________________________________________________\n\n\n"; let br = <>
</>;
return ret; default xml namespace = "";
XML.prettyPrinting = false;
XML.ignoreWhitespace = false;
return <></> +
<item>
<tags>{template.map(obj.names, tag, " ")}</tags>
<spec>{spec((obj.specs || obj.names)[0])}</spec>{
!obj.type ? "" : <>
<type>{obj.type}</type>
<default>{obj.defaultValue}</default></>}
<description>{
obj.description ? br+<p>{obj.description.replace(/\.?$/, ".")}</p> : "" }{
extraHelp ? br+extraHelp : "" }{
!(extraHelp || obj.description) ? br+<p>Sorry, no help available.</p> : "" }
</description>
</item>.toXMLString();
}, },
/** /**

View File

@@ -306,14 +306,14 @@ var timers = {};
var storage = { var storage = {
alwaysReload: {}, alwaysReload: {},
newObject: function newObject(key, constructor, store, type, options, reload) newObject: function newObject(key, constructor, params)
{ {
if (!(key in keys) || reload || this.alwaysReload[key]) if (!(key in keys) || params.reload || this.alwaysReload[key])
{ {
if (key in this && !(reload || this.alwaysReload[key])) if (key in this && !(params.reload || this.alwaysReload[key]))
throw Error(); throw Error();
let load = function () loadPref(key, store, type || Object); let load = function () loadPref(key, params.store, params.type || Object);
keys[key] = new constructor(key, store, load, options || {}); keys[key] = new constructor(key, params.store, load, params);
timers[key] = new Timer(1000, 10000, function () storage.save(key)); timers[key] = new Timer(1000, 10000, function () storage.save(key));
this.__defineGetter__(key, function () keys[key]); this.__defineGetter__(key, function () keys[key]);
} }
@@ -322,12 +322,12 @@ var storage = {
newMap: function newMap(key, store, options) newMap: function newMap(key, store, options)
{ {
return this.newObject(key, ObjectStore, store, null, options); return this.newObject(key, ObjectStore, store, options);
}, },
newArray: function newArray(key, store, options) newArray: function newArray(key, store, options)
{ {
return this.newObject(key, ArrayStore, store, Array, options); return this.newObject(key, ArrayStore, store, { type: Array, __proto__: options });
}, },
addObserver: function addObserver(key, callback, ref) addObserver: function addObserver(key, callback, ref)

View File

@@ -2,27 +2,18 @@ Priority list:
1-9 as in Vim (9 = required for next release, 5 = would be nice, 1 = probably not) 1-9 as in Vim (9 = required for next release, 5 = would be nice, 1 = probably not)
ARCHITECTURE: ARCHITECTURE:
- modular help system - decide on how to document Arrays in our jsdoc(ish) documentation. Host docs
- I made a quick attempt at parameterizing it using attributes but it on the website - is there even a documentation tool that can parse our source
breaks Asciidoc formatting in certain unpredictable (to me at least) sensibly?
contexts. --djk
- move as much as possible to common/*
- decide on how to document Arrays in our jsdoc(ish) documentation. Is there
even a documentation tool that can parse our source sensibly?
- update build system to generate config specific components from templates in
common/components/* and copy others -
a739cdeab8f1648fd771f17d8a4885533032376f attempt at linking didn't work.
BUGS: BUGS:
- add window resize support to hints - add window resize support to hints
- searching backwards incrementally does not work i.e. with 'incsearch' set - searching backwards incrementally does not work i.e. with 'incsearch' set
- Motion keys (j/k/h/l/^F/^B/...) don't scroll scrollable block elements.
- insert abbreviations broken on <space> - insert abbreviations broken on <space>
- :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar) - :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar)
- ;s saves the page rather than the image - ;s saves the page rather than the image
- RC file is sourced once per window - RC file is sourced once per window
- :undo seems to be effected by whether the tabstrip state - :undo seems to be effected by the tabstrip state
(recent CVS regressions): (recent CVS regressions):
- visual caret mode is broken, requires a manual page focus first anyway or - visual caret mode is broken, requires a manual page focus first anyway or
@@ -78,7 +69,7 @@ FEATURES:
Total time: 0.25 sec Total time: 0.25 sec
--Kris --Kris
8 allow for multiple ex commands separated with | (see #107) 8 allow for multiple ex commands separated with | (see #24)
8 <C-o>/<C-i> should work as in vim (i.e., save page positions as well as 8 <C-o>/<C-i> should work as in vim (i.e., save page positions as well as
locations in the history list). locations in the history list).
7 use ctrl-n/p in insert mode for word completion 7 use ctrl-n/p in insert mode for word completion
@@ -92,13 +83,12 @@ FEATURES:
7 The output of the pageinfo-command should contain the security-information of ssl-encrypted sites 7 The output of the pageinfo-command should contain the security-information of ssl-encrypted sites
7 Add :every command 7 Add :every command
6 :mksession 6 :mksession
6 support private mode (and :set [no]private): http://ehsanakhgari.org/blog/2008-11-08/prepare-your-add-private-browsing
6 add [count] support to :b* and :tab* commands where missing 6 add [count] support to :b* and :tab* commands where missing
6 registers 6 registers
Here, unlike Vim, y and "*y would be equivalent. That is, the pasteboard would Here, unlike Vim, y and "*y would be equivalent. That is, the pasteboard would
always be the default register. --Ted always be the default register. --Ted
6 check/correct spellings in insert mode with some mappings 6 check/correct spellings in insert mode with some mappings
6 add more autocommands (TabClose, TabOpen, TabChanged any more?) 6 add more autocommands (TabClose, TabOpen, TabChanged etc)
6 jump to the next heading with ]h, next image ]i, previous textbox [t and so on 6 jump to the next heading with ]h, next image ]i, previous textbox [t and so on
6 :grep support (needs location list) 6 :grep support (needs location list)
6 pipe selected text/link/website to an external command 6 pipe selected text/link/website to an external command