« MediaWiki:Common.js » : différence entre les versions
(Précision sélecteur) |
(Fond plus clair) |
||
Ligne 32 : | Ligne 32 : | ||
/* Add heading image (see Gestion:Tâches/Liste/564) */ | /* Add heading image (see Gestion:Tâches/Liste/564) */ | ||
img = $(".mw-capiunto-infobox-spanning").find("img").first().attr("src"); | img = $(".mw-capiunto-infobox-spanning").find("img").first().attr("src"); | ||
if(img) { $("#firstHeading-wrapper").css("background-image", "linear-gradient(0deg, black 0%, # | if(img) { $("#firstHeading-wrapper").css("background-image", "linear-gradient(0deg, black 0%, #00000032 30%), url(" + img + ")"); } |
Version du 30 mars 2022 à 00:33
/* Tout JavaScript ici sera chargé avec chaque page accédée par n’importe quel utilisateur. */
mw.loader.load( '/index.php?title=MediaWiki:Welcome-modal-dialog.js&action=raw&ctype=text/javascript' );
// Mermaid does not seem to load in talk namespaces. This script forces it.
if(mw.config.get('wgNamespaceNumber') % 2 && $('.ext-mermaid').length)
{
setTimeout(function() {
var config = mw.config.get( 'mermaid' );
mw.loader.using( [ 'mediawiki.api', 'ext.mermaid', 'ext.mermaid.theme.' + config.theme ] );
}, 3000);
}
/* Menu de gauche collapsible et en tête (Gestion:Tâches/Liste/221/13) */
$('#p-tb-label').addClass("not-collapsed");
$('#p-tb-label').siblings('.body').toggleClass( "collapsed" );
$('#p-tb-label').click(function(event) {
console.log(event);
$(event.target).siblings('.body').toggleClass( "collapsed" );
$(event.target).toggleClass( "not-collapsed" );
/* Prise en compte des iframe (e.g. fil de discussion) */
/*
if ($(event.target).parent().parent().nextUntil('h2').find("iframe").css( "height") == '0px'){
$(event.target).parent().parent().nextUntil('h2').find("iframe").css( "height", "");
}¸
*/
});
$('.collapse').click(); // Collaspe all by default.
/* Add heading image (see Gestion:Tâches/Liste/564) */
img = $(".mw-capiunto-infobox-spanning").find("img").first().attr("src");
if(img) { $("#firstHeading-wrapper").css("background-image", "linear-gradient(0deg, black 0%, #00000032 30%), url(" + img + ")"); }