User:555/monobook.js

From Wikisource
Jump to navigation Jump to search

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
//var div=document.getElementById('editpage-specialchars');
//if ( div ) {
//  
//}

 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);
   tbar.appendChild(ba);
 }

window.myOwnEditButtons=function() {
  var tbdiv=document.getElementById('toolbar');
  if ( tbdiv ) {
    tbdiv.appendChild(document.createTextNode(' '));

// Botao:{NowCommonsThis}
AddMyOwnButton(tbdiv, 'NowCommonsThis', 'javascript:document.editform.wpSummary.value=\'\{\{NowCommonsThis\}\}\';insertTags(\'\{\{NowCommonsThis}}\',\'\',\'\');document.editform.submit();', 'http://img385.imageshack.us/img385/3005/commons8au.png');

  }
}

window.myAddOnload=function(f) {
  if (window.addEventListener) window.addEventListener("load", f, false);
  else if (window.attachEvent) window.attachEvent("onload",f);
}
myAddOnload(myOwnEditButtons);