mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-16 04:23:32 +01:00
don't include "no" prefixed variants of boolean option names in the usage
This commit is contained in:
@@ -7,17 +7,6 @@ function Option(names, type, extra_info)//{{{
|
|||||||
this.names = names;
|
this.names = names;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
||||||
// add noOPTION variant of boolean OPTION to this.names
|
|
||||||
if (this.type == "boolean")
|
|
||||||
{
|
|
||||||
this.names = [];
|
|
||||||
for (var i = 0; i < names.length; i++)
|
|
||||||
{
|
|
||||||
this.names.push(names[i]);
|
|
||||||
this.names.push("no" + names[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setter = function(value) { Options.setPref(this.name, value); };
|
this.setter = function(value) { Options.setPref(this.name, value); };
|
||||||
this.getter = function() { return Options.getPref(this.name); };
|
this.getter = function() { return Options.getPref(this.name); };
|
||||||
|
|
||||||
@@ -46,6 +35,17 @@ function Option(names, type, extra_info)//{{{
|
|||||||
this.validator = extra_info.validator || null;
|
this.validator = extra_info.validator || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add noOPTION variant of boolean OPTION to this.names
|
||||||
|
if (this.type == "boolean")
|
||||||
|
{
|
||||||
|
this.names = [];
|
||||||
|
for (var i = 0; i < names.length; i++)
|
||||||
|
{
|
||||||
|
this.names.push(names[i]);
|
||||||
|
this.names.push("no" + names[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: forced defaults need to use Options.getPref
|
// NOTE: forced defaults need to use Options.getPref
|
||||||
Option.prototype.__defineGetter__("value", function() { return this.getter.call(this); });
|
Option.prototype.__defineGetter__("value", function() { return this.getter.call(this); });
|
||||||
Option.prototype.__defineSetter__("value", function(value) { this.setter.call(this, value); });
|
Option.prototype.__defineSetter__("value", function(value) { this.setter.call(this, value); });
|
||||||
|
|||||||
Reference in New Issue
Block a user