Usuário:Dantadd/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.
mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');
popupImages=false;
popupAdminLinks=false;
popupRevertSummary='Revertido para a edição %s usando [[:en:WP:POPUPS|popus]]';
popupQueriedRevertSummary='Revertido para a edição $1, feita em $2 por $3 usando [[:en:WP:POPUPS|popus]]'
popupQueriedRevertToPreviousSummary='Revertido para a edição $1, feita em $2 por $3 usando [[:en:WP:POPUPS|popus]]'
popupFixDabs='true';
popupFixDabsSummary='Substituindo desambiguação (%s) por %s usando [[:en:WP:POPUPS|popus]]';

//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:{lixo}
    caption = 'impróprio';
    var baer  = document.createElement('a');
    baer.href = 'javascript:document.editform.wpSummary.value=\'\{\{impróprio\}\}\';insertTags(\'\{\{impróprio|\[\[user:Dantadd|Dantadd]\]}}\',\'\',\'\');document.editform.submit();';
    var imger = document.createElement('img');
    imger.src = 'http://upload.wikimedia.org/wikipedia/commons/e/e4/Bouton_Vandale3.png';
    imger.alt = caption;
    baer.appendChild(imger);
    tbdiv.appendChild(baer);

// Botao:{redirect}
AddMyOwnButton(tbdiv, 'redirect', 'javascript:document.editform.wpSummary.value=\'\';insertTags(\'#\REDIRECT\\ [\[\',\']]\',\'\');', 'http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png');

// Botao:{Categoria}
AddMyOwnButton(tbdiv, 'categoria', 'javascript:document.editform.wpSummary.value=\'\+categoria\';insertTags(\'[\[Categoria:\',\']]\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/1/11/Button_category.png');

// Botao:autoDisambig
    caption = 'desambigtxt';
    var badis  = document.createElement('a');
    badis.href = 'javascript:document.editform.wpSummary.value=\'criação\';insertTags(\'\{\{desambiguação\}\}\\n\\nO termo \\\'\\\'\\\'\{\{subst:PAGENAME}}\\\'\\\'\\\' pode referir-se a:\\n* \\n\[\[Categoria:Desambiguação\]\]\',\'\',\'\');';
    var imgdis = document.createElement('img');
    imgdis.src = 'http://upload.wikimedia.org/wikipedia/commons/6/62/Button_desambig.png';
    imgdis.alt = caption;
    badis.appendChild(imgdis);
    tbdiv.appendChild(badis);

// Botao:CaixaSucessao
    AddMyOwnButton(tbdiv, 'Caixa de sucessão', 'javascript:document.editform.wpSummary.value=\'+caixa de sucessão\';insertTags(\'\{\{Começa caixa\}\}\\n\{\{Caixa de sucessão\|\\n\|título = \\n\|anos   = \\n\|antes  = \\n\|depois = \\n\}\}\\n\{\{Termina caixa\}\}\\n\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/8/8f/Cs_icon.png');

    // Botao:Listagem
    AddMyOwnButton(tbdiv, 'LI', 'javascript:document.editform.wpSummary.value=document.editform.wpSummary.value+\'+lista normal\';insertTags(\'\* elemento 1\\n\* elemento 2\\n\* elemento 3\\n\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png');

    // Botao:Numeracao
    AddMyOwnButton(tbdiv, 'NU', 'javascript:document.editform.wpSummary.value=document.editform.wpSummary.value+\'+lista numerada \';insertTags(\'\# elemento 1\\n\# elemento 2\\n\# elemento 3\\n\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png');

    // Botao:Oculto
    AddMyOwnButton(tbdiv, 'OC', 'javascript:document.editform.wpSummary.value=document.editform.wpSummary.value+\'+script oculto \';insertTags(\'<!-- -->\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png');

    // Botao:Biografia
    AddMyOwnButton(tbdiv, 'BIO', 'javascript:document.editform.wpSummary.value=document.editform.wpSummary.value+\'+dados bio \';insertTags(\'([[]], [[]] de [[]] &mdash; [[]], [[]] de [[]])\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/fr/0/04/bio.png');

// Botao:&mdash;
    AddMyOwnButton(tbdiv, 'MD', 'javascript:document.editform.wpSummary.value=document.editform.wpSummary.value+\'+&mdash; \';insertTags(\'—\',\'\',\'\');', 'http://pt.wikipedia.org/skins-1.5/common/images/button_hr.png');

    // Botao:Ver tambem
    AddMyOwnButton(tbdiv, 'VT', 'javascript:document.editform.wpSummary.value=document.editform.wpSummary.value+\'+ver também \';insertTags(\'=={{Ver também}}==\\n\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/fr/0/04/Ver_tambem.png');

    // Botao:Links externos
    AddMyOwnButton(tbdiv, 'LE', 'javascript:document.editform.wpSummary.value=document.editform.wpSummary.value+\'+ligações externas \';insertTags(\'=={{Ligações externas}}==\\n\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/fr/0/04/Links_externos.png');


// Botao:{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://upload.wikimedia.org/wikipedia/commons/3/30/Bv_icon.png';
    imgbv.alt = caption;
    babv.appendChild(imgbv);
    tbdiv.appendChild(babv);

// Botao:{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 = 'IP';
    imgbv.alt = caption;
    babv.appendChild(imgbv);
    tbdiv.appendChild(babv);

// Botao:<strike>
    caption = '<s></s>';
    var bas  = document.createElement('a');
    bas.href = 'javascript:insertTags(\'<s>\',\'</s>\',\'\');';
    var imgs = document.createElement('img');
    imgs.src = '<s>';
    imgs.alt = caption;
    bas.appendChild(imgs);
    tbdiv.appendChild(bas);

// Botao:{{ }}
    var caption = 'txt2predef';
    var ba  = document.createElement('a');
    ba.href = 'javascript:insertTags(\'{{\',\'}}\',\'\');';
    var img = document.createElement('img');
    img.src = '{{';
    img.alt = caption;
    ba.appendChild(img);
    tbdiv.appendChild(ba);

// Botao:<center>
    caption = '<center></center>';
    var basm  = document.createElement('a');
    basm.href = 'javascript:insertTags(\'<center>\',\'</center>\',\'\');';
    var imgsm = document.createElement('img');
    imgsm.src = 'center';
    imgsm.alt = caption;
    basm.appendChild(imgsm);
    tbdiv.appendChild(basm);

// Botao:<small>
    caption = '<small></small>';
    var basm  = document.createElement('a');
    basm.href = 'javascript:insertTags(\'<small>\',\'</small>\',\'\');';
    var imgsm = document.createElement('img');
    imgsm.src = 'small';
    imgsm.alt = caption;
    basm.appendChild(imgsm);
    tbdiv.appendChild(basm);

  }
}

importScript('Usuário:Lijealso/morebits.js');
importScript('Usuário:Lijealso/er.js');

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