Content deleted Content added
Manishearth (talk | contribs) No edit summary |
Manishearth (talk | contribs) removing my obnoxious debug alerts :P |
||
Line 7:
*/
if(!OrphanTabsConfig){
OrphanTabsConfig = {
}
}
var currentLinkWin
var otherOrphanTabs = false
Line 158 ⟶ 164:
function addOrphanTag(choice){
//alert("adding")
currentLinkWin.document.editform.wpTextbox1.value = addOrphanTagRaw(choice, currentLinkWin.document.editform.wpTextbox1.value)
var editSum = ""
Line 200 ⟶ 206:
if(val.replace(new RegExp("{{orphan}}", "i"), "") != val){
rVal = val.replace(new RegExp("{{orphan}}", "i"), "")
// alert(
}else if(/{{orphan\|\wdate=[^\}]*}}/i.test(val)){
rVal = val.replace(/{{orphan\|\wdate=[^\}]*}}/i, "")
// alert(
}else if(val.indexOf("{{articleissues") !=-1){
rVal=val.replace(/\|\w?orphan=[^\|\}]*/i,"")
rVal=rVal.replace(/\|\w?do-attempt=[^\|\}]*/i,"")
// alert(
}else{
rVal=val
// alert(
}
}else{
if(val.replace(new RegExp("{{orphan}}", "i"), "") != val){
rVal = val.replace("{{orphan}}", "{{do-attempt|att=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}}}")
// alert(21)
}else if(new RegExp("{{orphan|date=[^\}]}}","i").test(val)){
rVal = val.replace(/{{orphan\|date=([^\}]*)}}/i, "{{do-attempt|date=$1|att=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}}}")
// alert(22)
}else if(new RegExp("{{do-attempt|date=[^\|\}]*\|att=[^\|\}]*}}","i").test(val)){
rVal = val.replace(/({{do-attempt|date=[^\|\}]*\|att=)[^\|\}]*}}/i, "$1\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}}}")
Line 224 ⟶ 230:
}else if(val.indexOf("{{articleissues") !=-1){
rVal=rVal.replace(/\|\w?do-attempt=[^\|\}]*/i,"\|do-attempt=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}")
// alert(23)
}else{
rVal= "{{do-attempt|att=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}}}" + val
|