User:Phlsph7/Readability.js: Difference between revisions

Content deleted Content added
add exception
keytable
Line 162:
mainDif.insertBefore(overviewDif, mainDif.firstChild);
insertOverviewTable(overviewDif);
insertKeyTable(overviewDif);
overviewDif.appendChild(document.createElement('br'));
insertSentenceTable(overviewDif);
Line 181 ⟶ 182:
addRow(overviewTableBody, 'Number of words', totalWordCount);
addRow(overviewTableBody, 'Number of syllables', totalSyllableCount);
}
// Key for the coloring
function insertKeyTable(parent){
const keyTable = document.createElement('table');
parent.appendChild(keyTable);
keyTable.classList.add('wikitable');
keyTable.style = "float: right;";
key.innerHTML = `<thead>
<tr>
<th>Range</th>
<th>School level</th>
</tr>
</thead>
<tbody>
<tr class="score-100-90">
<td>100–90</td>
<td>5th grade</td>
</tr>
<tr class="score-90-80">
<td>90–80</td>
<td>6th grade</td>
</tr>
<tr class="score-80-70">
<td>80–70</td>
<td>7th grade</td>
</tr>
<tr class="score-70-60">
<td>70–60</td>
<td>8th & 9th grade</td>
</tr>
<tr class="score-60-50">
<td>60–50</td>
<td>10th to 12th grade</td>
</tr>
<tr class="score-50-40">
<td>50–40</td>
<td>College</td>
</tr>
<tr class="score-40-30">
<td>40–30</td>
<td>College</td>
</tr>
<tr class="score-30-20">
<td>30–20</td>
<td>College graduate</td>
</tr>
<tr class="score-20-10">
<td>20–10</td>
<td>College graduate</td>
</tr>
<tr class="score-10-0">
<td>10–0</td>
<td>College graduate</td>
</tr>
</tbody>`;
}