Diferencia entre revisiones de «MediaWiki:Gadget-artist-portal.js»

m
tweak
m (maybe?)
m (tweak)
mw.hook('Coppermind:Artists').add(function artist_portal(content) {
 
console.debug('artist-portal:', content)
 
document.querySelectorAll('a[title^="Coppermind:Artists/"]').forEach(function each_artist(el) {
Array.from(jQuery('a[title^="Coppermind:Artists/"]').closest('ul')).forEach(function sort_list(ul) {
const kids = Array.from(ul.children)
console.debug('sorting:', kids.length, 'elements from', ul)
kids.sort(function sort_kids(a,b) { return a.innerText < b.innerText ? -1 : +1 })
kids.forEach(function reinsert(li) { ul.append(li) })
40 275

ediciones