Diferencia entre revisiones de «MediaWiki:Gadget-botonera.js»
Contenido eliminado Contenido añadido
cierre de llaves |
Refactorización de la extensión de la botonera, con más botones ordenados por similitud, con nuevas imágenes de estilo uniforme y con funciones mejoradas y revisadas |
||
Línea 1: | Línea 1: | ||
// <nowiki> |
// <nowiki> |
||
( function ( $, mw ) { |
|||
var customizeToolbar = function () { |
|||
var wpTextbox1 = $('#wpTextbox1'); |
|||
function extraPublish () { |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
var sumario = $( '#wpSummary' ); |
|||
'section': 'advanced', |
|||
' |
if ( sumario === '' ) { |
||
var respuesta = window.prompt( 'Ingrese un resumen de edición' ); |
|||
'mantenimiento': { |
|||
if( respuesta !== null ) { |
|||
'label': 'Mantenimiento' // or use labelMsg for a localized label, see above |
|||
sumario.val( respuesta ); |
|||
}, |
|||
$( '#editform' ).submit(); |
|||
'miscelanea': { |
|||
} |
|||
'label': 'Miscelanea' // or use labelMsg for a localized label, see above |
|||
} |
|||
} |
|||
} |
|||
} |
|||
function extraPreview () { |
|||
}); |
|||
$( '#wpPreview' ).click(); |
|||
var selectionStart, selectionEnd; |
|||
} |
|||
$('#wpTextbox1').on('select', function() { |
|||
function extraWelcome () { |
|||
selectionStart = $('#wpTextbox1')[0].selectionStart; |
|||
var aviso = '{{sust:Bienvenida'; |
|||
selectionEnd = $('#wpTextbox1')[0].selectionEnd; |
|||
if ( /^\d+\.\d+\.\d+\.\d+$/.test( mw.config.get( 'wgTitle' ) ) ) { |
|||
}); |
|||
aviso = aviso + '|IP'; |
|||
} |
|||
aviso = aviso + '}} -- ~~~~'; |
|||
$( '#wpTextbox1' ).val( aviso + '\n' + $( '#wpTextbox1' ).val() ); |
|||
} |
|||
function extraCategory () { |
|||
var respuesta = window.prompt( 'Nombre de la categoría:' ); |
|||
if ( respuesta !== null ) { |
|||
$( '#wpTextbox1' ).val( $( '#wpTextbox1' ).val() + '\n[[' + 'Categoría:' + respuesta + ']]' ); |
|||
} |
|||
} |
|||
function extraChangeCase () { |
|||
var wpTextbox1 = $( '#wpTextbox1' ); |
|||
var selectionStart = wpTextbox1.prop('selectionStart'); |
|||
var selectionEnd = wpTextbox1.prop('selectionEnd'); |
|||
if ( selectionEnd > selectionStart ) { |
|||
var content = wpTextbox1.val(); |
|||
var selr = content.length - selectionEnd; |
|||
var selt = content.substring( selectionStart, selectionEnd ); |
|||
if ( selt === selt.toUpperCase() ) { |
|||
selt = selt.toLowerCase(); |
|||
} else if ( selt == selt.toLowerCase() && ( selectionEnd - selectionStart ) > 1 ) { |
|||
selt = selt.substring(0, 1).toUpperCase() + selt.substring(1).toLowerCase(); |
|||
} else { |
|||
selt = selt.toUpperCase(); |
|||
} |
|||
wpTextbox1.val( |
|||
content.substring( 0, selectionStart ) + |
|||
selt + |
|||
content.substring( selectionEnd ) |
|||
); |
|||
if ( selectionEnd > selectionStart ) { |
|||
wpTextbox1.prop('selectionStart', selectionStart); |
|||
wpTextbox1.prop('selectionEnd', content.length - selr); |
|||
} else { |
|||
wpTextbox1.prop('selectionStart', selectionEnd); |
|||
wpTextbox1.prop('selectionEnd', selectionStart); |
|||
} |
|||
} |
|||
} |
|||
function extraAddReflist () { |
|||
const section = '== Referencias ==\n{{Listaref}}\n\n'; |
|||
var wpTextbox1 = $( '#wpTextbox1' ); |
|||
var content = wpTextbox1.val(); |
|||
if ( content.search( /^(=+)\s*Referencias\s*\1/m ) < 0 ) { |
|||
var position = content.search( /(=+)\s*Enlaces externos\s*\1|\[\[\s*[Cc]ategoría\s*:/ ); |
|||
if ( position < 0 ) { |
|||
wpTextbox1.val( content + section ); |
|||
wpTextbox1.focus(); |
|||
wpTextbox1.prop('selectionStart', content.length); |
|||
wpTextbox1.prop('selectionEnd', content.length + section.length); |
|||
} else { |
|||
wpTextbox1.val( content.substring(0, position) + section + content.substring(position, content.length) ); |
|||
wpTextbox1.focus(); |
|||
wpTextbox1.prop('selectionStart', position); |
|||
wpTextbox1.prop('selectionEnd', position + section.length); |
|||
} |
|||
} |
|||
} |
|||
function extraArchiveCDB () { |
|||
var respuesta = window.prompt( 'Decisión:' ); |
|||
if( respuesta !== null ) { |
|||
$( '#wpTextbox1' ).val( |
|||
'{{cierracdb-arr}}: \'\'\'' + respuesta + '\'\'\' -- ~~~~\n' + |
|||
$( '#wpTextbox1' ).val().replace( /\{\{RETIRA ESTA PLANTILLA CUANDO CIERRES ESTA CONSULTA[^\}]*\}\}\n/, '' ) + |
|||
'\n{{cierracdb-ab}}' |
|||
); |
|||
$( '#wpSummary' ).val( 'Cerrando consulta: ' + respuesta ); |
|||
} |
|||
} |
|||
// groups: |
|||
function extraGrabar() { |
|||
wpTextbox1.wikiEditor('addToToolbar', { |
|||
var sumario = $('#wpSummary'); |
|||
section: 'advanced', |
|||
if (sumario === '') { |
|||
groups: { |
|||
sumario.val(window.prompt('Ingrese un resumen de edición')); |
|||
miscelanea: { |
|||
} |
|||
type: 'toolbar', |
|||
$('#editform').submit(); |
|||
label: 'Miscelánea' |
|||
} |
|||
}, |
|||
mantenimiento: { |
|||
type: 'toolbar', |
|||
label: 'Mantenimiento' |
|||
}, |
|||
} |
|||
} ); |
|||
// format buttons: |
|||
wpTextbox1.wikiEditor('addToToolbar', { |
|||
section: 'advanced', |
|||
group: 'format', |
|||
tools: { |
|||
strike: { |
|||
type: 'button', |
|||
label: 'Tachado', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Antu_format-text-strikethrough.svg/22px-Antu_format-text-strikethrough.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '<s>', |
|||
peri: 'Texto tachado', |
|||
post: '</s>' |
|||
} |
|||
} |
|||
}, |
|||
underline: { |
|||
type: 'button', |
|||
label: 'Subrayado', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Antu_format-text-underline.svg/22px-Antu_format-text-underline.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '<u>', |
|||
peri: 'Texto subrayado', |
|||
post: '</u>' |
|||
} |
|||
} |
|||
}, |
|||
} |
|||
} ); |
|||
// size buttons: |
|||
wpTextbox1.wikiEditor('addToToolbar', { |
|||
section: 'advanced', |
|||
group: 'size', |
|||
tools: { |
|||
changecase: { |
|||
type: 'button', |
|||
label: 'Cambiar a mayúsculas o minúsculas', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/e/e4/Toolbar_case.png', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function (context) { extraChangeCase(); } |
|||
} |
|||
}, |
|||
} |
|||
} ); |
|||
// insert buttons: |
|||
wpTextbox1.wikiEditor('addToToolbar', { |
|||
section: 'advanced', |
|||
group: 'insert', |
|||
tools: { |
|||
cite: { |
|||
type: 'button', |
|||
label: 'Cita', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/f/fd/Toolbar_blockquote.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Cita|1=', |
|||
peri: 'Texto en cita', |
|||
post: '|2=Autor}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
code: { |
|||
type: 'button', |
|||
label: 'Código', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/18/Antu_application-xsd.svg/22px-Antu_application-xsd.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '<code>', |
|||
peri: 'Código', |
|||
post: '</code>' |
|||
} |
|||
} |
|||
}, |
|||
math: { |
|||
type: 'button', |
|||
label: 'Fórmula matemática (LaTeX)', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/10/Antu_format-text-symbol.svg/22px-Antu_format-text-symbol.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '<math>', |
|||
peri: 'Escribe aquí una fórmula', |
|||
post: '</math>' |
|||
} |
|||
} |
|||
}, |
|||
line: { |
|||
type: 'button', |
|||
label: 'Línea horizontal', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/0/09/Antu_menu_new_sep.svg/22px-Antu_menu_new_sep.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '----\n', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
comment: { |
|||
type: 'button', |
|||
label: 'Comentario oculto', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d1/VisualEditor_-_Icon_-_Comment.svg/24px-VisualEditor_-_Icon_-_Comment.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '<!--', |
|||
peri: 'Texto oculto', |
|||
post: '-->' |
|||
} |
|||
} |
|||
}, |
|||
template: { |
|||
type: 'button', |
|||
label: 'Plantilla', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Template_alt_full_black_22.svg/22px-Template_alt_full_black_22.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{', |
|||
peri: 'Nombre de plantilla', |
|||
post: '}}' |
|||
} |
|||
} |
|||
}, |
|||
doublequote: { |
|||
type: 'button', |
|||
label: 'Comillas angulares', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/a/ac/Norwegian_quote_sign.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '«', |
|||
post: '»' |
|||
} |
|||
} |
|||
}, |
|||
singlequote: { |
|||
type: 'button', |
|||
label: 'Comillas inglesas', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/c/c6/Quote_toolbar_symbol.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '“', |
|||
post: '”' |
|||
} |
|||
} |
|||
}, |
|||
listaref: { |
|||
type: 'button', |
|||
label: 'Sección de referencias', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f9/VisualEditor_-_Icon_-_References.svg/24px-VisualEditor_-_Icon_-_References.svg.png', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function (context) { extraAddReflist(); } |
|||
} |
|||
}, |
|||
} |
|||
} ); |
|||
// misc. buttons: |
|||
wpTextbox1.wikiEditor('addToToolbar', { |
|||
section: 'advanced', |
|||
group: 'miscelanea', |
|||
tools: { |
|||
username: { |
|||
type: 'button', |
|||
label: 'Usuario', |
|||
filters: [ 'body:not(.ns-0, .ns-104)' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Antu_list-resource-add.svg/22px-Antu_list-resource-add.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{u|1=', |
|||
peri: 'nombre usuario', |
|||
post: '}}' |
|||
} |
|||
} |
|||
}, |
|||
unsigned: { |
|||
type: 'button', |
|||
label: 'No firmado', |
|||
filters: [ 'body:not(.ns-0, .ns-104)' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/0/05/Breezeicons-actions-22-draw-freehand.svg/22px-Breezeicons-actions-22-draw-freehand.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:nofirmado|1=', |
|||
peri: 'nombre usuario', |
|||
post: '|2=--~~~~}}' |
|||
} |
|||
} |
|||
}, |
|||
done: { |
|||
type: 'button', |
|||
label: 'Hecho', |
|||
filters: [ 'body:not(.ns-0, .ns-104)' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/85/Antu_games-endturn.svg/22px-Antu_games-endturn.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Hecho|1=', |
|||
peri: '', |
|||
post: '}}' |
|||
} |
|||
} |
|||
}, |
|||
preview: { |
|||
type: 'button', |
|||
label: 'Previsualizar', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/78/Antu_view-preview.svg/22px-Antu_view-preview.svg.png', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function (context) { extraPreview(); } |
|||
} |
|||
}, |
|||
save: { |
|||
type: 'button', |
|||
label: 'Publicar cambios', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Breezeicons-actions-22-document-save.svg/22px-Breezeicons-actions-22-document-save.svg.png', |
|||
// icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/df/Antu_document-save-as-template.svg/22px-Antu_document-save-as-template.svg.png', |
|||
//upload.wikimedia.org/wikipedia/commons/thumb/2/20/Save_font_awesome.svg/22px-Save_font_awesome.svg.png |
|||
//upload.wikimedia.org/wikipedia/commons/thumb/2/20/Feather-core-save.svg/22px-Feather-core-save.svg.png |
|||
action: { |
|||
type: 'callback', |
|||
execute: function (context) { extraGrabar(); } |
|||
} |
|||
}, |
|||
} |
|||
} ); |
|||
// mant. buttons: |
|||
wpTextbox1.wikiEditor('addToToolbar', { |
|||
section: 'advanced', |
|||
group: 'mantenimiento', |
|||
tools: { |
|||
citarequerida: { |
|||
label: 'Cita requerida', |
|||
type: 'button', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/c/c3/Toolbar_references2.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
post: '{{cr}}' |
|||
} |
|||
} |
|||
}, |
|||
bienvenida: { |
|||
type: 'button', |
|||
label: 'Bienvenida', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/3/33/Toolbar_welcome.png', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function (context) { extraWelcome(); } |
|||
} |
|||
}, |
|||
categoria: { |
|||
type: 'button', |
|||
label: 'Agregar categoría', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function (context) { extraCategory(); } |
|||
} |
|||
}, |
|||
avisocategoria: { |
|||
type: 'button', |
|||
label: 'Aviso categorizar', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso categorizar|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
desambiguacion: { |
|||
label: 'Desambiguación', |
|||
type: 'button', |
|||
filters: [ 'body.ns-0' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/72/Disambig.svg/25px-Disambig.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Desambiguación}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
votonulo: { |
|||
label: 'Voto nulo', |
|||
type: 'button', |
|||
filters: [ 'body.ns-1, body.ns-4, body.ns-5, body.ns-11, body.ns-13, body.ns-15, body.ns-101, body.ns-102, body.ns-103, body.ns-105, body.ns-829' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/6/6c/Toolbar_anular_voto.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: ':<s>', |
|||
peri: 'Voto a anular', |
|||
post: '</s> {{subst:Votonulo|-- ~~~~}}' |
|||
} |
|||
} |
|||
}, |
|||
avisovotonulo: { |
|||
label: 'Aviso voto nulo', |
|||
type: 'button', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/6/6c/Toolbar_anular_voto.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso votonulo}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
traduccion: { |
|||
type: 'button', |
|||
label: 'Traducción', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/40/Icono_de_traducción.svg/25px-Icono_de_traducción.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Traducción', |
|||
peri: '|ci=idioma|art=artículo original', |
|||
post: '}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
endesarrollo: { |
|||
type: 'button', |
|||
label: 'En desarrollo', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Commons-emblem-Under_construction-green.svg/25px-Commons-emblem-Under_construction-green.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{En desarrollo|1=' + mw.config.get( 'wgUserName' ) + '|t={{subst:CURRENTTIMESTAMP}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
transferir: { |
|||
type: 'button', |
|||
label: 'Transferir', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/27/Commons-emblem-doc.svg/25px-Commons-emblem-doc.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Transferir a|', |
|||
peri: 'wikiproyecto', |
|||
post: '|t={{subst:CURRENTTIMESTAMP}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
fusionar: { |
|||
type: 'button', |
|||
label: 'Fusionar', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Commons-emblem-merge.svg/25px-Commons-emblem-merge.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Fusionar|', |
|||
peri: 'nombre del artículo', |
|||
post: '|t={{subst:CURRENTTIMESTAMP}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
fusionarplantilla: { |
|||
type: 'button', |
|||
label: 'Fusionar', |
|||
filters: [ 'body.ns-10' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Commons-emblem-merge.svg/25px-Commons-emblem-merge.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '<noinclude>{{Fusionar|', |
|||
peri: 'nombre de la plantilla', |
|||
post: '|t={{subst:CURRENTTIMESTAMP}}}}</noinclude>', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoprueba1: { |
|||
type: 'button', |
|||
label: 'Aviso prueba 1', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/3/34/Ambox_warning_blue.svg/25px-Ambox_warning_blue.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso prueba1|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoprueba2: { |
|||
type: 'button', |
|||
label: 'Aviso prueba 2', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/74/Ambox_warning_yellow.svg/25px-Ambox_warning_yellow.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso prueba2|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoprueba3: { |
|||
type: 'button', |
|||
label: 'Aviso prueba 3', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Ambox_warning_orange.svg/25px-Ambox_warning_orange.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso prueba3|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoprueba4: { |
|||
type: 'button', |
|||
label: 'Aviso prueba 4', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/15/Ambox_warning_pn.svg/25px-Ambox_warning_pn.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso prueba4|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoimagen: { |
|||
type: 'button', |
|||
label: 'Aviso imagen retirada', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Unfree_image.svg/25px-Unfree_image.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso imagen|1=', |
|||
peri: 'nombre de la imagen', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoblanqueodiscu: { |
|||
type: 'button', |
|||
label: 'Aviso blanqueo discusión', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/b/ba/Toolbar_supr.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso blanqueo discusión}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
referencias: { |
|||
type: 'button', |
|||
label: 'Referencias', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_references.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Referencias|t={{subst:CURRENTTIMESTAMP}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoreferencias: { |
|||
type: 'button', |
|||
label: 'Aviso referencias', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_references.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso referencias|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
wikificar: { |
|||
type: 'button', |
|||
label: 'Wikificar', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Spanish_Language_Wiki.svg/25px-Spanish_Language_Wiki.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Wikificar|t={{subst:CURRENTTIMESTAMP}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisowikificar: { |
|||
type: 'button', |
|||
label: 'Aviso wikificar', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Spanish_Language_Wiki.svg/25px-Spanish_Language_Wiki.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso wikificar|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
copyedit: { |
|||
type: 'button', |
|||
label: 'Copyedit', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Commons-emblem-copyedit.svg/25px-Commons-emblem-copyedit.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Copyedit|t={{subst:CURRENTTIMESTAMP}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisocopyedit: { |
|||
type: 'button', |
|||
label: 'Aviso copyedit', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Commons-emblem-copyedit.svg/25px-Commons-emblem-copyedit.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso copyedit|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
noneutralidad: { |
|||
type: 'button', |
|||
label: 'No neutral', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Commons-emblem-scales.svg/25px-Commons-emblem-scales.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{No neutralidad}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisononeutralidad: { |
|||
type: 'button', |
|||
label: 'Aviso no neutralidad', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Commons-emblem-scales.svg/25px-Commons-emblem-scales.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso no neutralidad|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
maltraducido: { |
|||
type: 'button', |
|||
label: 'Mal traducido', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Commons-emblem-question_book_orange.svg/25px-Commons-emblem-question_book_orange.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Mal traducido}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisomaltraducido: { |
|||
type: 'button', |
|||
label: 'Aviso mal traducido', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Commons-emblem-question_book_orange.svg/25px-Commons-emblem-question_book_orange.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso mal traducido|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
autotrad: { |
|||
type: 'button', |
|||
label: 'Autotraducido', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/40/Commons-emblem-question-book-red.svg/25px-Commons-emblem-question-book-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Autotrad|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoautotrad: { |
|||
type: 'button', |
|||
label: 'Aviso autotrad', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/40/Commons-emblem-question-book-red.svg/25px-Commons-emblem-question-book-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso autotrad|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
contextualizar: { |
|||
type: 'button', |
|||
label: 'Contextualizar', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/16/Commons-emblem-hand.svg/25px-Commons-emblem-hand.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Contextualizar|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisocontextualizar: { |
|||
type: 'button', |
|||
label: 'Aviso contextualizar', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/16/Commons-emblem-hand.svg/25px-Commons-emblem-hand.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso contextualizar|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
promocional: { |
|||
type: 'button', |
|||
label: 'Promocional', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Commons-emblem-scales-red.svg/25px-Commons-emblem-scales-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Promocional|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisopromocional: { |
|||
type: 'button', |
|||
label: 'Aviso promocional', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Commons-emblem-scales-red.svg/25px-Commons-emblem-scales-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso promocional|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
fuenteprimaria: { |
|||
type: 'button', |
|||
label: 'Fuente primaria', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Commons-emblem-forbidden-primary-sources.svg/25px-Commons-emblem-forbidden-primary-sources.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Fuente primaria|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisofuenteprimaria: { |
|||
type: 'button', |
|||
label: 'Aviso fuente primaria', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Commons-emblem-forbidden-primary-sources.svg/25px-Commons-emblem-forbidden-primary-sources.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso fuente primaria|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
infraesbozo: { |
|||
type: 'button', |
|||
label: 'Infraesbozo', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Gnome-emblem-important.svg/25px-Gnome-emblem-important.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Infraesbozo|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoinfraesbozo: { |
|||
type: 'button', |
|||
label: 'Aviso infraesbozo', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Gnome-emblem-important.svg/25px-Gnome-emblem-important.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso infraesbozo|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
sinrelevancia: { |
|||
type: 'button', |
|||
label: 'Sin relevancia', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/46/NotCommons-emblem-registered-trademark.svg/25px-NotCommons-emblem-registered-trademark.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Sin relevancia|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisosinrelevancia: { |
|||
type: 'button', |
|||
label: 'Aviso sin relevancia', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/46/NotCommons-emblem-registered-trademark.svg/25px-NotCommons-emblem-registered-trademark.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso sin relevancia|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
copyvio: { |
|||
type: 'button', |
|||
label: 'Posible copyvio', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Commons-emblem-restricted-permission.svg/25px-Commons-emblem-restricted-permission.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Posible copyvio|1=', |
|||
peri: 'origen del texto', |
|||
post: '|2=~~~~|3={{subst:CURRENTDAY}}|4={{subst:CURRENTMONTHNAME}}}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisocopyvio: { |
|||
type: 'button', |
|||
label: 'Aviso de posible copyvio', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Commons-emblem-restricted-permission.svg/25px-Commons-emblem-restricted-permission.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso copyvio|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
plagio: { |
|||
type: 'button', |
|||
label: 'Plagio', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c3/NotCommons-emblem-copyrighted.svg/25px-NotCommons-emblem-copyrighted.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{Plagio|1=', |
|||
peri: 'origen del texto', |
|||
post: '|2=~~~~}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoplagio: { |
|||
type: 'button', |
|||
label: 'Aviso de plagio', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c3/NotCommons-emblem-copyrighted.svg/25px-NotCommons-emblem-copyrighted.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso copyvio|', |
|||
peri: 'nombre del artículo', |
|||
post: '|plagio}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
consultaborrado: { |
|||
type: 'button', |
|||
label: 'Consulta de borrado', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Help-browser-red.svg/25px-Help-browser-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{sust:cdb|motivo=', |
|||
peri: 'motivo de la consulta', |
|||
post: '}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisoconsultaborrado: { |
|||
type: 'button', |
|||
label: 'Aviso de consulta de borrado', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Help-browser-red.svg/25px-Help-browser-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{sust:Aviso cdb|', |
|||
peri: 'nombre del artículo|página de la consulta', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
propb: { |
|||
type: 'button', |
|||
label: 'Propuesta de borrado', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Commons-emblem-speedy-old.svg/25px-Commons-emblem-speedy-old.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:propb|', |
|||
peri: 'motivo', |
|||
post: '}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisopropb: { |
|||
type: 'button', |
|||
label: 'Aviso de propuesta de borrado', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Commons-emblem-speedy-old.svg/25px-Commons-emblem-speedy-old.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso propb|', |
|||
peri: 'nombre del artículo', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
destruir: { |
|||
type: 'button', |
|||
label: 'Borrado rápido', |
|||
filters: [ 'body.ns-0, body.ns-104' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/57/Commons-emblem-speedy.svg/25px-Commons-emblem-speedy.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{destruir|', |
|||
peri: 'motivo', |
|||
post: '}}', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
avisodestruir: { |
|||
type: 'button', |
|||
label: 'Aviso de borrado rápido', |
|||
filters: [ 'body.ns-3' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/57/Commons-emblem-speedy.svg/25px-Commons-emblem-speedy.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
options: { |
|||
pre: '{{subst:Aviso destruir|', |
|||
peri: 'nombre del artículo|motivos', |
|||
post: '}} -- ~~~~', |
|||
ownline: true |
|||
} |
|||
} |
|||
}, |
|||
} |
|||
} ); |
|||
if ( $.inArray( 'sysop', mw.config.get( 'wgUserGroups' ) ) > -1 ) { |
|||
wpTextbox1.wikiEditor('addToToolbar', { |
|||
section: 'advanced', |
|||
group: 'mantenimiento', |
|||
tools: { |
|||
archivarconsulta: { |
|||
type: 'button', |
|||
label: 'Archivar consulta de borrado', |
|||
filters: [ 'body.ns-4[class^=page-Wikipedia_Consultas_de_borrado]' ], |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Help-browser-red.svg/25px-Help-browser-red.svg.png', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function (context) { extraArchiveCDB(); } |
|||
} |
|||
}, |
|||
} |
|||
} ); |
|||
} |
|||
}; |
|||
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) { |
|||
function extraPreview() { |
|||
mw.loader.using( 'user.options' ).then( function () { |
|||
$('#wpPreview').click(); |
|||
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]]) |
|||
} |
|||
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) { |
|||
$.when( |
|||
function extraAnularvoto() { |
|||
mw.loader.using( 'ext.wikiEditor' ), $.ready |
|||
var texto1 = $('#wpTextbox1').val().substring(0, selectionStart), |
|||
).then( |
|||
texto2 = $('#wpTextbox1').val().substring(selectionStart, selectionEnd), |
|||
customizeToolbar |
|||
texto3 = $('#wpTextbox1').val().substring(selectionEnd, $('#wpTextbox1').val().length); |
|||
); |
|||
$('#wpTextbox1').val(texto1 + '<s>' + texto2 + '</s>{{votonulo|--~~~~}}' + texto3); |
|||
} |
|||
function extraOcultartexto() { |
|||
var texto1 = $('#wpTextbox1').val().substring(0, selectionStart), |
|||
texto2 = $('#wpTextbox1').val().substring(selectionStart, selectionEnd), |
|||
texto3 = $('#wpTextbox1').val().substring(selectionEnd, $('#wpTextbox1').val().length); |
|||
$('#wpTextbox1').val(texto1 + '<!--' + texto2 + '-->' + texto3); |
|||
} |
|||
function extraSeccionref() { |
|||
var cajatexto = $('#wpTextbox1'); |
|||
var valor = cajatexto.val().search('==Referencias=='), |
|||
exprreg = /\[\[Categoría:/, |
|||
indice = cajatexto.val().search(exprreg); |
|||
if (cajatexto.val().search('==Referencias==') == -1) { |
|||
if (!exprreg.test(cajatexto.val())) { |
|||
cajatexto.val(cajatexto.val() + '==Referencias==\n{{listaref}}'); |
|||
} else { |
|||
cajatexto.val(cajatexto.val().substring(0, indice) + '==Referencias==\n{{listaref}}\n' + cajatexto.val().substring(indice, cajatexto.val().length)); |
|||
} |
|||
} else |
|||
alert('Ya tiene sección referencias'); |
|||
} |
|||
function extraAbrirConsulta(pagina) { |
|||
if ($('#wpTextbox1').val() === '') { |
|||
var motivo = window.prompt('Motivo para abrir la consulta'); |
|||
var categoria = window.prompt('Categoría:'); |
|||
$('#wpTextbox1').val('{{sust:cdb2|pg=' + pagina + '|cat=' + categoria + '|texto=' + motivo + '|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTH}}}} ~~~~'); |
|||
$('#wpSummary').val('Nominado para borrado' + pagina); |
|||
} else { |
|||
alert('La consulta ya existe'); |
|||
} |
|||
} |
|||
function extraArchivarConsulta() { |
|||
if ($.inArray('sysop', mw.config.get('wgUserGroups')) > -1) { |
|||
var decision = window.prompt('Decision:'); |
|||
decision = "'''" + decision + "'''" + '--~~~~'; |
|||
$('#wpTextbox1').val('{{cierracdb-arr}} Decisión: ' + decision + '\n' + $('#wpTextbox1').val() + '\n{{cierracdb-ab}}'); |
|||
$('#wpSummary').val('Cerrando consulta: ' + decision); |
|||
} else { |
|||
alert('Función exclusiva para bibliotecarios'); |
|||
} |
|||
} |
|||
function extraCambiarCase() { |
|||
var cajaTexto1 = $('#wpTextbox1'), |
|||
selr, selt, temp; |
|||
selr = cajaTexto1.val().length - selectionEnd; |
|||
selt = cajaTexto1.val().substring(selectionStart, selectionEnd); |
|||
if (selectionEnd > selectionStart) { |
|||
if (selt == selt.toUpperCase()) { |
|||
selt = selt.toLowerCase(); |
|||
} else if (selt == selt.toLowerCase() && (selectionEnd - selectionStart) > 1) { |
|||
selt = selt.substring(0, 1).toUpperCase() + selt.substring(1).toLowerCase(); |
|||
} else { |
|||
selt = selt.toUpperCase(); |
|||
} |
|||
cajaTexto1.val( |
|||
cajaTexto1.val().substring(0, selectionStart) + |
|||
selt + |
|||
cajaTexto1.val().substring(selectionEnd)); |
|||
cajaTexto1[0].selectionStart = selectionStart; |
|||
if (selectionEnd > selectionStart) { |
|||
cajaTexto1[0].selectionEnd = cajaTexto1.val().length - selr; |
|||
} else { |
|||
temp = cajaTexto1[0].selectionEnd; |
|||
cajaTexto1[0].selectionEnd = selectionStart; |
|||
cajaTexto1[0].selectionStart = temp; |
|||
} |
|||
} |
|||
} |
|||
var sumario = ('#wpSummary'); |
|||
function agregarsum(texto, sumario) { |
|||
sumario.val(texto); |
|||
} |
|||
if (mw.config.get('wgNamespaceNumber') === 0) { //Para artículos |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'mantenimiento', |
|||
'tools': { |
|||
'agregarref': { |
|||
label: 'Solicitar referencias', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_references.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': '{{referencias|t={{subst:CURRENTTIMESTAMP}}}}', // text to be inserted |
|||
'peri': '', |
|||
'post': '', |
|||
} |
|||
} |
|||
}, |
|||
'cita requerida': { |
|||
label: 'cita requerida', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/9/9a/Button_references.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': '{{cita requerida}}', // text to be inserted |
|||
'peri': '', |
|||
'post': '', |
|||
} |
|||
} |
|||
}, |
|||
'plagio': { |
|||
label: 'Marcar plagio', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/9/94/Toolbar_copyright.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{plagio|1=", // text to be inserted |
|||
'peri': 'url plagiada', |
|||
'post': "|2=~~~~|3={{subst:CURRENTDAY}}|4={{subst:CURRENTMONTH}}}}", |
|||
} |
|||
} |
|||
}, |
|||
'copyvio': { |
|||
label: 'Marcar infracción - copyvio', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/7/71/Toolbar_copyvio.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{posible copyvio|1=", // text to be inserted |
|||
'peri': 'url plagiada', |
|||
'post': "|2=~~~~|3={{subst:CURRENTDAY}}|4={{subst:CURRENTMONTH}}}}", |
|||
} |
|||
} |
|||
}, |
|||
'autotrad': { |
|||
label: 'Traducción automática o deficiente', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Translation_arrow_ka.svg/25px-Translation_arrow_ka.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{autotrad|{{subst:CURRENTTIMESTAMP}}}}", // text to be inserted |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'maltraducido': { |
|||
label: 'Traducción deficiente', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Translation_arrow.svg/25px-Translation_arrow.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{mal traducido}}", // text to be inserted |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'Propuestadeborrado': { |
|||
label: 'Propuesta de borrado', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/b/ba/Toolbar_supr.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{propb|", // text to be inserted |
|||
'peri': 'motivo', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
}, |
|||
'Borradorapido': { |
|||
label: 'borrado rápido', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/2/23/Toolbar_cross.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{destruir|", // text to be inserted |
|||
'peri': 'motivo', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
}, |
|||
'consultaborrado': { |
|||
label: 'consulta de borrado', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/7/7b/Toolbar_clock.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:cdb|", |
|||
'peri': 'articulo principal', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
}, |
|||
'infraesbozo': { |
|||
label: 'infraesbozo', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/0/05/Toolbar_microstub.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:infraesbozo}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'Contextualizar': { |
|||
label: 'sin contexto', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Commons-emblem-hand.svg/25px-Commons-emblem-hand.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:contextualizar}}", |
|||
'peri': '', |
|||
'post': '', |
|||
} |
|||
} |
|||
}, |
|||
'SRA': { |
|||
label: 'sin relevancia aparente', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/1/17/Toolbar_relevancy.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:sin relevancia|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTH}}}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'FP': { |
|||
label: 'fuente primaria', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/c/c8/Toolbar_fuente_primaria.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:fuente primaria}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'promocional': { |
|||
label: 'promocional', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Commons-emblem-scales-red.svg/25px-Commons-emblem-scales-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:promocional}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'copyedit': { |
|||
label: 'copyedit', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Commons-emblem-copyedit.svg/25px-Commons-emblem-copyedit.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{copyedit|t={{subst:CURRENTTIMESTAMP}}}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'wikificar': { |
|||
label: 'wikificar', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Spanish_Language_Wiki.svg/25px-Spanish_Language_Wiki.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{wikificar|", |
|||
'peri': '1=categoría1|categoría2', |
|||
'post': "|t={{subst:CURRENTTIMESTAMP}}}}", |
|||
} |
|||
} |
|||
}, |
|||
'transferir': { |
|||
label: 'transferir', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Commons-emblem-doc.svg/25px-Commons-emblem-doc.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{transferir a|", |
|||
'peri': 'wikiproyecto', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'fusionar': { |
|||
label: 'fusionar', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Commons-emblem-merge.svg/25px-Commons-emblem-merge.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{fusionar|", |
|||
'peri': 'artículo', |
|||
'post': "|t={{subst:CURRENTTIMESTAMP}}}}", |
|||
} |
|||
} |
|||
}, |
|||
'noneutralidad': { |
|||
label: 'noneutral', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Commons-emblem-scales.svg/25px-Commons-emblem-scales.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{no neutralidad}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'desambiguación': { |
|||
label: 'desambiguación', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/72/Disambig.svg/25px-Disambig.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{desambiguación}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'endesarrollo': { |
|||
label: 'endesarrollo', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Commons-emblem-Under_construction-green.svg/25px-Commons-emblem-Under_construction-green.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{en desarrollo}}", |
|||
'peri': '', |
|||
'post': "", |
|||
} |
|||
} |
|||
}, |
|||
'en traducción': { |
|||
label: 'entraducion', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Icono_de_traducci%C3%B3n.svg/25px-Icono_de_traducci%C3%B3n.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{traducción", |
|||
'peri': '|ci=idioma|art=artículo original', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
if (mw.config.get('wgNamespaceNumber') === 3) { //Para discusión de usuarios |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'mantenimiento', |
|||
'tools': { |
|||
'agregarcat': { |
|||
label: 'aviso categoría', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:Aviso categorizar:", // text to be inserted |
|||
'peri': 'artículo', |
|||
'post': '}}' |
|||
}, |
|||
} |
|||
}, |
|||
'agregarref': { |
|||
label: 'Solicitar referencias', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_references.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': '{{subst:Aviso referencias|', // text to be inserted |
|||
'peri': 'artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'plagio': { |
|||
label: 'aviso de plagio', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/9/94/Toolbar_copyright.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:aviso copyvio|", // text to be inserted |
|||
'peri': 'artículo', |
|||
'post': "|plagio}} ~~~~", |
|||
} |
|||
} |
|||
}, |
|||
'autotrad': { |
|||
label: 'Traducción automática o deficiente', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Translation_arrow_ka.svg/25px-Translation_arrow_ka.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:Aviso autotrad|", // text to be inserted |
|||
'peri': 'artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'maltraducido': { |
|||
label: 'Traducción deficiente', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Translation_arrow.svg/25px-Translation_arrow.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:Aviso mal traducido|", // text to be inserted |
|||
'peri': 'nombre del artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'Propuestadeborrado': { |
|||
label: 'Propuesta de borrado', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/b/ba/Toolbar_supr.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:aviso propb|", // text to be inserted |
|||
'peri': 'artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'Borradorapido': { |
|||
label: 'aviso de borrado rápido', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/2/23/Toolbar_cross.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:Aviso borrado|", // text to be inserted |
|||
'peri': 'artículo|motivo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'consultaborrado': { |
|||
label: 'consulta de borrado', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/7/7b/Toolbar_clock.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:aviso cdb|", |
|||
'peri': 'artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'infraesbozo': { |
|||
label: 'aviso de infraesbozo', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/0/05/Toolbar_microstub.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{susbt:aviso infraesbozo|", |
|||
'peri': 'artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'Contextualizar': { |
|||
label: 'sin contexto', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Commons-emblem-hand.svg/25px-Commons-emblem-hand.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:aviso contextualizar|", |
|||
'peri': 'artículo', |
|||
'post': '', |
|||
} |
|||
} |
|||
}, |
|||
'SRA': { |
|||
label: 'sin relevancia aparente', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/1/17/Toolbar_relevancy.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:aviso sin relevancia|", |
|||
'peri': 'artículo', |
|||
'post': '', |
|||
} |
|||
} |
|||
}, |
|||
'FP': { |
|||
label: 'fuente primaria', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/c/c8/Toolbar_fuente_primaria.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:Aviso fuente primaria|", |
|||
'peri': '', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'promocional': { |
|||
label: 'promocional', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Commons-emblem-scales-red.svg/25px-Commons-emblem-scales-red.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:Aviso promocional|", |
|||
'peri': 'artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'copyedit': { |
|||
label: 'copyedit', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Commons-emblem-copyedit.svg/25px-Commons-emblem-copyedit.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{aviso copyedit|", |
|||
'peri': 'artículo', |
|||
'post': '}}', |
|||
} |
|||
} |
|||
}, |
|||
'wikificar': { |
|||
label: 'wikificar', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Spanish_Language_Wiki.svg/25px-Spanish_Language_Wiki.svg.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{aviso|wikificar|", |
|||
'peri': 'artículo', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'miscelanea', |
|||
'tools': { |
|||
'Bienvenido usuario': { |
|||
label: 'Bienvenida a usuario', // or use labelMsg for a localized label, see above |
|||
type: 'button', |
|||
icon: '//upload.wikimedia.org/wikipedia/commons/4/4a/Button_welcome.png', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:bienvenida}} ~~~~", |
|||
'peri': '', |
|||
'post':'', |
|||
} |
|||
} |
} |
||
} |
} ); |
||
} |
} |
||
}( jQuery, mediaWiki ) ); |
|||
}); |
|||
} |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'size', |
|||
'tools': { |
|||
'CambiarCase': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Toolbar_case.png', |
|||
label: 'Cambiar de mayúsculas a minúsculas', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraCambiarCase(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'insert', |
|||
'tools': { |
|||
'agregarReferencia': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/c/cf/Toolbar_insert_reference.png', |
|||
label: 'Agregar referencia', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraSeccionref(); |
|||
} |
|||
} |
|||
}, |
|||
'comentario': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/1/1b/Button_hide_wiki_tag.png', |
|||
label: 'Texto oculto', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraOcultartexto(); |
|||
} |
|||
} |
|||
}, |
|||
'plantilla': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png', |
|||
label: 'Insertar una plantilla', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{plantilla|", |
|||
'peri': '', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
}, |
|||
'cita': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/3/32/Button_apostrophe.PNG', |
|||
label: 'Insertar una cita', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{cita|", |
|||
'peri': '1=Cita|2=Autor', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
}, |
|||
'grabar': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/f/f6/Toolbar_save_changes.png', |
|||
label: 'Grabar', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraGrabar(); |
|||
} |
|||
} |
|||
}, |
|||
'previsualizar': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/b/bd/Toolbar_preview.png', |
|||
label: 'Previsualizar', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraPreview(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
if ($.inArray(mw.config.get('wgNamespaceNumber'), [0, 104]) == -1) { |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'miscelanea', |
|||
'tools': { |
|||
'cita': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/8/8a/Toolbar_user.png', |
|||
label: 'Insertar un/a usuario/a', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{u|", |
|||
'peri': '1=nombreusuario', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
}, |
|||
'nofirmado': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/1/1b/Button_miss_signature.png', |
|||
label: 'Insertar no firmado', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{subst:nofirmado|1=", |
|||
'peri': 'nombreusuario|2=~~~~', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
}, |
|||
'hecho': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Yes_check.svg/25px-Yes_check.svg.png', |
|||
label: 'Agregar un hecho', |
|||
action: { |
|||
type: 'encapsulate', |
|||
'options': { |
|||
'pre': "{{hecho|1=", |
|||
'peri': '', |
|||
'post': "}}", |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
if (mw.config.get('wgNamespaceNumber') % 2 == 1 || mw.config.get('wgNamespaceNumber') == 102) { |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'miscelanea', |
|||
'tools': { |
|||
'previsualizar': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/b/bd/Toolbar_preview.png', |
|||
label: 'Previsualizar', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraPreview(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
if (mw.config.get('wgPageName').indexOf("Wikipedia:Consultas_de_borrado/") > -1) { |
|||
$('#wpTextbox1').wikiEditor('addToToolbar', { |
|||
'section': 'advanced', |
|||
'group': 'mantenimiento', |
|||
'tools': { |
|||
'abrirconsulta': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/7/7b/Toolbar_clock.png', |
|||
label: 'abrir consulta de borrado', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraAbrirConsulta(mw.config.get('wgPageName').substring(mw.config.get('wgPageName') |
|||
.indexOf('/') + 1).replace(/_/g, ' ')); |
|||
} |
|||
} |
|||
}, |
|||
'archivarconsulta': { |
|||
type: 'button', |
|||
icon: 'https://upload.wikimedia.org/wikipedia/commons/8/80/Toolbar_archivo_borrar.png', |
|||
label: 'archivar consulta de borrado', |
|||
action: { |
|||
type: 'callback', |
|||
execute: function(context) { |
|||
extraArchivarConsulta(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
$('#wpTextbox1').on('wikiEditor-toolbar-doneInitialSections', function() { |
|||
if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1) { |
|||
mw.loader.using('user.options').then(function() { |
|||
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]]) |
|||
if (mw.user.options.get('usebetatoolbar') == 1) { |
|||
$.when( |
|||
mw.loader.using('ext.wikiEditor'), $.ready |
|||
).then(botoneraJSToolbar); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
// </nowiki> |
// </nowiki> |
Revisión del 17:38 30 may 2018
// <nowiki>
( function ( $, mw ) {
var customizeToolbar = function () {
var wpTextbox1 = $('#wpTextbox1');
function extraPublish () {
var sumario = $( '#wpSummary' );
if ( sumario === '' ) {
var respuesta = window.prompt( 'Ingrese un resumen de edición' );
if( respuesta !== null ) {
sumario.val( respuesta );
$( '#editform' ).submit();
}
}
}
function extraPreview () {
$( '#wpPreview' ).click();
}
function extraWelcome () {
var aviso = '{{sust:Bienvenida';
if ( /^\d+\.\d+\.\d+\.\d+$/.test( mw.config.get( 'wgTitle' ) ) ) {
aviso = aviso + '|IP';
}
aviso = aviso + '}} -- ~~~~';
$( '#wpTextbox1' ).val( aviso + '\n' + $( '#wpTextbox1' ).val() );
}
function extraCategory () {
var respuesta = window.prompt( 'Nombre de la categoría:' );
if ( respuesta !== null ) {
$( '#wpTextbox1' ).val( $( '#wpTextbox1' ).val() + '\n[[' + 'Categoría:' + respuesta + ']]' );
}
}
function extraChangeCase () {
var wpTextbox1 = $( '#wpTextbox1' );
var selectionStart = wpTextbox1.prop('selectionStart');
var selectionEnd = wpTextbox1.prop('selectionEnd');
if ( selectionEnd > selectionStart ) {
var content = wpTextbox1.val();
var selr = content.length - selectionEnd;
var selt = content.substring( selectionStart, selectionEnd );
if ( selt === selt.toUpperCase() ) {
selt = selt.toLowerCase();
} else if ( selt == selt.toLowerCase() && ( selectionEnd - selectionStart ) > 1 ) {
selt = selt.substring(0, 1).toUpperCase() + selt.substring(1).toLowerCase();
} else {
selt = selt.toUpperCase();
}
wpTextbox1.val(
content.substring( 0, selectionStart ) +
selt +
content.substring( selectionEnd )
);
if ( selectionEnd > selectionStart ) {
wpTextbox1.prop('selectionStart', selectionStart);
wpTextbox1.prop('selectionEnd', content.length - selr);
} else {
wpTextbox1.prop('selectionStart', selectionEnd);
wpTextbox1.prop('selectionEnd', selectionStart);
}
}
}
function extraAddReflist () {
const section = '== Referencias ==\n{{Listaref}}\n\n';
var wpTextbox1 = $( '#wpTextbox1' );
var content = wpTextbox1.val();
if ( content.search( /^(=+)\s*Referencias\s*\1/m ) < 0 ) {
var position = content.search( /(=+)\s*Enlaces externos\s*\1|\[\[\s*[Cc]ategoría\s*:/ );
if ( position < 0 ) {
wpTextbox1.val( content + section );
wpTextbox1.focus();
wpTextbox1.prop('selectionStart', content.length);
wpTextbox1.prop('selectionEnd', content.length + section.length);
} else {
wpTextbox1.val( content.substring(0, position) + section + content.substring(position, content.length) );
wpTextbox1.focus();
wpTextbox1.prop('selectionStart', position);
wpTextbox1.prop('selectionEnd', position + section.length);
}
}
}
function extraArchiveCDB () {
var respuesta = window.prompt( 'Decisión:' );
if( respuesta !== null ) {
$( '#wpTextbox1' ).val(
'{{cierracdb-arr}}: \'\'\'' + respuesta + '\'\'\' -- ~~~~\n' +
$( '#wpTextbox1' ).val().replace( /\{\{RETIRA ESTA PLANTILLA CUANDO CIERRES ESTA CONSULTA[^\}]*\}\}\n/, '' ) +
'\n{{cierracdb-ab}}'
);
$( '#wpSummary' ).val( 'Cerrando consulta: ' + respuesta );
}
}
// groups:
wpTextbox1.wikiEditor('addToToolbar', {
section: 'advanced',
groups: {
miscelanea: {
type: 'toolbar',
label: 'Miscelánea'
},
mantenimiento: {
type: 'toolbar',
label: 'Mantenimiento'
},
}
} );
// format buttons:
wpTextbox1.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
strike: {
type: 'button',
label: 'Tachado',
icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Antu_format-text-strikethrough.svg/22px-Antu_format-text-strikethrough.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<s>',
peri: 'Texto tachado',
post: '</s>'
}
}
},
underline: {
type: 'button',
label: 'Subrayado',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Antu_format-text-underline.svg/22px-Antu_format-text-underline.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<u>',
peri: 'Texto subrayado',
post: '</u>'
}
}
},
}
} );
// size buttons:
wpTextbox1.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'size',
tools: {
changecase: {
type: 'button',
label: 'Cambiar a mayúsculas o minúsculas',
icon: '//upload.wikimedia.org/wikipedia/commons/e/e4/Toolbar_case.png',
action: {
type: 'callback',
execute: function (context) { extraChangeCase(); }
}
},
}
} );
// insert buttons:
wpTextbox1.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'insert',
tools: {
cite: {
type: 'button',
label: 'Cita',
icon: '//upload.wikimedia.org/wikipedia/commons/f/fd/Toolbar_blockquote.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Cita|1=',
peri: 'Texto en cita',
post: '|2=Autor}}',
ownline: true
}
}
},
code: {
type: 'button',
label: 'Código',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/18/Antu_application-xsd.svg/22px-Antu_application-xsd.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<code>',
peri: 'Código',
post: '</code>'
}
}
},
math: {
type: 'button',
label: 'Fórmula matemática (LaTeX)',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/10/Antu_format-text-symbol.svg/22px-Antu_format-text-symbol.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<math>',
peri: 'Escribe aquí una fórmula',
post: '</math>'
}
}
},
line: {
type: 'button',
label: 'Línea horizontal',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/0/09/Antu_menu_new_sep.svg/22px-Antu_menu_new_sep.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '----\n',
ownline: true
}
}
},
comment: {
type: 'button',
label: 'Comentario oculto',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d1/VisualEditor_-_Icon_-_Comment.svg/24px-VisualEditor_-_Icon_-_Comment.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<!--',
peri: 'Texto oculto',
post: '-->'
}
}
},
template: {
type: 'button',
label: 'Plantilla',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Template_alt_full_black_22.svg/22px-Template_alt_full_black_22.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{',
peri: 'Nombre de plantilla',
post: '}}'
}
}
},
doublequote: {
type: 'button',
label: 'Comillas angulares',
icon: '//upload.wikimedia.org/wikipedia/commons/a/ac/Norwegian_quote_sign.png',
action: {
type: 'encapsulate',
options: {
pre: '«',
post: '»'
}
}
},
singlequote: {
type: 'button',
label: 'Comillas inglesas',
icon: '//upload.wikimedia.org/wikipedia/commons/c/c6/Quote_toolbar_symbol.png',
action: {
type: 'encapsulate',
options: {
pre: '“',
post: '”'
}
}
},
listaref: {
type: 'button',
label: 'Sección de referencias',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f9/VisualEditor_-_Icon_-_References.svg/24px-VisualEditor_-_Icon_-_References.svg.png',
action: {
type: 'callback',
execute: function (context) { extraAddReflist(); }
}
},
}
} );
// misc. buttons:
wpTextbox1.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'miscelanea',
tools: {
username: {
type: 'button',
label: 'Usuario',
filters: [ 'body:not(.ns-0, .ns-104)' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Antu_list-resource-add.svg/22px-Antu_list-resource-add.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{u|1=',
peri: 'nombre usuario',
post: '}}'
}
}
},
unsigned: {
type: 'button',
label: 'No firmado',
filters: [ 'body:not(.ns-0, .ns-104)' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/0/05/Breezeicons-actions-22-draw-freehand.svg/22px-Breezeicons-actions-22-draw-freehand.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:nofirmado|1=',
peri: 'nombre usuario',
post: '|2=--~~~~}}'
}
}
},
done: {
type: 'button',
label: 'Hecho',
filters: [ 'body:not(.ns-0, .ns-104)' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/85/Antu_games-endturn.svg/22px-Antu_games-endturn.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Hecho|1=',
peri: '',
post: '}}'
}
}
},
preview: {
type: 'button',
label: 'Previsualizar',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/78/Antu_view-preview.svg/22px-Antu_view-preview.svg.png',
action: {
type: 'callback',
execute: function (context) { extraPreview(); }
}
},
save: {
type: 'button',
label: 'Publicar cambios',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Breezeicons-actions-22-document-save.svg/22px-Breezeicons-actions-22-document-save.svg.png',
// icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/df/Antu_document-save-as-template.svg/22px-Antu_document-save-as-template.svg.png',
//upload.wikimedia.org/wikipedia/commons/thumb/2/20/Save_font_awesome.svg/22px-Save_font_awesome.svg.png
//upload.wikimedia.org/wikipedia/commons/thumb/2/20/Feather-core-save.svg/22px-Feather-core-save.svg.png
action: {
type: 'callback',
execute: function (context) { extraGrabar(); }
}
},
}
} );
// mant. buttons:
wpTextbox1.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'mantenimiento',
tools: {
citarequerida: {
label: 'Cita requerida',
type: 'button',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/c/c3/Toolbar_references2.png',
action: {
type: 'encapsulate',
options: {
post: '{{cr}}'
}
}
},
bienvenida: {
type: 'button',
label: 'Bienvenida',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/3/33/Toolbar_welcome.png',
action: {
type: 'callback',
execute: function (context) { extraWelcome(); }
}
},
categoria: {
type: 'button',
label: 'Agregar categoría',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png',
action: {
type: 'callback',
execute: function (context) { extraCategory(); }
}
},
avisocategoria: {
type: 'button',
label: 'Aviso categorizar',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbar_category.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso categorizar|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
desambiguacion: {
label: 'Desambiguación',
type: 'button',
filters: [ 'body.ns-0' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/72/Disambig.svg/25px-Disambig.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Desambiguación}}',
ownline: true
}
}
},
votonulo: {
label: 'Voto nulo',
type: 'button',
filters: [ 'body.ns-1, body.ns-4, body.ns-5, body.ns-11, body.ns-13, body.ns-15, body.ns-101, body.ns-102, body.ns-103, body.ns-105, body.ns-829' ],
icon: '//upload.wikimedia.org/wikipedia/commons/6/6c/Toolbar_anular_voto.png',
action: {
type: 'encapsulate',
options: {
pre: ':<s>',
peri: 'Voto a anular',
post: '</s> {{subst:Votonulo|-- ~~~~}}'
}
}
},
avisovotonulo: {
label: 'Aviso voto nulo',
type: 'button',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/6/6c/Toolbar_anular_voto.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso votonulo}} -- ~~~~',
ownline: true
}
}
},
traduccion: {
type: 'button',
label: 'Traducción',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/40/Icono_de_traducción.svg/25px-Icono_de_traducción.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Traducción',
peri: '|ci=idioma|art=artículo original',
post: '}}',
ownline: true
}
}
},
endesarrollo: {
type: 'button',
label: 'En desarrollo',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Commons-emblem-Under_construction-green.svg/25px-Commons-emblem-Under_construction-green.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{En desarrollo|1=' + mw.config.get( 'wgUserName' ) + '|t={{subst:CURRENTTIMESTAMP}}}}',
ownline: true
}
}
},
transferir: {
type: 'button',
label: 'Transferir',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/27/Commons-emblem-doc.svg/25px-Commons-emblem-doc.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Transferir a|',
peri: 'wikiproyecto',
post: '|t={{subst:CURRENTTIMESTAMP}}}}',
ownline: true
}
}
},
fusionar: {
type: 'button',
label: 'Fusionar',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Commons-emblem-merge.svg/25px-Commons-emblem-merge.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Fusionar|',
peri: 'nombre del artículo',
post: '|t={{subst:CURRENTTIMESTAMP}}}}',
ownline: true
}
}
},
fusionarplantilla: {
type: 'button',
label: 'Fusionar',
filters: [ 'body.ns-10' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Commons-emblem-merge.svg/25px-Commons-emblem-merge.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<noinclude>{{Fusionar|',
peri: 'nombre de la plantilla',
post: '|t={{subst:CURRENTTIMESTAMP}}}}</noinclude>',
ownline: true
}
}
},
avisoprueba1: {
type: 'button',
label: 'Aviso prueba 1',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/3/34/Ambox_warning_blue.svg/25px-Ambox_warning_blue.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso prueba1|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
avisoprueba2: {
type: 'button',
label: 'Aviso prueba 2',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/74/Ambox_warning_yellow.svg/25px-Ambox_warning_yellow.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso prueba2|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
avisoprueba3: {
type: 'button',
label: 'Aviso prueba 3',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Ambox_warning_orange.svg/25px-Ambox_warning_orange.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso prueba3|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
avisoprueba4: {
type: 'button',
label: 'Aviso prueba 4',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/15/Ambox_warning_pn.svg/25px-Ambox_warning_pn.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso prueba4|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
avisoimagen: {
type: 'button',
label: 'Aviso imagen retirada',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Unfree_image.svg/25px-Unfree_image.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso imagen|1=',
peri: 'nombre de la imagen',
post: '}} -- ~~~~',
ownline: true
}
}
},
avisoblanqueodiscu: {
type: 'button',
label: 'Aviso blanqueo discusión',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/b/ba/Toolbar_supr.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso blanqueo discusión}} -- ~~~~',
ownline: true
}
}
},
referencias: {
type: 'button',
label: 'Referencias',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_references.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Referencias|t={{subst:CURRENTTIMESTAMP}}}}',
ownline: true
}
}
},
avisoreferencias: {
type: 'button',
label: 'Aviso referencias',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/3/34/Toolbar_references.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso referencias|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
wikificar: {
type: 'button',
label: 'Wikificar',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Spanish_Language_Wiki.svg/25px-Spanish_Language_Wiki.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Wikificar|t={{subst:CURRENTTIMESTAMP}}}}',
ownline: true
}
}
},
avisowikificar: {
type: 'button',
label: 'Aviso wikificar',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Spanish_Language_Wiki.svg/25px-Spanish_Language_Wiki.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso wikificar|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
copyedit: {
type: 'button',
label: 'Copyedit',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Commons-emblem-copyedit.svg/25px-Commons-emblem-copyedit.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Copyedit|t={{subst:CURRENTTIMESTAMP}}}}',
ownline: true
}
}
},
avisocopyedit: {
type: 'button',
label: 'Aviso copyedit',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Commons-emblem-copyedit.svg/25px-Commons-emblem-copyedit.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso copyedit|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
noneutralidad: {
type: 'button',
label: 'No neutral',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Commons-emblem-scales.svg/25px-Commons-emblem-scales.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{No neutralidad}}',
ownline: true
}
}
},
avisononeutralidad: {
type: 'button',
label: 'Aviso no neutralidad',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Commons-emblem-scales.svg/25px-Commons-emblem-scales.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso no neutralidad|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
maltraducido: {
type: 'button',
label: 'Mal traducido',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Commons-emblem-question_book_orange.svg/25px-Commons-emblem-question_book_orange.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Mal traducido}}',
ownline: true
}
}
},
avisomaltraducido: {
type: 'button',
label: 'Aviso mal traducido',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Commons-emblem-question_book_orange.svg/25px-Commons-emblem-question_book_orange.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso mal traducido|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
autotrad: {
type: 'button',
label: 'Autotraducido',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/40/Commons-emblem-question-book-red.svg/25px-Commons-emblem-question-book-red.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Autotrad|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}',
ownline: true
}
}
},
avisoautotrad: {
type: 'button',
label: 'Aviso autotrad',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/40/Commons-emblem-question-book-red.svg/25px-Commons-emblem-question-book-red.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso autotrad|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
contextualizar: {
type: 'button',
label: 'Contextualizar',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/16/Commons-emblem-hand.svg/25px-Commons-emblem-hand.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Contextualizar|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}',
ownline: true
}
}
},
avisocontextualizar: {
type: 'button',
label: 'Aviso contextualizar',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/16/Commons-emblem-hand.svg/25px-Commons-emblem-hand.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso contextualizar|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
promocional: {
type: 'button',
label: 'Promocional',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Commons-emblem-scales-red.svg/25px-Commons-emblem-scales-red.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Promocional|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}',
ownline: true
}
}
},
avisopromocional: {
type: 'button',
label: 'Aviso promocional',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Commons-emblem-scales-red.svg/25px-Commons-emblem-scales-red.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso promocional|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
fuenteprimaria: {
type: 'button',
label: 'Fuente primaria',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Commons-emblem-forbidden-primary-sources.svg/25px-Commons-emblem-forbidden-primary-sources.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Fuente primaria|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}',
ownline: true
}
}
},
avisofuenteprimaria: {
type: 'button',
label: 'Aviso fuente primaria',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Commons-emblem-forbidden-primary-sources.svg/25px-Commons-emblem-forbidden-primary-sources.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso fuente primaria|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
infraesbozo: {
type: 'button',
label: 'Infraesbozo',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Gnome-emblem-important.svg/25px-Gnome-emblem-important.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Infraesbozo|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}',
ownline: true
}
}
},
avisoinfraesbozo: {
type: 'button',
label: 'Aviso infraesbozo',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Gnome-emblem-important.svg/25px-Gnome-emblem-important.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso infraesbozo|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
sinrelevancia: {
type: 'button',
label: 'Sin relevancia',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/46/NotCommons-emblem-registered-trademark.svg/25px-NotCommons-emblem-registered-trademark.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Sin relevancia|{{subst:CURRENTDAY}}|{{subst:CURRENTMONTHNAME}}}}',
ownline: true
}
}
},
avisosinrelevancia: {
type: 'button',
label: 'Aviso sin relevancia',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/46/NotCommons-emblem-registered-trademark.svg/25px-NotCommons-emblem-registered-trademark.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso sin relevancia|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
copyvio: {
type: 'button',
label: 'Posible copyvio',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Commons-emblem-restricted-permission.svg/25px-Commons-emblem-restricted-permission.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Posible copyvio|1=',
peri: 'origen del texto',
post: '|2=~~~~|3={{subst:CURRENTDAY}}|4={{subst:CURRENTMONTHNAME}}}}',
ownline: true
}
}
},
avisocopyvio: {
type: 'button',
label: 'Aviso de posible copyvio',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Commons-emblem-restricted-permission.svg/25px-Commons-emblem-restricted-permission.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso copyvio|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
plagio: {
type: 'button',
label: 'Plagio',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c3/NotCommons-emblem-copyrighted.svg/25px-NotCommons-emblem-copyrighted.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Plagio|1=',
peri: 'origen del texto',
post: '|2=~~~~}}',
ownline: true
}
}
},
avisoplagio: {
type: 'button',
label: 'Aviso de plagio',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c3/NotCommons-emblem-copyrighted.svg/25px-NotCommons-emblem-copyrighted.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso copyvio|',
peri: 'nombre del artículo',
post: '|plagio}} -- ~~~~',
ownline: true
}
}
},
consultaborrado: {
type: 'button',
label: 'Consulta de borrado',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Help-browser-red.svg/25px-Help-browser-red.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{sust:cdb|motivo=',
peri: 'motivo de la consulta',
post: '}}',
ownline: true
}
}
},
avisoconsultaborrado: {
type: 'button',
label: 'Aviso de consulta de borrado',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Help-browser-red.svg/25px-Help-browser-red.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{sust:Aviso cdb|',
peri: 'nombre del artículo|página de la consulta',
post: '}} -- ~~~~',
ownline: true
}
}
},
propb: {
type: 'button',
label: 'Propuesta de borrado',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Commons-emblem-speedy-old.svg/25px-Commons-emblem-speedy-old.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:propb|',
peri: 'motivo',
post: '}}',
ownline: true
}
}
},
avisopropb: {
type: 'button',
label: 'Aviso de propuesta de borrado',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Commons-emblem-speedy-old.svg/25px-Commons-emblem-speedy-old.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso propb|',
peri: 'nombre del artículo',
post: '}} -- ~~~~',
ownline: true
}
}
},
destruir: {
type: 'button',
label: 'Borrado rápido',
filters: [ 'body.ns-0, body.ns-104' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/57/Commons-emblem-speedy.svg/25px-Commons-emblem-speedy.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{destruir|',
peri: 'motivo',
post: '}}',
ownline: true
}
}
},
avisodestruir: {
type: 'button',
label: 'Aviso de borrado rápido',
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/57/Commons-emblem-speedy.svg/25px-Commons-emblem-speedy.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:Aviso destruir|',
peri: 'nombre del artículo|motivos',
post: '}} -- ~~~~',
ownline: true
}
}
},
}
} );
if ( $.inArray( 'sysop', mw.config.get( 'wgUserGroups' ) ) > -1 ) {
wpTextbox1.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'mantenimiento',
tools: {
archivarconsulta: {
type: 'button',
label: 'Archivar consulta de borrado',
filters: [ 'body.ns-4[class^=page-Wikipedia_Consultas_de_borrado]' ],
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Help-browser-red.svg/25px-Help-browser-red.svg.png',
action: {
type: 'callback',
execute: function (context) { extraArchiveCDB(); }
}
},
}
} );
}
};
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
mw.loader.using( 'user.options' ).then( function () {
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor' ), $.ready
).then(
customizeToolbar
);
}
} );
}
}( jQuery, mediaWiki ) );
// </nowiki>