mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 21:58:00 +01:00
Get rid of template.maybeXML.
This commit is contained in:
@@ -1158,7 +1158,8 @@ const Buffer = Module("buffer", {
|
|||||||
elem = find(doc.body || doc.getElementsByTagName("body")[0] ||
|
elem = find(doc.body || doc.getElementsByTagName("body")[0] ||
|
||||||
doc.documentElement);
|
doc.documentElement);
|
||||||
}
|
}
|
||||||
return elem;
|
let doc = buffer.focusedFrame.document;
|
||||||
|
return elem || doc.body || doc.documentElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
scrollVertical: function scrollVertical(elem, increment, number) {
|
scrollVertical: function scrollVertical(elem, increment, number) {
|
||||||
|
|||||||
@@ -1759,7 +1759,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
commands.add(["q[uit]"],
|
commands.add(["q[uit]"],
|
||||||
dactyl.has("tabs") ? "Quit current tab" : "Quit application",
|
dactyl.has("tabs") ? "Quit current tab" : "Quit application",
|
||||||
function (args) {
|
function (args) {
|
||||||
if (dactyl.has("tabs") && tabs.remove(config.browser.mCurrentTab, 1, false))
|
if (dactyl.has("tabs") && tabs.remove(tabs.getTab(), 1, false))
|
||||||
return;
|
return;
|
||||||
else if (dactyl.windows.length > 1)
|
else if (dactyl.windows.length > 1)
|
||||||
window.close();
|
window.close();
|
||||||
@@ -1889,6 +1889,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
return completion.javascript(context);
|
return completion.javascript(context);
|
||||||
},
|
},
|
||||||
count: true,
|
count: true,
|
||||||
|
hereDoc: true,
|
||||||
literal: 0,
|
literal: 0,
|
||||||
subCommand: 0
|
subCommand: 0
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -668,7 +668,10 @@ const JavaScript = Module("javascript", {
|
|||||||
"boolean", false, {
|
"boolean", false, {
|
||||||
setter: function (value) {
|
setter: function (value) {
|
||||||
if (services.debugger.isOn != value)
|
if (services.debugger.isOn != value)
|
||||||
services.debugger[value ? "on" : "off"]();
|
if (value)
|
||||||
|
(services.debugger.asyncOn || services.debugger.on)(null);
|
||||||
|
else
|
||||||
|
services.debugger.off();
|
||||||
},
|
},
|
||||||
getter: function () services.debugger.isOn
|
getter: function () services.debugger.isOn
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ defineModule("template", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
default xml namespace = XHTML;
|
default xml namespace = XHTML;
|
||||||
function fixXML() {
|
|
||||||
XML.ignoreWhiteSpace = false;
|
|
||||||
XML.prettyPrinting = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Template = Module("Template", {
|
const Template = Module("Template", {
|
||||||
add: function add(a, b) a + b,
|
add: function add(a, b) a + b,
|
||||||
@@ -39,18 +35,6 @@ const Template = Module("Template", {
|
|||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
|
||||||
maybeXML: function maybeXML(xml) {
|
|
||||||
if (typeof xml == "xml")
|
|
||||||
return xml;
|
|
||||||
try {
|
|
||||||
XML.ignoreWhitespace = false;
|
|
||||||
XML.prettyPrinting = false;
|
|
||||||
return new XMLList(xml);
|
|
||||||
}
|
|
||||||
catch (e) {}
|
|
||||||
return <>{xml}</>;
|
|
||||||
},
|
|
||||||
|
|
||||||
bookmarkDescription: function (item, text)
|
bookmarkDescription: function (item, text)
|
||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
@@ -282,7 +266,7 @@ const Template = Module("Template", {
|
|||||||
this.map(data, function (datum)
|
this.map(data, function (datum)
|
||||||
<tr>
|
<tr>
|
||||||
<td style={"font-weight: bold; min-width: 150px; padding-left: " + (indent || "2ex")}>{datum[0]}</td>
|
<td style={"font-weight: bold; min-width: 150px; padding-left: " + (indent || "2ex")}>{datum[0]}</td>
|
||||||
<td>{template.maybeXML(datum[1])}</td>
|
<td>{datum[1]}</td>
|
||||||
</tr>)
|
</tr>)
|
||||||
}
|
}
|
||||||
</table>;
|
</table>;
|
||||||
|
|||||||
Reference in New Issue
Block a user