User:Manishearth/orphantabs.js: Difference between revisions

Content deleted Content added
'addOnloadHook' is deprecated
m Remove legacy globals per phab:T72470 (via WP:JWB)
Line 76:
var gServerPost;
gServerPre = "http://www.google.com/search?hl=en&rlz=1G1GGLQ_ENUS255&as_q="
gServerPost="&as_epq=&as_oq=&as_eq=&num=100&lr=&as_filetype=&ft=i&as_sitesearch=" + mw.config.get('wgServer') + "&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=images"
var pgname = encodeURIComponent( mw.config.get('wgTitle') );
 
if(otherOrphanTabs){
if(OrphanTabsConfig.showWLHTab){
addPortletLink("p-cactions", mw.config.get('wgServer') + "/wiki/Special:WhatLinksHere/" + pgname, OrphanTabsConfig.wLHTabText, "ca-whatlinks" , "What links here");
}
if(OrphanTabsConfig.showSearchItTab){
addPortletLink("p-cactions", mw.config.get('wgServer') + "/wiki/Special:WhatLinksHere/" + pgname, OrphanTabsConfig.searchItTabText, "ca-searchit" , "What links here");
}
if(OrphanTabsConfig.showGoogleItTab){
Line 94:
}
if(OrphanTabsConfig.showCompleteTab){
addPortletLink("p-cactions", "javascript:initDeOrphan(prompt(\"What page\?\"\,\""+ ((mw.config.get('wgCanonicalNamespace')=="")?wgPageName:"")+"\"));", OrphanTabsConfig.completeTabText, "ca-de-orphan", "Find all Wikipedia pages with this page name in them");}
 
});
Line 115:
}
function initDeOrphan(pgName){
sWin = window.open(mw.config.get('wgServer') + "/w/index.php?title=Special:Search&ns0=1&redirs=1&search=%22" + pgName + "%22&limit=100&offset=0","","")
 
deOrphanPgName = pgName
Line 166:
function openALinkWin(){
currentLinkWin = window.open("about:blank","","")
currentLinkWin.___location.replace(mw.config.get('wgServer')+"/w/index.php?title=" + deOrphanDocumentLinkArray[linkACounter].replace(/\/wiki\//,"") + "&action=edit")
if(!currentLinkWin.$){
currentLinkWin.onload=function(){
Line 211:
currentLinkWin = window.open("about:blank","","")
}
currentLinkWin.___location.replace(mw.config.get('wgServer')+"/w/index.php?title=" + deOrphanPgName + "&action=edit")
if(!currentLinkWin.$){
currentLinkWin.onload=function(){