diff --git a/common/components/protocols.js b/common/components/protocols.js index 68a4b8df..590dcf93 100644 --- a/common/components/protocols.js +++ b/common/components/protocols.js @@ -22,14 +22,7 @@ const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler; const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); const prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService) .getBranch("extensions.dactyl."); - -let channel = Components.classesByID["{61ba33c0-3031-11d3-8cd0-0060b0fc14a3}"] - .getService(Ci.nsIProtocolHandler) - .newChannel(ioService.newURI("chrome://dactyl/content/data", null, null)) - .QueryInterface(Ci.nsIRequest); -const systemPrincipal = channel.owner; -channel.cancel(NS_BINDING_ABORTED); -channel = null; +const systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].getService(Ci.nsIPrincipal); function dataURL(type, data) "data:" + (type || "application/xml;encoding=UTF-8") + "," + escape(data); function makeChannel(url, orig) { @@ -154,6 +147,8 @@ Dactyl.prototype = { return makeChannel(url, uri); case "help-tag": let tag = decodeURIComponent(uri.path.substr(1)); + 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); } diff --git a/common/content/commands.js b/common/content/commands.js index 119257ec..727b234b 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -1183,9 +1183,9 @@ const Commands = Module("commands", { function quote(q, list, map) { map = map || Commands.quoteMap; let re = RegExp("[" + list + "]", "g"); - let res = function (str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; - res.list = list; - return res; + function quote(str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; + quote.list = list; + return quote; }; Commands.quoteArg = { diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 916dd18e..59214079 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -507,13 +507,14 @@ const Dactyl = Module("dactyl", { '\n' + '\n' + '\n' + + unescape(encodeURI( // UTF-8 handling hack.

Using Plugins

{body} -
.toXMLString(); + .toXMLString())); fileMap["plugins"] = function () ['text/xml;charset=UTF-8', help]; addTags("plugins", util.httpGet("dactyl://help/plugins").responseXML); @@ -551,7 +552,7 @@ const Dactyl = Module("dactyl", { function fix(node) { switch(node.nodeType) { case Node.ELEMENT_NODE: - if (node instanceof HTMLScriptElement) + if (isinstance(node, [HTMLBaseElement, HTMLScriptElement])) return; data.push("<"); data.push(node.localName); @@ -565,10 +566,13 @@ const Dactyl = Module("dactyl", { set.add(styles, value); } if (name == "href") { - if (value.indexOf("dactyl://help-tag/") == 0) - value = services.get("io").newChannel(value, null, null).originalURI.path.substr(1); - if (!/[#\/]/.test(value)) - value += ".xhtml"; + value = node.href; + if (value.indexOf("dactyl://help-tag/") == 0) { + let uri = services.get("io").newChannel(value, null, null).originalURI; + value = uri.spec == value ? "javascript:;" : uri.path.substr(1); + } + if (!/^#|[\/](#|$)|^[a-z]+:/.test(value)) + value = value.replace(/(#|$)/, ".xhtml$1"); } if (name == "src" && value.indexOf(":") > 0) { chrome[value] = value.replace(/.*\//, "");; diff --git a/common/content/help.xsl b/common/content/help.xsl index 77d9c2e9..109fe73e 100644 --- a/common/content/help.xsl +++ b/common/content/help.xsl @@ -359,7 +359,15 @@ - + + + + + + + + + external diff --git a/common/locale/en-US/browsing.xml b/common/locale/en-US/browsing.xml index a7679a8b..8def5196 100644 --- a/common/locale/en-US/browsing.xml +++ b/common/locale/en-US/browsing.xml @@ -340,7 +340,7 @@ want to bypass &dactyl.appName;'s key handling and pass keys directly to

For example, at the URL http://www.example.com/dir1/dir2/file.htm, - 2gu opens http://www.example.com/dir1/. + 2gu opens http://www.example.com/dir1/.

diff --git a/common/locale/en-US/buffer.xml b/common/locale/en-US/buffer.xml index 77e4336a..64259652 100644 --- a/common/locale/en-US/buffer.xml +++ b/common/locale/en-US/buffer.xml @@ -219,7 +219,7 @@

Scroll window downwards by the amount specified in the scroll option. With count, scroll as if - scroll were set to count. + scroll were set to count.

@@ -233,7 +233,7 @@

Scroll window upwards by the amount specified in the scroll option. With count, scroll as if - scroll were set to count. + scroll were set to count.

diff --git a/common/locale/en-US/gui.xml b/common/locale/en-US/gui.xml index ca5fca6e..1e145433 100644 --- a/common/locale/en-US/gui.xml +++ b/common/locale/en-US/gui.xml @@ -48,7 +48,7 @@

Opens the &dactyl.host; addon manager, where extensions and themes may be installed, removed, disabled, and configured. See also - :extensions, :extinstall, :extoptions, + :extensions, :extadd, :extoptions, :extenable, :extdisable, and :extdelete.

diff --git a/common/locale/en-US/insert.xml b/common/locale/en-US/insert.xml index b727c561..7f3f2706 100644 --- a/common/locale/en-US/insert.xml +++ b/common/locale/en-US/insert.xml @@ -8,7 +8,7 @@ title="&dactyl.appName; Insert Mode" xmlns="&xmlns.dactyl;" xmlns:html="&xmlns.html;"> -

Insert mode

+

Insert mode

diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index c27aab9b..6491919c 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -264,7 +264,7 @@

&dactyl.host; options can be viewed and set with the following commands:

- :prefs :preferences + :pref :prefs :preferences :preferences

@@ -277,7 +277,7 @@ - :prefs! :preferences! + :pref! :prefs! :preferences! :preferences!

@@ -1401,7 +1401,7 @@ - 'verbose', 'vbs' + 'vbs' 'verbose' 'verbose' 'vbs' number 1 diff --git a/common/locale/en-US/repeat.xml b/common/locale/en-US/repeat.xml index 20b4aabd..5ec7dae0 100644 --- a/common/locale/en-US/repeat.xml +++ b/common/locale/en-US/repeat.xml @@ -178,7 +178,7 @@ line, you can use,

- js <<EOF + :js <<EOF var hello = function () { alert(Hello world); } diff --git a/common/modules/util.jsm b/common/modules/util.jsm index c73d30e6..508126a1 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -275,7 +275,7 @@ const Util = Module("Util", { * @param {boolean} asIterator Whether to return the results as an * XPath iterator. */ - evaluateXPath: (function () { + evaluateXPath: update( function evaluateXPath(expression, doc, elem, asIterator) { if (!doc) doc = util.activeWindow.content.document; @@ -296,15 +296,15 @@ const Util = Module("Util", { : function () { for (let i = 0; i < this.snapshotLength; i++) yield this.snapshotItem(i); } } }); - } - evaluateXPath.resolver = function lookupNamespaceURI(prefix) ({ - xul: XUL.uri, - xhtml: XHTML.uri, - xhtml2: "http://www.w3.org/2002/06/xhtml2", - dactyl: NS.uri - }[prefix] || null); - return evaluateXPath; - })(), + }, + { + resolver: function lookupNamespaceURI(prefix) ({ + xul: XUL.uri, + xhtml: XHTML.uri, + xhtml2: "http://www.w3.org/2002/06/xhtml2", + dactyl: NS.uri + }[prefix] || null) + }), extend: function extend(dest) { Array.slice(arguments, 1).filter(util.identity).forEach(function (src) { diff --git a/pentadactyl/locale/en-US/intro.xml b/pentadactyl/locale/en-US/intro.xml index 3fc1f383..94b91b51 100644 --- a/pentadactyl/locale/en-US/intro.xml +++ b/pentadactyl/locale/en-US/intro.xml @@ -147,7 +147,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 and wildoptions
  • +
  • Tab completion for all commands, highly configurable via wildmode, autocomplete, ...
  • Hit-a-hint like navigation of links (start with f to follow a link)
  • Advanced completion of bookmark and history URLs
  • Vim-like status line with a Wget-like progress bar
  • @@ -157,8 +157,8 @@
  • Count supported for many commands (3 will go back 3 pages)
  • Visual bell for errors (visualbell)
  • Marks support (ma to set mark a, 'a to jump to it)
  • -
  • QuickMark support
  • -
  • :map, :command, :feedkeys, and macros
  • +
  • QuickMark support
  • +
  • :map, :command, :normal, and macros
  • Editing of text fields with an external editor
  • AutoCommands to execute actions on certain events
  • A comprehensive help system, explaining all commands, mappings, options, and plugins
  • diff --git a/pentadactyl/locale/en-US/tutorial.xml b/pentadactyl/locale/en-US/tutorial.xml index f7e214ed..8a384f5d 100644 --- a/pentadactyl/locale/en-US/tutorial.xml +++ b/pentadactyl/locale/en-US/tutorial.xml @@ -234,7 +234,7 @@

    - To test it, try this link: &dactyl.appName; Homepage. + To test it, try this link: &dactyl.appName; Homepage. Activate QuickHint mode with f or F to highlight all currently visible links. Then start typing the text of the link. The link should be uniquely identified soon, and &dactyl.appName; will open it. Once you're done, @@ -372,9 +372,9 @@ &dactyl.appName; has an energetic and growing user base. If you've run into a problem that you can't seem to solve with &dactyl.appName;, or if you think you might have found a bug, please let us know! There is support available on the - wiki - or in the #pentadactyl IRC - channel on OFTC. + wiki + or in the #pentadactyl IRC + channel on OFTC.