diff --git a/common/content/buffer.js b/common/content/buffer.js index fdfca6f7..e7879b8d 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1328,7 +1328,7 @@ const Buffer = Module("buffer", { context.process[1] = function (item, text) template.bookmarkDescription(item, template.highlightFilter(text, this.filter)); context.anchored = false; - context.keys = { text: "text", description: "url", icon: "icon" }; + context.keys = { text: "text", description: "url", icon: "icon", id: "id", command: function () "tabs.select" }; context.compare = CompletionContext.Sort.number; context.filters = [CompletionContext.Filter.textDescription]; @@ -1349,6 +1349,7 @@ const Buffer = Module("buffer", { return { text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], + id: i - 1, url: url, indicator: indicator, icon: tab.image || DEFAULT_FAVICON diff --git a/common/content/commandline.js b/common/content/commandline.js index 5d6acfdb..e6b25fea 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -877,10 +877,10 @@ const CommandLine = Module("commandline", { switch (key) { case "": - if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list") { - event.preventDefault(); - tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1); - } + event.preventDefault(); + let command = event.originalTarget.getAttributeNS(NS.uri, "command"); + if (command && dactyl.commands[command]) + return dactyl.commands[command](event); else openLink(dactyl.CURRENT_TAB); break; diff --git a/common/content/configbase.js b/common/content/configbase.js index b7be5a43..f2a50d61 100644 --- a/common/content/configbase.js +++ b/common/content/configbase.js @@ -155,22 +155,22 @@ const ConfigBase = Class(ModuleBase, { Disabled color: red; !Normal color: black !important; background: white !important; font-weight: normal !important; - !StatusNormal color: white !important; background: inherit !important; + !StatusNormal color: inherit !important; background: inherit !important; ErrorMsg color: white !important; background: red !important; font-weight: bold !important; InfoMsg color: black !important; background: white !important; - StatusInfoMsg color: white !important; background: inherit !important; + StatusInfoMsg color: inherit !important; background: inherit !important; LineNr color: orange !important; background: white !important; ModeMsg color: black !important; background: white !important; - StatusModeMsg color: white !important; background: inherit !important; + StatusModeMsg color: inherit !important; background: inherit !important; MoreMsg color: green !important; background: white !important; - StatusMoreMsg background: black !important; + StatusMoreMsg background: inherit !important; Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block; NonText color: blue; min-height: 16px; padding-left: 2px; *Preview color: gray; Question color: green !important; background: white !important; font-weight: bold !important; - StatusQuestion color: green !important; background: black !important; + StatusQuestion color: green !important; background: inherit !important; WarningMsg color: red !important; background: white !important; - StatusWarningMsg color: red !important; background: black !important; + StatusWarningMsg color: red !important; background: inherit !important; !CmdLine;>* font-family: monospace !important; padding: 1px !important; !StatusCmdLine>* color: white; background: black; font-weight: normal; diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 38f84234..3412a27c 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -31,8 +31,9 @@ const Dactyl = Module("dactyl", { // cheap attempt at compatibility window.liberator = this; modules.liberator = this; - this.observers = {}; + this.commands = {}; this.modules = modules; + this.observers = {}; // NOTE: services.get("profile").selectedProfile.name doesn't return // what you might expect. It returns the last _actively_ selected diff --git a/common/content/dactyl.xul b/common/content/dactyl.xul index cef08f73..76b2e25d 100644 --- a/common/content/dactyl.xul +++ b/common/content/dactyl.xul @@ -11,8 +11,8 @@ - - + + ]> diff --git a/common/content/tabs.js b/common/content/tabs.js index 4b73e768..29d3eeb1 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -33,6 +33,9 @@ const Tabs = Module("tabs", { if (config.hasTabbrowser) config.tabStrip.collapsed = true; // FIXME: see 'stal' comment + dactyl.commands["tabs.select"] = function (event) { + tabs.select(event.originalTarget.getAttribute("identifier")); + }; }, _updateTabCount: function () { diff --git a/common/modules/template.jsm b/common/modules/template.jsm index 2eab7d9b..d07161c4 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -50,7 +50,8 @@ const Template = Module("Template", { bookmarkDescription: function (item, text) <> - {text || ""}  + {text || ""}  { !(item.extra && item.extra.length) ? "" : diff --git a/common/modules/util.jsm b/common/modules/util.jsm index af4f30de..e7f3f1cf 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -811,16 +811,16 @@ const Util = Module("Util", { return doc.createTextNode(String(node)); case "element": let domnode = doc.createElementNS(node.namespace(), node.localName()); - for each (let attr in node.@*) + for each (let attr in node.@*::*) if (attr.name() != "highlight") - domnode.setAttributeNS(attr.namespace(), attr.name(), String(attr)); + domnode.setAttributeNS(attr.namespace(), attr.localName(), String(attr)); else { domnode.setAttributeNS(NS.uri, "highlight", String(attr)); for each (let h in String.split(attr, " ")) highlight.loaded[h] = true; } - for each (let child in node.*) + for each (let child in node.*::*) domnode.appendChild(xmlToDom(child, doc, nodes)); if (nodes && node.@key) nodes[node.@key] = domnode;