MediaWiki:Gadget-fastbuttons.js e Ajuda:Página de testes/2: diferenças entre as páginas
(Diferenças entre páginas)
Conteúdo apagado Conteúdo adicionado
Pedido em WP:PA/PP. |
m troca de switch por objeto contendo os sumários (menos código repetido); +version: '~~~~~' e catScanUrl no objeto fb; melhor separação entre def. dos menus e a das funções (fb.ESRok e fb.esbOk foram movidas para baixo); indentação com tabs |
||
Linha 7: | Linha 7: | ||
*/ |
*/ |
||
window.fb = { |
window.fb = { |
||
//Replace this string by 5~ before saving: |
|||
version: '16h14min de 28 de julho de 2011 (UTC)', |
|||
namespace: mw.config.get('wgNamespaceNumber'), |
namespace: mw.config.get('wgNamespaceNumber'), |
||
title: mw.config.get('wgTitle'), |
|||
catScanUrl: 'http://toolserver.org/~daniel/WikiSense/CategoryIntersect.php' + |
|||
'?wikilang=pt&wikifam=.wikipedia.org&userlang=pt&basecat=' + |
|||
encodeURIComponent( mw.config.get('wgTitle') ) + '&basedeep=1&go=Examinar&format=html&mode=', |
|||
menu: document.createElement('div'), |
menu: document.createElement('div'), |
||
submenu: document.createElement('div') |
submenu: document.createElement('div') |
||
Linha 115: | Linha 121: | ||
+ "|" + fb.link("subst:ESR-empresa|1=~~" + "~~", "empresa", "Empresa sem fontes e sem notoriedade") |
+ "|" + fb.link("subst:ESR-empresa|1=~~" + "~~", "empresa", "Empresa sem fontes e sem notoriedade") |
||
+ "| outra: </td><td><input type=\"text\" id=\"esrinput\" onKeyPress=\"fb.ESRok(event)\" size=55/><input type=\"button\" onMouseDown='fb.ESRok(\"ok\")' value=\"OK\"/></td></tr></table>"; |
+ "| outra: </td><td><input type=\"text\" id=\"esrinput\" onKeyPress=\"fb.ESRok(event)\" size=55/><input type=\"button\" onMouseDown='fb.ESRok(\"ok\")' value=\"OK\"/></td></tr></table>"; |
||
// TODO: Merge with function fb.esbOk() defined below, possibly using jQuery |
|||
// $('#target').keypress() |
|||
fb.ESRok = function(evt) { |
|||
if (window.event && window.event.keyCode == 13) { |
|||
evt = "ok"; |
|||
} else if (evt && evt.which == 13) { |
|||
evt = "ok"; |
|||
} |
|||
if (evt == "ok") { |
|||
this.run("subst:ESR", document.getElementById("esrinput").value + " ~~" + "~~"); |
|||
} |
|||
}; |
|||
/*** Menu [esboço] ***/ |
/*** Menu [esboço] ***/ |
||
Linha 140: | Linha 133: | ||
"<input type=\"button\" onMouseDown='fb.esbOk(\"ok\")' value=\"OK\"/>" + |
"<input type=\"button\" onMouseDown='fb.esbOk(\"ok\")' value=\"OK\"/>" + |
||
"</td></tr></table>"; |
"</td></tr></table>"; |
||
var esbText = "", |
|||
esbText2 = ""; |
|||
//TODO: Merge with function fb.ESRok() defined above, possibly using $('#target').keypress() |
|||
fb.esbOk = function (evt) { |
|||
if (window.event && window.event.keyCode == 13) { |
|||
evt = "ok"; |
|||
} else if (evt && evt.which == 13) { |
|||
evt = "ok"; |
|||
} |
|||
if (evt == "ok") { |
|||
fb.run("esboço-" + document.getElementById("esbinput").value); |
|||
} |
|||
}; |
|||
/*** Menu [manuteção] ***/ |
/*** Menu [manuteção] ***/ |
||
Linha 182: | Linha 161: | ||
/*** Menu [busca] ***/ |
/*** Menu [busca] ***/ |
||
fb.title = mw.config.get('wgTitle'); |
|||
if (fb.title.indexOf(" ") > -1){ |
if (fb.title.indexOf(" ") > -1){ |
||
fb.title = "\"" + fb.title + "\""; |
fb.title = "\"" + fb.title + "\""; |
||
Linha 251: | Linha 229: | ||
/** Menu [CatScan] **/ |
/** Menu [CatScan] **/ |
||
var catScanUrl = 'http://toolserver.org/~daniel/WikiSense/CategoryIntersect.php' + |
|||
'?wikilang=pt&wikifam=.wikipedia.org&userlang=pt' + |
|||
'&basecat=' + encodeURIComponent( mw.config.get('wgTitle') ) + |
|||
'&basedeep=1&go=Examinar&format=html&mode='; |
|||
fb.cat = "Procurar nesta categoria: " + [ |
fb.cat = "Procurar nesta categoria: " + [ |
||
"<a href='" + catScanUrl + "ts&templates=Sem-fontes'>sem fontes</a>", |
"<a href='" + fb.catScanUrl + "ts&templates=Sem-fontes'>sem fontes</a>", |
||
"<a href='" + catScanUrl + "ts&templates=Revis%C3%A3o&go='>revisão</a>", |
"<a href='" + fb.catScanUrl + "ts&templates=Revis%C3%A3o&go='>revisão</a>", |
||
"<a href='" + catScanUrl + "ts&templates=Wikifica%C3%A7%C3%A3o&go='>wikificação</a>", |
"<a href='" + fb.catScanUrl + "ts&templates=Wikifica%C3%A7%C3%A3o&go='>wikificação</a>", |
||
"<a href='" + catScanUrl + "ss&size=1000&stubop=or&links=4&go='>menos de 1 000 bytes ou 4 links</a>", |
"<a href='" + fb.catScanUrl + "ss&size=1000&stubop=or&links=4&go='>menos de 1 000 bytes ou 4 links</a>", |
||
"<a href='" + catScanUrl + "ss&size=500&stubop=or&links=2&go='>menos de 500 bytes ou 2 links</a>" |
"<a href='" + fb.catScanUrl + "ss&size=500&stubop=or&links=2&go='>menos de 500 bytes ou 2 links</a>" |
||
].join(' | '); |
].join(' | '); |
||
var esbText = "", |
|||
esbText2 = ""; |
|||
//TODO: Merge with function fb.ESRok() defined above, possibly using $('#target').keypress() |
|||
fb.esbOk = function (evt) { |
|||
if (window.event && window.event.keyCode == 13) { |
|||
evt = "ok"; |
|||
} else if (evt && evt.which == 13) { |
|||
evt = "ok"; |
|||
} |
|||
if (evt == "ok") { |
|||
fb.run("esboço-" + document.getElementById("esbinput").value); |
|||
} |
|||
}; |
|||
// TODO: Merge with function fb.esbOk() defined below, possibly using jQuery |
|||
// $('#target').keypress() |
|||
fb.ESRok = function(evt) { |
|||
if (window.event && window.event.keyCode == 13) { |
|||
evt = "ok"; |
|||
} else if (evt && evt.which == 13) { |
|||
evt = "ok"; |
|||
} |
|||
if (evt == "ok") { |
|||
this.run("subst:ESR", document.getElementById("esrinput").value + " ~~" + "~~"); |
|||
} |
|||
}; |
|||
/* |
/* |
||
Linha 269: | Linha 271: | ||
*/ |
*/ |
||
fb.open = function (menu) { |
fb.open = function (menu) { |
||
this.submenu.innerHTML = menu; |
|||
}; |
}; |
||
Linha 279: | Linha 281: | ||
*/ |
*/ |
||
fb.run = function (code, extraText) { |
fb.run = function (code, extraText) { |
||
var |
var textBox = document.getElementById("wpTextbox1"), |
||
summaries = { |
|||
if (extraText === null) { |
|||
'subst:VDA': 'Página marcada como [[WP:VDA|VDA]]', |
|||
// Do nothing if the user canceled the prompt box |
|||
'subst:apagar': 'Página proposta para [[Wikipedia:Eliminação' + |
|||
return false; |
|||
' por votação|eliminação por votação]]', |
|||
} |
|||
'subst:s-fontes': 'Página marcada como sem fontes', |
|||
if (mw.config.get('wgAction') == 'view') { |
|||
'subst:wkf': 'Página marcada para [[WP:WKF|wikificação]]', |
|||
'subst:rec': 'Página marcada para [[WP:RECI|reciclagem]]', |
|||
'parcial': 'Página marcada como parcial', |
|||
'subst:ctx': 'Página marcada como sem contexto', |
|||
'controverso|artigo': 'Marcado como controverso', |
|||
'subst:f-referências': 'Marcado que existem referências sem formatação', |
|||
'subst:m-notas': 'Marcado que carece de mais fontes', |
|||
'subst:s-notas': 'Página marcada como sem notas', |
|||
'subst:s-fontes-bpv': 'Marcado como [[WP:BPV|biografia de pessoa' + |
|||
' viva]] sem fontes', |
|||
'subst:fpr': 'Página marcada como sem fontes secundárias fiáveis' |
|||
}; |
|||
if (extraText === null) { |
|||
// Do nothing if the user canceled the prompt box |
|||
return false; |
|||
} |
|||
if (mw.config.get('wgAction') == 'view') { |
|||
var url = mw.util.wikiGetlink( mw.config.get('wgPageName') ) |
var url = mw.util.wikiGetlink( mw.config.get('wgPageName') ) |
||
+ '?action=edit&fastb=' + encodeURIComponent(code); |
+ '?action=edit&fastb=' + encodeURIComponent(code); |
||
if (extraText) { |
|||
location.href = url + '&fbtxt=' + encodeURIComponent(extraText); |
|||
} else { |
|||
location.href = url; |
|||
} |
|||
} |
|||
} else if (mw.config.get('wgAction') == "edit") { |
|||
var value = textBox.value; |
|||
var summary = " (usando [[Wikipédia:FB|FastButtons]])"; |
|||
if ( value.match(/\{\{(?:ER|ESR2|Usuário\:Salebot\/Impróprio)\|/i) ) { |
|||
alert("Já existe uma predefinição de eliminação nesta página."); |
|||
return false; |
|||
} |
|||
} |
|||
if (code.indexOf("ER") === 0) { |
|||
if (extraText) { |
|||
extraText = "|3=" + extraText + "}}\n\n"; |
|||
} else { |
|||
extraText = "}}\n\n"; |
|||
} |
|||
} |
|||
extraText = "{" + "{" + code + "|2=~~" + "~~" + extraText; |
|||
textBox.value = extraText + value; |
|||
if (this.salve) { |
|||
document.editform.wpSummary.value = "Página proposta para" + |
|||
" [[WP:ER|eliminação rápida]] (regra " + |
" [[WP:ER|eliminação rápida]] (regra " + |
||
code.substring(3) + ")" + summary; |
code.substring(3) + ")" + summary; |
||
} |
|||
} |
|||
} else if (code == "redirect") { |
|||
if (mw.config.get('wgNamespaceNumber') == 14) { |
if (mw.config.get('wgNamespaceNumber') == 14) { |
||
if (extraText) { |
if (extraText) { |
||
textBox.value = "{{redirecionamento de categoria|" + |
textBox.value = "{" + "{redirecionamento de categoria|" + |
||
extraText + "}}"; |
extraText + "}}"; |
||
} |
} |
||
Linha 327: | Linha 346: | ||
} |
} |
||
} |
} |
||
} else { |
|||
if (extraText) { |
|||
if (code.indexOf("|") > -1) { |
|||
extraText = "|1=" + extraText + "}}"; |
|||
} else { |
|||
extraText = "|1=" + extraText + "}}"; |
|||
} |
|||
} |
|||
} else { |
|||
extraText = "}}"; |
|||
} |
|||
} |
|||
extraText = "{{" + code + extraText; |
|||
if (mw.config.get('wgNamespaceNumber') == 3) { |
|||
value += "\n\n" + extraText + " ~~" + "~~"; |
|||
} else if (code == "mínimo" || code.indexOf("esboço") === 0) { |
|||
if (value.match(/\n\n\[\[/)) { |
|||
value = value.substring(0, value.search(/\n\n\[\[/)) + "\n\n" + |
|||
extraText + value.substring(value.search(/\n\n\[\[/)); |
extraText + value.substring(value.search(/\n\n\[\[/)); |
||
} else { |
|||
value += "\n\n" + extraText; |
|||
} |
|||
} |
|||
this.salve = (code == "mínimo") ? |
|||
"Página marcada como [[WP:M|mínimo]]" : |
"Página marcada como [[WP:M|mínimo]]" : |
||
"Página marcada como [[WP:EBC|esboço]]"; |
"Página marcada como [[WP:EBC|esboço]]"; |
||
} else if (code == "subst:VDA" || code == "subst:matrad") { |
|||
value = extraText; |
|||
} else { |
|||
value = extraText + "\n\n" + value; |
|||
} |
|||
} |
|||
textBox.value = value; |
|||
if (this.salve) { |
|||
if (mw.config.get('wgNamespaceNumber') == 3) { |
|||
this.salve = 'Adicionando aviso'; |
|||
} else { |
|||
if ( summaries[ code ] ) { |
|||
switch (code) { |
|||
this.salve = summaries[ code ]; |
|||
case "subst:VDA": |
|||
} else { |
|||
this.salve = "Página marcada como [[WP:VDA|VDA]]"; |
|||
if (this.salve === true) { |
|||
break; |
|||
this.salve = 'Adicionando marcação'; |
|||
case "subst:apagar": |
|||
} else if ( code.indexOf( 'subst:ESR' ) === 0 ) { |
|||
this.salve = "Página proposta para [[Wikipedia:Eliminação" + |
|||
this.salve = 'Página proposta para [[WP:ESR|eliminação' + |
|||
' semirrápida]]'; |
|||
break; |
|||
} |
|||
case "subst:s-fontes": |
|||
} |
|||
this.salve = "Página marcada como sem fontes"; |
|||
} |
|||
break; |
|||
document.editform.wpSummary.value = this.salve + summary; |
|||
case "subst:wkf": |
|||
} |
|||
this.salve = "Página marcada para [[WP:WKF|wikificação]]"; |
|||
} |
|||
break; |
|||
if (this.salve) { |
|||
case "subst:rec": |
|||
document.editform.submit(); |
|||
this.salve = "Página marcada para [[WP:RECI|reciclagem]]"; |
|||
} |
|||
break; |
|||
} |
|||
case "parcial": |
|||
this.salve = "Página marcada como parcial"; |
|||
break; |
|||
case "subst:ctx": |
|||
this.salve = "Página marcada como sem contexto"; |
|||
break; |
|||
case "controverso|artigo": |
|||
this.salve = "Marcado como controverso"; |
|||
break; |
|||
case "subst:f-referências": |
|||
this.salve = "Marcado que existem referências sem formatação"; |
|||
break; |
|||
case "subst:m-notas": |
|||
this.salve = "Marcado que carece de mais fontes"; |
|||
break; |
|||
case "subst:s-notas": |
|||
this.salve = "Página marcada como sem notas"; |
|||
break; |
|||
case "subst:s-fontes-bpv": |
|||
this.salve = "Marcado como [[WP:BPV|biografia de pessoa" + |
|||
" viva]] sem fontes"; |
|||
break; |
|||
case "subst:fpr": |
|||
this.salve = "Página marcada como sem fontes secundárias" + |
|||
" fiáveis"; |
|||
break; |
|||
default: |
|||
if (this.salve === true) { |
|||
this.salve = "Adicionando marcação"; |
|||
} else if (code.indexOf("subst:ESR") === 0) { |
|||
this.salve = "Página proposta para [[WP:ESR|eliminação" + |
|||
" semirrápida]]"; |
|||
} |
|||
} |
|||
} |
|||
document.editform.wpSummary.value = this.salve + summary; |
|||
} |
|||
} |
|||
if (this.salve) { |
|||
document.editform.submit(); |
|||
} |
|||
} |
|||
}; |
}; |
||
Linha 428: | Linha 406: | ||
*/ |
*/ |
||
fb.ajax = function (code, url) { |
fb.ajax = function (code, url) { |
||
var ajax = sajax_init_object(), |
|||
that = this; |
that = this; |
||
if (!ajax) { |
|||
return; |
|||
} |
|||
} |
|||
ajax.open('GET', url, true); |
|||
ajax.send(''); |
|||
ajax.onreadystatechange = function () { |
|||
if (ajax.readyState == 4 && ajax.status == 200) { |
|||
that.api(code, ajax.responseXML); |
|||
} |
|||
} |
|||
}; |
|||
}; |
}; |
||
Linha 448: | Linha 426: | ||
fb.api = function (code, api) { |
fb.api = function (code, api) { |
||
var url, esb, i, pages = '', charnum = 0, title, length, comment, user; |
var url, esb, i, pages = '', charnum = 0, title, length, comment, user; |
||
if (!api) { |
|||
url = mw.config.get('wgScriptPath') + "/api.php?format=xml&action=query&"; |
|||
// TODO: Criar um objeto { 'esb': ..., 'afl':... } com um item para cada "fabi" |
// TODO: Criar um objeto { 'esb': ..., 'afl':... } com um item para cada "fabi" |
||
switch ( code ) { |
switch ( code ) { |
||
Linha 491: | Linha 469: | ||
break; |
break; |
||
} |
} |
||
this.ajax(code, url); |
|||
} else { |
|||
/** Processamento da resposta do API **/ |
/** Processamento da resposta do API **/ |
||
switch ( code ) { |
|||
case 'afl': |
case 'afl': |
||
// Afluentes |
// Afluentes |
||
Linha 545: | Linha 523: | ||
case 'qualidade': |
case 'qualidade': |
||
// Qualidade do artigo |
// Qualidade do artigo |
||
api = api.getElementsByTagName("cl"); |
|||
if (api) { |
|||
var quality; |
|||
for (i = 0; i < api.length; i++) { |
|||
if (!api[i]){ |
if (!api[i]){ |
||
continue; |
continue; |
||
} |
} |
||
quality = api[i].getAttribute("title"); |
|||
if (quality.indexOf("!Artigos de qualidade") > -1) { |
|||
quality = quality.substr(32, 1); |
|||
if (quality == "d") { |
|||
quality = "?"; |
|||
} |
|||
} |
|||
this.submenu.innerHTML += "<span title='Qualidade do artigo'> Q-<b>" + |
|||
quality + "</b></span>"; |
quality + "</b></span>"; |
||
break; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} else { |
|||
return; |
|||
} |
|||
} |
|||
break; |
|||
case 'esb': |
|||
// Esboço temático |
// Esboço temático |
||
api = api.getElementsByTagName("p"); |
|||
if (api && api.length) { |
|||
api = api[0].getAttribute("title") |
|||
.replace(/Predefinição:Esboço-/gi, ""); |
.replace(/Predefinição:Esboço-/gi, ""); |
||
} else { |
|||
return; |
|||
} |
|||
} |
|||
if ((esb.setSelectionRange |
|||
|| esb.createTextRange |
|| esb.createTextRange |
||
|| typeof (esb.selectionStart) != 'undefined' |
|| typeof (esb.selectionStart) != 'undefined' |
||
Linha 584: | Linha 562: | ||
) { |
) { |
||
// Exibe sugestões. Baseado no script do HotCat |
// Exibe sugestões. Baseado no script do HotCat |
||
var start = esb.value.length; |
|||
esb.value = api; |
|||
esbText2 = api; |
|||
if (esb.setSelectionRange) { |
|||
esb.setSelectionRange(start, api.length); |
|||
} else if (esb.createTextRange) { |
|||
var sel = esb.createTextRange(); |
|||
sel.move("character", start); |
|||
sel.moveEnd("character", api.length - start); |
|||
sel.select(); |
|||
} else { |
|||
esb.selectionStart = start; |
|||
esb.selectionEnd = api.length; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
break; |
|||
case 'PV': |
|||
// Páginas vigiadas |
// Páginas vigiadas |
||
api = api.getElementsByTagName("item"); |
|||
for (i = 0; i < api.length && i < 10; i++) { |
|||
if (!api[i]){ |
if (!api[i]){ |
||
continue; |
continue; |
||
} |
} |
||
title = api[i].getAttribute("title"); |
|||
charnum += title.length; |
|||
if (charnum > 180) { |
|||
break; |
|||
} |
|||
} |
|||
length = (api[i].getAttribute("newlen") |
|||
- api[i].getAttribute("oldlen")); |
- api[i].getAttribute("oldlen")); |
||
if (length > 0) { |
|||
length = "+" + length; |
|||
} |
|||
} |
|||
comment = api[i].getAttribute("comment").replace("/*", "?"); |
|||
if (comment) { |
|||
comment = "(" + comment.replace("*/", ":") + ")"; |
|||
} |
|||
} |
|||
comment = comment.replace("[[Ajuda:Guia de edição/Menus e" + |
|||
" ferramentas/Sumário de edição|?]]", ""); |
" ferramentas/Sumário de edição|?]]", ""); |
||
if ( i > 0){ |
if ( i > 0){ |
||
pages += ' | '; |
pages += ' | '; |
||
} |
} |
||
pages += "<a href=\"" + mw.util.wikiGetlink( title ) + |
|||
"?diff=last\" title=\"(" + length + ") " + |
"?diff=last\" title=\"(" + length + ") " + |
||
api[i].getAttribute("user") + " " + comment + "\">" + |
api[i].getAttribute("user") + " " + comment + "\">" + |
||
title + "</a>"; |
title + "</a>"; |
||
} |
|||
} |
|||
this.submenu.innerHTML = pages; |
|||
break; |
break; |
||
case 'PN': |
|||
// Páginas novas |
// Páginas novas |
||
api = api.getElementsByTagName("rc"); |
|||
for (i = 0; i < api.length && i < 10; i++) { |
|||
if (!api[i]){ |
if (!api[i]){ |
||
continue; |
continue; |
||
} |
} |
||
title = api[i].getAttribute("title"); |
|||
charnum += title.length; |
|||
if (charnum > 180) { |
|||
break; |
|||
} |
|||
} |
|||
length = "+" + api[i].getAttribute("newlen"); |
|||
comment = api[i].getAttribute("comment"); |
|||
if (comment) { |
|||
comment = "(" + comment.replace("[[Ajuda:SEA|?]] ", "") + ")"; |
|||
} |
|||
} |
|||
if ( i > 0){ |
|||
pages += ' | '; |
pages += ' | '; |
||
} |
} |
||
pages += "<a href=\"" + mw.util.wikiGetlink( title ) |
|||
+ "?redirect=no&rcid=" + api[i].getAttribute("rcid") |
+ "?redirect=no&rcid=" + api[i].getAttribute("rcid") |
||
+ "\" title=\"(" + length + ") " + |
+ "\" title=\"(" + length + ") " + |
||
api[i].getAttribute("user") + " " + comment |
api[i].getAttribute("user") + " " + comment |
||
+ "\">" + title + "</a>"; |
+ "\">" + title + "</a>"; |
||
} |
|||
} |
|||
this.submenu.innerHTML = pages; |
|||
break; |
break; |
||
case 'MR': |
|||
// Mudanças recentes |
// Mudanças recentes |
||
api = api.getElementsByTagName("rc"); |
|||
for (i = 0; i < api.length && i < 10; i++) { |
|||
if (!api[i]){ |
if (!api[i]){ |
||
continue; |
continue; |
||
} |
} |
||
title = api[i].getAttribute("title"); |
|||
charnum += title.length; |
|||
if (charnum > 180) { |
|||
break; |
|||
} |
|||
} |
|||
length = (api[i].getAttribute("newlen") |
|||
- api[i].getAttribute("oldlen")); |
- api[i].getAttribute("oldlen")); |
||
if (length > 0) { |
|||
length = "+" + length; |
|||
} |
|||
} |
|||
comment = api[i].getAttribute("comment").replace("/*", "?"); |
|||
if (comment) { |
|||
comment = "(" + comment.replace("*/", ":") + ")"; |
|||
} |
|||
} |
|||
if ( i > 0){ |
|||
pages += ' | '; |
pages += ' | '; |
||
} |
} |
||
Linha 689: | Linha 667: | ||
+ api[i].getAttribute("user") + " " |
+ api[i].getAttribute("user") + " " |
||
+ comment + "\">" + title + "</a>"; |
+ comment + "\">" + title + "</a>"; |
||
} |
|||
} |
|||
this.submenu.innerHTML = pages; |
|||
break; |
break; |
||
case 'usu': |
|||
// Informações do(a) usuário(a) |
// Informações do(a) usuário(a) |
||
api = api.getElementsByTagName("u"); |
|||
if ( api && api.length ) { |
if ( api && api.length ) { |
||
var regDate = api[0].getAttribute("registration"); |
var regDate = api[0].getAttribute("registration"); |
||
Linha 726: | Linha 704: | ||
} |
} |
||
break; |
break; |
||
} |
|||
} |
|||
} |
|||
} |
|||
}; |
}; |
||
Linha 750: | Linha 728: | ||
} |
} |
||
} |
} |
||
if ($.inArray(mw.config.get('wgNamespaceNumber'), [0, 102]) !== -1) { |
|||
fb.menu.innerHTML += " [<a onMouseOver='this.style.cursor=\"default\"'" + |
fb.menu.innerHTML += " [<a onMouseOver='this.style.cursor=\"default\"'" + |
||
" onClick='fb.open(fb.ESR)'>ESR</a>] [" + |
" onClick='fb.open(fb.ESR)'>ESR</a>] [" + |
||
Linha 776: | Linha 754: | ||
fb.api("afl"); |
fb.api("afl"); |
||
} |
} |
||
} else { |
|||
if ($.inArray(mw.config.get('wgNamespaceNumber'), [2, 10]) !== -1) { |
if ($.inArray(mw.config.get('wgNamespaceNumber'), [2, 10]) !== -1) { |
||
fb.menu.innerHTML += " [" + fb.link("subst:apagar", "PE", |
fb.menu.innerHTML += " [" + fb.link("subst:apagar", "PE", |
||
Linha 789: | Linha 767: | ||
" onClick='fb.open(fb.cat)'>CatScan</a>]"; |
" onClick='fb.open(fb.cat)'>CatScan</a>]"; |
||
} |
} |
||
} |
|||
} |
|||
if (mw.config.get('wgNamespaceNumber') === 3) { |
|||
fb.menu.innerHTML += " [<a onMouseOver='this.style.cursor=\"default\"'" + |
fb.menu.innerHTML += " [<a onMouseOver='this.style.cursor=\"default\"'" + |
||
" onClick='fb.open(fb.warn)'>aviso</a>]"; |
" onClick='fb.open(fb.warn)'>aviso</a>]"; |