MediaWiki:Gadget-fastbuttons.js e Ajuda:Página de testes/2: diferenças entre as páginas

(Diferenças entre páginas)
Página 1
Página 2
Conteúdo apagado Conteúdo adicionado
ThiagoRuiz (discussão | contribs)
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;
this.submenu.innerHTML = menu;
};
};


Linha 279: Linha 281:
*/
*/
fb.run = function (code, extraText) {
fb.run = function (code, extraText) {
var textBox = document.getElementById("wpTextbox1");
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) {
if (extraText) {
location.href = url + '&fbtxt=' + encodeURIComponent(extraText);
location.href = url + '&fbtxt=' + encodeURIComponent(extraText);
} else {
} else {
location.href = url;
location.href = url;
}
}
} else if (mw.config.get('wgAction') == "edit") {
} else if (mw.config.get('wgAction') == "edit") {
var value = textBox.value;
var value = textBox.value;
var summary = " (usando [[Wikipédia:FB|FastButtons]])";
var summary = " (usando [[Wikipédia:FB|FastButtons]])";
if ( value.match(/\{\{(?:ER|ESR2|Usuário\:Salebot\/Impróprio)\|/i) ) {
if ( value.match(/\{\{(?:ER|ESR2|Usuário\:Salebot\/Impróprio)\|/i) ) {
alert("Já existe uma predefinição de eliminação nesta página.");
alert("Já existe uma predefinição de eliminação nesta página.");
return false;
return false;
}
}
if (code.indexOf("ER") === 0) {
if (code.indexOf("ER") === 0) {
if (extraText) {
if (extraText) {
extraText = "|3=" + extraText + "}}\n\n";
extraText = "|3=" + extraText + "}}\n\n";
} else {
} else {
extraText = "}}\n\n";
extraText = "}}\n\n";
}
}
extraText = "{{" + code + "|2=~~" + "~~" + extraText;
extraText = "{" + "{" + code + "|2=~~" + "~~" + extraText;
textBox.value = extraText + value;
textBox.value = extraText + value;
if (this.salve) {
if (this.salve) {
document.editform.wpSummary.value = "Página proposta para" +
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") {
} 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 {
} else {
if (extraText) {
if (extraText) {
if (code.indexOf("|") > -1) {
if (code.indexOf("|") > -1) {
extraText = "|1=" + extraText + "}}";
extraText = "|1=" + extraText + "}}";
} else {
} else {
extraText = "|1=" + extraText + "}}";
extraText = "|1=" + extraText + "}}";
}
}
} else {
} else {
extraText = "}}";
extraText = "}}";
}
}
extraText = "{{" + code + extraText;
extraText = "{{" + code + extraText;
if (mw.config.get('wgNamespaceNumber') == 3) {
if (mw.config.get('wgNamespaceNumber') == 3) {
value += "\n\n" + extraText + " ~~" + "~~";
value += "\n\n" + extraText + " ~~" + "~~";
} else if (code == "mínimo" || code.indexOf("esboço") === 0) {
} else if (code == "mínimo" || code.indexOf("esboço") === 0) {
if (value.match(/\n\n\[\[/)) {
if (value.match(/\n\n\[\[/)) {
value = value.substring(0, value.search(/\n\n\[\[/)) + "\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 {
} else {
value += "\n\n" + extraText;
value += "\n\n" + extraText;
}
}
this.salve = (code == "mínimo") ?
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") {
} else if (code == "subst:VDA" || code == "subst:matrad") {
value = extraText;
value = extraText;
} else {
} else {
value = extraText + "\n\n" + value;
value = extraText + "\n\n" + value;
}
}
textBox.value = value;
textBox.value = value;
if (this.salve) {
if (this.salve) {
if (mw.config.get('wgNamespaceNumber') == 3) {
if (mw.config.get('wgNamespaceNumber') == 3) {
this.salve = "Adicionando aviso";
this.salve = 'Adicionando aviso';
} else {
} 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" +
" por votação|eliminação por votaçã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(),
var ajax = sajax_init_object(),
that = this;
that = this;
if (!ajax) {
if (!ajax) {
return;
return;
}
}
ajax.open('GET', url, true);
ajax.open('GET', url, true);
ajax.send('');
ajax.send('');
ajax.onreadystatechange = function () {
ajax.onreadystatechange = function () {
if (ajax.readyState == 4 && ajax.status == 200) {
if (ajax.readyState == 4 && ajax.status == 200) {
that.api(code, ajax.responseXML);
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) {
if (!api) {
url = mw.config.get('wgScriptPath') + "/api.php?format=xml&action=query&";
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);
this.ajax(code, url);
} else {
} else {
/** Processamento da resposta do API **/
/** Processamento da resposta do API **/
switch ( code ) {
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");
api = api.getElementsByTagName("cl");
if (api) {
if (api) {
var quality;
var quality;
for (i = 0; i < api.length; i++) {
for (i = 0; i < api.length; i++) {
if (!api[i]){
if (!api[i]){
continue;
continue;
}
}
quality = api[i].getAttribute("title");
quality = api[i].getAttribute("title");
if (quality.indexOf("!Artigos de qualidade") > -1) {
if (quality.indexOf("!Artigos de qualidade") > -1) {
quality = quality.substr(32, 1);
quality = quality.substr(32, 1);
if (quality == "d") {
if (quality == "d") {
quality = "?";
quality = "?";
}
}
this.submenu.innerHTML += "<span title='Qualidade do artigo'> Q-<b>" +
this.submenu.innerHTML += "<span title='Qualidade do artigo'> Q-<b>" +
quality + "</b></span>";
quality + "</b></span>";
break;
break;
}
}
}
}
} else {
} else {
return;
return;
}
}
break;
break;
case 'esb':
case 'esb':
// Esboço temático
// Esboço temático
api = api.getElementsByTagName("p");
api = api.getElementsByTagName("p");
if (api && api.length) {
if (api && api.length) {
api = api[0].getAttribute("title")
api = api[0].getAttribute("title")
.replace(/Predefinição:Esboço-/gi, "");
.replace(/Predefinição:Esboço-/gi, "");
} else {
} else {
return;
return;
}
}
if ((esb.setSelectionRange
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;
var start = esb.value.length;
esb.value = api;
esb.value = api;
esbText2 = api;
esbText2 = api;
if (esb.setSelectionRange) {
if (esb.setSelectionRange) {
esb.setSelectionRange(start, api.length);
esb.setSelectionRange(start, api.length);
} else if (esb.createTextRange) {
} else if (esb.createTextRange) {
var sel = esb.createTextRange();
var sel = esb.createTextRange();
sel.move("character", start);
sel.move("character", start);
sel.moveEnd("character", api.length - start);
sel.moveEnd("character", api.length - start);
sel.select();
sel.select();
} else {
} else {
esb.selectionStart = start;
esb.selectionStart = start;
esb.selectionEnd = api.length;
esb.selectionEnd = api.length;
}
}
}
}
break;
break;
case 'PV':
case 'PV':
// Páginas vigiadas
// Páginas vigiadas
api = api.getElementsByTagName("item");
api = api.getElementsByTagName("item");
for (i = 0; i < api.length && i < 10; i++) {
for (i = 0; i < api.length && i < 10; i++) {
if (!api[i]){
if (!api[i]){
continue;
continue;
}
}
title = api[i].getAttribute("title");
title = api[i].getAttribute("title");
charnum += title.length;
charnum += title.length;
if (charnum > 180) {
if (charnum > 180) {
break;
break;
}
}
length = (api[i].getAttribute("newlen")
length = (api[i].getAttribute("newlen")
- api[i].getAttribute("oldlen"));
- api[i].getAttribute("oldlen"));
if (length > 0) {
if (length > 0) {
length = "+" + length;
length = "+" + length;
}
}
comment = api[i].getAttribute("comment").replace("/*", "?");
comment = api[i].getAttribute("comment").replace("/*", "?");
if (comment) {
if (comment) {
comment = "(" + comment.replace("*/", ":") + ")";
comment = "(" + comment.replace("*/", ":") + ")";
}
}
comment = comment.replace("[[Ajuda:Guia de edição/Menus e" +
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 ) +
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;
this.submenu.innerHTML = pages;
break;
break;
case 'PN':
case 'PN':
// Páginas novas
// Páginas novas
api = api.getElementsByTagName("rc");
api = api.getElementsByTagName("rc");
for (i = 0; i < api.length && i < 10; i++) {
for (i = 0; i < api.length && i < 10; i++) {
if (!api[i]){
if (!api[i]){
continue;
continue;
}
}
title = api[i].getAttribute("title");
title = api[i].getAttribute("title");
charnum += title.length;
charnum += title.length;
if (charnum > 180) {
if (charnum > 180) {
break;
break;
}
}
length = "+" + api[i].getAttribute("newlen");
length = "+" + api[i].getAttribute("newlen");
comment = api[i].getAttribute("comment");
comment = api[i].getAttribute("comment");
if (comment) {
if (comment) {
comment = "(" + comment.replace("[[Ajuda:SEA|?]] ", "") + ")";
comment = "(" + comment.replace("[[Ajuda:SEA|?]] ", "") + ")";
}
}
if ( i > 0){
if ( i > 0){
pages += ' | ';
pages += ' | ';
}
}
pages += "<a href=\"" + mw.util.wikiGetlink( title )
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;
this.submenu.innerHTML = pages;
break;
break;
case 'MR':
case 'MR':
// Mudanças recentes
// Mudanças recentes
api = api.getElementsByTagName("rc");
api = api.getElementsByTagName("rc");
for (i = 0; i < api.length && i < 10; i++) {
for (i = 0; i < api.length && i < 10; i++) {
if (!api[i]){
if (!api[i]){
continue;
continue;
}
}
title = api[i].getAttribute("title");
title = api[i].getAttribute("title");
charnum += title.length;
charnum += title.length;
if (charnum > 180) {
if (charnum > 180) {
break;
break;
}
}
length = (api[i].getAttribute("newlen")
length = (api[i].getAttribute("newlen")
- api[i].getAttribute("oldlen"));
- api[i].getAttribute("oldlen"));
if (length > 0) {
if (length > 0) {
length = "+" + length;
length = "+" + length;
}
}
comment = api[i].getAttribute("comment").replace("/*", "?");
comment = api[i].getAttribute("comment").replace("/*", "?");
if (comment) {
if (comment) {
comment = "(" + comment.replace("*/", ":") + ")";
comment = "(" + comment.replace("*/", ":") + ")";
}
}
if ( i > 0){
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;
this.submenu.innerHTML = pages;
break;
break;
case 'usu':
case 'usu':
// Informações do(a) usuário(a)
// Informações do(a) usuário(a)
api = api.getElementsByTagName("u");
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) {
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 {
} 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) {
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>]";