Skip to content

Commit

Permalink
Use ul.comma for allprefs lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 8, 2023
1 parent 8db82ea commit f22b5c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
14 changes: 4 additions & 10 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9934,7 +9934,7 @@ function render_allpref() {
var pctr = this;
demand_load.pc().then(function (pcs) {
var allpref = pattrnear(pctr, "data-allpref") || "",
atomre = /(\d+)([PT])(\S+)/g, t = [], m, pref, frag, i, e, u;
atomre = /(\d+)([PT])(\S+)/g, t = [], m, pref, ul, i, e, u;
while ((m = atomre.exec(allpref)) !== null) {
pref = parseInt(m[3]);
t.push([m[2] === "P" ? pref : 0, pref, t.length, pcs[m[1]], m[2]]);
Expand All @@ -9951,7 +9951,7 @@ function render_allpref() {
else
return a[2] < b[2] ? -1 : 1;
});
frag = document.createDocumentFragment();
ul = $e("ul", "comma");
for (i = 0; i !== t.length; ++i) {
u = t[i];
pref = u[1];
Expand All @@ -9960,15 +9960,9 @@ function render_allpref() {
} else {
e = $e("span", "asspref1", u[4].concat("+", pref));
}
e = $e("span", "nb", usere(u[3]), " ", e);
if (i < t.length - 1) {
e.append(",");
frag.append(e, " ");
} else {
frag.append(e);
}
ul.append($e("li", null, usere(u[3]), " ", e));
}
pctr.replaceChildren(frag);
pctr.parentElement.replaceChild(ul, pctr);
removeClass(pctr, "need-allpref");
}, function () {
pctr.closest("div").replaceChildren();
Expand Down
11 changes: 9 additions & 2 deletions stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1190,14 +1190,21 @@ ul.semi {
margin-top: 0;
margin-bottom: 0;
}
ul.semi > li {
ul.comma {
display: inline;
}
ul.semi > li, ul.comma > li {
display: inline-block;
}
ul.semi > li::after {
content: "; ";
padding-right: 0.35em;
}
ul.semi > li:last-child::after {
ul.comma > li::after {
content: ", ";
padding-right: 0.35em;
}
ul.semi > li:last-child::after, ul.comma > li:last-child::after {
content: "";
padding-right: 0;
}
Expand Down

0 comments on commit f22b5c7

Please sign in to comment.