Examples > web-settings
PLUGIN.JS (3/5)
function control(f) {
const attrs = `data-k="${f.key}" id="${api.name}-${f.key}"`;
if (f.type === 'select') {
return ``;
}
if (f.type === 'checkbox') {
return ``;
}
const type = f.type === 'url' ? 'text' : f.type;
const extra = [
f.placeholder ? `placeholder="${esc(f.placeholder)}"` : '',
f.min != null ? `min="${f.min}"` : '',
f.max != null ? `max="${f.max}"` : '',
f.type === 'password' ? 'autocomplete="new-password"' : 'autocomplete="off"',
].join(' ');
return ``;
}
Next: 06 plugin.js (4/5)