User:Manishearth/orphantabs.js: Difference between revisions

Content deleted Content added
FINALLY IT WORKS
No edit summary
Line 11:
var deOrphanDocumentLinkArray = new Array()
var linkACounter=0
var howManyActuallyDeOrphaned = 0
var linkAlreadyThere = 0
var deOrphaning = false
var deOrphanPgName = ""
Line 135 ⟶ 137:
}
}
 
}
 
function endOfLinkWins(){
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\'.")
alert("IT IS THE END!!!!!!!!!!")
currentLinkWin = window.open("about:blank","","")
currentLinkWin.___location.replace(wgServer+"/wiki/" + deOrphanPgName)
if(!currentLinkWin.addOnloadHook){
currentLinkWin.onload=function(){
currentLinkWin.addOnloadHook(function () {
addOrphanTag(choice)
});
}
}else{
if(!currentLinkWin.document.loaded){
currentLinkWin.addOnloadHook(function () {
addOrphanTag(choice)
});
}else{
addOrphanTag(choice)
}
}
 
function addOrphanTag(choice){
var val = currentLinkWin.editform.wpTextbox1.value
var returnVal = val
//LEFT OFF HERE (I'll do something here next)
}
 
function openALInnerFunct(){
if(currentLinkWin.wgCanonicalNamespace == ""){
if(orphanRawWikify(deOrphanPgName, currentLinkWin.editform.wpTextbox1.value) == currentLinkWin.editform.wpTextbox1.value){
linkAlreadyThere++
}else{
howManyActuallyDeOrphaned++
currentLinkWin.deOrphanWikify(deOrphanPgName)
currentLinkWin.document.editform.submit()
//alert("submitting")
setTimeout("closeTheWindow()",1000)
}
}else{
closeTheWindow()