User:Wookipan/common.js
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 / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
var classes = ['/w/images/3/33/Login_Scout.png', '/w/images/3/33/Login_Scout.png', '/w/images/7/71/Login_Pyro.png', '/w/images/3/35/Login_Heavy.png', '/w/images/a/ab/Login_Engineer.png', '/w/images/3/35/Login_Heavy.png', '/w/images/d/d4/Login_Medic.png', '/w/images/e/e4/Login_Sniper.png', '/w/images/2/27/Login_Spy.png'], // pick a random class image out of nine choices pickClass = classes[Math.floor(Math.random() * 9)]; // ensure all relative elements are hit var nodes = $('#pt-userpage, #pt-anonuserpage, #pt-login'); for (var i = 0; i < nodes.length; i++) { nodes[i].style.backgroundImage = 'url(' + pickClass + ')'; }