Usuário(a):Spectrun/monobook.js

Origem: Wikipédia, a enciclopédia livre.

Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.

  • Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
  • Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
  • Internet Explorer / Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5
  • Opera: Pressione Ctrl-F5.
/*
==teste==
*/
  // teste
  //
  //  Indicate where you would like "teste" to appear:
  //    pt-userpage, pt-mytalk, pt-preferences,
   //    pt-watchlist, pt-mycontris, pt-logout
  //
 gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout"
  //
 function KateLink()
 {
  var user = document.getElementById( 'pt-userpage').firstChild.firstChild.data;

  var li = document.createElement( 'li' );
    li.id = 'pt-kate';

    var a = document.createElement( 'a' );
      a.appendChild( document.createTextNode( 'contador' ) ); // eh, the css makes the text lowercase
      a.href = 'http://pt.wikipedia.org/wiki/Usu%C3%A1rio:Thrasher/Teste' + user;

    li.appendChild( a );

  if ( ! gsKateInsertBefore ) // append to end (right) of list
  {  document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
  }
  else
  {  var before = document.getElementById( gsKateInsertBefore );
      before.appendChild( li, before );
  }
 }
   if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false );
 else if ( window.attachEvent      ) window.attachEvent   ( 'onload', KateLink );
  //  teste-----------------------------------------------------------------------------------


----------------------
----------------------
----------------------
/*
==Contador==
*/
  //  Add a "Kate" link to your monobook "personal menu" list at the very
  //  top of the page.
  //
  //  Indicate where you would like "Kate" to appear:
  //    pt-userpage, pt-mytalk, pt-preferences,
   //    pt-watchlist, pt-mycontris, pt-logout
  //
 gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout"
  //
 function KateLink()
 {
  var user = document.getElementById( 'pt-userpage').firstChild.firstChild.data;

  var li = document.createElement( 'li' );
    li.id = 'pt-kate';

    var a = document.createElement( 'a' );
      a.appendChild( document.createTextNode( 'contador' ) ); // eh, the css makes the text lowercase
      a.href = 'http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=ptwiki_p&user=' + user;

    li.appendChild( a );

  if ( ! gsKateInsertBefore ) // append to end (right) of list
  {  document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
  }
  else
  {  var before = document.getElementById( gsKateInsertBefore );
      before.appendChild( li, before );
  }
 }
   if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false );
 else if ( window.attachEvent      ) window.attachEvent   ( 'onload', KateLink );
  //  Contador -----------------------------------------------------------------------------------


/*
==Anti-vandal tool==
*/
 // Filter changes live
 // [[:en:User:Lupin/Anti-vandal tool]] - please include this line
 document.write('<script type="text/javascript" src="' 
             + 'http://pt.wikipedia.org/w/index.php?title=Wikipedia:Software/antivandaltool.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');


/*
==MyOwnEditButtons==
*/

 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:{{ }}
    AddMyOwnButton(tbdiv, 'txt2predef', 'javascript:insertTags(\'{{\',\'}}\',\'\');', 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_topredef.png');

    // Botao:{Bem vindo}
    AddMyOwnButton(tbdiv, 'Bem vindo', 'javascript:document.editform.wpSummary.value=\'\{\{bem vindo\}\}\';insertTags(\'\{\{bem vindo}} \{\{subst:Usuário:Rei-artur/ass}}\~\~\~\~\~\',\'\',\'\');document.editform.submit();', 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_bvip.png');

    // Botao:{lixo}
    AddMyOwnButton(tbdiv, 'Lixo', 'javascript:document.editform.wpSummary.value=\'\{\{lixo\}\}\';insertTags(\'\{\{lixo|\~\~\~\~\}}\',\'\',\'\');document.editform.submit();', 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_lixo.png');

    // Botao:<small>
    AddMyOwnButton(tbdiv, '<small></small>', 'javascript:insertTags(\'<small>\',\'</small>\',\'\');', 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_small.png');

    // Botao:<strike>
    AddMyOwnButton(tbdiv, '<s></s>', 'javascript:insertTags(\'<s>\',\'</s>\',\'\');', 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_strike.png');

    // Botao:autoDisambig
    AddMyOwnButton(tbdiv, 'desambigtxt', 'javascript:document.editform.wpSummary.value=\'v1\';insertTags(\'\{\{desambiguação\}\}\\n\\nPor \\\'\\\'\\\'\{\{subst:PAGENAME}}\\\'\\\'\\\' pode estar à procura de:\\n* \',\'\',\'\');', 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_disambig.png');

    // Botao:CaixaSucessao
    AddMyOwnButton(tbdiv, 'Caixa de sucessão', 'javascript:document.editform.wpSummary.value=\'+cxsucc\';insertTags(\'\{\{Começa caixa\}\}\\n\{\{Caixa de sucessão\|\\n\|título = \\n\|anos   = \\n\|antes  = \\n\|depois = \\n\}\}\\n\{\{Termina caixa\}\}\\n\',\'\',\'\');', 'http://img375.imageshack.us/img375/9823/coroa9ki.png');

    // Botao:LicencaIncompleta
    AddMyOwnButton(tbdiv, '\{\{SemInfo\}\}', 'javascript:document.editform.wpSummary.value=\'Aviso: Licença Incompleta\';insertTags(\';Descrição\\n:(informar aqui, por favor)\\n;Fonte\\n:(informar aqui, por favor)\\n;Licença\\n:\{\{CD|{\{subst:Usuário:Rei-artur/msg/+15}}}} <\!-- troque esta predefinição pela tag do respectivo copyright -->\\n\[\[Categoria:Imagens de origem desconhecida\]\] <\!-- remova esta categoria após indicar a fonte -->\\n\',\'\',\'\');', 'http://img427.imageshack.us/img427/3602/livro4qz.png');

    // Botao:{av-img}
    AddMyOwnButton(tbdiv, 'avimg', 'javascript:document.editform.wpSummary.value=\'\{\{av-img\}\}\';insertTags(\'\{\{av-img|}}\{\{subst:Usuário:Rei-artur/ass}}\~\~\~\~\~\',\'\',\'\');', 'http://img468.imageshack.us/img468/489/aviso6bi.png');

    // Botao:{DP}
    AddMyOwnButton(tbdiv, 'dp', 'javascript:document.editform.wpSummary.value=\'\{\{DP\}\}\';insertTags(\'\{\{DP}}\',\'\',\'\');', 'http://img387.imageshack.us/img387/336/dp9ge.png');

    // Botao:{GFDL}
    AddMyOwnButton(tbdiv, 'gfdl', 'javascript:document.editform.wpSummary.value=\'\{\{GFDL\}\}\';insertTags(\'\{\{GFDL}}\',\'\',\'\');', 'http://img389.imageshack.us/img389/2791/gnu6ut.png');

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

  }
}


/*
==MyToolboxButtons==
*/
/* change the names of personal tools links and the edit tab */
function changelinks() {
    if(!document.getElementById) return;
    document.getElementById('pt-mytalk').firstChild.innerHTML = 'minha discussão';
    document.getElementById('pt-preferences').firstChild.innerHTML = 'preferências';
    document.getElementById('pt-watchlist').firstChild.innerHTML = 'artigos vigiados';
    document.getElementById('pt-mycontris').firstChild.innerHTML = 'minhas contribuições';
    document.getElementById('pt-logout').firstChild.innerHTML = 'sair';
    if(document.getElementById('ca-edit'))
        document.getElementById('ca-edit').firstChild.innerHTML = 'editar';
}

/* this function is used to add extra tabs and links */
function addlilink(tabs, url, name, id) {
    var na = document.createElement('a');
    na.href = url;
    na.id = id;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}

/* add links to the sidebar toolbox */
function addtoolboxlinks() {
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    addlilink(tb, '/wiki/Especial:Newimages', 'Galeria de Imagens', '');
    addlilink(tb, '/wiki/Categoria:Itens_candidatos_à_eliminação', 'Verificar e apagar', '');
    addlilink(tb, '/wiki/Categoria:Páginas para eliminação rápida', 'Eliminação Rápida', '');
    addlilink(tb, '/wiki/Wikipedia:Esplanada', 'Esplanada', '');
    addlilink(tb, '/wiki/Especial:Log', 'Log', '');
}


/* Go! */
window.onload = Main;
function Main() {
    changelinks();
    addtoolboxlinks()
    addpurge();
    addSinceTab();
    morelinks();
}


/*

==Portal==
*/
 window.mynav_addlilink=function(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    if(id) {
      if(key && title) ta[id] = [key, title];
      else if(key)     ta[id] = [key, ''];
      else if(title)   ta[id] = ['', title];
    }

    //akeytt();
    return li;
 }


 window.showPortalIfTagged=function(){
  var ppdiv=document.getElementById('n-portal-teste');
  if (ppdiv) {
    var plet = document.getElementById('p-navigation').getElementsByTagName('ul')[0];
    if (plet) {
        mynav_addlilink(plet, 'http://pt.wikipedia.org/wiki/Portal:' + ppdiv.childNodes[0].nodeValue, 'Portal:'+ ppdiv.childNodes[0].nodeValue, 'n-portal-tematico');
    }
  }
}


/*
==Portlet:Correlatos==
*/
window.mycorr_addlilink=function(tabs, url, name, id){

   var na = document.createElement('a');
   na.href = url;
   na.appendChild(document.createTextNode(name));
   var li = document.createElement('li');
   if(id) li.id = id;
   li.appendChild(na);
   tabs.appendChild(li);

   return li;

}

window.showCorrelatoIfTagged=function(){

 var ppdiv=document.getElementById('c-projecto-commons');
 if (ppdiv) {
   var plet = document.getElementById('p-correlatos').getElementsByTagName('ul')[0];
   var i = 0;
   if (plet) {
      while (ppdiv[i]) {
         mycorr_addlilink(plet, 'http://commons.wikimedia.org/wiki/' + ppdiv[i].childNodes[0].nodeValue, ppdiv[i].childNodes[0].nodeValue, 'c-projecto-'+ppdiv[i].childNodes[0].nodeValue);
         i++;
      }
   }
 }

}

window.myOwnPortlet=function() {
   var pcorrheader = document.createElement('h5');
   pcorrheader.appendChild(document.createTextNode('Correlatos'));

   var pcorrbody = document.createElement('div');
   pcorrbody.setAttribute('class','pBody');
   pcorrbody.appendChild(document.createElement('ul'));

   var pcorr = document.createElement('div');
   pcorr.setAttribute('class','portlet');
   pcorr.setAttribute('id','p-correlatos');
   pcorr.appendChild(pcorrheader);
   pcorr.appendChild(pcorrbody);

   var pparent = document.getElementById('column-one');
   if ( pparent ) {
      var piw = document.getElementById('p-lang');
      if ( piw ) {
         pparent.insertBefore(pcorr,piw);
      } else {
         pparent.appendChild(pcorr);
      }
   }
   showCorrelatoIfTagged();
}

/*

==Load up==
*/

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



myAddOnload(myOwnEditButtons);
myAddOnload(showPortalIfTagged);
myAddOnload(myOwnPortlet);

/*
==Editor==
*/
// install [[User:Cacycle/diff]] text diff code
document.write('<script type="text/javascript" src="' 
  + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js' 
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Pilaf/Live_Preview]] page preview tool
document.write('<script type="text/javascript" src="' 
  + 'http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js' 
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Cacycle/editor]] edit tool
document.write('<script type="text/javascript" src="' 
  + 'http://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio:Rei-artur/editor.js' 
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/*
==Barra de Navegação==
*/
// set up the words in your language
var NavigationBarHide = '▲ Esconder';
var NavigationBarShow = '▼ Expandir';