Small refactoring 8

This commit is contained in:
Hans5958 2023-04-17 00:12:02 +07:00
parent f577980f9b
commit 7d8eaae1ca
2 changed files with 2 additions and 12 deletions

View file

@ -11,8 +11,7 @@ fetch('all-authors.txt')
.then(text => text.trim().split('\n').sort())
.then(contributors => {
document.querySelector('#reddit-contributors-count').textContent = contributors.length
for (const index in contributors) {
contributor = contributors[index]
for (const contributor of contributors) {
const userEl = document.createElement('a')
userEl.href = 'https://reddit.com/user/' + contributor
userEl.textContent = contributor

View file

@ -77,16 +77,7 @@ async function init() {
//let resp = await fetch("../tools/temp-atlas.json")
const resp = await fetch("./atlas.json")
atlas = await resp.json()
atlas.sort(function (a, b) {
if (a.center[1] < b.center[1]) {
return -1
}
if (a.center[1] > b.center[1]) {
return 1
}
// a must be equal to b
return 0
})
atlas.sort((a, b) => a.center[1] - b.center[1])
atlasAll = updateAtlasAll(atlas)