« MediaWiki:Group-sysop.js » : différence entre les versions

Contenu supprimé Contenu ajouté
Adaptation du code d'User:Orlodrim pour étre compatible avec 1) ResourceLoader 2) Les outils de masqueur de modifications
m Coding style de MediaWiki
Ligne 44 :
}
 
/*/ Masquage de plusieurs révisions à la fois dans la liste des révisions supprimées d'une page. */
if ( mw.config.get(" 'wgCanonicalSpecialPageName"' ) == "'Undelete"' ) {
var hdrBC = $( '#bodyContent' );
if ( hdrBC.length == 0 ) {
hdrBC = $( '#article' );
}
if (hdrBC.length == 0) hdrBC = $('#mw_contentholder');
varif checkboxes =( hdrBC.find('input[typelength =checkbox]'= 0 ); {
if (hdrBC.length == 0) hdrBC = $( '#mw_contentholder' );
var firstCheckbox = checkboxes.filter(':first');
}
var pagecheckboxes = hdrBC.find( 'input[nametype=targetcheckbox]').attr('value' );
var firstCheckbox = checkboxes.filter( ':first' );
// Les masqueurs de modifications disposent d'une checkbox en plus, dans ce cas, prendre la suivante
if ( firstCheckbox.attr( 'name' ) == 'wpUnsuppress' ) {
firstCheckbox = checkboxes.filter( ':eq(1)' );
}
var hdrList = firstCheckbox.closest( 'ul' );
var hdrBt = $( '<input type="button" value="Afficher/masquer les versions sélectionnées" style="float:right">' );
hdrBt.click( function() {
var page = hdrBC.find('input[name=target]').attr('value');
var listpage = hdrListhdrBC.find( 'input:checked[name=target]' ).attr( 'value' );
var paramlist = listhdrList.mapfind(function() {'input:checked' );
var nameparam = $(this)list.attrmap( function('name'); {
ifvar (typeof(name) == "undefined"$( &&this name).substrattr(0, 2)'name' != "ts") return '';
if ( typeof( name ) == 'undefined' && name.substr( 0, 2 ) != 'ts' ) {
return '';
}
return '&ids[' + name.substr(2) + ']=1';
}).get().join( '' );
window.location = mw.config.get( 'wgScript' ) + "'?title="'
+ encodeURIComponent(" 'Spécial:Versions supprimées"' )
+ "&type=archive&target="+ encodeURIComponent( page ) + param;
});
hdrList.before( hdrBt );
}
} ) } );