User:Nx/Scripts/RandomCP.js
From RationalWiki
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Clear the cache in Tools → Preferences
if (typeof randomcpindent == 'undefined') randomcpindent = false; function randomCP() { if (n_randompage = document.getElementById('n-randompage')) { if (wgNamespaceNumber == 100 || wgNamespaceNumber == 101) { n_randomcp = document.createElement('li'); n_randomcp.id = "n-randomcp"; n_randomcp.innerHTML = "<a"+' href="/wiki/Special:Random/Conservapedia" title="Load a random page from Conservapedia namespace">Random CP page</a>'; if (randomcpindent) { n_randomcpul = document.createElement('ul'); n_randomcpul.appendChild(n_randomcp); n_randomcp = n_randomcpul; } n_randompage.parentNode.insertBefore(n_randomcp,n_randompage.nextSibling); } } } addOnloadHook(randomCP)