Get rid of the nitfiness; use ye olde DOM
Works better for more people, so win.
diff --git a/content/index.html b/content/index.html
index 12e64f3..be18199 100644
--- a/content/index.html
+++ b/content/index.html
@@ -150,9 +150,9 @@
<a href="mailto:dev-subscribe@annotator.incubator.apache.org?subject=subscribe&body=Just click send. It's that easy! %5E_%5E%0A%0ALove%2C%0AApache Annotator (incubating)">dev-subscribe@annotator.incubator.apache.org</a>.
Be sure to say "hi" once you're in!</p>
- <div class="ui vertical fluid menu">
+ <div class="ui vertical fluid menu" id="recent-mailings">
<a href="https://lists.apache.org/list.html?dev@annotator.apache.org"
- class="header item" id="recent-mailings"
+ class="header item"
title="View All dev@ Archives">
<code>dev@</code> Mailing List Posts
</a>
diff --git a/content/index.js b/content/index.js
index 483824d..d2000b9 100644
--- a/content/index.js
+++ b/content/index.js
@@ -1,18 +1,21 @@
// Uses the PonyMail API to gather remote list of recent messages
const recent_messages_url = 'https://lists.apache.org/api/stats.lua?list=dev&domain=annotator.apache.org';
-const Item = ({id, subject}) => `
-<a class="item" rel="external" href="https://lists.apache.org/thread.html/${id}">${subject}</a>
-`;
+let a = document.createElement('a');
+a.className = 'item';
+a.rel = 'external';
-const $h = document.getElementById('recent-mailings');
+const $recent = document.getElementById('recent-mailings');
fetch(recent_messages_url)
.then(r => r.json())
.then((msgs) => {
if ('emails' in msgs && msgs.emails.length > 0) {
for (let i = 0; i < 5; i++) {
- $h.insertAdjacentHTML('afterend', Item(msgs.emails[i]));
+ let _a = a.cloneNode(a);
+ _a.href = 'https://lists.apache.org/thread.html/' + msgs.emails[i].id;
+ _a.textContent = msgs.emails[i].subject;
+ $recent.append(_a);
}
}
});