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

//Fusión de varios "monobuques" fundamentalmente a partir del de Charlitos 
//(que es el de Comae tras pasar por varias manos, entre ellas, la mía)
//y el de Angus

//En [[:Categoría:Botones de edición]] están los botones de la barra de edición que aparece por defecto, 
//más los que he creado para mi barra particular.

// incluir mi Live Preview, modificado a partir del de Pilaf.

document.write('<script type="text/javascript" src="/w/index.php?title=Usuario:Sanbec/LivePreview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

function addLoadEvent(func) {
   if (window.addEventListener) {
       window.addEventListener("load", func, false);
   } else if (window.attachEvent) {
       window.attachEvent("onload", func);
   }
}

function CargaLivePreview()
{
 LivePreviewInstall();
}
addLoadEvent(CargaLivePreview);

var wpUserName = 'Reanduro';

/************ Módulo botonera flotante **************/
function botoneraFlotante()
{
  var botones='<style type="text/css">\n .botón {background-color:transparent; border:0px; float:left; font-size:80%; padding:.25px; line-height:1.5 }\n</style> <div class="botonera" style="position:fixed; bottom:6px; left:4px; z-index:3; font-size:13px; color:#000; font-weight:900; text-align:center; width:150px; float:right">';
  botones+=creaBotón("Mapa de la ayuda", "<img src=http://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Question.gif/20px-Question.gif>", "http://es.wikipedia.org/wiki/Wikipedia:Mapa", "");
  botones+=creaBotón("Café", "<img src=http://upload.wikimedia.org/wikipedia/es/9/9e/Tacita.png>", "http://es.wikipedia.org/wiki/Wikipedia:Café", "");
  botones+=creaBotón("Cambios recientes", "<img src=http://upload.wikimedia.org/wikipedia/es/0/00/Icono_recientes.png>", "http://es.wikipedia.org/wiki/Especial:Recentchanges", "");
  botones+=creaBotón("Lista de seguimiento", "<img src=http://upload.wikimedia.org/wikipedia/es/2/24/Icono_seguimiento.png>", "http://es.wikipedia.org/wiki/Especial:Watchlist", "");
 
  if (document.getElementById("editform")!=null) {
  //Estos botones no se muestran si no se está editando:
  }

  botones+='</div>';
  <!--var toolbox = document.getElementById("contentTop");-->
  var toolbox = document.getElementById("column-one");
  toolbox.innerHTML += botones;
} // fin botoneraFlotante
addLoadEvent(botoneraFlotante);

function creaBotón(title, texto, destino, estilo)
{
  return '<a href="'+destino+'" style="text-decoration:none"><div class="botón" style="'+estilo+'" title="'+title+'">'+texto+'</div></a>';
}
/************ Fin módulo botonera flotante **************/

/*** Módulo caja de herramientas personales ***/

function nuevaCaja() {
  var l = document.getElementById("column-one");
  if (l) {
    l.innerHTML = l.innerHTML
    + '<div class="portlet" id="p-nbx">'
    + ' <h5>Herramientas personales</h5>'
    + ' <div class="pBody">'
    + '   <ul>'
    + '     <li><a href="http://es.wikipedia.org/wiki/Usuario:Sanbec/monobook.js">monobook.js</a></li>'
    + '     <li><a href="http://es.wikipedia.org/wiki/Usuario:Sanbec/LivePreview.js">LivePreview.js</a></li>'
    + '     <li><a href="http://es.wikipedia.org/wiki/Usuario:Sanbec/monobook.css">monobook.css</a></li>'
    + '   </ul>'
    + ' </div>'
    + '</div> ';
  }
}
addLoadEvent(nuevaCaja);
/*** Fin módulo caja de herramientas personales ***/

/*** subir al fondo - Desactivo, ya está en el monobuque general
function agrega_enlace_para_subir_a_commons()
{
    if (document.getElementById("enlace-subir-a-commons")) return;
    var li_subir = document.getElementById("t-upload");
    if (!li_subir) return;
    var siguiente = li_subir.nextSibling;
    var ul_herramientas = li_subir.parentNode;
    var li = document.createElement("li");
    li.id = "enlace-subir-a-commons";
    li.innerHTML = '<a href="http://commons.wikimedia.org/wiki/Special:Upload">Subir a Commons</a>';
    if (siguiente) ul_herramientas.insertBefore(li, siguiente);
    else ul_herramientas.appendChild(li);
}
addLoadEvent(agrega_enlace_para_subir_a_commons); */

/*** fin subir al fondo */

/************      Módulo de búsqueda     **************/
function moduloBusqueda()
{
  var btSearch = '<div>';
  btSearch += buttonCode('onclick="goSearch(0)" value="en:" title="Wikipedia en inglés"');
  btSearch += buttonCode('onclick="goSearch(1)" value="de:" title="Wikipedia en alemán"');
  btSearch += buttonCode('onclick="goSearch(2)" value="fr:" title="Wikipedia en francés"');
  btSearch += buttonCode('onclick="goSearch(3)" value="EL" title="Enciclopedia Libre"');
  btSearch += buttonCode('onclick="goSearch(4)" value="Wikc"');
  btSearch += buttonCode('onclick="goSearch(5)" value="FSF" title="Free Software Foundation"');
  btSearch += '</div>';
  
  var boxSearch = document.getElementById("searchform");
  if (boxSearch)
    boxSearch.innerHTML += btSearch;
}

function goSearch(i)
{
  urls = new Array(
    "http://en.wikipedia.org/wiki/", 
    "http://de.wikipedia.org/wiki/",
    "http://fr.wikipedia.org/wiki/",
    "http://enciclopedia.us.es/index.php/",
    "http://es.wiktionary.org/wiki/",
    "http://www.gnu.org/cgi-bin/htsearch?words="
  );

  var text = document.getElementById("searchInput");
  
  window.open(urls[i] + escape(text.value));
}

function buttonCode(strCode)
{
  return '&nbsp;<input type="button" class="searchButton" '+strCode+' />';
}

addLoadEvent(moduloBusqueda);

/************     Fin módulo de búsqueda    **************/

/* Modulo barra de herramientas de la caja de edición */

function toolbarExtendido()
{
  var botones='';
  botones='';
  var toolbar = document.getElementById("toolbar")
  if (toolbar!=null) {
  //Estos botones se añaden a la barra de herramientas que hay dobre la caja de edición
    for (i=0; i<mis_botones.length; i++)
    {
      var imageFile = mis_botones[i].img;
      var speedTip = mis_botones[i].st;
      
      botones+="<a href=\"javascript:" + "hanApretadoUnBoton('"+i+"')\">";
      botones+="<img width=\"23\" height=\"22\" src=\""+imageFile+"\" border=\"0\" alt=\""+speedTip+"\" title=\""+speedTip+"\"/>";
      botones+="</a>";
      	
    }
    toolbar.innerHTML += botones;
  }

} // fin toolbarExtendido
addLoadEvent(toolbarExtendido);

mis_botones = new Array();

// ¡han apretado un botón!
// esto es insertTags modificado, sólo que llama a una función para
// modificar el texto
function hanApretadoUnBoton (cual)
{
	if (!mis_botones[cual]) return;
	var fn = mis_botones[cual].fn;
	if (!fn) return;
	
	var txtarea = document.editform.wpTextbox1;
	// IE
	if(document.selection  && !is_gecko) {
		var theSelection = document.selection.createRange().text;
		if(!theSelection) { theSelection="";}
		txtarea.focus();
		if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any
			theSelection = theSelection.substring(0, theSelection.length - 1);
			document.selection.createRange().text = fn(theSelection) + " ";
		} else {
			document.selection.createRange().text = fn(theSelection);
		}

	// Mozilla
	} else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
 		var startPos = txtarea.selectionStart;
		var endPos = txtarea.selectionEnd;
		var scrollTop=txtarea.scrollTop;
		var myText = (txtarea.value).substring(startPos, endPos);
		if(!myText) { myText="";}
		if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any
			subst = fn(myText.substring(0, (myText.length - 1)))+" ";
		} else {
			subst = fn(myText);
		}
		txtarea.value = txtarea.value.substring(0, startPos) + subst +
		  txtarea.value.substring(endPos, txtarea.value.length);
		txtarea.focus();

		var cPos=startPos+subst.length;
		txtarea.selectionStart=cPos;
		txtarea.selectionEnd=cPos;
		txtarea.scrollTop=scrollTop;

	// All others
	} else {
		var copy_alertText=alertText;
		var re1=new RegExp("\\$1","g");
		var re2=new RegExp("\\$2","g");
		copy_alertText=copy_alertText.replace(re1,"xyz");
		copy_alertText=copy_alertText.replace(re2,fn("xyz"));
		var text;
		if (sampleText) {
			text=prompt(copy_alertText);
		} else {
			text="";
		}
		if(!text) { text="xyz";}
		text=fn(text);
		document.infoform.infobox.value=text;
		// in Safari this causes scrolling
		if(!is_safari) {
			txtarea.focus();
		}
		noOverwrite=true;
	}
	// reposition cursor if possible
	if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate();
}


// Esta es una versión modificada de addButton.
// Parámetros:
// * la imagen para colocar en el botón,
// * el texto de ayuda (se muestra cuando el puntero del mouse
//   pasa sobre el botón,
// * una función a la que se llamará cuando se pulse el botón, con
//   un parámetro: el texto seleccionado, y que deberá devolver el
//   texto a poner en su lugar.           
//
// No funciona con el infobox
function otro_boton (imageFile, speedTip, funcion) {
	var btn = { img: imageFile, st: speedTip, fn: funcion };
	mis_botones[mis_botones.length] = btn;
}

function Usuario(s)
{
	if (s == "") s = wpUserName;
	// si no tiene '|' duplicamos el término
	if (s.indexOf("|") == -1) s = s + "|" + s;
	
	return "[[Usuario:" + s + "]]";
}

otro_boton("http://upload.wikimedia.org/wikipedia/es/2/29/Button_user.png",
	"Enlace a usuario", Usuario);


function Discusion(s)
{
	if (s == "") s = wpUserName;
	// si no tiene '|' duplicamos el término
	if (s.indexOf("|") == -1) s = s + "|" + s;
	
	return "[[Usuario Discusión:" + s + "]]";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/f/fc/Button_user_talk.png",
	"Enlace a discusión de usuario", Discusion);

function Bienvenida(s) {return '{'+'{Bienvenido usuario}}';}
otro_boton("http://upload.wikimedia.org/wikipedia/es/8/83/Button_wellcome.png",
	"Bienvenida", Bienvenida);

function enlace_a_dicc (s)
{
	if (s == "") s = "palabra";
	// si no tiene '|' duplicamos el término
	if (s.indexOf("|") == -1) s = s + "|" + s;
	return "[[wikt:" + s + "]]";
}

otro_boton("http://upload.wikimedia.org/wikipedia/es/0/00/Button_dicc.png",
	"enlace al wikcionario", enlace_a_dicc);
    
function category(s)
{
	return "[["+"Categoría:" + s + "]]";
}
otro_boton("http://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png",
	"Categoría", category);


function copyvio(s)
{
Qr='';
if(!Qr){void(Qr=prompt('Copiada de:',''));}
if(Qr) return "{"+"{copyvio|1="+Qr+"|2=~~"+"~~|3="+"{"+"{subst:CURRENTDAY}}|4={"+"{subst:CURRENTMONTHNAME}}}}";
}

otro_boton("http://upload.wikimedia.org/wikipedia/es/e/e5/Button_copyvio.png",
	"Alerta de copyright", copyvio);

function avisoborrar(s)
{
  Qr='';
  if(!Qr){void(Qr=prompt('Motivo:',''));}
  if(Qr)return "{"+"{aviso borrar|"+Qr+"|~~"+"~~}}";
}

otro_boton("http://upload.wikimedia.org/wikipedia/es/e/ec/Button_aviso.png",
	"Aviso de borrado", avisoborrar);

function consultaborrar(s)
{
  Qr='';
  Qr2 = get_subpage_title().replace(/_/g , ' ');  
  
  if(!Qr){void(Qr=prompt('Motivo:',''));}
  if(Qr)return "{"+"{subst:Consulta borrar|"+Qr2+"|"+Qr+"|~~"+"~~|{"+"{subst:CURRENTDAY}}|{"+"{subst:CURRENTMONTHNAME}}}}";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/a/aa/Button_question.png",
	"Consulta de borrado", consultaborrar);

function desconocido(s)
{
	return "{"+"{Sin origen ni licencia|{"+"{subst:CURRENTDAY}}|{"+"{subst:CURRENTMONTHNAME}}}}";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/2/2a/Button_examine.png",
	"Imagen sin origen ni licencia", desconocido);

function incompleta(s)
{
	return "{"+"{Sin origen|{"+"{subst:CURRENTDAY}}|{"+"{subst:CURRENTMONTHNAME}}}}";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/2/23/Button_licimc.png",
	"Imagen sin origen", incompleta);

function Retirada(s)
{
  return "{"+"{Imagen retirada|"+Firma(s)+"}}";
}

otro_boton("http://upload.wikimedia.org/wikipedia/es/2/2d/Button_removed.png",
	"Imagen retirada", Retirada);

function gif(s)
{
	return '{'+'{gif}}';
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/d/da/Button_nogifs.png",
	"Quema los GIFs", gif);


function GFDL(s)
{
  return "{"+"{GFDL}}";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/8/87/Button_gfdl.png",
	"Licencia GFDL", GFDL);

function Latinas (s)
{
	return "«" + s + "»";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/2/26/Button_latinas.png",
	"Comillas latinas", Latinas);

function Llaves (s)
{
	return "{"+"{" + s + "}}";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/5/59/Button_template.png",
	"Llaves para plantillas", Llaves);

function Tachar (s)
{
	return "<s>" + s + "</s>";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/3/3d/Button_tachar.png",
	"Tachado", Tachar);


function fusionar(s)
{
  return "{"+"{fusionar|" + s + "}}";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/2/2f/Button_merge.png",
	"Fusionar", fusionar);


function ponRedirect(s)
{
  return "#REDIRECT [[" + s + "]]";
}
otro_boton("http://upload.wikimedia.org/wikipedia/es/4/47/Button_redir.png",
	"Redirect", ponRedirect);


function ponWEI(s)
{
  if (s == "") s = ";-)";
  return '<code style="background:yellow">'+s+'</code>';
}
    
otro_boton("http://upload.wikimedia.org/wikipedia/es/e/e1/Button_smiley.png",
	"Emoticono", ponWEI);

function innecesaria(s)
{
  return "{"+"{innecesaria}}";}
    
otro_boton("http://upload.wikimedia.org/wikipedia/es/f/f1/Button_bckgrnd.png",
	"Aviso de plantilla innecesaria", innecesaria);


function Firma(s)
{
  return "~"+"~~ [[Usuario Discusión:"+wpUserName+"|✍]] ~~"+"~~"+"~";
}
otro_boton("http://es.wikipedia.org/style/images/button_sig.png",
	"Mi firma", Firma);

// Gets the article lemma with the namespace
function get_title()
{
  // get the article link from the label 'ca-edit' out of the document text.
  var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
  // cut everything up to "title=" from the start and everything past "&" from the end
  // Note if the page has & in its title, that is represented here as %26, so it
  // doesn't cause a problem
  editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.indexOf('&'));
  return editlk;
}

// Gets the article lemma, with the namespace but without sub pages.
function get_tidy_title()
{
  var editlk = get_title()
  editlk = editlk.replace(/\/.*$/, ''); //removing subpages from the link
  return editlk;
}
// Gets the subpage lemma, with the namespace but without sub pages.
function get_subpage_title()
{
  var editlk = get_title()
  editlk = editlk.substring(editlk.indexOf('/') + 1); // strip off 
  return editlk;
}


// Función copiada a Angus
function agrega_enlaces_de_editar_revision()
{
  var as = document.getElementsByTagName("a");
  for (var i=0; i<as.length; i++)
  {
    var a=as.item(i);
    if (a.href.match(/^http:\/\/es\.wikipedia\.org\/w\/index\.php\?title=.*oldid=\d+/))
    {
      var inner=a.innerHTML;
      if (inner.match(/^Revisión de /))
      {
        a.parentNode.innerHTML += " <a href=\"" + a.href + "&amp;action=edit\">[editar]</a>";
      }
    }
  }
}

addLoadEvent(agrega_enlaces_de_editar_revision);