1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 03:07:58 +01:00

Some option listing fixes/improvements.

This commit is contained in:
Kris Maglione
2010-11-04 10:08:49 -04:00
parent f1b8e7ee7e
commit 47f498a403
2 changed files with 6 additions and 4 deletions

View File

@@ -58,13 +58,13 @@ const JavaScript = Module("javascript", {
objectKeys: function objectKeys(obj, toplevel) {
// Things we can dereference
if (!obj || ["object", "string", "function"].indexOf(typeof obj) == -1)
if (!obj || ["object", "string", "function"].indexOf(typeof obj) === -1)
return [];
if (jsmodules.isPrototypeOf(obj) && !toplevel)
return [];
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))]);
return completions;
},

View File

@@ -393,7 +393,7 @@ const Option = Class("Option", {
return re;
},
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: {
stringlist: function (k) this.value.indexOf(k) >= 0,
@@ -725,8 +725,10 @@ const Options = Module("options", {
if (opt.type == "boolean") {
if (!opt.value)
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
option.value = <>={template.highlight(opt.stringValue)}</>;
yield option;