mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 23:27:58 +01:00
More selective :ext* completion filtering.
This commit is contained in:
@@ -416,12 +416,14 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
name: "exte[nable]",
|
name: "exte[nable]",
|
||||||
description: "Enable an extension",
|
description: "Enable an extension",
|
||||||
action: "enableItem"
|
action: "enableItem",
|
||||||
|
filter: function ({ item: e }) !e.enabled
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "extd[isable]",
|
name: "extd[isable]",
|
||||||
description: "Disable an extension",
|
description: "Disable an extension",
|
||||||
action: "disableItem"
|
action: "disableItem",
|
||||||
|
filter: function ({ item: e }) e.enabled
|
||||||
}
|
}
|
||||||
].forEach(function (command) {
|
].forEach(function (command) {
|
||||||
commands.add([command.name],
|
commands.add([command.name],
|
||||||
@@ -448,7 +450,13 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
argCount: "?", // FIXME: should be "1"
|
argCount: "?", // FIXME: should be "1"
|
||||||
bang: true,
|
bang: true,
|
||||||
completer: function (context) completion.extension(context)
|
completer: function (context)
|
||||||
|
{
|
||||||
|
completion.extension(context)
|
||||||
|
if (command.filter)
|
||||||
|
context.filters.push(command.filter);
|
||||||
|
},
|
||||||
|
literal: 0
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
commands.add(["exto[ptions]", "extp[references]"],
|
commands.add(["exto[ptions]", "extp[references]"],
|
||||||
@@ -459,8 +467,7 @@ const liberator = (function () //{{{
|
|||||||
if (!extension || !extension.options)
|
if (!extension || !extension.options)
|
||||||
return void liberator.extension("E474: Invalid argument");
|
return void liberator.extension("E474: Invalid argument");
|
||||||
if (args.bang)
|
if (args.bang)
|
||||||
window.openDialog(extension.options,
|
window.openDialog(extension.options, "_blank", "chrome");
|
||||||
"_blank", "chrome");
|
|
||||||
else
|
else
|
||||||
liberator.open(extension.options,
|
liberator.open(extension.options,
|
||||||
options.get("newtab").has("all", "extoptions")
|
options.get("newtab").has("all", "extoptions")
|
||||||
@@ -491,6 +498,7 @@ const liberator = (function () //{{{
|
|||||||
["Name", "Version", "Status", "Description"], [],
|
["Name", "Version", "Status", "Description"], [],
|
||||||
([template.icon(e, e.name),
|
([template.icon(e, e.name),
|
||||||
e.version,
|
e.version,
|
||||||
|
/* XXX: Inline style. */
|
||||||
e.enabled ? <span style="color: blue;">enabled</span>
|
e.enabled ? <span style="color: blue;">enabled</span>
|
||||||
: <span style="color: red;">disabled</span>,
|
: <span style="color: red;">disabled</span>,
|
||||||
e.description] for ([,e] in Iterator(extensions)))
|
e.description] for ([,e] in Iterator(extensions)))
|
||||||
|
|||||||
Reference in New Issue
Block a user