User:Cool Hand Luke/tagging.js

//FastButtons, based on the original work of Racso from Spanish Wikipedia, //translated by Macy.

// var pagina =; var mot=; var txt=; var botones=; var usuario=; var temporal=; var sep="|"; var biblio=false; var ufb = ', using a modified version of FastButtons'; var dire="http://en.wikipedia.org/w/index.php?title="; var fin_otro="edit&borrar=otro-"; var fin_aviso="edit&aviso="; var fin_prod="edit&prod="; var vec="http://en.wikipedia.org/wiki/User:Macys123/Sandbox&action=edit&motivoVEC="; var textopruebas="Warn user:\n1|(article): Level 1\n2|(article): Level 2\n3|(article): Level 3\n4|(article): Level 4\n4im|(article): Level 4im"; var prodreason="Please enter a reason for proposing this page for deletion:"; var FBpersonales = false; //Personal configuration var FBpruebas= true;	//Test edits var FBblanco = true;	//Vandalism var FBne = true;	//Nonsense pages var FBinfra = true;	//Attack pages var FBautopromo = true;	//Promotional var FBotro = true;	//Custom CSD var FBcommons = true;	//NowCommons var FBimfu = true;	//No fair use rationale var FBprod = true;	//PROD pages var FBwikify = true;   //Wikify var FBunref = true;	//Unreferenced var FBcleanup = true;	//Cleanup var FBnpov = true;	//POV var FBglobal = true;	//Globalize var FBcedit = true;	//Copyedit var FBborrar = false;	//Speedy delete (test) var FBvec = false;	//Report to AIV (test) var FBprotect = true;	//Mark page as protected var FBaviso = true;	//Warn user var FBwelcome = false;	//Welcome user var FBnoindex = true;	//Welcome user //All data is here: for (i=0; i<wgUserGroups.length; i++) { if (wgUserGroups[i] == "sysop") biblio=true; }

for (i=0; ispeedy delete!] '; } if (FBprotect){tmp+= '[pp-vand (full)] '; } if (FBprotect){tmp+= '[pp-vand (semi)] '; } if (tmp!=''){botones = botones + 'Sysop buttons: ' +tmp+' ';} } if (biblio===false) if (autoconfirmed===true) {	tmp=''; if (FBpruebas){tmp+= '[test] '; } if (FBblanco){tmp+= '[vandalism] '; } if (FBne){tmp+= '[nonsense] '; } if (FBinfra){tmp+= '[attack] '; } if (FBautopromo){tmp+= '[promotional] '; } if( wgNamespaceNumber == 6 ) if (FBimfu){tmp+= '[<a href='+dire+'edit&borrar=norat>no fair use</a>] '; } if( wgNamespaceNumber == 6 ) if (FBcommons){tmp+= '[<a href='+dire+'edit&borrar=commons>commons</a>] '; } if( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) if (FBprod){tmp+='[<a onclick="mot=prompt(prodreason);location.href=dire + fin_prod +encodeURI(mot) ;">PROD</a>] ';} if (FBotro){tmp+= '[<a onclick="mot=prompt(/Enter reason:/);location.href=dire + fin_otro +encodeURI(mot) ;"> Other </a>] ';} if (tmp!='') { botones= botones + 'CSD: ' + tmp + ' ';} } tmp=''; if( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) if (FBwikify){tmp+= '[<a href='+dire+'edit&plant=wikify>wikify</a>] '; } if( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) if (FBunref){tmp+= '[<a href='+dire+'edit&plant=unref>unreferenced</a>] '; } if( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) if (FBcleanup){tmp+= '[<a href='+dire+'edit&plant=cleanup>cleanup</a>] '; } if( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) if (FBnpov){tmp+= '[<a href='+dire+'edit&plant=npov>POV</a>] '; } if( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) if (FBglobal){tmp+= '[<a href='+dire+'edit&plant=global>globalize</a>] '; } if( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) if (FBcedit){tmp+= '[<a href='+dire+'edit&plant=cedit>copyedit</a>] '; }

if (FBnoindex){tmp+= '[<a href='+dire+'edit&plant=NOINDEX>noindex</a>] '; } if (tmp!=''){botones = botones + 'Templates: ' +tmp+' ';}

tmp=''; if( wgNamespaceNumber == 3 ) if (FBaviso){tmp+='[<a onclick="mot=prompt(textopruebas);location.href=dire + fin_aviso +encodeURI(mot) ;">warn user</a>] ';} if( wgNamespaceNumber == 2 || wgNamespaceNumber == 3 ) { if (FBvec){tmp+= '[<a onclick=";mot=prompt(\n/Please add reason below/);location.href=vec + usuario + sep + mot;">AIV report</a>] ';} } if( wgNamespaceNumber == 3 ) if (FBcedit){tmp+= '[<a href='+dire+'edit&plant=welcome>welcome user</a>] '; }

if (tmp!=''){botones = botones + 'Special: ' +tmp+' ';} /* Botones funcionando */ $(function { if (document.getElementById('contentSub').innerHTML!='') {document.getElementById('contentSub').innerHTML+=' ';} document.getElementById('contentSub').innerHTML = document.getElementById('contentSub').innerHTML+ botones; if (location.href.match("borrar=blanco")) {	txt=document.getElementById("wpTextbox1").value;	if (txt.match("{destruir")==null)	{		txt= '\n' + txt;		document.getElementById ("wpTextbox1").value=txt;		document.editform.wpSummary.value = 'Requesting speedy deletion G2'+ufb;		document.editform.submit;	} } else if (location.href.match("borrar=pruebas")) {	txt=document.getElementById("wpTextbox1").value;	if ((txt.match("{destruir")==null) && (txt!=""))	{		txt= '\n' + txt;		document.getElementById ("wpTextbox1").value=txt;		document.editform.wpSummary.value = 'Requesting speedy deletion G3'+ufb;		document.editform.submit;	} } else if (location.href.match("borrar=NE")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt= '\n' + txt document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Requesting speedy deletion G1'+ufb; document.editform.submit; } } else if (location.href.match("borrar=infra")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt= '\n' + txt document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Requesting speedy deletion G10'+ufb; document.editform.submit; } } else if (location.href.match("borrar=autopromo")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt= '\n' + txt document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Requesting speedy deletion G11'+ufb; document.editform.submit; } } else if (location.href.match("borrar=otro")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		mot=location.href.substring(location.href.indexOf('otro-')+5, location.href.length) if (mot!=null) {			txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Requesting speedy deletion'+ufb; document.editform.submit; }	} } else if (location.href.match("borrar=norat")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt= '\n' + txt document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Requesting speedy deletion I8'+ufb; document.editform.submit; } } else if (location.href.match("borrar=commons")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt= '\n' + txt document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Requesting speedy deletion I6'+ufb; document.editform.submit; } } else if (location.href.match("protected=yes")) {	txt=document.getElementById("wpTextbox1").value; if ((txt.match("{destruir")==null) && (txt!="")) {		txt= '\n' + txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.submit; } } else if (location.href.match("protected=semi")) {	txt=document.getElementById("wpTextbox1").value; if ((txt.match("{destruir")==null) && (txt!="")) {		txt= '\n' + txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.submit; } } else if (location.href.match("plant=wikify")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.submit; } } else if (location.href.match("plant=unref")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.submit; } } else if (location.href.match("plant=cleanup")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.wpSave.click; } } else if (location.href.match("plant=npov")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.wpSave.click; } }

else if (location.href.match("plant=NOINDEX")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.wpSave.click; } }

else if (location.href.match("plant=global")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.wpSave.click; } }

else if (location.href.match("plant=cedit")) {	txt=document.getElementById("wpTextbox1").value if ((txt.match("{destruir")==null) && (txt!="")) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Tagged with '+ufb; document.editform.submit; } }

else if (location.href.match("plant=welcome")) {	txt=document.getElementById("wpTextbox1").value if (txt.match("{destruir")==null) {		txt='\n'+txt; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Welcoming user'+ufb; document.editform.submit; } } else if (location.href.match("rapido=si")) {	document.getElementById ("wpConfirmB").click; } else if (location.href.match("motivoVEC=")) {	var txt2; var strt="Añade la siguiente solicitud debajo de esta línea.-->"; mot=location.href.substring(location.href.indexOf('motivoVEC=')+10, location.href.length); txt=document.getElementById("wpTextbox1").value; txt2=txt.split(strt).join(strt+"\n\n"+decodeURI(mot)+" --~"); document.getElementById("wpTextbox1").value=txt2; document.editform.wpSummary.value = 'Reporting ' + uid + ''+ufb; document.editform.submit; } else if (location.href.match("aviso=")) {	txt=document.getElementById("wpCombobox1").value; mot=location.href.substring(location.href.indexOf('aviso=')+6, location.href.length); txt=txt+'\n\n --~'; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Warning user'+ufb; document.editform.submit; } else if (location.href.match("prod=")) {	txt=document.getElementById("wpTextbox1").value; mot=location.href.substring(location.href.indexOf('aviso=')+6, location.href.length); txt=txt+'\n\n'+decodeURI(mot)+''; document.getElementById ("wpTextbox1").value=txt; document.editform.wpSummary.value = 'Warning user'+ufb; document.editform.submit; } });

//

//Special FastButtons start here //Edit count FastButton $(function { if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {     var username = encodeURIComponent( wgTitle );     var checkurl = "http://toolserver.org/~interiot/cgi-bin/Tool1/wannabe_kate?username="+ username +"&site=en.wikipedia.org" ;     mw.util.addPortletLink("p-cactions", checkurl, "edc", "ca-contrib", "View edit count by this user");  } });

//Special:Prefixindex FastButton $(function { if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {     var username = encodeURIComponent( wgTitle );     var checkurl = wgServer + "/w/index.php?title=Special:Prefixindex&from=" + username + "&namespace=2" ;     mw.util.addPortletLink("p-cactions", checkurl, "all pages", "ca-contrib", "List of page prefixed");  } });