Ir al contenido

Usuario:Dreitmen/reversion.js

De Wikipedia, la enciclopedia libre

Nota: Después de guardar, debes refrescar la caché de tu navegador para ver los cambios. Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar. Firefox: mientras presionas Mayús pulsas el botón Actualizar, (o presiona Ctrl-Shift-R). Los usuarios de Google Chrome y Safari pueden simplemente pulsar el botón Recargar. Para más detalles e instrucciones acerca de otros exploradores, véase Ayuda:Cómo limpiar la caché.

//<pre>
var pagina =''; var mot=''; var txt=''; var botones=''; var usuario=''; var temporal='';
var sep="|"; var biblio=false;
var ufb = ', usando [[w:es:Usuario:Racso/Fastbuttons|Fastbuttons]]';
var dire="http://es.wikipedia.org/w/index.php?title=";
var dire2=dire+"Especial:BlockIP/"
var fin_otro="edit&borrar=otro-";
var fin_aviso="edit&aviso=";
var vec="http://es.wikipedia.org/w/index.php?title=Wikipedia:Vandalismo_en_curso&action=edit&section=1&motivoVEC=";
var tab="http://es.wikipedia.org/w/index.php?title=Usuario:Dreitmen/prueba&action=edit&section=1&preload=Wikipedia:Tabl%C3%B3n_de_anuncios_de_los_bibliotecarios/Portal/Archivo/Protecci%C3%B3n_de_art%C3%ADculos/precarga&editintro=Wikipedia:Tabl%C3%B3n_de_anuncios_de_los_bibliotecarios/Portal/Archivo/Protecci%C3%B3n_de_art%C3%ADculos/editintro&motivoTAB=";
var textopruebas="Aviso:\n(nada): Prueba\n0a: Wikietiqueta\n0b: Estilo\n0c: Spam\n2: Ediciones sin sentido\n2a: Blanqueo\n3: Detente\n4: Última advertencia\n5: Bloqueo";
var FBpersonales = false; //¿Activar config personal?
var FBpruebas= true;	//Pruebas de edición
var FBblanco = true;	//Prueba de edición blanqueadas
var FBne = true;	//No enciclopédico
var FBinfra = true;	//Infraesbozo
var FBautopromo = true;	//Página de usuario que viola WP:PU
var FBotro = true;	//Botón universal: otros motivos
var FBwikificar = true;//Wikificar
var FBwikci = true;	//Wikcionario
var FBborrar = true;	//Borrado instantáneo
var FBblock = true;	//Aviso al usuario
var FBvec = true;	//Reportar en WP:VEC
var FBaviso = true;	//Aviso al usuario
var FBrefs = true;      //Referencias
var FBtab = true;       //Enviar informe a TAB/P
 
/* Toma de datos */
 
for (i=0; i<wgUserGroups.length; i++)
   {  if (wgUserGroups[i] == "sysop") biblio=true; }
 
pagina=encodeURI(wgPageName);
if (pagina.match("&"))
{
pagina=pagina.replace("&","%26");
}
dire=dire+pagina+"&action=";
usuario=pagina.split(":")[1];
 
 
if (pagina=="Especial:Contributions")
{usuario=location.href.substring(location.href.indexOf('Contributions/')+14,location.href.length);}
 
 
 
/* Inicio */
 
if (biblio==false)
{
	tmp='';
 
	if (FBpruebas){tmp+= '[<a href='+dire+'edit&borrar=pruebas>Pruebas</a>] '; }
 	if (FBblanco){tmp+= '[<a href='+dire+'edit&borrar=blanco>En blanco</a>] '; }
	if (FBne){tmp+= '[<a href='+dire+'edit&borrar=NE>No enciclopédico</a>] '; }
	if (FBinfra){tmp+= '[<a href='+dire+'edit&borrar=infra>Infraesbozo</a>] '; }
 	if (FBautopromo){tmp+= '[<a href='+dire+'borrar=autopromo>Autopromoción</a>] '; }
	if (FBotro){tmp+= '[<a onclick="mot=prompt(/Motivo/);location.href=dire + fin_otro +encodeURI(mot) ;"> OTRO </a>] ';}
 
	if (tmp!='') { botones= botones + 'Destruir: ' + tmp + '<br>';}
 
}
 
if (biblio)
{
tmp='';
 
	if (FBborrar){tmp+= '[<a href='+dire+'delete&rapido=si>¡Borrar!</a>] '; }
        if (FBblock){tmp+= '[<a href='+dire2+usuario+'&autoblock=6>Bloqueo suave</a>] '; }
        if (FBblock){tmp+= '[<a href='+dire2+usuario+'&autoblock=infinito>Bloqueo infinito</a>] '; }
 
if (tmp!=''){botones = botones + 'Para biblios: ' +tmp+'<br>';}
}
 
 
tmp='';
 
if (FBwikificar){tmp+= '[<a href='+dire+'edit&plant=wikificar>Wikificar</a>] '; }
if (FBwikci){tmp+= '[<a href='+dire+'edit&plant=wikci>Wikci</a>] '; }
if (FBrefs){tmp+= '[<a href='+dire+'edit&plant=refs>Referencias</a>] '; }
 
if (tmp!=''){botones = botones + 'Plantillas: ' +tmp+'<br>';}
 
 
tmp='';
 
if (FBaviso){tmp+='[<a onclick="mot=prompt(textopruebas);location.href=dire + fin_aviso +encodeURI(mot) ;">Advertencia</a>] ';}
 
if (biblio==false)
{if (FBvec){tmp+= '[<a onclick=";mot=prompt(/Motivo/);location.href=vec + usuario + sep + mot;">Reportar en VEC</a>] ';}}
if (biblio==false)
{if (FBtab){tmp+= '[<a onclick=";mot=prompt(/Motivo/);location.href=tab + usuario + sep + mot;">Solicitud en TAB</a>] ';}}

 
if (tmp!=''){botones = botones + 'Especiales: ' +tmp+'<br>';}
 
 
/* Botones funcionando */
 
$(function ()
{
 
if (document.getElementById('contentSub').innerHTML!='')
{document.getElementById('contentSub').innerHTML+='<br>';}
 
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= '{{destruir|Pruebas de edición}}\n' + txt;
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Destruir: pruebas de edición'+ufb;
		document.editform.submit();
	}
}
 
 
else if (location.href.match("borrar=pruebas")) 
{
	txt=document.getElementById("wpTextbox1").value;
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt= '{{destruir|Pruebas de edición}}\n' + txt;
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Destruir: pruebas de edición'+ufb;
		document.editform.submit();
	}
}
 
 
else if (location.href.match("borrar=irrelev")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt= '{{destruir|No enciclopédico}}\n' + txt
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Destruir: no enciclopédico'+ufb;
		document.editform.submit();
	}
}
 
 
else if (location.href.match("borrar=infra")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt= '{{destruir|Infraesbozo}}\n' + txt
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Destruir: infraesbozo'+ufb;
		document.editform.submit();
	}
}
 
 
else if (location.href.match("borrar=autopromo"))
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt= '{{destruir|Artículo promocional/de vanidad}}\n' + txt
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Destruir: Autopromocional'+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='{{destruir|'+decodeURI(mot)+'}}\n'+txt;
			document.getElementById ("wpTextbox1").value=txt;
			document.editform.wpSummary.value = 'Destruir: '+decodeURI(mot)+ufb;
	 		document.editform.submit();
		}
	}
}
 
 
 
else if (location.href.match("plant=wikificar")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt='{{wikificar}}\n'+txt;
		document.getElementById ("wpTextbox1").value=txt; 
		document.editform.wpSummary.value = 'Wikificar'+ufb;
		document.editform.submit();
	} 
}
 
 

else if (location.href.match("plant=refs")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt='{{referencias}}\n'+txt;
		document.getElementById ("wpTextbox1").value=txt; 
		document.editform.wpSummary.value = 'Referenciar'+ufb;
		document.editform.submit();
	} 
}
 
 
 
else if (location.href.match("plant=wikci")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt='{{wikci}}\n'+txt;
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Al wikcionario'+ufb;
		document.editform.wpSave.click();
	}
}
 
 
else if (location.href.match("rapido=si")) 
{
	document.getElementById ("wpConfirmB").click();
}
 
else if (location.href.match("autoblock=6")) 
{
 
        document.getElementById ("wpBlockExpiry").value="6 hours";
        document.getElementById ("wpBlockReasonList").value="other";
        document.getElementById ("mw-bi-reason").value="Vandalismo";
        document.getElementById ("wpAnonOnly").checked="checked";
        document.getElementById ("wpCreateAccount").checked="checked";
        document.getElementById ("wpEnableAutoblock").checked="checked";
        document.getElementById ("wpEmailBan").checked="checked";
        document.getElementById ("wpWatchUser").checked="checked";
        document.getElementById ("wpAllowUsertalk").checked="checked";
 
	document.getElementById("blockip").submit();
}
 
else if (location.href.match("autoblock=infinito")) 
{
 
        document.getElementById ("wpBlockExpiry").value="infinite";
        document.getElementById ("wpBlockReasonList").value="other";
        document.getElementById ("mw-bi-reason").value="Vandalismo";
        document.getElementById ("wpAnonOnly").checked="checked";
        document.getElementById ("wpCreateAccount").checked="checked";
        document.getElementById ("wpEnableAutoblock").checked="checked";
        document.getElementById ("wpEmailBan").checked="checked";
        document.getElementById ("wpWatchUser").checked="checked";
        document.getElementById ("wpAllowUsertalk").checked="checked";
 
	document.getElementById("blockip").submit();
}
 
 
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{{subst:Reportevandalismo|"+decodeURI(mot)+"|~~~~}}");
	document.getElementById("wpTextbox1").value=txt2;
	document.editform.wpSummary.value = 'Reportando'+ufb;
	document.editform.submit();
}
 
else if (location.href.match("motivoTAB=")) 
{
	var txt2;
	var strt="Añade la siguiente solicitud debajo de esta línea.-->";
	mot=location.href.substring(location.href.indexOf('motivoTAB=')+10, location.href.length);
	txt=document.getElementById("wpTextbox1").value;
	txt2=txt.split(strt).join(strt+"\n\n{{subst:Wikipedia:Tablón de anuncios de los bibliotecarios/Portal/Archivo/Protección de artículos/precarga|"+decodeURI(mot)+"}}");
	document.getElementById("wpTextbox1").value=txt2;
	document.editform.wpSummary.value = 'Enviando solicitud de protección'+ufb;
	document.editform.submit();
}
else if (location.href.match("aviso=")) 
{
	txt=document.getElementById("wpTextbox1").value;
	mot=location.href.substring(location.href.indexOf('aviso=')+6, location.href.length);
	txt=txt+'\n\n{{prueba'+decodeURI(mot)+'}} --~~~~';
	document.getElementById ("wpTextbox1").value=txt;
	document.editform.wpSummary.value = 'Aviso al usuario'+ufb;
	document.editform.submit();
}
 
 
 
 
});
 
//</pre>