User:Fandyllic/wowwiki.js

From Warcraft Wiki
Jump to navigation Jump to search

Note: After publishing, 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: Press Ctrl-F5.
// <!-- ''Shamelessly mostly stolen from several users.'' --><pre>

// Disable tooltip hovers code from Pcj's user page... should be enabled globally now.
// wowwiki tooltips from [[Template:Loot]]
//document.write('<script type="text/javascript" //src="http://www.wowwiki.com/index.php?title=User:Pcj/itemtooltip.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// Show both Search Boxes
function twoSearch() {
  var googleSearch = document.getElementById('p-search').innerHTML.replace("Search", "Google Search");
  var wikiSearch = "<h5><label for='searchInput'>Wiki Search</label></h5><div id='searchBody' class='pBody'><form action='/index.php?title=Special:Search' id='searchform'><div><input id='searchInput' name='search' value='' type='text'><input name='go' class='searchButton' id='searchGoButton' value='Go' type='submit'>&nbsp;<input name='fulltext' class='searchButton' id='mw-searchButton' value='Search' type='submit'></div></form></div>";
  document.getElementById("p-search").innerHTML = googleSearch + wikiSearch;
}

// changes the personal links (at the top) to include direct links to
// the customized CSS and JS pages, shortens the other links

function changePersonal() {
var divs = document.getElementsByTagName('div');
document.getElementById('p-personal').innerHTML = "<h5>Personal tools</h5><div class='pBody'><ul><li id='pt-userpage'><a href='/User:Fandyllic'>Fandyllic</a></li><li id='pt-mytalk'><a href='/User_talk:Fandyllic'>talk</a></li><li id='pt-preferences'><a href='/Special:Preferences'>preferences</a></li><li id='pt-watchlist'><a href='/Special:Watchlist'>watchlist</a></li><li id='pt-contributions'><a href='/Special:Contributions/Fandyllic'>contributions</a></li><li id='pt-mycss'><a href='/User:Fandyllic/wowwiki.css'>css</a></li><li id='pt-myjs'><a href='/User:Fandyllic/wowwiki.js'>js</a></li><li id='pt-logout'><a href='/Special:Userlogout'>logout</a></li></ul></div>";
// add the following back if you want "what links here" in this area:
// <li id='pt-wlh'><a href='/Special:Whatlinkshere/"+ escape(wgPageName) +"'>what links here</a></li>
}

// adds "what links here" tab to right of normal page tabs
function changeTabs() {
if ( escape(wgPageName) != "Special%3AWhatlinkshere" ) {
    var divs = document.getElementsByTagName('div');
    var tabHTML = document.getElementById('p-cactions').innerHTML;
    var newTabHTML = tabHTML.replace(/<\/ul>/i,'') + "<li id='ca-linkshere'><a href='/Special:Whatlinkshere/"+ escape(wgPageName) +"'>What links here</a></li></ul>";
    document.getElementById('p-cactions').innerHTML = newTabHTML;
    }
}


addOnloadHook(twoSearch);
addOnloadHook(changePersonal);
addOnloadHook(changeTabs);



// install [[wikipedia:User:Cacycle/wikEd]] in-browser text editor
  // document.write('<script type="text/javascript" src="'
  // + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
  // + '&action=raw&ctype=text/javascript"></' + 'script>');

// mobtooltips (test based on User:Pcj/npctooltip.js)
// disabled, now that mob template uses NPC
  // document.write('<script type="text/javascript" src=" \
  // http://www.wowwiki.com/index.php?title=User:Fandyllic/mobtooltip.js \
  // &action=raw&ctype=text/javascript&dontcountme=s"></script>');

// </pre> [[Category:User JS|Fandyllic]]