|
|
@ -1,4 +1,4 @@ |
|
|
|
/* globals isThread */ |
|
|
|
/* globals __n isThread */ |
|
|
|
window.addEventListener('DOMContentLoaded', () => { |
|
|
|
window.addEventListener('DOMContentLoaded', () => { |
|
|
|
|
|
|
|
|
|
|
|
const statsElem = document.getElementById('threadstats'); |
|
|
|
const statsElem = document.getElementById('threadstats'); |
|
|
@ -49,8 +49,8 @@ window.addEventListener('DOMContentLoaded', () => { |
|
|
|
const numFiles = +statsElem.children[1].innerText.match(/^(\d+)/g); |
|
|
|
const numFiles = +statsElem.children[1].innerText.match(/^(\d+)/g); |
|
|
|
const filesTotal = numFiles + newFiles; |
|
|
|
const filesTotal = numFiles + newFiles; |
|
|
|
const postTotal = numPosts + 1; |
|
|
|
const postTotal = numPosts + 1; |
|
|
|
statsElem.children[0].innerText = `${postTotal} repl${postTotal === 1 ? 'y' : 'ies'}`; |
|
|
|
statsElem.children[0].innerText = __n('%s replies', postTotal); |
|
|
|
statsElem.children[1].innerText = `${filesTotal} file${filesTotal === 1 ? '' : 's'}`; |
|
|
|
statsElem.children[1].innerText = __n('%s files', filesTotal); |
|
|
|
if (e.detail.json.userId) { |
|
|
|
if (e.detail.json.userId) { |
|
|
|
const userId = e.detail.post.querySelector('.user-id'); |
|
|
|
const userId = e.detail.post.querySelector('.user-id'); |
|
|
|
idElems.push(userId); |
|
|
|
idElems.push(userId); |
|
|
@ -67,7 +67,7 @@ window.addEventListener('DOMContentLoaded', () => { |
|
|
|
statsElem.appendChild(spacer); |
|
|
|
statsElem.appendChild(spacer); |
|
|
|
statsElem.appendChild(uidSpan); |
|
|
|
statsElem.appendChild(uidSpan); |
|
|
|
} |
|
|
|
} |
|
|
|
statsElem.children[2].innerText = `${idMap.size} UID${idMap.size === 1 ? '' : 's'}`; |
|
|
|
statsElem.children[2].innerText = __n('%s UIDs', idMap.size); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|