User:Rennie McGreet/vector.js

if (typeof randomanyindent == 'undefined') randomanyindent = false; if (typeof randomanyns == 'undefined') { // Format is: { : [, ,  ] } randomanyns = { 106 : ['Fun', 'Fun', 'Fun'], 107: ['Fun', 'Fun', 'Fun'] , 2 : ['User_talk', 'talk', 'User talk'], } }

function randomany { if (n_randompage = document.getElementById('n-randompage')) { if ( typeof randomanyns[wgNamespaceNumber] != 'undefined') { n_randomany = document.createElement('li'); n_randomany.id = "n-randomany"; n_randomany.innerHTML = "' + 'Random ' + randomanyns[wgNamespaceNumber][1] + ' page'; if (randomanyindent) { n_randomanyul = document.createElement('ul'); n_randomanyul.appendChild(n_randomany); n_randomany = n_randomanyul; }     n_randompage.parentNode.insertBefore(n_randomany,n_randompage.nextSibling); } } }

addOnloadHook(randomany)