Adds white-listing for certain attributes to default to 'initial' rather than 'ellipse'
This commit is contained in:
parent
6cd39cb79f
commit
b36ffb3234
|
@ -164,10 +164,18 @@
|
||||||
var form2 = document.createElement('form');
|
var form2 = document.createElement('form');
|
||||||
form2.id = "form2";
|
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 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) {
|
for (key in atts) {
|
||||||
var a = template;
|
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">';
|
inner += '</tbody></table><input type="submit" value="Get Output">';
|
||||||
form2.innerHTML = inner;
|
form2.innerHTML = inner;
|
||||||
|
|
Loading…
Reference in New Issue