« MediaWiki:Common.js » : différence entre les versions
Apparence
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| Ligne 34 : | Ligne 34 : | ||
// L'onglet n'apparaît que si la page possède un parent | // L'onglet n'apparaît que si la page possède un parent | ||
if ( slashPosition > 0 ) { | //if ( slashPosition > 0 ) { | ||
var parentPage = pageName.substring( 0, slashPosition ); | var parentPage = pageName.substring( 0, slashPosition ); | ||
| Ligne 46 : | Ligne 46 : | ||
'#ca-history' | '#ca-history' | ||
); | ); | ||
} | //} | ||
} ); | } ); | ||
Version du 2 juillet 2026 à 23:49
/* Tout JavaScript présent ici sera exécuté par tous les utilisateurs à chaque chargement de page.
$(function () {
$('a.mw-wiki-logo, a.mw-logo')
.attr('href', 'https://aecfc.org')
.attr('title', 'Retour au site d'AECFC');
});
*/
(function () {
'use strict';
function restoreAecfcLink() {
document.querySelectorAll('a.mw-logo').forEach(function (link) {
link.href = 'https://aecfc.org/';
link.title = 'Site de l’AECFC';
});
}
if (document.readyState === 'loading') {
document.addEventListener(
'DOMContentLoaded',
restoreAecfcLink,
{ once: true }
);
} else {
restoreAecfcLink();
}
})();
mw.loader.using( 'mediawiki.util' ).then( function () {
var pageName = mw.config.get( 'wgPageName' );
var slashPosition = pageName.lastIndexOf( '/' );
// L'onglet n'apparaît que si la page possède un parent
//if ( slashPosition > 0 ) {
var parentPage = pageName.substring( 0, slashPosition );
mw.util.addPortletLink(
'p-views',
mw.util.getUrl( parentPage ),
'Page parente',
'ca-parent-page',
'Revenir à la page parente',
null,
'#ca-history'
);
//}
} );