User:Waldyrious/extra-edit-buttons.js

From translatewiki.net

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/************************************************************/
 /*                  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);