Saltar para o conteúdo

Usuário(a):OS2Warp/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)
  • Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5.
/* [[Usuário:Lijealso/statuschangerX.js]] */

//<pre><nowiki>
/* Parámetros del administrador de estados */
var wpStatusBarra     = true;  // true:barra de estado en barra personal, false:en panel a la izquierda
var wpTextoCompleto   = true;  // true:mostrar texto completo, false:texto abreviado (800x600)
var wpUbicaciónInicio = true;  // true:barra al inicio de la barra personal, false:al final
var wpVigilarEstado   = true;  // true:vigilar página de estado, false: no vigilar

document.write('<'+'script src="https://pt.wikipedia.org/w/index.php?' 
+  'title=Usuário:Lijealso/statuschangerX.js'
+  '&action=raw&ctype=text/javascript"' 
+  'type="text/javascript"><'+'/script>');

//</nowiki></pre>

 //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:{ER}
     caption = '\{\er1||2=\~\~\~\~\}';
     var bas = document.createElement('a');
     bas.href = 'javascript:insertTags(\'{\{er1|\',\'\<número da regra>\|2=\~\~\~\~\}}\',\'\');';
     var imgs = document.createElement('img');
     imgs.src = 'http://upload.wikimedia.org/wikipedia/commons/1/11/Button_ER.png';
     imgs.alt = caption;
     bas.appendChild(imgs);
     tbdiv.appendChild(bas);

   }
 }

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

// installation of the wikEd editing page extension

// install [[User:Cacycle/diff]] text diff code
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js&action=raw&ctype=text/javascript' );

// install [[User:Pilaf/Live_Preview]] page preview tool
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript' );

// install [[User:Mboverload/RegExTypoFix|RegExTypoFix]] common typo fixer
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Cacycle/RegExTypoFix.js&action=raw&ctype=text/javascript' );

// install [[User:Cacycle/wikEd international]] English example translation (disabled)
// document.write('<script type="text/javascript" src="'
// + 'https://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd_international_en.js'
// + '&action=raw&ctype=text/javascript"></script>');

// install [[User:Cacycle/wikEd]] editing page extension
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js&action=raw&ctype=text/javascript' );







// Origem: [[User:Lupin/recent2.js]]
mw.loader.load( 'https://pt.wikipedia.org/w/index.php?title=User:Lupin/recent2.js&action=raw&ctype=text/javascript' );




// Filter changes live
// [[en:User:Lupin/Anti-vandal tool]] - please include this line






//<pre>
//Auto AFD script
//Please include the two following lines
//Modified version of AutoVFD script to work with AFD
//Script Modified by User:Jtkiefer
//Further modified to work with [[:en:WP:AFDC]] by [[:en:User:ais523]]
//Modificado para a versão lusófona por [[Usuário:Giro720]]

// This needs to change depending on skin used.
function add_link(url, name)
{
  var na = document.createElement('a');
  na.setAttribute('href', url);
  na.appendChild(document.createTextNode(name));

  var li = document.createElement('li');
  li.appendChild(na);

  var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
  tabs.appendChild(li);
}

function strip_namespace(target)
{
  var colon = target.indexOf(':');
  if (colon != -1)
    {
      var spaces = new Array('Usuário', 'Wikipedia', 'Imagem', 'MediaWiki', 'Predefinição', 'Ajuda', 'Categoria');
      var ns = target.substring(0, colon);
      if (ns == '' || ns == 'Discussão')
        return target.substring(colon + 1);
      else
        for (var i = 0; i < spaces.length; ++i)
          {
            if (ns == spaces[i]
                || ns == spaces[i] + '_talk')
              return target.substring(colon + 1);
          }
    }

  return target;
}

function afd()
{
  document.editform.wpTextbox1.value = '{{' + 'subst:apagar2}}\n' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'nomeação para eliminação';

  var target = document.editform.action;
  target = target.substring(target.indexOf('title=') + 6,
                            target.lastIndexOf('&action=submit'));

  var date = new Date();
  var months = new Array('Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro');
 date.setUTCDate(date.getUTCDate() + 7);

  date = date.getUTCDate() + '_' + 'de' + '_' + months[date.getUTCMonth()];

  var pagename = strip_namespace(target);

  window.open('/w/index.php?title=Wikipedia:Páginas_para_eliminar/' + pagename + '&action=edit&fakeaction=afdsub&faketarget=' + target,
              'Afd ' + unescape(target),
              'status,toolbar,location,menubar,directories,resizeable,scrollbars');
  window.open('/w/index.php?title=Wikipedia:Páginas_para_eliminar/' + date + '&action=edit&fakeaction=afdlist&faketarget=' + pagename,
              'AfdLog ' + unescape(target),
              'status,toolbar,location,menubar,directories,resizeable,scrollbars');
}

function autoafd()
{
    if (document.title.indexOf('Editando ') == 0)
    {
      var action = '';
      var target = '';
      if (location.search)
        {
          var l = location.search.substring(1).split('&');
          for (var i = 0; i < l.length; ++i)
            {
              var eq = l[i].indexOf('=');
              var name = l[i].substring(0, eq);
              if (name == 'fakeaction')
                action = l[i].substring(eq + 1);
              else if (name == 'faketarget')
                target = decodeURI((l[i].substring(eq + 1)).replace(/_/g, ' '));
            }
        }

      if (action == 'afdlist')
        {
          document.editform.wpTextbox1.value += '{{' + 'Wikipedia:Páginas_para_eliminar/' + target + '}}\n';
          document.editform.wpSummary.value = '[[Wikipedia:Páginas_para_eliminar/' + target + ']]';
        }
      else if (action == 'afdsub')
        {
          if (document.editform.wpTextbox1.value.length > 0)
            {
              target = document.editform.action;
              target = unescape(target.substring(target.indexOf('title=') + 6, target.lastIndexOf('&action=submit'))).replace(/_/g, ' ');
              window.alert("Já existe uma página com esse nome para eliminação.\n\n" +
                           'Please either move it out of the way (and update existing links to it), or file the Afd by hand in another location (such as [[' + target + ' (2)]]).');
            }
          else
            document.editform.wpTextbox1.value += '{{' + 'subst:novoapagar|' + target + '|Motivo|~~' + '~~' + '}}';
        }
      else
        add_link('javascript:afd()', 'Propor eliminação');
    }
}

$(autoafd);

//</pre>
//</pre>



/**** quick image delete ****/
document.write('<script type="text/javascript"' +
  'src="https://pt.wikipedia.org/w/index.php?title=Usuário:Lijealso/quickimgdelete.js' +
  '&action=raw&ctype=text/javascript"></script>');

/* This is to keep track of who is using this extension: [[User:Howcheng/quickimgdelete.js]] */




/*<pre>*/
/*Returns the name of the page. For example, if you were browsing the "[[foo]]" WP page, getPname() would return "foo".*/
function getPname() {
  return wgPageName.replace(/_/g, ' ');
}
/*</pre>




/*<pre>*/
//A helper function to add a button to one of the toolbars in the interface.
//An improved(I hope) version of [[Wikipedia:WikiProject User scripts/Scripts/Add LI link|addlilink]].
//[[User:JesseW/sig|JesseW, the juggling janitor]] 05:33, 8 November *2005 (UTC)

function addLink(where, url, name, id, title, key, after){
    //* where is the id of the toolbar where the button should be added;
    //   i.e. one of "p-cactions", "p-personal", "p-navigation", or "p-tb".
    //
    //* url is the URL which will be called when the button is clicked.
    //   javascript: urls can be used to do more complex things.
    //
    //* name is what will appear as the name of the button.
    //
    //* id is the id of the button; it's best to define one.  
    //   Use a prefix to make sure its unique. Optional.
    //
    //* title is the tooltip title that gives a longer description 
    //   of the button; if you define a accesskey, mention it here. Optional.
    //
    //* key is the char you want for the accesskey. Optional.
    //
    //* after is the id of the button you want to follow this one. Optional.
    //
    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);
    var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
    if(after) {
	tabs.insertBefore(li,document.getElementById(after));
    } else {
	tabs.appendChild(li);
    }
    if(id) {
	if(key && title) { ta[id] = [key, title]; }
	else if(key) { ta[id] = [key, '']; }
	else if(title) { ta[id] = ['', title];} 
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}
/*</pre>[[Categoria:!Software para a Wikipédia]]*/



//fim de ferramenta de marcação de imagens







// [[:en:User:Lupin/popups.js]]

mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript' );
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:{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_bemvindo.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 = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_bvip.png';
    imgbv.alt = caption;
    babv.appendChild(imgbv);
    tbdiv.appendChild(babv);

// Botao:{impróprio}
    caption = 'Impróprio';
    var baer  = document.createElement('a');
    baer.href = 'javascript:document.editform.wpSummary.value=\'\{\{impróprio\}\}\';insertTags(\'\{\{impróprio|\[\[Usuário:OS2Warp|OS2Warp]\] \~\~\~\~\~}} \',\'\',\'\');document.editform.submit();';
    var imger = document.createElement('img');
    imger.src = 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_lixo.png';
    imger.alt = caption;
    baer.appendChild(imger);
    tbdiv.appendChild(baer);

// Botao:<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);

// Botao:{{ }}
    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);

// Botao:<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);

// Botao:<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);

// Botao:autoDisambig
    caption = 'desambigtxt';
    var badis  = document.createElement('a');
    badis.href = 'javascript:document.editform.wpSummary.value=\'v1\';insertTags(\'\{\{desambiguação\}\}\\n\\n\\\'\\\'\\\'\{\{subst:PAGENAME}}\\\'\\\'\\\' pode se tratar 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);

// 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:\{\{subst:\Cd2}} <\!-- 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://upload.wikimedia.org/wikipedia/commons/d/de/Button_image.png');

// Botao:{av-img}
AddMyOwnButton(tbdiv, 'avimg', 'javascript:document.editform.wpSummary.value=\'\{\{subst:av-img\}\}\';insertTags(\'\{\{av-img|}}\[[Usuário:Danilodn|danilo_br]]\~\~\~\~\~\',\'\',\'\');', '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');

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

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

// Botao:correlatos
AddMyOwnButton(tbdiv, 'correlatos', 'javascript:document.editform.wpSummary.value=\'\+correlato\';insertTags(\'{\{Começa correlatos}\}\\n\{\{Correlato\|\commons\|}\}\\n\{\{Correlato\|\wikiquote\|}\}\\n\{\{Correlato\|\wikcionário\|}\}\\n\{\{Correlato\|\wikilivros\|}\}\\n\{\{Correlato\|\wikinotícias\|}\}\\n\{\{Correlato\|\wikisource\|}\}\\n\{\{Correlato\|\wikispecies\|}\}\\n\{\{Correlato\|\meta\|}\}\\n\{\{Termina correlatos}\}\\n\',\'\',\'\');', 'http://img379.imageshack.us/img379/6558/wikimedia5wg.png');

  }
}

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

/** Twinkle *********************************************************************************
 *     Ajuda: Wikipedia:Software/Scripts/Twinkle
 * Descrição: Fornece várias ferramentas de manutenção, reversão, etc.
 *     Autor: w:en:AzaToth
 ********************************************************************************************/
importScript('Usuário:Lijealso/morebits.js');       /* módulo-base necessário para os outros */
importScript('Usuário:Lijealso/twinklefluff.js');   /* reversão de edições */
importScript('Usuário:Lijealso/er.js');             /* eliminação rápida */

//<pre>
//Version: 3.1
//============================================================
// pt: ACRESCENTA ALGUNS BOTÕES EXTRAS AO PAINEL DE EDIÇÃO
// en: ADD SOME EXTRA BUTTONS TO THE EDITPANEL
// de: FÜGE NEUE BUTTON IN DIE WERKZEUGLEISTE
//============================================================
// Vorschläge für neue Buttons werden gerne entgegengenommen
// Die Reihenfolge und Anzahl der Buttons ist über die (alphabetische) Variable XEBOrder wählbar.

//================================
//Control Variables
//
//rmEditButtons - Removes standard toolbar buttons
//XEBOrder - The order in which the buttons are displayed

mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:MarkS/XEB/live.css&action=raw&ctype=text/css', 'text/css' );

if(typeof XEBPopups== 'undefined')XEBPopups=true;
if(typeof XEBHideDelay== 'undefined')XEBHideDelay=5.0; //Time before the popup disappears after the mouse moves out
if(typeof XEBExtendEditSummary == 'undefined')XEBExtendEditSummary=true; // Is the edit summary extended after a popup

//fills the variable mwCustomEditButtons (s. function in /wikibits.js), with buttons for the Toolbar  
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText){
mwCustomEditButtons.push({
  "imageFile": imageFile,
  "speedTip": speedTip,
  "tagOpen": tagOpen,
  "tagClose": tagClose,
  "sampleText": sampleText});
}

if (typeof usersignature == 'undefined') var usersignature = '-- \~\~\~\~';

var Isrc='http://upload.wikimedia.org/wikipedia/commons/';

// English Wikipedia creates 11 extra buttons which are stored in mwCustomEditButtons
//  rather than mwEditButtons. However, there is no guarantee it will always be 11
//  so we count them here. 
var enExtraButtons=mwCustomEditButtons.length;


var BDict={
'A':['c/c8/Button_redirect.png','Redireccionar página',"#REDIRECT [[","]]",'Título da ligação'],
'B':['5/58/Button_small.png','Texto em tamanho pequeno','<small>','<\/small>','Texto aqui'],
'C':['5/56/Button_big.png','Texto em tamanho grande','<big>','<\/big>','Texto aqui'],
'D':['6/6a/Button_sup_letter.png','Texto sobrescrito','<sup>','<\/sup>','Texto aqui'],
'D1':['a/aa/Button_sub_letter.png','Texto subscrito','<sub>','<\/sub>','Texto aqui'],
'E':['c/c9/Button_strike.png','Texto riscado','<s>','<\/s>','Texto aqui'],
'F':['f/fd/Button_underline.png','Texto sublinhado',"<u>","<\/u>",'Texto aqui'],
'FS':['1/11/Btn_toolbar_liste.png','Lista normal',"\n* ","\n* Elemento 2\n* Elemento 3",'Elemento 1'],
'G':['8/88/Btn_toolbar_enum.png','Numeração',"\n# ","\n# Elemento 2\n# Elemento 3",'Elemento 1'],
'H':['d/d3/Button_definition_list.png','Insertir lista de definições','\n; ','\n: Item 1\n: Item 2','Definição'],
'I1':['f/fd/Button_blockquote.png','Bloco de texto citado','<blockquote style="border: 1px solid blue; padding: 2em;">\n','\n<\/blockquote>','Texto aqui'],
'I2':['0/04/Button_multicol.png','Texto em colunas (use em textos grandes)','<div style="-moz-column-count:2; -webkit-column-count:2; column-count:2;">\n','\n<\/div>','Texto aqui'],
'J1':['d/d8/Button_Lettrine_S.png','Texto colorido e formatado','<font face="Old English Text MT" size="2" color="red">\n','\n<\/font>','Texto aqui'],
'J2':['0/04/Button_array.png','Inserir tabela','\n{| class="wikitable" \n|- \n| 1 || 2\n|- \n| 3 || 4','\n|}\n',''],
'K':['9/9e/Btn_toolbar_gallery.png','Galeria de imagens',"\n<gallery>\nImage:","|[[Volkswagen Beetle]]\nImage:Mona Lisa.jpg|[[Mona Lisa]]\nImage:Albert Einstein Head.jpg|[[Albert Einstein ]]\n<\/gallery>",'Vw kaefer 1500 v sst.jpg'],
'L':['4/4d/Button_quotes.png','Adicionar citação','{{quote2|','|autor}}','Citação aqui'],
'M':['1/1b/Button_miss_signature.png','Referir um usuário que não assinou','{{não assinou|','|~~~~~}}','Utilizador ou IP'],
'N':['9/93/Button_sub_link.png','Ligação interna com sublink','[[','#Sublink]]','Título da ligação'],
'O':['7/74/Button_comment.png','Comentário oculto',"<!-- "," -->",'Comentário'],
'P':['e/e9/Button_headline2.png','Seção de nível 3','\n=== ',' ===','Texto secundário'],
'P1':['c/c1/Button_city_silhouette.png','Inserir panorama','{{Panorama|','|2000px|Vista de [[Manhattan]]}}','Skyline-New-York-City.jpg'],
'Q':['d/d1/Button_mysignature.png','Sua assinatura com hora e data (sem o sinal --)','~~~~','',''],
'R':['1/13/Button_enter.png','Quebra de linha','<br />','',''],
'R1':['6/6c/Button_see_also.png','Ver também',"\n=={{Ver também}}==\n",'',''],
'R2':['b/bd/Button_recherche_ip.png','Ligação externa (predefinição)',"\n=={{Ligações externas}}==\n",'',''],
'R3':['9/9a/Button_references.png','Notas e Referências (use no final do artigo)',"\n{{ref-section|Notas e Referências}}\n",'',''],
'R4':['b/b6/Button_category_link.png','Categorizar página',"[[Categoria:","]]",'Nome da categoria'],
'S':['2/23/Button_code.png','Texto em código-fonte','<code>','<\/code>','Texto aqui'],
'T':['7/79/Button_reflink.png','Inserir referência material','<ref>','<\/ref>','Insert reference material'],
'TS':['b/b5/Button_mini_stub.png','Marcar como mínimo','{{mínimo sobre|','}}','Título da ligação'],
'TC':['8/8e/Button_stub.png','Marcar como esboço','{{esboço-','}}','tema'],
'TE':['e/e9/Button_preview.png','Marcar para revisão','{{revisão|data=','}}','{{SUBST:CURRENTMONTHNAME}} de {{CURRENTYEAR}}'],
'TR':['0/0d/Button_wikification.png','Marcar para wikificar','{{wikificação|data=','}}','{{SUBST:CURRENTMONTHNAME}} de {{CURRENTYEAR}}'],
'T1':['2/2e/Button_broom.png','Marcar para reciclar','{{reciclar|data=','}}','{{SUBST:CURRENTMONTHNAME}} de {{CURRENTYEAR}}'],
'TL':['3/37/Button_no_neutral.png','Marcar como parcial','{{parcial|data=','}}','{{SUBST:CURRENTMONTHNAME}} de {{CURRENTYEAR}}'],
'U':['a/aa/Button_question.png','Marcar como controverso','{{controverso}}','',''],
'V':['2/28/Button_info.png','Marcar para corrigir','{{corrigir}}','',''],
'W':['e/eb/Button_plantilla.png','Adicionar predefinição','{{','}}','Nome da predefinição'],
'X':['3/30/Tt_icon.png','Texto de Teletipo','<tt>','<\/tt>','Texto aqui'],
'Y1':['3/37/Button_tl_template.png','Indicar uma predefinição',"{{tl|",'}}','predefinição aqui'],
'Y2':['1/11/Button_ER.png','Marcar para Eliminação Rápida','{{ER|','|~~~~}}','lista'],
'Z':['2/29/Button_user.png','Referir um usuário ou IP','{{Usuário2|','}}','Nome do usuário ou IP'],
'AI':['1/1c/Button_advanced_image.png','Imagem Avançada',"[[Image:","|thumb|right|px|Caption]]",'FileName.jpg'],
'GEO':['b/b8/Button_Globe.png','Coordenadas geográficas',"","",""],
'TALK':['4/49/Button_talk.png','Mensagens predefinidas para usuários',"","",""]
};

var XEBOrder2=[];




$(initButtons);
if(!wgIsArticle)// only if edit
{ 

	if(XEBPopups)hookEvent("load", extendButtons);
}

function initButtons(){

	var bc,d;

	if (typeof XEBOrder!='string') // can be modified
		XEBOrder2="A,B,C,D,D1,E,F,FS,G,H,I1,I2,J1,J2,K,L,M,N,O,P,P1,Q,R,R1,R2,R3,R4,S,T,TS,TC,TE,TR,T1,TL,U,V,W,X,Y1,Y2,Z,AI,GEO,TALK".split(",");
	else if (XEBOrder.toLowerCase()=='all') 
		for (b in BDict) XEBOrder2.push(b);
	else XEBOrder2=XEBOrder.toUpperCase().split(",");

	for (b in BDict) BDict[b][0] = Isrc+BDict[b][0]; // // Add the start of the URL (Isrc) to the XEB buttons
	// If the user has defined any buttons then add them into the available button lists 

	if (typeof myButtons=='object')
	  for (b in myButtons) BDict[b] = myButtons[b];	// custom user buttons
	// Add the media wiki standard buttons into the available buttons 

	for (b in mwEditButtons) { // add standard buttons for full XEB order changing

	//	BDict[b]=[];
BDict[b]=[mwEditButtons[b].imageFile,mwEditButtons[b].speedTip,mwEditButtons[b].tagOpen,mwEditButtons[b].tagClose,mwEditButtons[b].sampleText];

//		for (d in mwEditButtons[b]) BDict[b].push(mwEditButtons[b][d]);
	}

	// Build the new buttons 

	for (i=0;i<XEBOrder2.length;i++) {
		bc = BDict[XEBOrder2[i]];

		//Check if bc is an object 
		// - protects if user specified a non-existant buttons
		// - IE causes a javascript error when viewing a page
		if(typeof bc=='object')
		{

			//Call addCustomButton in wikibits
			addCustomButton(bc[0],bc[1],bc[2],bc[3],bc[4]);
		}
	}

	// Remove the default buttons (if requested by the user)
	eraseButtons();
}


/** en: Removes arbitrary standard buttons from the toolbar
* @author: [[:de:User:Olliminatore]]
* @version: 0.1 (01.10.2006) **/

function eraseButtons(){

	//Remove the buttons the user doesn't want

	if(typeof rmEditButtons!='object') return;

	if (typeof rmEditButtons[0] == 'string' && rmEditButtons[0].toLowerCase() == 'all') 
	{
		mwEditButtons=[];
		for(i=0;i<enExtraButtons;i++){mwCustomEditButtons.shift();}
	}
	//Sort the user's requests so we remove the button with the highest index first
	//- This ensures we remove the buttons the user expects whatever order he requested the buttons in
	rmEditButtons.sort(sortit);

	//Remove individual buttons the user doesn't want 

	for(i=0;i<rmEditButtons.length;i++){
		var n=rmEditButtons[i];
		//Standard Wikimedia buttons
		if(n>=0 && n<mwEditButtons.length){
			if(n<mwEditButtons.length){
				var x = -1;
				while((++x)<mwEditButtons.length)
					if(x>=n)
						mwEditButtons[x] = mwEditButtons[x+1];
			}
		mwEditButtons.pop();
		}
		//Extra buttons in English Wikipedia
		n=n-mwEditButtons.length;
		if(n>0 && n<mwCustomEditButtons.length){
		if(n<mwCustomEditButtons.length){
				var x = -1;
				while((++x)<mwCustomEditButtons.length)
					if(x>=n)
						mwCustomEditButtons[x] = mwCustomEditButtons[x+1];
			}
		mwCustomEditButtons.pop();
		}
	}
};

//Function:
//	sortit
//Purpose:
//	Used to sort the rmEditButtons array into descending order
function sortit(a,b){
	return(b-a)
}


//Function:
//Purpose:
//	Adds extended onclick-function to some buttons 
function extendButtons(){

	if(!(allEditButtons = document.getElementById('toolbar'))) return false;
	if(typeof editform != 'undefined')
		if(!(window.editform = document.forms['editform'])) return false;

	//  table
	extendAButton(Isrc+"0/04/Button_array.png",XEBPopupTable)
	extendAButton(Isrc+"7/79/Button_reflink.png",XEBPopupRef)
	extendAButton(Isrc+"b/b8/Button_Globe.png",XEBPopupGeoLink)
	extendAButton(Isrc+"4/49/Button_talk.png",XEBPopupTalk)
	extendAButton(Isrc+"1/1c/Button_advanced_image.png",XEBPopupImage)
	//extendAButton(Isrc+"6/6a/Button_sup_letter.png",XEBPopupFormattedText)

	// redirect -##IE doesn't like this line. Object doesn't support this property or method
	//c=XEBOrder2.getIndex('V');

//	if(c != -1)
//		allEditButtons[bu_len+c].onclick=function(){
//		var a='#REDIRECT \[\['+prompt("Which page do you want to redirect to\?")+'\]\]';
//		document.editform.elements['wpTextbox1'].value=a;
//		document.editform.elements['wpSummary'].value=a;
//		document.editform.elements['wpWatchthis'].checked=false
//  };
};

function extendAButton(url,newfunc)
{
	if(!(allEditButtons = document.getElementById('toolbar'))) return false;
	if(typeof editform != 'undefined')
		if(!(window.editform = document.forms['editform'])) return false;
	allEditButtons = allEditButtons.getElementsByTagName('img');
	for(i=0;i<allEditButtons.length;i++)
	{
		if(allEditButtons[i].src==url)
		{
			allEditButtons[i].onclick=newfunc;
		}
	}
}

//==========================================================================================================
// General purpose popup code
//==========================================================================================================

function getXEBPopupDiv(name)
{
	XEBMainDiv= document.getElementById("XEB");
	if(XEBMainDiv==null){
		XEBMainDiv=document.createElement("div");
		document.body.appendChild(XEBMainDiv);
		XEBMainDiv.id="XEB";
	}

	me= document.getElementById("XEBPopup" & name);
	if(!(me==null))return me;
	me=document.createElement("div");
	XEBMainDiv.appendChild(me);

	me.id="XEBPopup";
	me.style.position='absolute';
	me.display='none';
	me.visibility='hidden';
	me.onmouseout=CheckHideXEBPopup;
	me.onmouseover=cancelHidePopup;
	return me;
}
 
//Function:
//	CheckHideXEBPopup
//Purpose:
//	Looks at the cursor position and if it has moved outside the popup it will close the popup
//Called:
//	When the onMouseEvent is fired on the popup

function CheckHideXEBPopup(e){
	m= document.getElementById("XEBmnu");
	if(is_gecko)
	{
		ph=m.offsetHeight;
		var x=e.clientX + window.scrollX;
		var y=e.clientY + window.scrollY;;
		s=window.getComputedStyle(m,"");
		ph=s.height;
		ph=Number(ph.substring(0,ph.length-2));
	}
	else
	{
		var x=event.clientX+ document.documentElement.scrollLeft + document.body.scrollLeft;
		var y=event.clientY+ document.documentElement.scrollTop + document.body.scrollTop;
		ph=m.offsetHeight;
	}
	pl=curPopup.x;
	pt=curPopup.y;
	pw=m.style.width;
	pw=Number(pw.substring(0,pw.length-2));

	if(x>(pl+2)&&x<(pl+pw-5)&&y>(pt+2)&&y<(pt+ph-5))return;
	curPopup.hideTimeout=setTimeout('hideXEBPopup()',XEBHideDelay*1000);
}

function cancelHidePopup()
{
	clearTimeout(curPopup.hideTimeout)
}

function hideXEBPopup(){
	XEBMainDiv= document.getElementById("XEB");
	m= document.getElementById("XEBPopup");
	XEBMainDiv.removeChild(m);
}

function XEBstartDrag(e)
{
	m=new GetPos(e||event);
	curPopup.startDrag.mouse=m;
	curPopup.startDrag.floatpopup.y=parseInt(curPopup.div.style.top);
	curPopup.startDrag.floatpopup.x=parseInt(curPopup.div.style.left);
	curPopup.dragging=true;
}

function XEBstopDrag(e)
{
	if(curPopup.dragging==false)return;
	curPopup.dragging=false;
}

function XEBDrag(e)
{
	if(curPopup.dragging==false)return;

	m=new GetPos(e||event);
	x=parseInt(curPopup.startDrag.floatpopup.x+(m.x-curPopup.startDrag.mouse.x));
	y=parseInt(curPopup.startDrag.floatpopup.y+(m.y-curPopup.startDrag.mouse.y));

	curPopup.div.style.top=y+"px";
	curPopup.div.style.left=x+"px";

	curPopup.x=x;
	curPopup.y=y;
}

//=============================================================================
// Popup: Table
//=============================================================================

function XEBPopup(name,x,y)
{
	// Make sure the popup can appear on the screen

	this.IESelectedRange=XEBgetIESelectedRange();

	winW=(is_gecko)?window.innerWidth:document.body.offsetWidth;
	if((winW-this.width)<x)x=(winW-this.width);

	this.div=getXEBPopupDiv(name);
	this.div.style.zIndex=2000;
	this.div.display="inline";
	this.div.visibility="visible";
	this.div.style.top=y + "px";
	this.x=x;
	this.y=y;
	this.name=name;

	this.startDrag=new Object;
	this.startDrag.floatpopup=new Object;
}

function setInnerHTML(text)
{
	winW=(is_gecko)?window.innerWidth:document.body.offsetWidth;
	if((winW-this.width)<this.x)this.x=(winW-this.width);
	this.div.style.left=this.x+ "px";

	mt="<div id='XEBmnu' style='width:" + this.width + "px' >";
	mt+='<div id="XEBmnuTitle" class="XEBPopupTitle" onmousedown="XEBstartDrag(event)" onmouseup="XEBstopDrag(event)" onmousemove="XEBDrag(event)">Menu</div>'
	mt+=text;
	mt+="</div>";
	this.div.innerHTML=mt;
//Turn off autocomplete. If the mouse moves over the autocomplete popup then x,y in CheckHidePopup is relative to the
// autocomplete popup and our popup is hidden
	var InTexts = this.div.getElementsByTagName('input');
	for (var i = 0; i < InTexts.length; i++) {
        	var theInput = InTexts[i];
		if (theInput.type == 'text'){theInput.setAttribute('autocomplete','off');}
	}
//Add rollover features to menu items. Doing it here means we don't have to do it for each menu
	x=XEBgetElementsByClassName(this.div,'XEBMnuItm','span');
	for (var i = 0; i < x.length; i++) {
        	var theItm = x[i];
		theItm.onmouseout=XEBMenuMouseOut;
		theItm.onmouseover=XEBMenuMouseOver;
	}

	this.div.style.borderWidth='thin';
	this.div.style.borderStyle='solid';
	this.div.style.backgroundColor='#D0D0D0';
}
XEBPopup.prototype.width=250;
XEBPopup.prototype.dragging=false;
XEBPopup.prototype.setInnerHTML=setInnerHTML;

var curPopup;

function GetPos(e)
{
	this.x=e.clientX-10+ document.documentElement.scrollLeft + document.body.scrollLeft;
	this.y=e.clientY-10+ document.documentElement.scrollTop + document.body.scrollTop;
}

function XEBPopupTable(e){
	m=new GetPos(e||event);

	curPopup=new XEBPopup("table",m.x,m.y);

	mt='<p>Introduza os parâmetros da tabela abaixo:: <\/p>'
		+'<form name="XEBPopupTableForm">'
		+'Legenda da tabela: <input type="checkbox" name="inputCaption"><p\/>'
		+'Alinhamento da tabela: centro<input type="checkbox" name="inputAlign"><p\/>'
		+'Título da tabela: colorido<input type="checkbox" name="inputHead"><p\/>'
		+'Número de linhas: <input type="text" name="inputRow" value="3" size="2"><p\/>'
		+'Número de colunas: <input type="text" name="inputCol" value="3" size="2"><p\/>'
		//+'Alternação de linhas cinzentas: <input type="checkbox" name="inputLine" checked="1" ><p\/>'
		+'Coluna do item: <input type="checkbox" name="inputItems" ><p\/>'
		+'Sorteável: <input type="checkbox" name="inputSort" ><p\/>'
		+'<\/form>'
		+'<i>A tabela padrão leva em conta somente os campos e valores.<\/i><p\/>'
		+'Checar "Coluna de item" para levar em conta a tabela para ter campos, itens, e valores.<\/i><p\/>'
		+'<p><button onClick="javascript:insertTableCode()">Inserir</button>'
		+'<button onClick="hideXEBPopup()">Cancelar</button>'

	curPopup.setInnerHTML(mt);

	return true;
}

function insertTableCode(){
	f=document.XEBPopupTableForm;
	var caption = (f.inputCaption.checked)?"|+ Título da tabela \n":""; 
	var exhead = (f.inputHead.checked)?'|- style="background: #DDFFDD;"\n':""; 
	var nbRow = parseInt(f.inputRow.value); 
	var nbCol = parseInt(f.inputCol.value); 
	var exfield = f.inputItems.checked; 
	var align = (f.inputAlign.checked)?'align="center"':""; 

	//generateTable(caption, exhead, nbCol, nbRow, exfield, align);

	var code = "\n";
	code += '{| class="wikitable" ' + align + ' '; // en: class="wikitable"
	code+=(f.inputSort.checked)?'class="sortable" \n':'\n';
	code += caption + exhead;
	if (exfield) code += '!\n';
	for (i=1;i<nbCol+1;i++) code += '! Cabeçalho ' + i + '\n';
	var items = 0;
	for (var j=0;j<nbRow;j++){
		if (exfield) { 
			items++;
			code += '|-\n! style="background: #FFDDDD;"|Item ' + items + '\n';
		}	else code += '|-\n';
		for (i=0;i<nbCol;i++) code += '| Elemento ' + i + '\n';
	}
	code += '|}\n';
	hideXEBPopup();
	insertTags('','', code);
	extendSummary('tabela');

	return false;
}  

// Get the text currently selected by user in the textAra
// This code is based on part of the insertTags function in wikibits.js

function XEBGetSelectedText()
{
	var txtarea;
	if (document.editform) {
		txtarea = document.editform.wpTextbox1;
	} else {
		// some alternate form? take the first one we can find
		var areas = document.getElementsByTagName('textarea');

		txtarea = areas[0];
	}
	// IE & Opera
	if (document.selection  && !is_gecko)
	{
		var theSelection = document.selection.createRange().text;
		if (!theSelection) theSelection='';
	}
	// Mozilla
	else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
		var replaced = false;
		var startPos = txtarea.selectionStart;
		var endPos = txtarea.selectionEnd;
		var theSelection = (txtarea.value).substring(startPos, endPos);
		if (!theSelection) theSelection='';
	}
	return theSelection;
}

//Notes:
//	IE loses the cursor position in the textarea when the popup is used. 
//	So we save the cursor position here
function XEBgetIESelectedRange(){
	var IESel=new Object;
	var txtarea;
	if (document.editform) {
		txtarea = document.editform.wpTextbox1;
	} else {
		// some alternate form? take the first one we can find
		var areas = document.getElementsByTagName('textarea');

		txtarea = areas[0];
	}
	// IE & Opera

	if (document.selection  && !is_gecko)
	{
		txtarea.focus();
		IESel.Rng=document.selection.createRange();
		return IESel;
	}
}

function XEBinsertText(beforeText,selText,afterText,IESelectedRange) {
	var newText=beforeText + selText + afterText;
	var txtarea;
	if (document.editform) {
		txtarea = document.editform.wpTextbox1;
	} else {
		// some alternate form? take the first one we can find
		var areas = document.getElementsByTagName('textarea');
		txtarea = areas[0];
	}

	// IE
	if (document.selection  && !is_gecko) {

		tr=IESelectedRange.Rng;
		tr.text=newText;
		txtarea.focus();
		//txtarea.caretpos=tr.duplicate();
		tr.select();

		return;

	// Mozilla
	} else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
		var replaced = false;
		var startPos = txtarea.selectionStart;
		var endPos = txtarea.selectionEnd;

		if (endPos-startPos) {
			replaced = true;
		}
		var scrollTop = txtarea.scrollTop;
//		var myText = (txtarea.value).substring(startPos, endPos);
//		if (!myText) {
//			myText=sampleText;
//		}
//		if (myText.charAt(myText.length - 1) == " ") { // exclude ending space char, if any
//			subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " ";
//		} else {
//			subst = tagOpen + myText + tagClose;
//		}
		txtarea.value = txtarea.value.substring(0, startPos) + newText +
			txtarea.value.substring(endPos, txtarea.value.length);
		txtarea.focus();
		//set new selection
		if (!replaced) {
			var cPos = startPos+(newText.length);
			txtarea.selectionStart = cPos;
			txtarea.selectionEnd = cPos;
		} else {
			txtarea.selectionStart = startPos+beforeText.length;
			txtarea.selectionEnd = startPos+beforeText.length+selText.length;
		}
		txtarea.scrollTop = scrollTop;

	// All other browsers get no toolbar.
	// There was previously support for a crippled "help"
	// bar, but that caused more problems than it solved.
	}
	// reposition cursor if possible
	if (txtarea.createTextRange) {

		txtarea.caretPos = document.selection.createRange().duplicate();
//txtarea.caretPos =IESelectedRange.Rng;
	}
txtarea.focus();
}


//============================================================
// Table generator 
//============================================================
/** en: Generate an array using Mediawiki syntax
* @author: originally from fr:user:dake
* @version: 0.2 */
function generateTable(caption, exhead, nbCol, nbRow, exfield, align){
	
};


function XEBPopupRef(e){

	m=new GetPos(e||event);

	curPopup=new XEBPopup("ref",m.x,m.y);
	curPopup.width=150;
	mt='<p>Introduza os parâmetros de referência abaixo: <\/p>'
		+'<form name="XEBPopupRefForm">'
		+'Nome:<input type="text" name="refName" value="" size="10"><p\/>'
		+'Material:<input type="text" name="refMaterial" value="' + XEBGetSelectedText() + '" size="20">'
		+'<\/form>'
		+'<p><button onClick="javascript:insertRef()">Inserir</button>'
		+'<button onClick="hideXEBPopup()">Cancelar</button>';

	curPopup.setInnerHTML(mt);
//	document.XEBPopupRefForm.refName.focus();
	return true;
}

function insertRef(){
	f=document.XEBPopupRefForm;
	var refName = f.refName.value;
	var refMaterial=f.refMaterial.value;
	
	hideXEBPopup();
	var code1='<ref';
	code1+=(refName)?' name="'+refName+'">':'>'; 
	code2=refMaterial;
	code3='<\/ref>'
	XEBinsertText(code1,code2,code3,curPopup.IESelectedRange);

	extendSummary('ref');
	return false;
} 

//===GEO LINK Function==================================================

function XEBPopupGeoLink(e)
{
	m=new GetPos(e||event);

	curPopup=new XEBPopup("geo",m.x,m.y);
	curPopup.width=300;
	mt='<p>Introduza os parâmetros de posição abaixo: <\/p>'
		+'<form name="XEBPopupGeoLinkForm">'
		+'Localização:<p\/>'
		+'<table style="background: transparent;">'
		+'<tr><td>Latitude:<\/td><td><input type="text" autocomplete="off" name="geoLatDeg" value="" size="4"><\/td>'
		+'<td><input type="text" name="geoLatMin" size="4"><\/td>'
		+'<td><input type="text" name="geoLatSec" size="4"><\/td>'
		+'<td><select name="geoLatNS"><option value="N">N<option value="S">S</select><\/td><\/tr>'
		+'<tr><td>Longitude:<\/td><td><input type="text" name="geoLonDeg" value="" size="4"><\/td>'
		+'<td><input type="text" name="geoLonMin" value="" size="4"><\/td>'
		+'<td><input type="text" name="geoLonSec" value="" size="4"><\/td>'
		+'<td><select name="geoLonEW"><option value="E">L<option value="W">O</select><\/td><\/tr>'
		+'<\/table>'
		+'Região:<input type="text" name="geoRegion" value="" size="4"><p\/>'
		+'Tipo:'
		+'<SELECT NAME="geoType" size="4">'
		+'<OPTION VALUE="country">País<OPTION VALUE="state">Estado'
		+'<OPTION VALUE="adm1st">Unid Admin, Nível 1<OPTION VALUE="adm2st">Unid Admin, Nível 2'
		+'<OPTION VALUE="city">Cidade<OPTION VALUE="airport">Aeroporto'
		+'<OPTION VALUE="mountain">Montanha<OPTION VALUE="isle">Ilha'
		+'<OPTION VALUE="waterbody">Corpo de água<OPTION VALUE="landmark" SELECTED>Marco'
		+'<OPTION VALUE="forest">Floresta</SELECT><br>'
		+'Title: <input type="checkbox" name="geoTitle" ><p\/>'
		+'<\/form>'
		+'<p><button onClick="javascript:insertGeoLink()">Inserir</button>'
		+'<button onClick="hideXEBPopup()">Cancelar</button>';

	curPopup.setInnerHTML(mt);
	document.paramForm.refName.focus();
	return true;

}
function insertGeoLink()
{
	f=document.XEBPopupGeoLinkForm;

	var code='{{Coor ';
	if(f.geoTitle.checked)code+='title ';
	ft='dms';
	if(f.geoLatSec.value==''&&f.geoLonSec.value=='')ft='dm';
	if(ft=='dm'&&f.geoLatMin.value==''&&f.geoLonMin.value=='')ft='d';
	code+=ft;
	code+='|'+f.geoLatDeg.value;
	code+=(ft=='dm'||ft=='dms')?'|'+f.geoLatMin.value:'';
	code+=(ft=='dms')?'|'+f.geoLatSec.value:'';
	code+='|'+f.geoLatNS.value;
	code+='|'+f.geoLonDeg.value;
	code+=(ft=='dm'||ft=='dms')?'|'+f.geoLonMin.value:'';
	code+=(ft=='dms')?'|'+f.geoLonSec.value:'';
	code+='|'+f.geoLonEW.value;
	code+='|type:'+f.geoType.value+'_region:'+f.geoRegion.value
	code+='}}';
	insertTags('','', code);
	extendSummary('geo-coord');
	hideXEBPopup();
	return false;
}

//===Talk Page entry Function===========================================

function XEBPopupTalk(e)
{
	m=new GetPos(e||event);

	curPopup=new XEBPopup("talk",m.x,m.y);
	curPopup.width=200;
	mt='<div style="font-size:medium"><p>Por favor escolha:<\/p>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(1)">Olá!<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(2)">Bem vindo<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(3)">Bem vindo IP<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(4)">Assine<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(5)">Feliz aniversário<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(6)">Cópia<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(7)">Substituição<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(8)">Propaganda<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(9)">Aviso<\/span><br>'
	mt+='<span class="XEBMnuItm" onclick="XEBInsertTalk(10)">Aviso-assinatura<\/span></div>'

	curPopup.setInnerHTML(mt);

	return true;

}
function XEBInsertTalk(itm)
{
	hideXEBPopup();
	if(itm==1)code='Olá, {{subst:BASEPAGENAME}}!';
	if(itm==2)code='{{subst:Bem vindo}}';
	if(itm==3)code='{{subst:Bem vindo IP}}';
	if(itm==4)code='{{subst:Assine}}';
	if(itm==5)code='{{subst:Feliz Aniversário}}';
	if(itm==6)code='{{subst:Cópia}}';
	if(itm==7)code='{{subst:Substituição}}';
	if(itm==8)code='{{subst:Propaganda}}';
	if(itm==9)code='{{subst:aviso1}}';
	if(itm==10)code='{{subst:Aviso-assinatura}}';

	insertTags('','', code);
	return false;
}
function XEBPopupImage(e)
{
	m=new GetPos(e||event);

	curPopup=new XEBPopup("image",m.x,m.y);
	curPopup.width=300;

	mt='<p>Introduza os parâmetros de imagem abaixo: <\/p>'
		+'<form name="XEBPopupImageForm">'
		+'Arquivo:<input type="text" name="imgFile" value="Exemplo.jpg' + XEBGetSelectedText() + '" size="20"><br>'
		+'Tipo:<SELECT NAME="imgType">'
		+'<OPTION VALUE="thumb">Moldura'
		+'<OPTION VALUE="border">Borda'
                +'<OPTION VALUE="frame">Tamanho original'
		+'<OPTION VALUE="none">Nenhum'
		+'</SELECT><br>'
		+'Posição:<SELECT NAME="imgLocation">'
		+'<OPTION VALUE="left">Esquerda'
		+'<OPTION VALUE="center">Centro'
		+'<OPTION VALUE="right">Direita'
		+'<OPTION VALUE="none">Nenhuma'
		+'</SELECT><br>'
		+'Tamanho:<input type="text" name="imgSize" value="100px" size="3">px<br>'
		+'Legenda:<input type="text" name="imgCaption" value="Exemplo" size="30"><\/p>'
		+'<\/form>'
		+'<p><button onClick="javascript:XEBInsertImage()">Inserir</button>'
		+'<button onClick="hideXEBPopup()">Cancelar</button>';

	curPopup.setInnerHTML(mt);

	return true;
}
function XEBInsertImage()
{
	f=document.XEBPopupImageForm;
	hideXEBPopup();
	var code='[[Imagem:';
	code+=f.imgFile.value;
	code+='|'+f.imgType.value;
	code+='|'+f.imgLocation.value;
	code+='|'+f.imgSize.value;
	code+='|'+f.imgCaption.value;
	code+=']]';
	insertTags('','', code);
	extendSummary('imagem');

	return false;
}

function XEBPopupFormattedText(e)
{
	m=new GetPos(e||event);

	curPopup=new XEBPopup("image",m.x,m.y);
	curPopup.width=300;
	
	mt='<form name="XEBPopupImageForm">'
		+'<table  style="background: transparent;">'
		+'<tr><td>Bold:<\/td><td><input type="checkbox" name="textBold"><\/td>'
		+'<td>Superscript:<\/td><td><input type="checkbox" name="textSuperscript"><\/td><\/tr>'
		+'<tr><td>Italic:<\/td><td><input type="checkbox" name="textItalic"><\/td>'
		+'<td>Subscript:<\/td><td><input type="checkbox" name="textSubscript"><\/td><\/tr>'
		+'<tr><td>Strike:<\/td><td><input type="checkbox" name="textStrike"><\/td>'
		+'<td>&nbsp;<\/td><\/tr>'
		+'</table>'
		+'Size:<SELECT NAME="textSize">'
		+'<OPTION VALUE="small">small'
		+'<OPTION VALUE="normal">[Normal]'
		+'<OPTION VALUE="big">big'
		+'</SELECT><br><table style="background:transparent;"><tr><td>Colour:<\/td><td>'
		+'<table width="100px">'
		+'<tr><td colspan="4">None<\/td></tr>'
		+'<tr><td bgcolor="aqua">&nbsp;<\/td><td bgcolor="gray"> &nbsp;<\/td>'
		+'<td bgcolor="olive">&nbsp;<\/td><td bgcolor="navy">&nbsp;<\/td><\/tr>'
		+'<tr><td bgcolor="black">&nbsp;<\/td><td bgcolor="green"> &nbsp;<\/td>'
		+'<td bgcolor="purple">&nbsp;<\/td><td bgcolor="teal">&nbsp;<\/td><\/tr>'
		+'<tr><td bgcolor="blue">&nbsp;<\/td><td bgcolor="lime">&nbsp;<\/td>'
		+'<td bgcolor="red">&nbsp;<\/td><td bgcolor="white">&nbsp;<\/td><\/tr>'
		+'<tr><td bgcolor="fuchsia">&nbsp;<\/td><td bgcolor="maroon">&nbsp;<\/td>'
		+'<td bgcolor="silver">&nbsp;<\/td><td bgcolor="yellow">&nbsp;<\/td><\/tr>'
		+'</table><\/td><\/tr>'
		+'<\/form>'
		+'Sample:'
		+'<span id="sampleText">Text</span>"'
		+'<p><button onClick="javascript:XEBInsertFormattedText()">Inserir</button>'
		+'<button onClick="hideXEBPopup()">Cancelar</button>';

	curPopup.setInnerHTML(mt);

	return true;
}

function XEBUpdateSampleText()
{
	f=document.XEBPopupImageForm;
}

//====================

function XEBMenuMouseOut(e)
{
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;

	targ.style.color='black';
}

function XEBMenuMouseOver(e)
{	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;

	targ.style.color='red';
}

//=======================================================================
// Other functions
//=======================================================================

function XEBgetElementsByClassName(parent,clsName,htmltag){ 
	var arr = new Array(); 
	var elems = parent.getElementsByTagName(htmltag);
	for ( var cls, i = 0; ( elem = elems[i] ); i++ ){
		if ( elem.className == clsName ){
			arr[arr.length] = elem;
		}
	}
	return arr;
}

function extendSummary(newText)
{
	if(!XEBExtendEditSummary)return;
	s=document.editform.elements['wpSummary'].value;
	s+=(s=='')?newText:' +'+newText;
	document.editform.elements['wpSummary'].value=s;
}

function bug(msg)
{
	if(wgUserName=='MarkS')alert(msg);
}


//</pre>


/*  barra de navegação */

// set up the words in your language
var NavigationBarHide = '▲';
var NavigationBarShow = '▼';