743
modifications
Modifications
Sauter à la navigation
Sauter à la recherche
/* global mw, $ */
/* jshint strict:false, browser:true */
mw.loader.using/**********************************************************************************************************//* Fonctions générales MediaWiki ( ['mediawikipallient les limitations du logiciel) *//* Surveiller : https://git.user', 'mediawikiwikimedia.util', 'org/history/mediawiki%2Fcore.notify'] )git/HEAD/skins%2Fcommon%2Fwikibits.done( function () {js *//* Begin of mw.loader.using callback *********************************************************************************************************/
if ( mwwindow.config.get( 'wgPageName' ) obtenir === 'Main_Page' || mw.config.getfunction ( 'wgPageName' ) === 'Talk:Main_Page' name ) { $( function () { mw.util.addPortletLinkimportScript( 'pMediaWiki:Gadget-lang', + name + '//meta.wikimedia.org/wiki/List_of_Wikipedias', 'Complete list', 'interwiki-completelist', 'Complete list of Wikipediasjs' ); } );}
if function TransformeEnDiscussion( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgNamespaceNumber' ) === 2 $ ) { var titleParts = mw.config.getif ( 'wgPageName' ).split( '/' ); /* Make sure there was a part before and after the slash and that the latter is 'skin.js' or 'skin.css' */ if ^Wikipédia:( titleParts.length == 2 Le_Bistro|Bulletin_des_administrateurs|Questions_techniques) { var userSkinPage = titleParts/.shifttest() + '/' + mw.config.get( 'skinwgPageName' );) || if $( titleParts.slice( -1 '#transformeEnPageDeDiscussion' ) == 'skin.js' length ) { window.location.href = mw.util.getUrl $( userSkinPage + '.jsbody' ); } else if ( titleParts.sliceremoveClass( 'ns-1 ) == 'skin.csssubject' ) { window.location.href = mw.util.getUrladdClass( userSkinPage + '.cssns-talk' ); }
var extraCSS = mw.util.getParamValue( 'withCSS' ),
extraJS = mw.util.getParamValue( 'withJS' );
if function sousTitreH1( extraCSS $content ) { if $( extraCSS.match( /^MediaWiki:[^&<'#firstHeading >=%#]*\sous_titre_h1' ).css$/ remove() ) {; mw.loader var $span = $content.loadfind( '/w/index.php?title=' + extraCSS + '&action=raw&ctype=text/css', 'text/css#sous_titre_h1' ); } else if ( $span.length ) { mw$span.notifyprepend( 'Only pages from the MediaWiki namespace are allowed.', { title: ); $( 'Invalid withCSS value#firstHeading' } ).append( $span );
if ( extraJS ) {
if ( extraJS.match( /^MediaWiki:[^&<>=%#]*\.js$/ ) ) {
mw.loader.load( '/w/index.php?title=' + extraJS + '&action=raw&ctype=text/javascript' );
} else {
mw.notify( 'Only pages from the MediaWiki namespace are allowed.', { title: 'Invalid withJS value' } );
}
}
function makeCollapsibleMwCollapsible( $content ) {
var $tables = $content
.find( 'table.collapsible:not(.mw-collapsible)' )
.addClass( 'mw-collapsible' );
// because of colored backgrounds, style the link in the text color // to ensure accessible contrast } ); $toggle = $element( Links ).find( 'a' ).mw-collapsible-toggle' each( function ( _, thisToggleLink );{ if ( $togglethisToggleLink.id === Link.length id) { // Make the toggle inherit text color if( $togglethisToggleLink.parent()[0]parentNode.style.color ) display = "none"; } else { $toggle thisToggleLink.parentNode.find( 'a' )style.css( 'color', 'inherit' )display = ""; }
function rewritePageH1bis() { var collapseCaption helpPage = document.getElementById("helpPage"); if (helpPage) { var h1 = document.getElementById('hidefirstHeading');var expandCaption if (h1) { h1.innerHTML += '<span id= "h1-helpPage">' + helpPage.innerHTML + 'show</span>'; } }}$( rewritePageH1bis );
lang = mw.user.options.get( 'language' ); $content.find( 'a.image' ).attr( 'href', function ( i, currVal ) { if ( $( this ).find( 'img' ).attr( 'src' ).indexOf( uploadBase ) === 0 ) { if ( localBasePath.test( currVal ) ) { return currVal.replace( localBasePath, commonsBasePath ) + '?uselang=' + lang; } else if ( !navFrame || !navToggle localBaseScript.test( currVal ) ) { return currVal.replace( localBaseScript, commonsBaseScript ) + '&uselang=' + lang; } else { return currVal; } } } ); return false} ); } );}
/** * Ajout d'un lien « ajouter une section » en bas de page */ If shown now if ( navTogglemw.firstChildconfig.data get( 'wgAction' ) === navigationBarHide 'view' ) { $( function( $ ) { for var $newSectionLink = $( navChild = navFrame'#ca-addsection' ).firstChildfind( 'a' ); navChild !== null; navChild = navChild if ( $newSectionLink.nextSibling length ) { if ( $( navChild '#mw-content-text' ).hasClassappend( '<div style="text-align:right; font-size:0.9em; margin:1em 0 -0.5em">' + 'NavContent<a href="' ) || + $( navChild )newSectionLink.hasClassattr( 'NavPichref' ) ) {+ '" title="Commencer une nouvelle section">Ajouter un sujet</a>' navChild.style.display = + 'none</div>'; });
navToggle.firstChild.data = navigationBarShow } );}
/** * Repositionnement de la page sur l'ancre avec laquelle elle a été appelée * après le repli des boîtes déroulantes, entre autres. */ If hidden now } else if ( navTogglewindow.firstChildlocation.data === navigationBarShow hash ) { $( function ( $ ) { for setTimeout( function ( navChild = navFrame.firstChild; navChild !== null; navChild = navChild.nextSibling ) { if var currentTarget = document.getElementById( $decodeURIComponent( navChild )window.location.hash.hasClasssubstring( 'NavContent' 1 ) ) || $( navChild ).hasClass; if ( 'NavPic' ) currentTarget ) { navChildcurrentTarget.style.display = 'block'scrollIntoView();
event// ESPACE DE NOM 'SPECIAL'if ( mw.preventDefaultconfig.get('wgNamespaceNumber' );}=== -1 ) {
function createNavigationBarToggleButtonif ( $content ) { var i, j, navChild, navToggle, navToggleText, isCollapsed, indexNavigationBar = 0; // Iterate over all < div >-elements var $divs = $contentmw.config.findget( 'div.NavFrame:not(.mw-collapsible)wgCanonicalSpecialPageName' ); $divs.each( function ( i, navFrame ) { indexNavigationBar++; navToggle = document.createElement( == 'aWhatlinkshere' );{ navToggle mw.className = 'NavToggle'; navToggleloader.setAttributeusing( 'idmediawiki.Uri', 'NavToggle' + indexNavigationBar ); navToggle.setAttributefunction ( 'href', '#' );{ $( navToggle ).onfunction ( 'click', $.proxy( toggleNavigationBar, null, indexNavigationBar ) );{
isCollapsed var query = $( navFrame )new mw.hasClassUri( 'collapsed' null, { overrideKeys: true } ) ).query; /** * Check if any children are already hidden. This loop is here for backwards compatibility: * the old way of making NavFrames start out collapsed was to manually add style var append ="display:none" * to all the NavPic/NavContent elements. Since this was bad for accessibility (no way to make * the content visible without JavaScript support), the new recommended way is to add the class * "collapsed" to the NavFrame itself, just like with collapsible tablesquery. */ for ( navChild = navFrame.firstChild; navChild !== null namespace ? '&& !isCollapsed; navChild namespace= navChild.nextSibling ) { if ( $' + encodeURIComponent( navChild )query.hasClass( 'NavPic' namespace ) || $( navChild ).hasClass( : 'NavContent' ) ) { if + ( navChildquery.style.display === invert ? 'none' ) { isCollapsed &invert= true; } } } if ( isCollapsed ) { for ( navChild = navFrame.firstChild; navChild !== null; navChild = navChild.nextSibling ) { if ( $( navChild ).hasClass( 'NavPic' ) || $+ encodeURIComponent( navChild )query.hasClass( 'NavContent' invert ) ) { navChild.style.display = : 'none'; } } } navToggleText = document.createTextNode( isCollapsed ? navigationBarShow : navigationBarHide ); navToggle.appendChild( navToggleText );
// Find the NavHead and attach the toggle link if (Must be this complicated because Mozappend !== ''s firstChild handling is borked) for ( j = 0; j < navFrame.childNodes.length; j++ ) { if ( $( navFrame.childNodes[j] '#whatlinkshere-customfilters' ).hasClassfind( 'NavHeada' ) .each( function () { navToggle this.style.color href += navFrame.childNodes[j].style.colorappend; navFrame.childNodes[j].appendChild( navToggle } );
function addEditIntroif ( name ) { $mw.config.get( '.mw-editsection, #ca-editwgCanonicalSpecialPageName' ).find( === 'aEditTags' ).each( function ( i, el ) { el importScript( 'MediaWiki:Common.href = $( this )js/EditTags.attr( 'href' ) + '&editintro=js' + name; } );
$( // Personnalisation des liens dans les pages d'aide selon un paramètre de l'URL.// Utilisé par [[Aide:Comment créer un article/publier]].function ReplaceSourcePageInLinks() { var cats match = mwwindow.configlocation.getsearch.match( /[?&]sourcepage=('wgCategories'[^&]*)/ ); if ( !cats match ) { return; } if var page = decodeURIComponent( match[1] ); $.inArray( 'Living people.sourcepage-subst a', cats ) !== -1 || $.inArrayeach( function() { if ( /^(https?:)?\/\/[^/]+\.wikipedia\.org\//.test( 'Possibly living people', cats this.href ) !== -1 ) { addEditIntrothis.href = this.href.replace( 'Template:BLP_editintroTITRE-A-REMPLACER' , encodeURIComponent( page ) );
/* Actions specific to the edit page */if ( mw.config.get( 'wgActionwgPageName' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submitAide:Comment_créer_un_article/publier' ) { /** * Fix edit summary prompt for undo * * Fixes the fact that the undo function combined with the "no edit summary prompter" * complains about missing editsummary, if leaving the edit summary unchanged. * Added by [[User:Deskana]], code by [[User:Tra]]. * See also [[phab:T10912]]. */ $(function () { if (document.location.search.indexOf('undo=') !== -1 && document.getElementsByName('wpAutoSummary')[0]) { document.getElementsByName('wpAutoSummary')[0].value = '1'; } }ReplaceSourcePageInLinks );
/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */
aucun résumé de modification
/* jshint scripturl:true, laxbreak:true, loopfunc:true */
/* global mw, $, importScript */
/**
* Keep code in MediaWiki:Common.js to a minimum as it is unconditionally * loaded for all users on every wiki N'importe quel JavaScript ici sera chargé pour n'importe quel utilisateur et pour chaque pageaccédée. If possible create a gadget that is * enabled by default instead of adding it here (since gadgets are fully * optimized ResourceLoader modules with possibility to add dependencies etc.)
*
* Since CommonATTENTION : Avant de modifier cette page, veuillez tester vos changements avec votre propre * vector.js isn. Une erreur sur cette page peut faire bugger le site entier (et gêner l't a gadgetensemble des * visiteurs), there is no place to declare itsmême plusieurs heures après la modification ! * dependencies, so we have to lazy load them with mw.loader.using on demand and * then execute the rest in the callback. In most cases these dependencies willPrière de ranger les nouvelles fonctions dans les sections adaptées : * - Fonctions JavaScript * be loaded (or loading) already and the callback will not be delayed. In case a- Fonctions spécifiques pour MediaWiki * dependency hasn- Applications spécifiques à la fenêtre d't arrived yet it'll make sure those are loaded before thisédition * - Applications qui peuvent être utilisées sur toute page * - Applications spécifiques à un espace de nom ou une page * * Note : une ré-écriture de cette page en utilisant jQuery a été commencée sur [[Projet:JavaScript/Refonte Common.js avec jQuery]]. * * <nowiki> /!\ Ne pas retirer cette balise
*/
/**
* Main Page layout fixes * * Description: Adds an additional link to the complete list of languages available. * Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]Projet JavaScript
*/
/**
* Redirect User:Name/skin.js and skin.css to the current skin's Transformer les pages * (unless the 'skin' du Bistro, du BA et les pages spécifiées en page really exists) * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js * @rev: 2de discussion
*/
}
}
$( TransformeEnDiscussion );
/**
* Map addPortletLink to mw.util * @deprecated: Use mw.util.addPortletLink instead.Ajouter un bouton à la fin de la barre d'outils
*/
if ( typeof addCustomButton === 'undefined' ) { window.addCustomButton = function ( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId ) { mw.loghook( 'wikipage.deprecateeditform' ).add( function () { mw.loader.using( window'ext.gadget.MonobookToolbar', function () { if ( typeof imageFile === 'addPortletLinkobject') { MonobookToolbar.fonctions.CreateButton( imageFile.imageFile, imageFile.speedTip, mw imageFile.tagOpen, imageFile.utiltagClose, imageFile.addPortletLinksampleText, 'Use mw imageFile.imageId ); } else { MonobookToolbar.utilfonctions.addPortletLink instead' CreateButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId ); } } ); } ); };} /****************************************//* Applications pour l'ensemble du site *//****************************************/
/**
* Extract a URL parameter from the current URLTout ce qui concerne la page d'édition * @deprecatedVoir MediaWiki: Use mwGadget-CommonEdit.util.getParamValue with proper escapingjs pour ces fonctions
*/
if ( { edit: 1, submit: 1 }[ mw.logconfig.deprecateget( 'wgAction' ) ] ) { mw.loader.load( 'ext.gadget.CommonEdit' ); // pour que les fonctions soient définies dès maintenant, // mais l'exécution réelle ne se fait qu'une fois la dépendance chargée window.addSpecialCharset = function ( title, chars ) { mw.loader.using( 'getURLParamValueext.gadget.CommonEdit', function () { window.realAddSpecialCharset( title, chars ); } ); }; window.addSpecialCharsetHTML = function ( title, charsHTML ) { mw.utilloader.getParamValue, using( 'Use mwext.utilgadget.getParamValue insteadCommonEdit' , function () { window.realAddSpecialCharsetHTML( title, charsHTML ); } ); }; } else { // pour que les fonctions soient toujours définies, // ce qui peut éviter aux scripts utilisateur de planter window.addSpecialCharset = function () {}; window.addSpecialCharsetHTML = function (){};}
/**
* Test if an element has a certain classRéécriture des titres * @deprecated * Fonction utilisée par [[Modèle: Titre incorrect]] * * La fonction cherche un bandeau de la forme Use $(element).hasClass() instead.* <div id="RealTitleBanner"> * <span id="RealTitle">titre</span> * </div> * * Un élément comportant id="DisableRealTitle" désactive la fonction
*/
function rewritePageTitle( $ ) { var $realTitle, titleText, $h1, $realTitleBanner = $( '#RealTitleBanner' ); if ( $realTitleBanner.length && !$( '#DisableRealTitle' ).length ) { $realTitle = $( '#RealTitle' ); $h1 = $( 'h1:first' ); if ( $realTitle.length && $h1.length ) { titleText = $realTitle.html(); if ( titleText === '' ) { $h1.hide(); } else { $h1.html( titleText ); if ( mw.logconfig.deprecateget( window, 'hasClasswgAction' ) === 'view', function && $realTitle.children( element, className ).length === 0 ) { return document.title = $realTitle.text( element )+ " — Wikipédia"; } } $realTitleBanner.hasClasshide( className );} $( '<p>' ).css( 'font-size', '80%' ) .append( 'Titre à utiliser pour créer un lien interne : ', $( 'Use jQuery<b>' ).hasClasstext(mw.config.get( 'wgPageName' ) instead.replace( /_/g, ' ' ) ) ) .insertAfter( $h1 ); } }}$( rewritePageTitle );
/**
* @source www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URLAjout d'un sous-titre * * Fonction utilisée par [[Modèle:Sous-titre]] * * La fonction cherche un élément de la forme * @rev 6<span id="sous_titre_h1">Sous-titre</span>
*/
}
}
mw.hook( 'wikipage.content' ).add( sousTitreH1 );
/**
* WikiMiniAtlasBoîtes déroulantes
*
* Description: WikiMiniAtlas is a popup click and drag world map. * This script causes all of our coordinate links to display the WikiMiniAtlas popup button. * The script itself is located on meta because it is used by many projects. * See Pour [[MetaModèle:WikiMiniAtlasMéta palette de navigation]] for more information. * Note - use of this service is recommended to be repalced with mw:Help:Extension:Kartographer
*/
var Palette_Derouler = '[afficher]';var Palette_Enrouler = '[masquer]'; var Palette_max = 1; function Palette_toggle( $table ) { $table.find( 'tr:not( :first)' ).toggleClass( 'navboxHidden' );} function Palette($content ) { var require_wikiminiatlas $tables = false$content.find( 'table.collapsible' ); var coord_filter groups = /geohack/{}; $tables.each( function (_, table ) { $( 'avar group = table.externaldataset.textautocollapseGroup || '__default__' ; groups[group] = ( groups[group] || 0 ) + 1; } ); $tables.each( function( key_, link table ) { if var $table = $( linktable ); var group = table.dataset.href autocollapseGroup || '__default__'; var autoCollapse = groups[group] > Palette_max; var collapsed = $table.hasClass( 'collapsed' ) || ( autoCollapse && coord_filter$table.exechasClass( link.href 'autocollapse' ) ) {; require_wikiminiatlas = true; // break from loop return false; }le modèle dispose d'une classe "navbox-title", } // sauf que les palettes "inlinées" (e.g. « {| class="navbox collapsible collapsed" »);n'ont pas cette classe if $table.find( 'tr:first th:first' ).prepend( $( 'div<span class="navboxToggle">\u00a0</span>' ).kmldataappend( $( ' <a href="javascript:">' + (collapsed ? Palette_Derouler : Palette_Enrouler) + '</a>' ).click( function ( e ) { e.preventDefault(); if ( this.length textContent === Palette_Enrouler ) { require_wikiminiatlas this.textContent = Palette_Derouler; } else { this.textContent = truePalette_Enrouler; } Palette_toggle( $table ); } ) ) }); if ( require_wikiminiatlas collapsed ) { mw.loader.loadPalette_toggle( '//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript' $table );
}
} );
// permet de dérouler/enrouler les palettes en cliquant n'importe où sur l'entête // (utilisation de la classe "navbox-title", comme ça seules les vraies palettes utilisant le modèle sont ciblées) $content.find( '.navbox-title' ) .click( function ( e ) { if ( $( e.target ).closest( 'a' ).length ) { return; } $( this ).find( '.navboxToggle a' ).click(); } ) .css( 'cursor', 'pointer' );}mw.hook( 'wikipage.content' ).add(Palette );
/**
* Collapsible tables; reimplemented with mw-collapsibe * Styling is also in place to avoid FOUC * * Allows tables to be collapsed, showing only the header. See Pour [[HelpModèle:CollapsingBoîte déroulante]]. * @version 3.0.0 (2018-05-20) * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js * @author [[User:R. Koot]] * @author [[User:Krinkle]] * @author [[User:TheDJ]] * @deprecated Since MediaWiki 1.20: Use class="mw-collapsible" instead which * is supported in MediaWiki core. Shimmable since MediaWiki 1.32
*/
var BoiteDeroulante_Derouler = '[afficher]';var BoiteDeroulante_Enrouler = '[masquer]'; function BoiteDeroulante_toggle(NavToggle){ var NavFrame = NavToggle.parentNode; var caption = []; caption[0] = NavFrame.dataset.boiteDeroulanteDerouler; caption[1] = NavFrame.dataset.boiteDeroulanteEnrouler; var $NavContent = $(NavFrame).eachfind('.NavContent').first( $tables, function); if ( index, table NavToggle.textContent === caption[1] ) { // mwNavToggle.logtextContent = caption[0]; $NavContent.warnhide( 'This page is using the deprecated class collapsible); } else { NavToggle. Please replace it with mw-collapsibletextContent = caption[1]; $NavContent.'show(); if }} function BoiteDeroulante( $( table content ){ $content.hasClassfind( 'collapsed.NavFrame') .each( function ( _, NavFrame ) { $ var CustomTexts, Derouler, Enrouler, NavToggle; if ( table )NavFrame.title && NavFrame.title.addClassindexOf( 'mw"/") !== -collapsed' 1);{ // mwCustomTexts = NavFrame.logtitle.warnsplit( 'This page is using the deprecated class collapsed. Please replace it with mw-collapsed.'"/"); Derouler = CustomTexts[0]; Enrouler = CustomTexts[1]; } else { Derouler = BoiteDeroulante_Derouler; Enrouler = BoiteDeroulante_Enrouler;
}
NavFrame.title = '';
NavFrame.dataset.boiteDeroulanteDerouler = Derouler;
NavFrame.dataset.boiteDeroulanteEnrouler = Enrouler;
NavToggle = document.createElement("a");
NavToggle.className = 'NavToggle';
NavToggle.href = 'javascript:';
NavToggle.onclick = function (e) {
e.preventDefault();
BoiteDeroulante_toggle(e.target);
};
NavToggle.textContent = Enrouler;
NavFrame.insertBefore(NavToggle, NavFrame.firstChild);
BoiteDeroulante_toggle(NavToggle);
} );
// permet de dérouler/enrouler les boîtes en cliquant n'importe où sur l'entête $content.find( '.NavHead' ) .click( function ( e ) { if( $tables( e.target ).closest( 'a' ).length > ) { return; } var toggle = $( this ).siblings( 'a.NavToggle' )[0 ]; if ( toggle ) { toggle.click(); // pas du jquery, mais du vanilla js } } ) .css( 'cursor', 'pointer' );} mw.loaderhook( 'wikipage.content' ).add( BoiteDeroulante ); /** * Fonctionnement du [[Modèle:Animation]] * Le JavaScript principal se situe dans [[MediaWiki:Gadget-Diaporama.js]] */mw.usinghook( 'jquerywikipage.makeCollapsiblecontent' ).thenadd( function($content ) { if ( $tablescontent.find( '.diaporama' ).length ) { mw.loader.makeCollapsibleusing('ext.gadget.Diaporama', function () { Diaporama_Init( $content );
} );
}
} );
/**
* Permet d'afficher les catégories cachées pour les contributeurs enregistrés, en ajoutant un (+) à la manière des boîtes déroulantes
*/
function hiddencat( $ ) {
if (mw.util.getParamValue('printable') === 'yes') {
return;
}
var cl = document.getElementById('catlinks');
if (!cl) {
return;
}
var $hc = $('#mw-hidden-catlinks');
if ( !$hc.length ) {
return;
}
if ( $hc.hasClass('mw-hidden-cats-user-shown') ) {
return;
}
if ( $hc.hasClass('mw-hidden-cats-ns-shown') ) {
$hc.addClass('mw-hidden-cats-hidden');
}
var nc = document.getElementById('mw-normal-catlinks');
if ( !nc ) {
var catline = document.createElement('div');
catline.id = 'mw-normal-catlinks';
var a = document.createElement('a');
a.href = '/wiki/Catégorie:Accueil';
a.title = 'Catégorie:Accueil';
a.appendChild(document.createTextNode('Catégories'));
catline.appendChild(a);
catline.appendChild(document.createTextNode(' : '));
nc = cl.insertBefore(catline, cl.firstChild);
}
var lnk = document.createElement('a');
lnk.id = 'mw-hidden-cats-link';
lnk.title = 'Cet article contient des catégories cachées';
lnk.style.cursor = 'pointer';
lnk.style.color = 'black';
lnk.style.marginLeft = '0.3em';
$(lnk).click(toggleHiddenCats);
lnk.appendChild(document.createTextNode('[+]'));
nc.appendChild(lnk);
}
function toggleHiddenCats(e) {
var $hc = $('#mw-hidden-catlinks');
if ( $hc.hasClass('mw-hidden-cats-hidden') ) {
$hc.removeClass('mw-hidden-cats-hidden');
$hc.addClass('mw-hidden-cat-user-shown');
$(e.target).text('[–]');
} else {
$hc.removeClass('mw-hidden-cat-user-shown');
$hc.addClass('mw-hidden-cats-hidden');
$(e.target).text('[+]');
}
}
mw.hookloader.using( 'wikipagemediawiki.contentutil' , function ().add{ $( makeCollapsibleMwCollapsible hiddencat );});
/**
* Add support to mw-collapsible for autocollapse, innercollapse and outercollapse * * Maintainers: TheDJScript pour alterner entre plusieurs cartes de géolocalisation
*/
function mwCollapsibleSetupGeoBox_Init( $collapsibleContent content) { var $element, $toggle, autoCollapseThreshold = 2; $content.find( 'div.img_toogle' ).each( $collapsibleContent, function (indexi, elementContainer ) { $element Container.id = 'img_toogle_' + i; var Boxes = $( element Container ).find( '.geobox' ); if ( $elementvar ToggleLinksDiv = document.hasClasscreateElement( 'collapsibleul' ) ; ToggleLinksDiv.id = 'geoboxToggleLinks_' + i; Boxes.each( function ( a, ThisBox ) { $elementThisBox.id = 'geobox_' + i + "_" + a; ThisBox.style.borderTop='0'; var ThisAlt = ThisBox.findgetElementsByTagName('tr:first > th:firstimg')[0].prepend( $elementalt; var toggle = document.findcreateElement('tr:first > * > a'); toggle.mw-collapsible-id = 'geoboxToggle_' + i + "_" + a; toggle'.appendChild(document.createTextNode(ThisAlt)); } toggle.href = 'javascript:'; if ( $collapsibleContent toggle.length >onclick = autoCollapseThreshold && $elementfunction (e) { e.hasClasspreventDefault( 'autocollapse' ) ; GeoBox_Toggle(this) {; }; $elementvar Li = document.datacreateElement( 'mw-collapsibleli' ); Li.collapseappendChild(toggle); } else if ( $element ToggleLinksDiv.hasClassappendChild( 'innercollapse' Li) ) {; if ( $element.parentsa === ( 'Boxes.outercollapse' length - 1)){ Li.length > 0 ) style.display = "none"; } else { $elementThisBox.data( 'mw-collapsible' )style.collapse()display = "none";
}
} );
Container.appendChild(ToggleLinksDiv);
} );
}
function GeoBox_Toggle(link){
var ImgToggleIndex = link.id.replace('geoboxToggle_', '').replace(/_.*/g, "");
var GeoBoxIndex = link.id.replace(/.*_/g, "");
var ImageToggle = document.getElementById('img_toogle_' + ImgToggleIndex);
var Links = document.getElementById('geoboxToggleLinks_' + ImgToggleIndex);
var Geobox = document.getElementById('geobox_' + ImgToggleIndex + "_" + GeoBoxIndex);
var Link = document.getElementById('geoboxToggle_' + ImgToggleIndex + "_" + GeoBoxIndex);
if ( (!ImageToggle) || (!Links) || (!Geobox) || (!Link) ) {
return;
}
$( ImageToggle ).find( '.geobox' ).each( function ( _, ThisgeoBox ) {
if (ThisgeoBox.id === Geobox.id) {
ThisgeoBox.style.display = "";
} else {
ThisgeoBox.style.display = "none";
}
}
} );
}
mw.hook( 'wikipage.collapsibleContentcontent' ).add( mwCollapsibleSetup GeoBox_Init );
/**
* Dynamic Navigation Bars permet d'ajouter un petit lien (experimentalpar exemple d'aide)à la fin du titre d'une page. *utilisé par [[Modèle:Aide contextuelle]] * Descriptionknown bug : See conflit avec le changement de titre classique. * Pour les commentaires, merci de contacter [[Wikipediauser:NavFramePlyd|Plyd]]. * Maintainers: UNMAINTAINED
*/
/** * Configuration du tri des diacritique dans les tables de class "sortable" */ Set up the words in your languagevar navigationBarHide = mw.config.set( 'tableSorterCollation', {'à':'a', 'â':'[a' + collapseCaption + , ']æ';var navigationBarShow = :'ae', 'é':'e', 'è':'e', 'ê':'e', 'î':'i', 'ï':'i', 'ô':'o', 'œ':'oe', 'û':'u', '[ç' + expandCaption + :']c', } );
/**
* Shows and hides content and picture (if available) of navigation bars.Direct imagelinks to Commons
*
* Required modules: mediawiki.RegExp, mediawiki.util, user.options * * @param {number} indexNavigationBar The index of navigation bar to be toggledsource www.mediawiki.org/wiki/Snippets/Direct_imagelinks_to_Commons * @param {jQuery.Event} event Event objectauthor Krinkle * @version 2015-06-23 * Ajouté le 'uselang' ce 18 janvier 2016 — Ltrlg
*/
if ( mw.config.get( 'wgNamespaceNumber' ) >= 0 ) { mw.loader.using( [ 'mediawiki.RegExp', 'mediawiki.util', 'user.options' ] ).done(function toggleNavigationBar( indexNavigationBar, event ) { mw.hook( 'wikipage.content' ).add( function ( $content ) { var navToggle uploadBase = '//upload.wikimedia.org/wikipedia/commons/', fileNamespace = documentmw.config.getElementByIdget( 'NavTogglewgFormattedNamespaces' )['6'], localBasePath = new RegExp( '^' + indexNavigationBar mw.RegExp.escape( mw.util.getUrl( fileNamespace + ':' );) ), var navFrame localBaseScript = documentnew RegExp( '^' + mw.RegExp.getElementByIdescape( mw.util.wikiScript() + 'NavFrame?title=' + indexNavigationBar mw.util.wikiUrlencode( fileNamespace + ':' ) ) );, commonsBasePath = '//commons.wikimedia.org/wiki/File:', var navChild; commonsBaseScript = '//commons.wikimedia.org/w/index.php?title=File:',
}
}
}, 1 ); navToggle.firstChild.data = navigationBarHide } ); } /************************************************************//* Function Strictement spécifiques à un espace de nom ou à une page *//************************************************************/
/**
* Adds show/hide-button to navigation bars.Ajoute le namespace aux filtres personnalisés sur [[Spécial:Pages liées]] * * @param {jQuery} $contentVoir aussi [[MediaWiki:Linkshere]]
*/
}
} navFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );
} );
}
/** * Affiche un modèle Information sur la page de téléchargement de fichiers [[Spécial:Téléchargement]] * Voir aussi [[MediaWiki:Onlyifuploading.js]] */if ( mw.hookconfig.get( 'wikipage.contentwgCanonicalSpecialPageName' ) === 'Upload' ){ importScript( 'MediaWiki:Onlyifuploading.add( createNavigationBarToggleButton js' );}
/**
* Magic editintros **************************************************** * * Description: Adds editintros on disambiguation pages and BLP pages.Supprime de la liste des balises disponibles et de la liste des balises supprimables * Maintainers: [[User:RockMFR]]certaines balises réservées à des outils automatiques
*/
}
} // Fin du code concernant l'espace de nom 'Special' // ESPACE DE NOM 'UTILISATEUR'if ( mw.config.get( 'wgNamespaceNumber' ) === 0 2 ) { /* * Fonctionnement du [[Modèle:Cadre à onglets]] * Le JavaScript principal se situe dans [[MediaWiki:Gadget-CadreOnglets.js]] */mw.hook( 'wikipage.content' ).add( function ( $content ) { if ( $content.find( '.cadre_a_onglets' ).length ) { mw.loader.using( 'ext.gadget.CadreOnglets', function () { CadreOnglets_Init( $content ); } ); }} ); } // Fin du code concernant l'espace de nom 'Utilisateur' // ESPACE DE NOM 'RÉFÉRENCE'if ( documentmw.config.get( 'wgNamespaceNumber' ) === 104 ) { /* * Choix du mode d'affichage des références * @note L'ordre de cette liste doit correspondre a celui de Modèle:Édition ! */ var addBibSubsetMenu = function ( $content ) { var $specialBib = $content.getElementByIdfind( 'disambigbox#specialBib' ) ; if ( !$specialBib.length ) { return; } // select subsection of special characters var chooseBibSubset = function ( s ) { addEditIntro $content.find( '.edition-Liste' ).css( 'display', s === 0 ? 'block' : 'none' ); $content.find( '.edition-WikiNorme' ).css( 'display', s === 1 ? 'block' : 'none' ); $content.find( '.edition-BibTeX' ).css( 'display', s === 2 ? 'block' : 'none' ); $content.find( '.edition-ISBD' ).css( 'Templatedisplay', s === 3 ? 'block' :Disambig_editintro'none' ); $content.find( '.edition-ISO690' ).css( 'display', s === 4 ? 'block' : 'none' ); }; var $menu = $( '<select>' ) .css( 'display', 'inline' ) .change( function () { chooseBibSubset( this.selectedIndex ); } ) .append( $( '<option>' ).text( 'Liste' ), $( '<option>' ).text( 'WikiNorme' ), $( '<option>' ).text( 'BibTeX' ), $( '<option>' ).text( 'ISBD' ), $( '<option>' ).text( 'ISO690' ) ); $specialBib.append( $menu ); /* default subset - try to use a cookie some day */ chooseBibSubset( 0 );}; mw.hook( 'wikipage.content' ).add( addBibSubsetMenu ); } // Fin du code concernant l'espace de nom 'Référence' // PAGES SPÉCIFIQUES
}
} );
}
}