Usuario:Savh/botonesdenixon.js
Nota: Después de publicar, quizás necesite actualizar la caché de su navegador para ver los cambios.
- Firefox/Safari: Mantenga presionada la tecla Shift mientras pulsa el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
- Google Chrome: presione Ctrl+Shift+R (⌘+Shift+R en Mac)
- Internet Explorer/Edge: mantenga presionada Ctrl mientras pulsa Actualizar, o presione Ctrl+F5
- Opera: Presiona Ctrl+F5.
// Botones desarrollados por Usuario:Nixón, copiados para mi uso propio.
//<nowiki>
var pagina = '';
var mot = '';
var ufb = '';
var txt = '';
var botones = '';
var usuario = '';
var temporal = '';
var sep = "|";
var biblio = false;
var dire = mw.util.wikiScript('index') + '?title=';
var textopruebas = "Página a redirigir:";
var personales = false; //¿Activar config personal?
var pruebas = true; //Pruebas
var vand = true; //Vandalismo
var infra = true; //Infraesbozo
var sra = true; //Sin relevancia aparente
var promo = true; //Promocional
var cont = true; //Sin contexto
var fp = true; //Fuente primaria
var bulo = true; //Bulo
var ne = true; //No enciclopédico
var spambot = true; //spambot
var autor = true; //A petición de autor
var usp = true; //Uso indebido de página de usuario
var plagio = true; //Plagio
var redir = true; //Redirección innecesaria
var resub = true; //Resumen de borrado en blanco
var disc = true; //Página de discusión huérfana
var autotrad = true; //Traducción automática
var warnblock = true; //Aviso a usuario bloqueado
var aviso1 = true; //Aviso a usuario 1
var aviso2 = true; //Aviso a usuario 2
var aviso3 = true; //Aviso a usuario 3
var aviso4 = true; //Último aviso a usuario
var avisoblanqueo = true; //Aviso a usuario blanqueo
var avisospam1 = true; //Aviso a usuario spam 1
var avisospam2 = true; //Aviso a usuario spam 2
/* Toma de datos */
for(i = 0; i < wgUserGroups.length; i++) {
if(wgUserGroups[i] == "autoconfirmed") biblio = true;
}
pagina = encodeURI(wgPageName);
if(pagina.match("&")) {
pagina = pagina.replace("&", "%26");
}
dire = dire + pagina + "&action=";
usuario = pagina.split(":")[1];
tmp = '';
if(resub) {
tmp += '[<a href=' + dire + 'delete&wpReason=-&speedy=yes>borrar</a>] ';
}
if(vand) {
tmp += '[<a href=' + dire + 'delete&wpReason=' + encodeURIComponent("[[WL:BR#G1|G1]]: [[WL:VN|vandalismo]]") + '&speedy=yes>vand</a>] ';
}
if(pruebas) {
tmp += '[<a href=' + dire + 'delete&wpReason=' + encodeURIComponent("[[WL:BR#G4|G4]]: pruebas de edición") + '&speedy=yes>prueb</a>] ';
}
if (wgNamespaceNumber == 1) if(disc) {
tmp += '[<a href=' + dire + 'delete&wpReason=' + encodeURIComponent("[[WL:BR#G7|G7]]: página de discusión huérfana") + '&speedy=yes>disc</a>] ';
}
if(wgNamespaceNumber == 0) if(ne) {
tmp += '[<a href=' + dire + 'delete&wpReason=' + encodeURIComponent("[[WL:BR#L1|L1]]: [[Wikilibros:Lo_que_Wikilibros_no_es|No corresponde a este proyecto]].") + '&speedy=yes>no-es</a>] ';
}
if(wgNamespaceNumber == 0) if(plagio) {
tmp += '[<a href=' + dire + 'delete&wpReason=' + encodeURIComponent("[[WL:BR#G6|G6]]: violación de los derechos de autor") + '&speedy=yes>plagio</a>] ';
}
if(spambot) {
tmp += '[<a href=' + dire + 'delete&wpReason=' + encodeURIComponent("Spambot") + '&speedy=yes>spambot</a>] ';
}
if(tmp != '') {
botones = botones + 'Borrar: ' + tmp + '<br>';
}
tmp = '';
if(wgNamespaceNumber == 3)
{
if(warnblock) {
tmp += '[<a href=' + dire + 'edit&warn=block>Aviso bloqueado</a>] ';
}
if(aviso1) {
tmp += '[<a href=' + dire + 'edit&warn=aviso1>Aviso1</a>] ';
}
}
if(wgNamespaceNumber == 0)
{
if(sra) {
tmp += '[<a href=' + dire + 'edit&warn=sra>sra</a>] ';
}
}
if(tmp != '') {
botones = botones + 'Avisos: ' + tmp + '<br>';
}
jQuery( function( $ ) {
if(document.getElementById('contentSub').innerHTML != '') {
document.getElementById('contentSub').innerHTML += '<br>';
}
document.getElementById('contentSub').innerHTML = document.getElementById('contentSub').innerHTML + botones;
if(mw.util.getParamValue( 'speedy' ) === "yes") {
document.getElementById("wpConfirmB").click();
} else {if(mw.util.getParamValue( 'warn' ) === "block") {
txt = document.getElementById("wpTextbox1").value;
txt = txt + '\n{{subst:Aviso bloqueado}} --~~~~'
document.getElementById("wpTextbox1").value = txt;
document.editform.wpSummary.value = 'Aviso: Usuario ha sido bloqueado' + ufb;
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
if(mw.util.getParamValue( 'warn' ) === "aviso1") {
txt = document.getElementById("wpTextbox1").value;
txt = txt + '\n{{subst:aviso prueba1}} --~~~~'
document.getElementById("wpTextbox1").value = txt;
document.editform.wpSummary.value = 'Pruebas de edición' + ufb;
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
}
});
//</nowiki>