Fix: add styleMetaErrorSelectValueMismatch
This commit is contained in:
parent
45e70b2b6a
commit
f35fbb5b36
|
@ -773,6 +773,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"styleMetaErrorSelectValueMismatch": {
|
||||||
|
"message": "Invalid @select: value doesn't exist in the list",
|
||||||
|
"description": "Error displayed when the value of @select is invalid"
|
||||||
|
},
|
||||||
"styleMissingMeta": {
|
"styleMissingMeta": {
|
||||||
"message": "Missing metadata @$key$",
|
"message": "Missing metadata @$key$",
|
||||||
"description": "Error displayed when a mandatory metadata is missing",
|
"description": "Error displayed when a mandatory metadata is missing",
|
||||||
|
|
|
@ -512,7 +512,7 @@ var usercss = (() => {
|
||||||
function validVar(va, value = 'default') {
|
function validVar(va, value = 'default') {
|
||||||
if (va.type === 'select' || va.type === 'dropdown') {
|
if (va.type === 'select' || va.type === 'dropdown') {
|
||||||
if (va.options.every(o => o.value !== va[value])) {
|
if (va.options.every(o => o.value !== va[value])) {
|
||||||
throw new Error(chrome.i18n.getMessage('invalid select value'));
|
throw new Error(chrome.i18n.getMessage('styleMetaErrorSelectValueMismatch'));
|
||||||
}
|
}
|
||||||
} else if (va.type === 'checkbox' && !/^[01]$/.test(va[value])) {
|
} else if (va.type === 'checkbox' && !/^[01]$/.test(va[value])) {
|
||||||
throw new Error(chrome.i18n.getMessage('styleMetaErrorCheckbox'));
|
throw new Error(chrome.i18n.getMessage('styleMetaErrorCheckbox'));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user