« MediaWiki:Common.js » : différence entre les versions

De decaf-fr
Page créée avec « Tout JavaScript présent ici sera exécuté par tous les utilisateurs à chaque chargement de page. : $( function() { var iwlinks = jQuery( 'div.interProject' ); if ( iwlinks.length > 0 ) { var pproject = jQuery( '#p-tb' ).clone().attr( 'id', 'p-project' ).insertAfter( '#p-tb' ); pproject.find( 'h3' ).attr( 'id', 'p-project-label' ).text( 'On other projects' ); pproject.find( 'ul' ).addClass( 'interProject' ).empty().append( iw... »
 
(Aucune différence)

Dernière version du 15 janvier 2024 à 15:02

/* Tout JavaScript présent ici sera exécuté par tous les utilisateurs à chaque chargement de page. */
$( function() {
    var iwlinks = jQuery( 'div.interProject' );
    if ( iwlinks.length > 0 ) {
        var pproject = jQuery( '#p-tb' ).clone().attr( 'id', 'p-project' ).insertAfter( '#p-tb' );
        pproject.find( 'h3' ).attr( 'id', 'p-project-label' ).text( 'On other projects' );
        pproject.find( 'ul' ).addClass( 'interProject' ).empty().append( iwlinks );
        iwlinks.replaceWith( function() {
            return $( '<li></li>' ).addClass( $(this).attr( 'class' ) ).append( $(this).contents() );
        });
    }
});