Content deleted Content added
DreamRimmer (talk | contribs) fix |
DreamRimmer (talk | contribs) fixes |
||
Line 547:
return Promise.all(promises).then(results => {
const allRfcs = results.flat();
console.log('Total RfCs found:', allRfcs.length);
console.log('RfC data:', allRfcs.slice(0, 3));
return createRfCDisplay(allRfcs);
});
Line 553 ⟶ 555:
function parseRfCs(wikitext, topicName) {
const rfcs = [];
const rfcPattern = /'''\[\[([^\]]+)\]\]'''[\s\S]*?\{\{rfcquote\|text=([^}]+)\}\}/g;
let match;
while ((match = rfcPattern.exec(wikitext)) !== null) {
const linkText = match[1];
let pageName, anchor;
Line 567 ⟶ 570:
}
const
if (
const
const
const daysDiff = Math.floor((now - rfcDate) / (1000 * 60 * 60 * 24));
`https://en.wikipedia.org/wiki/${encodeURIComponent(pageName)}#${encodeURIComponent(anchor)}` :
▲ const timestampStr = timestampMatch[1];
topic: topicName,
daysOld:
timestamp: timestampStr
▲ });
}▼
}
}
Line 624 ⟶ 621:
});
html += `</select></p>`;
if (rfcs.length > 0) {
html += '<h4>All Current RfCs</h4><table class="wikitable sortable"><thead><tr><th>Topic</th><th>Title</th><th>Days Old</th><th>Started</th></tr></thead><tbody>';
rfcs.sort((a, b) => a.daysOld - b.daysOld).forEach(rfc => {
html += `<tr><td>${rfc.topic}</td><td><a href="${rfc.url}" target="_blank">${rfc.title}</a></td><td>${rfc.daysOld}</td><td>${rfc.timestamp}</td></tr>`;
}
html += '<div id="rfc-summary-table"><h4>RfC Count Summary</h4><table class="wikitable"><thead><tr><th>Topic</th>';
|