Difference between revisions of "User:Fbstj/gadget/history-test.js"
Jump to navigation
Jump to search
m (moved to MediaWiki:Group-keeper.js) |
m (try adding notice to the tops of templates) |
||
document.querySelectorAll('.patrollink').forEach(enable_link)
// move notices above
while (true) {
// don't do things on edit page
const edit_box = document.querySelector('.editButtons')
if (!!edit_box) break
if (location.search != '') break
// find {{notice}} after {{infobox}}
var el = document.querySelector('.infobox+.notice')
if (!el) { // check first child of #mw-content-text is a notice
}
if (!el) break
const
if (!infobox) {
ind.parentElement.insertBefore(el, ind)▼
// move above the title on non-infobox pages
const ind = document.querySelector('.mw-indicators')
▲ ind.parentElement.insertBefore(el, ind)
} else {
const row = infobox.insertRow(0)
const cell = row.insertCell()
cell.setAttribute('colspan','2')
cell.appendChild(el)
}
}
|