User:Pcj/wowwiki.js

indicator="http://images1.wikia.nocookie.net/__cb20080505054258/wowwiki/images/0/0e/Progressbar.gif"; /*

function changeSearch { $('#p-search').html(" Search    "); }

/*

function goTalk { window.location = "http://www.wowwiki.com/User_talk:Pcj?diff=cur"; }

function urchinTracker {} //fix error caused by blocking google stuff function quantserve {}

/*

function changePersonal { var tmlt = ""; if ($('div.usermessage').html) tmlt = "   "; $('#p-personal').html(" Personal tools Pcj" + tmlt + "talk<a href='/Special:Preferences'>preferences</a></li><a href='/Special:Userlogout'>Log out</a></li></ul> "); }

/*

function changeNavigation { $('#p-navigation').html(" navigation <ul><a href='/'>Main Page</a></li><a href='/index.php?title=Special:RecentChanges&limit=100'>Recent changes</a></li><a href='/WW:F'>Forums</a></li><a href='/Special:Wantedpages?limit=1000'>Wanted pages</a></li><a href='http://www.wowwiki.com/index.php?title=Special:ShortPages&limit=1000'>Short pages</a></li><a href='/MediaWiki:Common.js'>JavaScript</a></li><a href='/WW:GS'>Guild stubs</a></li><a href='/index.php?title=Special:NewPages&hidepatrolled=1&hidebots=1&namespace=all'>New pages</a></li></ul> "); } /*

function goToPreview { $("#wpPreview").click; }

/*

function fixPreview { if ($('#ca-edit.selected').html) document.body.ondblclick = goToPreview; }

function elinksTitle { if (wgCanonicalNamespace == "") { document.getElementById("bodyContent").style.position = "relative"; document.getElementById("bodyContent").style.top = "15px"; var h1s = document.getElementsByTagName( "h1" ); elinksDiv = document.createElement("div"); elinksDiv.setAttribute("id", "elinksDiv"); h1s[0].parentNode.insertBefore(elinksDiv, h1s[0].nextSibling); newdiv = document.getElementById("elinksDiv"); sQuery = wgPageName.replace("Quest:", ""); newdiv.innerHTML += ' <a href="http://www.wowhead.com?search=' + sQuery + '" target="_blank">&omega;</a> <a href="http://thottbot.com/?s=' + sQuery + '" target="_blank">&tau;</a> <a href="http://wow.allakhazam.com/search.html?q=' + sQuery + '" target="_blank">&alpha;</a> '; } }

function monaco { if (wgAction == "view") { addPortletLink('p-cactions', 'http://www.wowwiki.com/index.php?title=' + wgPageName + '&useskin=monaco&usetheme=custom', 'monaco', 'ca-mb', 'View page in monaco', ''); } }

function doRegex { reprompt = new RegExp(prompt("Regular expression:", ""), "g"); retext = prompt("Replacement text:", ""); if (reprompt && retext) { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(reprompt, retext); document.editform.wpDiff.click; } }

function regex { if (wgAction == "edit") { addPortletLink('p-cactions', 'javascript:doRegex;', 'regex', 'ca-regex', 'Perform a regular expression replace on text', ''); } }

loadedExtJS = {}; function loadExtJS( URL ) { var scriptElem = document.createElement( 'script' ); scriptElem.setAttribute( 'src', URL ); scriptElem.setAttribute( 'type', 'text/javascript' ); document.getElementsByTagName( 'head' )[0].appendChild( scriptElem ); }

wowItem = new Array; function doTooltip { tt = prompt("Item name or ID",wgTitle.replace(" (heroic)","")).replace(/ /g,"_").replace(/'/g,""); if (tt) { wowItem[tt] = {}; loadExtJS("http://www.warcraftjs.com/?i="+tt); setTimeout('processTooltip("'+tt+'");',2000); } }

function processTooltip(tt) { if (typeof(retrieveItem) == "function") retrieveItem; if (wowItem[tt].error) { alert ("Error:\n"+wowItem[tt].error); } else { if (wowItem[tt].name.replace(/ /g,"_").replace(/'/g,"") == tt || wowItem[tt].itemid == tt) { document.getElementById("wpTextbox1").value = "\n \n==Source==\n...\n\n==External links==\n\n"; retrieveItem = 0; } else { setTimeout('processTooltip("'+tt+'");',2000); } } }

function loadTooltip { if (wgAction == "edit") { addPortletLink('p-cactions', 'javascript:doTooltip;', 'tooltip', 'ca-Tooltip', 'Import an item tooltip from Wowhead', ''); } }

// does everything function pcj { if (cookieValue != siteNoticeID) dismissNotice; $("#bodyContent").bind("ajaxPageLoad",function { $("ul.special>li:has(a[href*='Special:Log/useravatar'])").hide; }); changePersonal; changeNavigation; changeSearch; fixPreview; elinksTitle; monaco; regex; loadTooltip; $("#wpLeaveRedirect").removeAttr("checked"); } addOnloadHook(pcj); /*