MediaWiki:Gadget-wikibugs.js e Ajuda:Página de testes/1: diferenças entre as páginas
Aspeto
(Diferenças entre páginas)
Conteúdo apagado Conteúdo adicionado
Manutenção: jQuery.trim está obsoleta; deve ser utilizado String.prototype.trim |
m MediaWiki:Gadget-wikibugs.js: Redução do código que é carregado por padrão para todos os editores (o restante só é usado pelos que clicarem no link para informar um erro - não tem porque ser enviado para todo mundo) |
||
Linha 17: | Linha 17: | ||
*/ |
*/ |
||
getRefinedPageName: function( title ) { |
getRefinedPageName: function( title ) { |
||
return ( title || mw.config.get( 'wgPageName' ) ).replace( /_/g, ' ' ) |
return $.trim( ( title || mw.config.get( 'wgPageName' ) ).replace( /_/g, ' ' ) ); |
||
}, |
}, |
||
Linha 28: | Linha 28: | ||
onClick = function( event ) { |
onClick = function( event ) { |
||
event.preventDefault(); |
event.preventDefault(); |
||
mw.loader.using([ 'mediawiki.user', 'jquery.ui', 'mediawiki.api' ], function(){ |
mw.loader.using([ 'mediawiki.user', 'jquery.ui.dialog', 'mediawiki.api' ], function(){ |
||
if( wb.open ){ |
if( wb.open ){ |
||
wb.open( wb[ $(event.target).data( 'wikibugs-message-name') ] ); |
wb.open( wb[ $(event.target).data( 'wikibugs-message-name') ] ); |
||
} else { |
} else { |
||
$.getScript( mw.config.get('wgServer') + mw.util.wikiScript() + '?title=MediaWiki:Gadget-wikibugs.js/Core.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' ) |
|||
mw.loader.using( 'ext.gadget.wikibugsCore', function(){ |
|||
.done(function(){ |
|||
wb.open( wb[ $(event.target).data( 'wikibugs-message-name') ] ); |
wb.open( wb[ $(event.target).data( 'wikibugs-message-name') ] ); |
||
}); |
}); |
||
Linha 68: | Linha 69: | ||
.click( onClick ); |
.click( onClick ); |
||
if( mw.config.get('wgPageName') === ' |
if( mw.config.get('wgPageName') === 'Wikipédia:Informe_um_erro' ){ |
||
// Link on the report-an-error page itself |
// Link on the report-an-error page itself |
||
$( '#report-bug-link a, #ca-addsection a' ) |
$( '#report-bug-link a, #ca-addsection a' ) |