mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 16:47:58 +01:00
Some option listing fixes/improvements.
This commit is contained in:
@@ -58,13 +58,13 @@ const JavaScript = Module("javascript", {
|
|||||||
|
|
||||||
objectKeys: function objectKeys(obj, toplevel) {
|
objectKeys: function objectKeys(obj, toplevel) {
|
||||||
// Things we can dereference
|
// Things we can dereference
|
||||||
if (!obj || ["object", "string", "function"].indexOf(typeof obj) == -1)
|
if (!obj || ["object", "string", "function"].indexOf(typeof obj) === -1)
|
||||||
return [];
|
return [];
|
||||||
if (jsmodules.isPrototypeOf(obj) && !toplevel)
|
if (jsmodules.isPrototypeOf(obj) && !toplevel)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
let completions = [k for (k in this.iter(obj, toplevel))];
|
let completions = [k for (k in this.iter(obj, toplevel))];
|
||||||
if (obj == modules) // Hack.
|
if (obj === modules) // Hack.
|
||||||
completions = completions.concat([k for (k in this.iter(jsmodules, toplevel))]);
|
completions = completions.concat([k for (k in this.iter(jsmodules, toplevel))]);
|
||||||
return completions;
|
return completions;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ const Option = Class("Option", {
|
|||||||
return re;
|
return re;
|
||||||
},
|
},
|
||||||
unparseRegexp: function (re) re.bang + Option.quote(re.source.replace(/\\(.)/g, function (m, n1) n1 == "/" ? n1 : m), /^!|:/) +
|
unparseRegexp: function (re) re.bang + Option.quote(re.source.replace(/\\(.)/g, function (m, n1) n1 == "/" ? n1 : m), /^!|:/) +
|
||||||
(typeof re.result === "string" ? ":" + Option.quote(re.result) : ""),
|
(typeof re.result === "boolean" ? "" : ":" + Option.quote(re.result)),
|
||||||
|
|
||||||
getKey: {
|
getKey: {
|
||||||
stringlist: function (k) this.value.indexOf(k) >= 0,
|
stringlist: function (k) this.value.indexOf(k) >= 0,
|
||||||
@@ -725,8 +725,10 @@ const Options = Module("options", {
|
|||||||
if (opt.type == "boolean") {
|
if (opt.type == "boolean") {
|
||||||
if (!opt.value)
|
if (!opt.value)
|
||||||
option.pre = "no";
|
option.pre = "no";
|
||||||
option.default = (option.default ? "" : "no") + opt.name;
|
option.default = (opt.defaultValue ? "" : "no") + opt.name;
|
||||||
}
|
}
|
||||||
|
else if (isArray(opt.value))
|
||||||
|
option.value = <>={template.map(opt.value, function (v) template.highlight(String(v)), <>,<span style="width: 0; display: inline-block"> </span></>)}</>;
|
||||||
else
|
else
|
||||||
option.value = <>={template.highlight(opt.stringValue)}</>;
|
option.value = <>={template.highlight(opt.stringValue)}</>;
|
||||||
yield option;
|
yield option;
|
||||||
|
|||||||
Reference in New Issue
Block a user