Adds white-listing for certain attributes to default to 'initial' rather than 'ellipse'

This commit is contained in:
sloum 2021-07-10 20:31:22 -07:00
parent 6cd39cb79f
commit b36ffb3234
1 changed files with 10 additions and 2 deletions

View File

@ -164,10 +164,18 @@
var form2 = document.createElement('form');
form2.id = "form2";
var inner = '<table><thead><tr><td></td><th scope="col">Ellipses</th><th scope="col">Initial</th><th scope="col">Unset</th></thead><tbody>';
var template = '<tr id="tr-$$"><th scope="row">$$</th><td><input type="radio" name="radio-$$" value="e" checked></td><td><input type="radio" name="radio-$$" value="i"></td><td><input type="radio" name="radio-$$" value="u"></td></tr>';
var template = '<tr id="tr-$$"><th scope="row">$$</th><td><input type="radio" name="radio-$$" value="e" !!></td><td><input type="radio" name="radio-$$" value="i" ^^></td><td><input type="radio" name="radio-$$" value="u"></td></tr>';
for (key in atts) {
var a = template;
inner += a.replaceAll('$$', key);
a = a.replaceAll('$$', key);
if (key == "role" || key == "alt" || key.indexOf("aria") == 0 ) {
a = a.replaceAll('!!', '');
a = a.replaceAll('^^', 'checked');
} else {
a = a.replaceAll('!!', 'checked');
a = a.replaceAll('^^', '');
}
inner += a
}
inner += '</tbody></table><input type="submit" value="Get Output">';
form2.innerHTML = inner;