Widget:Autorenbox: Unterschied zwischen den Versionen
Aus ZUM-Unterrichten
KKeine Bearbeitungszusammenfassung Markierung: 2017-Quelltext-Bearbeitung |
KKeine Bearbeitungszusammenfassung Markierung: 2017-Quelltext-Bearbeitung |
||
Zeile 40: | Zeile 40: | ||
.query | .query | ||
.pages[pageid]; | .pages[pageid]; | ||
acc.lastmodified = Math.max(acc.lastmodified, Date.parse(pageData.touched)); | |||
acc = pageData | acc = pageData | ||
Zeile 51: | Zeile 53: | ||
}, acc); | }, acc); | ||
return acc; | return acc; | ||
}); | }, {lastmodified: -1, userChanges:{}}); | ||
const usernames = Object.keys(userCounts.userChanges).sort((a,b) => { | const usernames = Object.keys(userCounts.userChanges).sort((a,b) => { | ||
let diff = userCounts.userChanges[b].count - userCounts.userChanges[a].count; | let diff = userCounts.userChanges[b].count - userCounts.userChanges[a].count; | ||
Zeile 59: | Zeile 61: | ||
return userCounts.userChanges[b].last - userCounts.userChanges[a].last; | return userCounts.userChanges[b].last - userCounts.userChanges[a].last; | ||
}) | }) | ||
$(lastModifiedEl).append(new Date(userCounts.lastmodified).toLocaleDateString()); | |||
const userdatas = usernames.map((user) => api | const userdatas = usernames.map((user) => api | ||
.parse(`{{#avatar:${user}|l}}`) | .parse(`{{#avatar:${user}|l}}`) |