Skip to content

Commit ea294db

Browse files
committed
Replace Issues with Suggestion Quality column
- Added addSpellerSuggQuality() function to fetch spellersuggs.json data - Updated table header from 'Issues' to 'Suggestion Quality' - Fetches suggestion quality badge from gh-pages branch
1 parent 4bf1b28 commit ea294db

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

assets/js/spellertable.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ function addSpellerTableHeader() {
9292
let heading_3 = document.createElement('th');
9393
heading_3.innerHTML = 'Lemma Count';
9494
let heading_4 = document.createElement('th');
95-
heading_4.innerHTML = 'Issues';
96-
heading_4.setAttribute('style', 'width: 15%;');
95+
heading_4.innerHTML = 'Suggestion Quality';
96+
heading_4.setAttribute('style', 'width: 20%;');
9797

9898
row_1.appendChild(heading_1);
9999
row_1.appendChild(heading_2);
@@ -149,6 +149,18 @@ function addSpellerRepoTable(repos, mainFilter, filters) {
149149

150150
// Spellchecker-specific table row generation
151151

152+
function addSpellerSuggQuality(repo) {
153+
let row_sugg = document.createElement('td');
154+
const sugg_image = document.createElement('img');
155+
sugg_image.setAttribute(
156+
'src',
157+
'https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fgiellalt%2F' + repo.name + '%2Fgh-pages%2Fspellersuggs.json&label=S'
158+
);
159+
sugg_image.setAttribute('alt', 'Suggestion Quality');
160+
row_sugg.appendChild(sugg_image);
161+
return row_sugg;
162+
}
163+
152164
function addSpellerTR(repo) {
153165
let row = document.createElement('tr');
154166

@@ -158,7 +170,7 @@ function addSpellerTR(repo) {
158170
row.appendChild(row_lang);
159171
row.appendChild(addRepo(repo));
160172
row.appendChild(addLemmaCount(repo));
161-
row.appendChild(addIssues(repo));
173+
row.appendChild(addSpellerSuggQuality(repo));
162174

163175
return row;
164176
}

0 commit comments

Comments
 (0)