Difference between revisions of "User:Fbstj/gadget/history-test.js"
Jump to navigation
Jump to search
m (oops) |
m (tweak) |
||
function A(url, text) {▼
/* add links to edit box */
$(function () {
el.appendChild(ln)▼
const pagename = mw.config.get('wgPageName')▼
const edit_box = document.querySelector('.editButtons')
// check that there is an edit box
if (!edit_box || mw.config.get('wgCanonicalNamespace') !==
const wob_url = link('https://wob.coppermind.net/basic_search/?query='+ pagename, 'Arcanum', 'search Arcanum for "'+ pagename +'"')▼
const book_url = link('http://search.coppermind.net/?search='+ pagename, 'book search', 'search books for "'+ pagename +'"')▼
▲const wob_url =
edit_box.appendChild(wob_url)
edit_box.appendChild(book_url)▼
▲const
});
/* Add edit link to templates */▼
▲/* Add edit link to templates */
function add_editsection_link(box) {
if (!box.id) return;
// FIXME: what does this do?
const id = box.id.replace(/\.(\d+)/,
// generate an edit link▼
// get the title element
const title = box.querySelector('.title')
▲ // generate an edit link
▲ const a = A('/edit/Template:'+ id, 'edit')
}
document.querySelectorAll('.infobox,.navbar').forEach(add_editsection_link)
|