mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:17:59 +01:00
Fix links in :ls and remove some old cruft as a result.
This commit is contained in:
@@ -1328,7 +1328,7 @@ const Buffer = Module("buffer", {
|
|||||||
context.process[1] = function (item, text) template.bookmarkDescription(item, template.highlightFilter(text, this.filter));
|
context.process[1] = function (item, text) template.bookmarkDescription(item, template.highlightFilter(text, this.filter));
|
||||||
|
|
||||||
context.anchored = false;
|
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.compare = CompletionContext.Sort.number;
|
||||||
context.filters = [CompletionContext.Filter.textDescription];
|
context.filters = [CompletionContext.Filter.textDescription];
|
||||||
|
|
||||||
@@ -1349,6 +1349,7 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
||||||
|
id: i - 1,
|
||||||
url: url,
|
url: url,
|
||||||
indicator: indicator,
|
indicator: indicator,
|
||||||
icon: tab.image || DEFAULT_FAVICON
|
icon: tab.image || DEFAULT_FAVICON
|
||||||
|
|||||||
@@ -877,10 +877,10 @@ const CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "<LeftMouse>":
|
case "<LeftMouse>":
|
||||||
if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list") {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1);
|
let command = event.originalTarget.getAttributeNS(NS.uri, "command");
|
||||||
}
|
if (command && dactyl.commands[command])
|
||||||
|
return dactyl.commands[command](event);
|
||||||
else
|
else
|
||||||
openLink(dactyl.CURRENT_TAB);
|
openLink(dactyl.CURRENT_TAB);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -155,22 +155,22 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
Disabled color: red;
|
Disabled color: red;
|
||||||
|
|
||||||
!Normal color: black !important; background: white !important; font-weight: normal !important;
|
!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;
|
ErrorMsg color: white !important; background: red !important; font-weight: bold !important;
|
||||||
InfoMsg color: black !important; background: white !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;
|
LineNr color: orange !important; background: white !important;
|
||||||
ModeMsg color: black !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;
|
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;
|
Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block;
|
||||||
NonText color: blue; min-height: 16px; padding-left: 2px;
|
NonText color: blue; min-height: 16px; padding-left: 2px;
|
||||||
*Preview color: gray;
|
*Preview color: gray;
|
||||||
Question color: green !important; background: white !important; font-weight: bold !important;
|
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;
|
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;
|
!CmdLine;>* font-family: monospace !important; padding: 1px !important;
|
||||||
!StatusCmdLine>* color: white; background: black; font-weight: normal;
|
!StatusCmdLine>* color: white; background: black; font-weight: normal;
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ const Dactyl = Module("dactyl", {
|
|||||||
// cheap attempt at compatibility
|
// cheap attempt at compatibility
|
||||||
window.liberator = this;
|
window.liberator = this;
|
||||||
modules.liberator = this;
|
modules.liberator = this;
|
||||||
this.observers = {};
|
this.commands = {};
|
||||||
this.modules = modules;
|
this.modules = modules;
|
||||||
|
this.observers = {};
|
||||||
|
|
||||||
// NOTE: services.get("profile").selectedProfile.name doesn't return
|
// NOTE: services.get("profile").selectedProfile.name doesn't return
|
||||||
// what you might expect. It returns the last _actively_ selected
|
// what you might expect. It returns the last _actively_ selected
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
<!DOCTYPE overlay SYSTEM "dactyl.dtd" [
|
<!DOCTYPE overlay SYSTEM "dactyl.dtd" [
|
||||||
<!ENTITY and "&&">
|
<!ENTITY and "&&">
|
||||||
<!ENTITY dactyl.content "chrome://dactyl/content/">
|
<!ENTITY dactyl.content "chrome://dactyl/content/">
|
||||||
<!ENTITY commandline "window.dactyl ∧ dactyl.modules.commandline">
|
<!ENTITY commandline "if (window.dactyl) return dactyl.modules.commandline">
|
||||||
<!ENTITY events "if (window.dactyl ∧ dactyl.modules.loaded.events) dactyl.modules.events">
|
<!ENTITY events "if (window.dactyl ∧ dactyl.modules.loaded.events) return dactyl.modules.events">
|
||||||
<!ENTITY status "dactyl-statusline-field-">
|
<!ENTITY status "dactyl-statusline-field-">
|
||||||
]>
|
]>
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ const Tabs = Module("tabs", {
|
|||||||
if (config.hasTabbrowser)
|
if (config.hasTabbrowser)
|
||||||
config.tabStrip.collapsed = true; // FIXME: see 'stal' comment
|
config.tabStrip.collapsed = true; // FIXME: see 'stal' comment
|
||||||
|
|
||||||
|
dactyl.commands["tabs.select"] = function (event) {
|
||||||
|
tabs.select(event.originalTarget.getAttribute("identifier"));
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateTabCount: function () {
|
_updateTabCount: function () {
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ const Template = Module("Template", {
|
|||||||
|
|
||||||
bookmarkDescription: function (item, text)
|
bookmarkDescription: function (item, text)
|
||||||
<>
|
<>
|
||||||
<a href={item.item.url} highlight="URL">{text || ""}</a> 
|
<a xmlns:dactyl={NS} identifier={item.id} dactyl:command={item.command}
|
||||||
|
href={item.item.url} highlight="URL">{text || ""}</a> 
|
||||||
{
|
{
|
||||||
!(item.extra && item.extra.length) ? "" :
|
!(item.extra && item.extra.length) ? "" :
|
||||||
<span class="extra-info">
|
<span class="extra-info">
|
||||||
|
|||||||
@@ -811,16 +811,16 @@ const Util = Module("Util", {
|
|||||||
return doc.createTextNode(String(node));
|
return doc.createTextNode(String(node));
|
||||||
case "element":
|
case "element":
|
||||||
let domnode = doc.createElementNS(node.namespace(), node.localName());
|
let domnode = doc.createElementNS(node.namespace(), node.localName());
|
||||||
for each (let attr in node.@*)
|
for each (let attr in node.@*::*)
|
||||||
if (attr.name() != "highlight")
|
if (attr.name() != "highlight")
|
||||||
domnode.setAttributeNS(attr.namespace(), attr.name(), String(attr));
|
domnode.setAttributeNS(attr.namespace(), attr.localName(), String(attr));
|
||||||
else {
|
else {
|
||||||
domnode.setAttributeNS(NS.uri, "highlight", String(attr));
|
domnode.setAttributeNS(NS.uri, "highlight", String(attr));
|
||||||
for each (let h in String.split(attr, " "))
|
for each (let h in String.split(attr, " "))
|
||||||
highlight.loaded[h] = true;
|
highlight.loaded[h] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for each (let child in node.*)
|
for each (let child in node.*::*)
|
||||||
domnode.appendChild(xmlToDom(child, doc, nodes));
|
domnode.appendChild(xmlToDom(child, doc, nodes));
|
||||||
if (nodes && node.@key)
|
if (nodes && node.@key)
|
||||||
nodes[node.@key] = domnode;
|
nodes[node.@key] = domnode;
|
||||||
|
|||||||
Reference in New Issue
Block a user