2023-03-22 16:38:18 +01:00
|
|
|
/*!
|
|
|
|
* The 2022 r/place Atlas
|
|
|
|
* Copyright (c) 2017 Roland Rytz <roland@draemm.li>
|
|
|
|
* Copyright (c) 2022 Place Atlas contributors
|
2023-07-20 07:38:27 +02:00
|
|
|
* Licensed under AGPL-3.0 (https://2022.place-atlas.stefanocoding.me/license.txt)
|
2023-03-22 16:38:18 +01:00
|
|
|
*/
|
2022-07-03 07:11:05 +02:00
|
|
|
|
2023-06-16 12:40:56 +02:00
|
|
|
const contributorsEl = document.querySelector('#contributors-wrapper')
|
|
|
|
|
|
|
|
// <i aria-label="GitHub" class="bi bi-github"></i>
|
|
|
|
const gitHubEl = document.createElement("i")
|
|
|
|
gitHubEl.ariaLabel = "GitHub:"
|
|
|
|
gitHubEl.className = "bi bi-github"
|
|
|
|
|
2022-07-03 07:11:05 +02:00
|
|
|
fetch('all-authors.txt')
|
|
|
|
.then(response => response.text())
|
2023-06-16 12:40:56 +02:00
|
|
|
.then(text => text.trim().split('\n').sort((a, b) => {
|
|
|
|
const aSplit = a.split(':')
|
|
|
|
const bSplit = b.split(':')
|
|
|
|
return aSplit[aSplit.length - 1] > bSplit[bSplit.length - 1]
|
|
|
|
}))
|
2022-07-03 07:11:05 +02:00
|
|
|
.then(contributors => {
|
2023-06-16 12:40:56 +02:00
|
|
|
document.querySelector('#contributors-count').textContent = contributors.length
|
2023-04-16 19:12:02 +02:00
|
|
|
for (const contributor of contributors) {
|
2022-07-03 07:11:05 +02:00
|
|
|
const userEl = document.createElement('a')
|
2023-06-16 12:40:56 +02:00
|
|
|
const contributorSplit = contributor.split(':')
|
|
|
|
if (contributorSplit[0] === "gh") {
|
|
|
|
const contributor1 = contributorSplit[1]
|
|
|
|
userEl.href = 'https://github.com/' + contributor1
|
|
|
|
userEl.appendChild(gitHubEl.cloneNode())
|
|
|
|
userEl.appendChild(document.createTextNode(' ' + contributor1))
|
|
|
|
} else {
|
|
|
|
userEl.href = 'https://reddit.com/user/' + contributor
|
|
|
|
userEl.textContent = contributor
|
|
|
|
}
|
|
|
|
contributorsEl.appendChild(userEl)
|
|
|
|
contributorsEl.appendChild(document.createTextNode(' '))
|
2022-07-03 07:11:05 +02:00
|
|
|
}
|
|
|
|
})
|