// ==UserScript== // @name Edit Article Quicklink // @namespace wowhead // @description Adds an "Edit Article" quick link // @include http://*wowhead.com/?* // ==/UserScript== var url = window.location.href var a = unsafeWindow.ce('a'); var type = 1 var typeid = 1234 if (url.match('npc=')) { typeid = url.split("npc=")[1] type = 1 } else if (url.match('object=')) { typeid = url.split("object=")[1] type = 2 } else if (url.match('item=')) { typeid = url.split("item=")[1] type = 3 } else if (url.match('itemset=')) { typeid = url.split("itemset=")[1] type = 4 } else if (url.match('quest=')) { typeid = url.split("quest=")[1] type = 5 } else if (url.match('spell=')) { typeid = url.split("spell=")[1] type = 6 } else if (url.match('zone=')) { typeid = url.split("zone=")[1] type = 7 } else if (url.match('faction=')) { typeid = url.split("faction=")[1] type = 8 } a.href = 'http://www.wowhead.com/?edit=article&type='+type+'&typeid='+typeid a.innerHTML = 'Edit' var small = unsafeWindow.ce('small'); small.innerHTML = ' '; unsafeWindow.ae(small, a); unsafeWindow.ae(document.getElementsByTagName("h1")[1], small); //document.getElementById("topbar-right").appendChild(a)