Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var paths = document.location.pathname.split("/");
- var number = parseInt(paths[2]);
- var directory = paths[1];
- var validDirectories = {
- "achievements": "achievement",
- "currencies": "currency",
- "factions": "faction",
- "items": "item",
- "item-sets": "itemset",
- "npcs": "npc",
- "objects": "object",
- "pet-abilities": "petability",
- "quests": "quest",
- "spells": "spell",
- "titles": "title",
- "world-events": "event",
- "zones": "zone"
- }
- var directoryLookup = validDirectories[directory];
- if (number && directoryLookup) {
- document.location = "http://www.wowhead.com/" + directoryLookup + "=" + number;
- } else {
- window.addEventListener("DOMContentLoaded", function() {
- var wowheadLink = document.querySelector("[data-tracking=wowhead-link]");
- if (wowheadLink) {
- window.location = wowheadLink.getAttribute("href");
- }
- }, false);
- }
Add Comment
Please, Sign In to add comment