Skip to content

Commit

Permalink
Do not omit API entries that have no confluence data
Browse files Browse the repository at this point in the history
Otherwise, features with zero implementations are likely to be omitted

See also GoogleChromeLabs/confluence#427
  • Loading branch information
dontcallmedom committed Jun 12, 2019
1 parent ee67575 commit fa85e54
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions extract-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const idlreducer = (impldata, name) => (idlacc, member) => {
if (member.name) {
const browserdata = impldata.array.find(d => d.id === name + "#" + member.name);
if (!browserdata) {
idlacc[member.name] = null;
return idlacc;
}
idlacc[member.name] = Object.keys(browserdata)
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
th[scope="row"] + td { border-right: 1px black solid;}
td { border-right: 1px #aaa solid;}
tr td:first-child { border-right: 1px black solid;}
.unknown { background-color: #eee;}
.yes { background-color: #eFe;}
.no { background-color: #Fee;}
.yes2 { background-color: #cFc;}
Expand Down
22 changes: 13 additions & 9 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@ fetch(shortname + ".json")

const nameSpan = document.createElement("span");
const scoreSpan = document.createElement("span");
nameSpan.textContent = member + " ";
scoreSpan.textContent = Object.keys(d[name][member]).length + "/4";
scoreSpan.className = "score";
nameSpan.textContent = member + " ";
if (!d[name][member]) {
scoreSpan.textContent = "?/4";
memberTd.className = "unknown";
} else {
scoreSpan.textContent = Object.keys(d[name][member]).length + "/4";
memberTd.className = Object.keys(d[name][member]).length >= 2 ? "yes" + Object.keys(d[name][member]).length : "no" + (4 - Object.keys(d[name][member]).length);
markupBrowserSupport(chromeTd, d[name][member].chrome);
markupBrowserSupport(edgeTd, d[name][member].edge);
markupBrowserSupport(firefoxTd, d[name][member].firefox);
markupBrowserSupport(safariTd, d[name][member].safari);
}

memberTd.appendChild(nameSpan);
memberTd.appendChild(scoreSpan);

memberTd.className = Object.keys(d[name][member]).length >= 2 ? "yes" + Object.keys(d[name][member]).length : "no" + (4 - Object.keys(d[name][member]).length);
markupBrowserSupport(chromeTd, d[name][member].chrome);
markupBrowserSupport(edgeTd, d[name][member].edge);
markupBrowserSupport(firefoxTd, d[name][member].firefox);
markupBrowserSupport(safariTd, d[name][member].safari);

container.appendChild(memberTd);
container.appendChild(chromeTd);
container.appendChild(edgeTd);
Expand Down

0 comments on commit fa85e54

Please sign in to comment.