152
edições
REMOVA OS ANÚNCIOS!
Apoiando através de https://apoia.se/arddhu a partir do tier de Apoiador, você pode navegar na wiki sem anúncios e ainda colabora com o projeto!
Sem resumo de edição |
Sem resumo de edição |
||
Linha 19: | Linha 19: | ||
/* Get the two elements you want to compare, | /* Get the two elements you want to compare, | ||
one from current row and one from the next: */ | one from current row and one from the next: */ | ||
x = rows[i].querySelector("h3>span.mw-headline"); | x = rows[i].querySelector("h3>span.mw-headline"); | ||
y = rows[i + 1].querySelector("h3>span.mw-headline"); | y = rows[i + 1].querySelector("h3>span.mw-headline"); | ||
// check if the two rows should switch place: | // check if the two rows should switch place: | ||
if ( | if ( | ||
Linha 29: | Linha 26: | ||
y.getAttribute("id").toLowerCase() | y.getAttribute("id").toLowerCase() | ||
) { | ) { | ||
// if so, mark as a switch and break the loop: | // if so, mark as a switch and break the loop: | ||
shouldSwitch = true; | shouldSwitch = true; | ||
Linha 45: | Linha 40: | ||
.querySelector(".mw-headline") | .querySelector(".mw-headline") | ||
.getAttribute("id"); | .getAttribute("id"); | ||
var floatTOCLinkA = document.querySelector( | var floatTOCLinkA = document.querySelector( | ||
'a[href$="' + rowIdA + '"]' | 'a[href$="' + rowIdA + '"]' |