User:Manishearth/orphantabs.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 13:
if(OrphanTabsConfig === undefined){
OrphanTabsConfig = {
auto : false,
autoChoice : 3,
showCompleteTab : true,
completeTabText : "de-orphan-complete",
Line 65:
}
var currentLinkWin
var otherOrphanTabs = falsetrue
var deOrphanDocumentLinkArray = new Array()
var linkACounter=0
Line 81:
 
if(otherOrphanTabs){
if(OrphanTabsConfig.showWLHTab){
addPortletLink("p-cactions", wgServer + "/wiki/Special:WhatLinksHere/" + pgname, "WhatLinksHere", "ca-whatlinks" , "What links here");
addPortletLink("p-cactions", wgServer + "/wiki/Special:WhatLinksHere/" + pgname, "Search it!"OrphanTabsConfig.wLHTabText, "ca-searchitwhatlinks" , "What links here");
}
 
if(OrphanTabsConfig.showSearchItTab){
 
addPortletLink("p-cactions", gServerPrewgServer + pgname"/wiki/Special:WhatLinksHere/" + gServerPostpgname, "Google it!"OrphanTabsConfig.searchItTabText, "ca-googleitsearchit" , "FindWhat alllinks Wikipedia pages with this page name in themhere");
}
if(OrphanTabsConfig.showGoogleItTab){
addPortletLink("p-cactions", "javascript:initDeOrphan(prompt(\"WhatgServerPre page\?\"\,\""+ ((wgCanonicalNamespace=="")?wgPageName:"")pgname +"\"));" gServerPost, "De-orphan-complete"OrphanTabsConfig.googleItTabText, "ca-de-orphangoogleit", "Find all Wikipedia pages with this page name in them");
}
}
if (document.editform && OrphanTabsConfig.showWikify){
addPortletLink("p-cactions","javascript:deOrphanWikify(prompt(\"What page are you de-orphaning?\",\"\"))", "De-orphan-wikify"OrphanTabsConfig.wikifyTabText, "ca-de-orphan-wikify", "Wikify to deorphan another page");
}
if(OrphanTabsConfig.showCompleteTab){
addPortletLink("p-cactions", "javascript:initDeOrphan(prompt(\"What page\?\"\,\""+ ((wgCanonicalNamespace=="")?wgPageName:"")+"\"));", "De-orphan-complete", "ca-de-orphan", "Find all Wikipedia pages with this page name in them");
addPortletLink("p-cactions", "javascript:initDeOrphan(prompt(\"What page\?\"\,\""+ ((wgCanonicalNamespace=="")?wgPageName:"")+"\"));", OrphanTabsConfig.completeTabText, "ca-de-orphan", "Find all Wikipedia pages with this page name in them");}
 
});
Line 200 ⟶ 205:
 
function endOfLinkWins(){
if(OrphanTabsConfig.auto){
var choice = ((linkAlreadyThere + howManyActuallyDeOrphaned)>OrphanTabsConfig.autoChoice)?true:false;
}else{
var choice = confirm(linkAlreadyThere + " pages linked to " + deOrphanPgName + " before de-orphaning.\n" + howManyActuallyDeOrphaned + " pages were linked to " + deOrphanPgName + "\n" + (linkAlreadyThere + howManyActuallyDeOrphaned) + " pages link to " + deOrphanPgName + " now\n De-orphan? (Press cancel to tag the page with \'do-attempt\'.")
currentLinkWin = window.open("about:blank","","")
}
currentLinkWin.___location.replace(wgServer+"/w/index.php?title=" + deOrphanPgName + "&action=edit")
if(!currentLinkWin.addOnloadHook){