User:Waldir/extra-edit-buttons.js

From translatewiki.net
Jump to: navigation, search
/************************************************************/
 /*                  botões de edição                        */
 /************************************************************/
 
 //see [[:commons:Category:ButtonToolbar]]
 
 window.AddMyOwnButton=function(tbar, caption, href, imgsrc) {
   var ba = document.createElement('a');
   ba.href = href;
   var img = document.createElement('img');
   img.src = imgsrc;
   img.alt = caption;
   ba.appendChild(img);
   ba.onfocus = ba.blur;
   tbar.appendChild(ba);
 }
 
 window.myOwnEditButtons=function() {
 
  var tbdiv=document.getElementById('toolbar');
  if ( tbdiv ) {
    AddMyOwnButton(tbdiv, 'plural', 'javascript:insertTags(\'{\{PLURAL:\$1\||\',\'}}\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/8/8b/Button_portail.png');
   }
 }
 
 hookEvent('load', myOwnEditButtons);