Closed maddes-b closed 1 year ago
Can already be used with the current lib version by replacing the functions for select fields:
GM_config.init({
'id': 'myUserScript', // GM_config instance id
'fields':
{
'locale': // This is the id of the field
{
'label': 'Select a locale', // Appears next to field
'type': 'select',
'options': locales,
'default': 'en'
},
},
types:
{
select:
{
// --- HERE: copy the toNode, toValue and reset functions from the pull request
toNode: function() {
...
},
toValue: function() {
...
},
reset: function() {
...
},
// ------------------------------------------------------------
}
},
});
That is from line 601 to line 869.
Until then people can used the suggested workaround.
Allow option names for select fields via multi-dimensional array or a "Dictionary" Object with
"optvalue": "optname"
pairs. It is backwards compatible with the current options array, that contains only strings for the values.Examples:
Additional:
References: