Usuário(a):Tschulz/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.
    
  //  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 );
  //  F



mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');


// 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>');


//Utilitários
//var div=document.getElementById('editpage-specialchars');
//if ( div ) {
//  
//}

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

    // B:{Bem vindo}
    caption = 'Bem vindo';
    var babv  = document.createElement('a');
    babv.href = 'javascript:document.editform.wpSummary.value=\'\{\{bem vindo\}\}\';insertTags(\'\{\{subst:bem vindo}} \~\~\~\~\',\'\',\'\');document.editform.submit();';
    var imgbv = document.createElement('img');
    imgbv.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_bvip.png';
    imgbv.alt = caption;
    babv.appendChild(imgbv);
    tbdiv.appendChild(babv);

    // B:{lixo}
    caption = 'Lixo';
    var baer  = document.createElement('a');
    baer.href = 'javascript:document.editform.wpSummary.value=\'\{\{lixo\}\}\';insertTags(\'\{\{lixo|\[\[user:thrasher|Thrasher]\]}}\',\'\',\'\');document.editform.submit();';
    var imger = document.createElement('img');
    imger.src = 'http://img217.imageshack.us/img217/5972/20pxboutonvandale34by.png';
    imger.alt = caption;
    baer.appendChild(imger);
    tbdiv.appendChild(baer);

    // B:{Bem vindo ip}
    caption = 'Bem vindo IP';
    var babv  = document.createElement('a');
    babv.href = 'javascript:document.editform.wpSummary.value=\'\{\{bem vindo ip\}\}\';insertTags(\'\{\{subst:bem vindo ip}} \~\~\~\~\',\'\',\'\');document.editform.submit();';
    var imgbv = document.createElement('img');
    imgbv.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_bvip.png';
    imgbv.alt = caption;
    babv.appendChild(imgbv);
    tbdiv.appendChild(babv);

    // B:{impróprio}
    caption = 'Impróprio';
    var baer  = document.createElement('a');
    baer.href = 'javascript:document.editform.wpSummary.value=\'\{\{impróprio\}\}\';insertTags(\'\{\{impróprio|\[\[user:thrasher|Thrasher]\]}}\',\'\',\'\');document.editform.submit();';
    var imger = document.createElement('img');
    imger.src = 'http://img217.imageshack.us/img217/7213/20pxboutonvandale22iu.png';
    imger.alt = caption;
    baer.appendChild(imger);
    tbdiv.appendChild(baer);

    // B:{VDA2}
    caption = 'VDA2';
    var baer  = document.createElement('a');
    baer.href = 'javascript:document.editform.wpWatchthis.checked=true;insertTags(\'\{\{vda2|1\=\PAGINA|2\=\DATA}}\',\'\',\'\');';
    var imger = document.createElement('img');
    imger.src = 'http://img158.imageshack.us/img158/2046/20pxnoia64appsapplixware0au.png';
    imger.alt = caption;
    baer.appendChild(imger);
    tbdiv.appendChild(baer);

    // B:<strike>
    caption = '<s></s>';
    var bas  = document.createElement('a');
    bas.href = 'javascript:insertTags(\'<s>\',\'</s>\',\'\');';
    var imgs = document.createElement('img');
    imgs.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_strike.png';
    imgs.alt = caption;
    bas.appendChild(imgs);
    tbdiv.appendChild(bas);

    // B:{{ }}
    var caption = 'txt2predef';
    var ba  = document.createElement('a');
    ba.href = 'javascript:insertTags(\'{{\',\'}}\',\'\');';
    var img = document.createElement('img');
    img.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_topredef.png';
    img.alt = caption;
    ba.appendChild(img);
    tbdiv.appendChild(ba);

    // B:<tt>
    caption = '<tt></tt>';
    var batt  = document.createElement('a');
    batt.href = 'javascript:insertTags(\'<tt>\',\'</tt>\',\'\');';
    var imgtt = document.createElement('img');
    imgtt.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_tt.png';
    imgtt.alt = caption;
    batt.appendChild(imgtt);
    tbdiv.appendChild(batt);

    // B:<small>
    caption = '<small></small>';
    var basm  = document.createElement('a');
    basm.href = 'javascript:insertTags(\'<small>\',\'</small>\',\'\');';
    var imgsm = document.createElement('img');
    imgsm.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_small.png';
    imgsm.alt = caption;
    basm.appendChild(imgsm);
    tbdiv.appendChild(basm);

    // B:autoDisambig
    caption = 'desambigtxt';
    var badis  = document.createElement('a');
    badis.href = 'javascript:document.editform.wpSummary.value=\'v1\';insertTags(\'\{\{desambiguação\}\}\\n\\nPor \\\'\\\'\\\'\{\{subst:PAGENAME}}\\\'\\\'\\\' pode estar à procura de:\\n* \',\'\',\'\');';
    var imgdis = document.createElement('img');
    imgdis.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_disambig.png';
    imgdis.alt = caption;
    badis.appendChild(imgdis);
    tbdiv.appendChild(badis);

    // B:LicencaIncompleta
    caption = '\{\{SemInfo\}\}';
    var bsi  = document.createElement('a');
    bsi.href = '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:\{\{CopyrightDesconhecido\}\} <\!-- troque esta predefinição pela tag do respectivo copyright -->\\n\[\[Categoria:Imagens de origem desconhecida\]\] <\!-- remova esta categoria após indicar a fonte -->\\n\',\'\',\'\');';
    var imgsi = document.createElement('img');
    imgsi.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_seminfo.png';
    imgsi.alt = caption;
    bsi.appendChild(imgsi);
    tbdiv.appendChild(bsi);

    // Botao:CaixaSucessao
    caption = 'Caixa de sucessão';
    var bcs  = document.createElement('a');
    bcs.href = '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\',\'\',\'\');';
    var imgcs = document.createElement('img');
    imgcs.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_template.png';
    imgcs.alt = caption;
    bcs.appendChild(imgcs);
    tbdiv.appendChild(bcs);

    // B:LicencaIncompleta2
    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|{\{15 dias}}}} <\!-- 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');
  }
}

/*
==Toolbox==
*/
/* 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', '');
}


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

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