mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 13:37:59 +01:00
Fix :set number!=...
This commit is contained in:
@@ -2288,7 +2288,8 @@ var Buffer = Module("buffer", {
|
|||||||
|
|
||||||
setter: function setter(value) {
|
setter: function setter(value) {
|
||||||
prefs.set(this.PREF, value > 1);
|
prefs.set(this.PREF, value > 1);
|
||||||
return value > 1 ? value : this.globalValue;
|
if (value > 1)
|
||||||
|
return value;
|
||||||
},
|
},
|
||||||
|
|
||||||
validator: function (value) value > 0
|
validator: function (value) value > 0
|
||||||
|
|||||||
@@ -600,6 +600,23 @@ var Option = Class("Option", {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
string: function string(operator, values, scope, invert) {
|
||||||
|
if (invert)
|
||||||
|
return values[(values.indexOf(this.value) + 1) % values.length];
|
||||||
|
|
||||||
|
switch (operator) {
|
||||||
|
case "+":
|
||||||
|
return this.value + values;
|
||||||
|
case "-":
|
||||||
|
return this.value.replace(values, "");
|
||||||
|
case "^":
|
||||||
|
return values + this.value;
|
||||||
|
case "=":
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
stringmap: function stringmap(operator, values, scope, invert) {
|
stringmap: function stringmap(operator, values, scope, invert) {
|
||||||
let res = update({}, this.value);
|
let res = update({}, this.value);
|
||||||
|
|
||||||
@@ -657,23 +674,7 @@ var Option = Class("Option", {
|
|||||||
get regexplist() this.stringlist,
|
get regexplist() this.stringlist,
|
||||||
get regexpmap() this.stringlist,
|
get regexpmap() this.stringlist,
|
||||||
get sitelist() this.stringlist,
|
get sitelist() this.stringlist,
|
||||||
get sitemap() this.stringlist,
|
get sitemap() this.stringlist
|
||||||
|
|
||||||
string: function string(operator, values, scope, invert) {
|
|
||||||
if (invert)
|
|
||||||
return values[(values.indexOf(this.value) + 1) % values.length];
|
|
||||||
switch (operator) {
|
|
||||||
case "+":
|
|
||||||
return this.value + values;
|
|
||||||
case "-":
|
|
||||||
return this.value.replace(values, "");
|
|
||||||
case "^":
|
|
||||||
return values + this.value;
|
|
||||||
case "=":
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
validIf: function validIf(test, error) {
|
validIf: function validIf(test, error) {
|
||||||
@@ -1005,6 +1006,7 @@ var Options = Module("options", {
|
|||||||
res.optionValue = res.option.get(res.scope);
|
res.optionValue = res.option.get(res.scope);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (!res.invert || res.option.type != "number") // Hack.
|
||||||
res.values = res.option.parse(res.value);
|
res.values = res.option.parse(res.value);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user