Nexus Clash: Navbar+

Upgrades the Nexus Clash navigation bar by including it on Wiki pages, adding Google Doc map link "+", renaming "Game Map" to "Game", and moving the Ultramap next to it as "Map".

  1. // ==UserScript==
  2. // @name Nexus Clash: Navbar+
  3. // @namespace http://nexusclash.com/wiki/index.php/user:xensyria
  4. // @version 1.4
  5. // @description Upgrades the Nexus Clash navigation bar by including it on Wiki pages, adding Google Doc map link "+", renaming "Game Map" to "Game", and moving the Ultramap next to it as "Map".
  6. // @match http://nexusclash.com/*
  7. // @match http://www.nexusclash.com/*
  8. // @exclude http://nexusclash.com/wiki/images/*
  9. // @exclude http://www.nexusclash.com/wiki/images/*
  10. // @exclude http://nexusclash.com/chargen.html
  11. // @exclude http://www.nexusclash.com/chargen.html
  12. // @grant GM_addStyle
  13. // @copyright PD
  14. // ==/UserScript==
  15.  
  16. if (document.URL.match(/nexusclash\.com\/wiki/)){ // Check to see if it's the Wiki, and needs the navbar added
  17.  
  18. // Move login / user links
  19. document.getElementById ('firstHeading').parentNode.insertBefore (document.getElementById ('p-personal'), document.getElementById ('firstHeading'));
  20. GM_addStyle('#p-personal { padding-top: 0.9em !important; }');
  21.  
  22. // Create navbar
  23. document.getElementById ('p-cactions').insertAdjacentHTML('beforebegin',
  24. '<table id="wikinavbar">'
  25. +'<tr>'
  26. +'<td><img src="/themes/NukeNews/images/pixel.gif" width="347px" height="10px"></img></td>'
  27. +'<td align="center" valign="center">'
  28. +'<a class="wikinavbarlink" href="/modules.php?name=Game">Game</a>'
  29. +'<a class="wikinavbarlink" href="http://hem.bredband.net/Treecko/ULTRAMAP.htm">Map</a>'
  30. +'<a class="wikinavbarlink" id="wikinavbarplus" href="https://docs.google.com/spreadsheet/ccc?key=0ApnLeomaP9WndGY4b2Q5b0Z6bjFtYkhTY0I1aHVjeGc#gid=0">+</a>'
  31. +'<a class="wikinavbarlink" href="/modules.php?name=Game&op=faction">Factions</a>'
  32. +'<a class="wikinavbarlink" href="/modules.php?name=Forums">Forums</a>'
  33. +'<a class="wikinavbarlink" href="/wiki">Wiki</a>'
  34. +'<a class="wikinavbarlink" href="/chargen.html">Planner</a>'
  35. +'<a class="wikinavbarlink" href="/modules.php?name=Your_Account">Account</a>'
  36. +'</td>'
  37. +'<td align="center" valign="center">'
  38. +'<form action="https://www.paypal.com/cgi-bin/webscr" method="post">'
  39. +'<input type="hidden" name="cmd" value="_s-xclick">'
  40. +'<input type="hidden" name="hosted_button_id" value="NXMLRLMUST7CA">'
  41. +'<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">'
  42. +'<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">'
  43. +'</form>'
  44. +'</td>'
  45. +'<td><img src="/themes/NukeNews/images/pixel.gif" hspace="0" width="17px" height="10px" align="right"></img></td>'
  46. +'</tr>'
  47. +'</table>');
  48. GM_addStyle('#wikinavbar { position: absolute; width: 100%; height: 76px; top: 0px; background: none; padding: 8px; cellpadding: 0; cellspacing: 0; }');
  49. GM_addStyle('.wikinavbarlink { background: #ffffff; color: #000000 !important; font-weight: bold; font-size: 14px; font-family: Verdana, Helvetica, Geneva, sans-serif; text-decoration: none; border-color: #000000; border-style: outset; border-width: 3px; padding: 2px; margin: 0px 2px; }');
  50. GM_addStyle('.wikinavbarlink:hover { background: #C0C0C0; color: #FFFFFF !important; font-weight: bold; font-size: 14px; font-family: Verdana, Helvetica, Geneva, sans-serif; text-decoration: none; border-color: #000000; border-style: inset; border-width: 3px; padding: 2px; margin: 0px 2px; }');
  51. GM_addStyle('#wikinavbarplus { margin-left: -5px !important; }');
  52. GM_addStyle('#content { margin: 68px 0 0 12.2em !important; }');
  53. GM_addStyle('#p-cactions { top: 49px !important; }');
  54.  
  55. } else { // If it's not the Wiki, then just change the existing bar
  56.  
  57. var navBar = document.getElementsByClassName('navbar');
  58. navBar[0].innerHTML = 'Game';
  59. navBar[5].innerHTML = 'Map';
  60. navBar[0].parentNode.insertBefore (navBar[5], navBar[1]);
  61. navBar[1].insertAdjacentHTML('afterend','<a class="navbar" id="navbarplus" href="https://docs.google.com/spreadsheet/ccc?key=0ApnLeomaP9WndGY4b2Q5b0Z6bjFtYkhTY0I1aHVjeGc#gid=0">+</a>');
  62. GM_addStyle('#navbarplus { margin-left: -3px !important; margin-right: 4px !important; }');
  63.  
  64. }