Utilisateur:Delhovlyn/changerTailleTextbox.js

Note : après avoir enregistré la page, vous devrez forcer le rechargement complet du cache de votre navigateur pour voir les changements.

Mozilla / Firefox / Konqueror / Safari : maintenez la touche Majuscule (Shift) en cliquant sur le bouton Actualiser (Reload) ou pressez Maj-Ctrl-R (Cmd-R sur Apple Mac) ;

Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.
function changertaille(diff) {
  if (document.getElementById("toolbar") == null) return;  // Teste si on est en cours de modification : si oui, OK ; si non, stop.

  if(diff != 0) {
  document.getElementById('wpTextbox1').rows = document.getElementById('wpTextbox1').rows + diff;
  } else {
  document.getElementById('wpTextbox1').rows = window.prompt('Nombre de lignes pour la zone d\'édition ?', '10');
  }
}

function init_boutonstaille() {
  if (document.getElementById("toolbar") == null) return;  // Teste si on est en cours de modification : si oui, OK ; si non, stop.
  var barredoutils = document.getElementById("toolbar");
  barredoutils.innerHTML = '<div style="display:inline; border:grey solid 1px; padding:2px; background-color:#E9E9E9; border-bottom:none; border-right:none;">&nbsp;'
                           + '<a href="javascript:changertaille(-1);">–</a>&nbsp;&nbsp;&nbsp;<a href="javascript:changertaille(1);">+</a>&nbsp;&nbsp;&nbsp;<a href="javascript:changertaille(0);">?</a>'
                           + ' </div>' + barredoutils.innerHTML;
}
addOnloadHook(init_boutonstaille);