diff --git a/common/components/protocols.js b/common/components/protocols.js index 20792f5a..87914ac1 100644 --- a/common/components/protocols.js +++ b/common/components/protocols.js @@ -175,7 +175,7 @@ Dactyl.prototype = { if (tag in this.FILE_MAP) return redirect("dactyl://help/" + tag, uri); if (tag in this.HELP_TAGS) - return redirect("dactyl://help/" + this.HELP_TAGS[tag] + "#" + tag, uri); + return redirect("dactyl://help/" + this.HELP_TAGS[tag] + "#" + tag.replace(/#/g, encodeURIComponent), uri); case "locale": return makeChannel(["resource://dactyl-locale", config.locale, path].join("/"), uri); case "locale-local": diff --git a/common/content/commandline.js b/common/content/commandline.js index cb4daf2e..8f827d28 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1103,17 +1103,8 @@ var CommandLine = Module("commandline", { if (event.type == "click" && (event.target instanceof HTMLAnchorElement || event.originalTarget.hasAttributeNS(NS, "command"))) { - let command = event.originalTarget.getAttributeNS(NS, "command"); - if (command && event.button == 2) - return PASS; - - if (command && dactyl.commands[command]) { - event.preventDefault(); - return dactyl.withSavedValues(["forceNewTab"], function () { - dactyl.forceNewTab = event.ctrlKey || event.shiftKey || event.button == 1; - return dactyl.commands[command](event); - }); - } + if (event.getPreventDefault()) + return; switch (key) { case "": diff --git a/common/content/dactyl.js b/common/content/dactyl.js index ebc98bc2..a59ec5c2 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -968,6 +968,19 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { } }, + onClick: function onClick(event) { + let command = event.originalTarget.getAttributeNS(NS, "command"); + if (command && event.button == 0) { + event.preventDefault(); + + if (dactyl.commands[command]) + dactyl.withSavedValues(["forceNewTab"], function () { + dactyl.forceNewTab = event.ctrlKey || event.shiftKey || event.button == 1; + dactyl.commands[command](event); + }); + } + }, + /** * Opens one or more URLs. Returns true when load was initiated, or * false on error. @@ -1307,6 +1320,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { return items; } }, { + events: function () { + events.addSessionListener(window, "click", dactyl.closure.onClick, true); + }, // Only general options are added here, which are valid for all Dactyl extensions options: function () { options.add(["errorbells", "eb"], diff --git a/common/content/help.xsl b/common/content/help.xsl index 785f6426..ac166064 100644 --- a/common/content/help.xsl +++ b/common/content/help.xsl @@ -352,6 +352,7 @@ +
@@ -375,7 +376,11 @@ + and not(starts-with(@topic, 'mailto:') or + starts-with(@topic, 'chrome:') or + starts-with(@topic, 'resource:') or + starts-with(@topic, 'dactyl:'))"> + external diff --git a/common/content/mappings.js b/common/content/mappings.js index e72b2651..8e2ac9ed 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -422,13 +422,14 @@ var Mappings = Module("mappings", { Command Action + { template.map(hives, function (hive) let (i = 0) + template.map(maps(hive), function (map) template.map(map.names, function (name) - {!i++ ? hive.name : ""} + {!i++ ? hive.name : ""} {modeSign} {name} {map.rhs || map.action.toSource()} diff --git a/common/locale/en-US/map.xml b/common/locale/en-US/map.xml index 13ffa3bd..f8273799 100644 --- a/common/locale/en-US/map.xml +++ b/common/locale/en-US/map.xml @@ -7,6 +7,7 @@ name="map" title="&dactyl.appName; Key Mappings" xmlns="&xmlns.dactyl;" + xmlns:dactyl="&xmlns.dactyl;" xmlns:html="&xmlns.html;">

Keyboard shortcuts and commands

@@ -617,36 +618,42 @@

Custom completion can be provided by specifying the - custom,thing argument to -complete. If - thing evaluates to a function (i.e., it is a variable - holding a function value, or a string containing the definition - itself), it is called with two arguments: a completion context, and - an object describing the command's arguments. It should set the - context's completions property, or return an object with - items and start properties describing the - completions and where the replacement is to start. + custom,thing argument to -complete. If + thing evaluates to a function (i.e., it is a variable holding + a function value, or a string containing the definition itself), it + is called with two arguments: a completion context, and an object + describing the command's arguments. It should set the context's + completions property to the list of completion results. + Other influential properties include title, sort, + anthored, and filters, which are documented in the + source code.

start is the index into the word being completed at which the returned values should be applied and completions is a two-dimensional array of the form: - [[arg1, description1], [arg2, description2], …] + [[arg1, description1], [arg2, description2], …]

Otherwise thing should be an array of the same form as the - completions property of the context object. + completions property of the context object.

Example: - :command foo -complete custom, -\ function (context) context.completions = [["arg1", "description1"], ["arg2", "description2"]] -\ :echo Useless + :command foo -nargs=? + \ -complete custom, + \ function (context) context.completions = [["arg1", "description1"], ["arg2", "description2"]] + \ :echo Useless + <q-args> -:command foo -complete custom,[["arg1", "description1"], ["arg2, "description2"]] -\ :echo Same as above but simpler - +:command foo -nargs=? + \ -complete custom,[ + \ ["arg1", "description1"], + \ ["arg2, "description2"] + \ ] + \ :echo Same as above but simpler + <q-args>

Count handling

diff --git a/common/locale/en-US/repeat.xml b/common/locale/en-US/repeat.xml index 879be967..831b9b1c 100644 --- a/common/locale/en-US/repeat.xml +++ b/common/locale/en-US/repeat.xml @@ -167,19 +167,20 @@ Additionally, certain commands support the same ‘here document’ syntax supported by most Unix shells and by the &tag.command-line;. So, to execute a JavaScript statement which does not comfortably fit - on a single line, you can use + on a single line, you can use:

-

See also ex-scripts below.

- :js <<EOF var hello = function () { alert(Hello world); } EOF + +

See also ex-scripts below.

+ :lpl :loadplugins @@ -277,8 +278,8 @@ character.

- " This is a comment - foo bar " This is a comment + " This is a comment + foo bar " This is a comment This is not a comment foo bar This is not a comment diff --git a/pentadactyl/locale/en-US/autocommands.xml b/pentadactyl/locale/en-US/autocommands.xml index 3726d8b5..50852cc2 100644 --- a/pentadactyl/locale/en-US/autocommands.xml +++ b/pentadactyl/locale/en-US/autocommands.xml @@ -7,7 +7,7 @@ xmlns="&xmlns.dactyl;" xmlns:html="&xmlns.html;"> -
+
BookmarkAdd
Triggered after a page is bookmarked
BookmarkChange
Triggered after a page's bookmark is changed
BookmarkRemove
Triggered after a page's bookmark is removed
@@ -26,7 +26,7 @@
Leave
Triggered before exiting &dactyl.host;
-
+
<bookmark>
The JavaScript bookmark object. Only for Bookmark*.
<changed>
The name of the property that has changed. Only for BookmarkChange.
<doc>
The document for which the event occurred. Only for DOMLoad, PageLoad and PageLoadPre.
diff --git a/pentadactyl/locale/en-US/intro.xml b/pentadactyl/locale/en-US/intro.xml index 7bf808ba..5da41e46 100644 --- a/pentadactyl/locale/en-US/intro.xml +++ b/pentadactyl/locale/en-US/intro.xml @@ -15,7 +15,7 @@ and finger feel should be familiar to Vim users.

-
    +
    1. Quick-start tutorial: A quick-start tutorial for new users. @@ -116,7 +116,7 @@
    -
      +
      • Vim-like keybindings (h, j, gg, ZZ, , etc.)
      • Ex commands (:quit, :open www.foo.com, …)
      • Tab completion for all commands, highly configurable via wildmode, autocomplete, ...
      • diff --git a/pentadactyl/locale/en-US/map.xml b/pentadactyl/locale/en-US/map.xml index 054fad3d..9effed24 100644 --- a/pentadactyl/locale/en-US/map.xml +++ b/pentadactyl/locale/en-US/map.xml @@ -7,7 +7,7 @@ xmlns="&xmlns.dactyl;" xmlns:html="&xmlns.html;"> -
        +
        abbreviation
        abbreviations
        altstyle
        alternate author style sheets
        bookmark
        bookmarks