/*
==Navigation popups==
*/
//
popupStructure='menus'; // new feature: lovely CSS dropdown menus
popupFixDabs=true;
popupFixRedirs=true;
popupAdminLinks = true;
popupRedirAutoClick = 'wpSave';
document.write('<script type="text/javascript" src="'
+ 'http://pt.wikipedia.org/w/index.php?title=Usuário:Nuno_Tavares/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/*
/** Anti-vandal tool ************************************************************************
* Origem: ]
* Ajuda: ]
* Descrição: Monitorização de mudanças recentes
* Autor: ] e ]
********************************************************************************************/
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>');
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:{aviso1-bl1}
AddMyOwnButton(tbdiv, '{ Block }', 'javascript:document.editform.wpSummary.value=\'Bloqueio\';insertTags(\'\{\{subst:Bloqueado|2 horas|]}}\~\~\~\~\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso.png');
// Botao:{aviso1-bl1}
AddMyOwnButton(tbdiv, '{ aviso2 }', 'javascript:document.editform.wpSummary.value=\'aviso:será bloqueado.\';insertTags(\'\{\{subst:aviso1|}} A continuar será bloqueado. Contribua em vez de estragar! \~\~\~\~\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso.png');
// Botao:{aviso1}
AddMyOwnButton(tbdiv, '{ aviso1 }', 'javascript:document.editform.wpSummary.value=\'aviso\';insertTags(\'\{\{subst:aviso1|}} \~\~\~\~\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso.png');
// Botao:{Ort}
AddMyOwnButton(tbdiv, '{ Ort. }', 'javascript:document.editform.wpSummary.value=\'ORT\';insertTags(\'\{\{subst:ORT|}} \~\~\~\~\',\'\',\'\');');
// Botao:{bv-av}
AddMyOwnButton(tbdiv, '{ bv-av }', 'javascript:document.editform.wpSummary.value=\'\{\{bv-av\}\}\';insertTags(\'\{\{subst:bv-av|}} \~\~\~\~\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso.png');
// Botao:{Prop}
AddMyOwnButton(tbdiv, '{ Prop }', 'javascript:document.editform.wpSummary.value=\'\{\{Propaganda\}\}\';insertTags(\'\{\{subst:Propaganda|}} \~\~\~\~\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso.png');
// Botao:{Não assinou}
AddMyOwnButton(tbdiv, '{ Assinatura }', 'javascript:document.editform.wpSummary.value=\'\{\{Não assinou\}\}\';insertTags(\'\{\{Subst:Não assinou|1=|2=\~\~\~\~\~}}\',\'\',\'\');');
// Botao:{Bem vindo}
AddMyOwnButton(tbdiv, '{ bem vindo }', 'javascript:document.editform.wpSummary.value=\'\{\{bem vindo\}\}\';insertTags(\'\{\{subst\:bem vindo}} \~\~\~\~\',\'\',\'\');document.editform.submit();', 'http://upload.wikimedia.org/wikipedia/commons/3/30/Bv_icon.png');
// Botao:{aviso}
AddMyOwnButton(tbdiv, '{ aviso }', 'javascript:document.editform.wpSummary.value=\'\{\{aviso\}\}\';insertTags(\'\{\{aviso}}\',\'\',\'\');document.editform.submit();', 'http://upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso.png');
// Botao:{lixo}
AddMyOwnButton(tbdiv, '{ Lixo }', 'javascript:document.editform.wpSummary.value=\'\{\{lixo\}\}\';document.editform.wpTextbox1.value=\'\';insertTags(\'\{\{ER1|20|2\=\~\~\~\~}}\',\'\',\'\');document.editform.submit();', 'http://upload.wikimedia.org/wikipedia/commons/e/e4/Bouton_Vandale3.png');
// Botao:{impróprio}
AddMyOwnButton(tbdiv, '{ Impróprio }', 'javascript:document.editform.wpSummary.value=\'\{\{impróprio\}\}\';document.editform.wpTextbox1.value=\'\';insertTags(\'\{\{impróprio|1\=\~\~\~\~}}\',\'\',\'\');document.editform.submit();', 'http://upload.wikimedia.org/wikipedia/commons/f/f0/Bouton_Vandale0.png');
// Botao:{er}
AddMyOwnButton(tbdiv, '{ er1 }', 'javascript:document.editform.wpSummary.value=\'\{\{er1\}\}\';document.editform.wpTextbox1.value=\'\';insertTags(\'\{\{er1|1=|2=\~\~\~\~}}\',\'\',\'\');');
// Botao:{VDA3}
AddMyOwnButton(tbdiv, '{ VDA }', 'javascript:document.editform.wpSummary.value=\'\{\{VDA\}\}\';insertTags(\'\{\{subst:VDA3|}} \',\'\',\'\');','http://upload.wikimedia.org/wikipedia/commons/3/30/Tt_icon.png');
// Botao:{Sem-fontes}
AddMyOwnButton(tbdiv, '{ Sem-fontes }', 'javascript:document.editform.wpSummary.value=\'\{\{Sem-fontes\}\}\';insertTags(\'\{\{Sem-fontes}} \',\'\',\'\');');
// Botao:{Wikificar}
AddMyOwnButton(tbdiv, '{ Wikificar }', 'javascript:document.editform.wpSummary.value=\'\{\{Wikificar\}\}\';insertTags(\'\{\{subst:wkf}} \',\'\',\'\');document.editform.submit();','http://upload.wikimedia.org/wikipedia/commons/5/58/Button_small.png');
// Botao:{Contexto}
AddMyOwnButton(tbdiv, '{ Contexto }', 'javascript:document.editform.wpSummary.value=\'\{\{Contexto\}\}\';insertTags(\'\{\{Contexto}} \',\'\',\'\');document.editform.submit();', 'http://republico.estv.ipv.pt/~nmct/wikipedia/icons/button_tt.png');
// Botao:{Bem vinda}
AddMyOwnButton(tbdiv, '{ bem vinda }', 'javascript:document.editform.wpSummary.value=\'\{\{bem vinda\}\}\';insertTags(\'\{\{subst\:bem vinda}} \~\~\~\~\',\'\',\'\');document.editform.submit();', 'http://upload.wikimedia.org/wikipedia/commons/3/30/Bv_icon.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://upload.wikimedia.org/wikipedia/commons/6/62/Button_desambig.png');
// Botao:{Apagar}
AddMyOwnButton(tbdiv, '{ Apagar }', 'javascript:document.editform.wpSummary.value=\'\{\{Apagar\}\}\';insertTags(\'\{\{Subst:Apagar}} \',\'\',\'\');document.editform.submit();','http://upload.wikimedia.org/wikipedia/commons/5/58/Button_small.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:\{\{subst:\Cd2}} <\!-- troque esta predefinição pela tag do respectivo copyright -->\\n\\] <\!-- remova esta categoria após indicar a fonte -->\\n\',\'\',\'\');', 'http://upload.wikimedia.org/wikipedia/commons/d/de/Button_image.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://upload.wikimedia.org/wikipedia/commons/8/8f/Cs_icon.png');
// Botao:Gerador de tabelas
AddMyOwnButton(tbdiv, 'Gerador de tabelas', 'javascript:popupTabela();', 'http://upload.wikimedia.org/wikipedia/fr/0/04/Button_array.png');
}
}
/*
==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 = ;
else if(key) ta = ;
else if(title) ta = ;
}
//akeytt();
return li;
}
window.showPortalIfTagged=function(){
var ppdiv=document.getElementById('n-portal-teste');
if (ppdiv) {
var plet = document.getElementById('p-navigation').getElementsByTagName('ul');
if (plet) {
mynav_addlilink(plet, 'http://pt.wikipedia.orghttps://wiki386.com/pt/Portal:' + ppdiv.childNodes.nodeValue, 'Portal:'+ ppdiv.childNodes.nodeValue, 'n-portal-tematico');
}
}
}
/*
==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);
//============================================================
// Gerador de tabelas
//============================================================
/**
*
* English: Generate an array using Mediawiki syntax.
*
* @author: fr:user:dake
* @version: 0.1
*/
function geraTabela(nbCol, nbRow, border, styleHeader, styleLine)
{
var code = "\n";
code += '{| border="' + border + '"\n';
code += '|+ Título da tabela\n';
for (var i=0;i<nbCol;i++) code += '! en-tête ' + i + '\n'
for (var j=0;j<nbRow;j++) {
if ((j+1)%2==0 && styleLine==1) {
code += '|-{'+'color="#C0C0C0"'+'}\n'
} else {
code += '|-----\n'
}
for (var i=0;i<nbCol;i++) code += '| elemento\n';
}
code += '|}';
insertTags('','', code);
}
/**
*
* English: Open a popup with parameters to generate an array.
* The number of rows/columns can be modified. Some additional
* parameters are related to templates available on :fr
*
* @author: fr:user:dake
* @version: 0.1
*/
function popupTabela()
{
var popup = window.open('','name','height=400,width=500');
javaCode = '<script type="text\/javascript">function insertCode(){';
javaCode += 'var row = parseInt(document.paramForm.inputRow.value); '
javaCode += 'var col = parseInt(document.paramForm.inputCol.value); '
javaCode += 'var bord = parseInt(document.paramForm.inputBorder.value); '
javaCode += 'var styleHeader = document.paramForm.inputHeader.checked; '
javaCode += 'var styleLine = document.paramForm.inputLine.checked; '
javaCode += 'window.opener.geraTabela(col,row,bord,styleHeader,styleLine); '
javaCode += '}<\/script>';
popup.document.write('<html><head><title>Parâmetros da tabela</title>');
popup.document.write('<script type="text\/javascript" src="\/skins-1.5\/common\/wikibits.js"><!-- wikibits js --><\/script>');
popup.document.write('<style type="text\/css" media="screen,projection">/*<!]>*/<\/style>');
popup.document.write(javaCode);
popup.document.write('</head><body>');
popup.document.write('<p>Insira os parâmetros da tabela : </p>');
popup.document.write('<form name="paramForm">');
popup.document.write('Número de linhas : <input type="text" name="inputRow" value="3" ><p>');
popup.document.write('Número de colunas : <input type="text" name="inputCol" value="3" ><p>');
popup.document.write('Largura do bordo : <input type="text" name="inputBorder" value="1" ><p>');
popup.document.write('Alteração de linhas a cinzento: <input type="checkbox" name="inputLine" checked="1" ><p>');
popup.document.write('</form">');
popup.document.write('<p><a href="javascript:insertCode();"> Inserir o código na janela de edição</a></p>');
popup.document.write('<p><a href="javascript:self.close()"> Fechar</a></p>');
popup.document.write('</body></html>');
popup.document.close();
}