Note : après avoir publié vos modifications, il se peut que vous deviez forcer le rechargement complet du cache de votre navigateur pour voir les changements.

  • Firefox / Safari : maintenez la touche Maj (Shift) en cliquant sur le bouton Actualiser ou appuyez sur Ctrl + F5 ou Ctrl + R (⌘ + R sur un Mac).
  • Google Chrome : appuyez sur Ctrl + Maj + R (⌘ + Shift + R sur un Mac).
  • Internet Explorer / Edge : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl + F5.
  • Opera : appuyez sur Ctrl + F5.
/**
 * Sous-pages
 *
 * Place un bouton "afficher les sous-pages" dans la boîte à outils
 *
 * Auteur : Delhovlyn, Lgd pour la mise à jour Mediawiki 1.19
 * Date de la dernière révision : 4 mars 2012
 * {{Catégorisation JS|SousPages}}
 */

(function () {

    var NSWithoutSubpages = [-6, 14, 104, 105];
    if (NSWithoutSubpages.indexOf(mw.config.get('wgNamespaceNumber')) !== -1) {
        return;
    }

    mw.loader.using('mediawiki.util', function () {
        $(function ($) {

/**
 * AncreTitres
 *
 * Cette fonction fournit un lien vers une section de page en cliquant
 * sur le lien [URL] ou [[lien]] à droite du titre de section.
 *
 * Auteurs : Pabix, Phe, Bayo, Chphe, Arkanosis, Mah3110, Ash_Crow
 * {{Projet:JavaScript/Script|AncreTitres}}
 */
/* global $, mw */
/* eslint-env browser */
// <nowiki>
mw.loader.using( [ 'mediawiki.util', 'user' ], function () {
	'use strict';

	$( function ( $ ) {
		var lang = mw.config.get( 'wgUserLanguage' ),
			messages = {
				en: {
					'ancretitres-anchor-name': '[URL]',
					'ancretitres-internal-link-name': '[[Link]]',
					'ancretitres-description': 'Get an URL to this section',
					'ancretitres-int-description': 'Get an internal link to this section',
					'ancretitres-notif-title': 'Text copied to clipboard',
					'ancretitres-notif-error': 'Could not copy to clipboard'
				},
				fr: {
					'ancretitres-anchor-name': '[URL]',
					'ancretitres-internal-link-name': '[[Lien]]',
					'ancretitres-description': 'Obtenir une URL vers cette section',
					'ancretitres-int-description': 'Obtenir un lien interne vers cette section',
					'ancretitres-notif-title': 'Texte copié dans le presse-papiers',
					'ancretitres-notif-error': 'Impossible de copier dans le presse-papiers'
				}
			},
			options = {
				afficheE: true,
				afficheI: true
			};

		mw.messages.set( messages.en );
		if ( lang !== 'en' && lang in messages ) {
			mw.messages.set( messages[ lang ] );
		}

		// https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript/30810322#30810322
		function copyTextToClipboard( text ) {
			var textArea = document.createElement( 'textarea' );

			textArea.style.position = 'fixed';
			textArea.style.top = 0;
			textArea.style.left = 0;

			textArea.style.width = '2em';
			textArea.style.height = '2em';
			textArea.style.padding = 0;
			textArea.style.border = 'none';
			textArea.style.outline = 'none';
			textArea.style.boxShadow = 'none';
			textArea.style.background = 'transparent';

			textArea.value = text;

			document.body.appendChild( textArea );
			textArea.focus();
			textArea.select();

			var copySuccess;
			try {
				document.execCommand( 'copy' );
				copySuccess = true;
			} catch ( e ) {
				copySuccess = false;
			}

			document.body.removeChild( textArea );

			if ( copySuccess ) {
				mw.notify( text, { title: mw.msg( 'ancretitres-notif-title' ), tag: 'ancretitres', type: 'info', autoHide: true } );
			} else {
				mw.notify( mw.msg( 'ancretitres-notif-error' ), { tag: 'ancretitres', type: 'error', autoHide: true } );
			}
		}

		if ( typeof window.AncreTitres !== 'undefined' ) {
			$.extend( options, window.AncreTitres );
		}

		if ( !options.afficheI && !options.afficheE ) {
			return;
		}

		$( 'span.mw-headline' ).each( function ( _, headline ) {
			var $span = $( '<span>' )
				.addClass( 'noprint ancretitres' )
				.css( {
					'font-size': 'xx-small',
					'font-weight': 'normal',
					'user-select': 'none' // jQuery se charge d'ajouter un vendor prefix si nécessaire
				} );

			if ( options.afficheE ) {
				var $linkE = $( '<a href="#" title="' + mw.msg( 'ancretitres-description' ) + '">' + mw.msg( 'ancretitres-anchor-name' ) + '</a>' ).click( function ( e ) {
					e.preventDefault();
					var outputText = 'https:' + mw.config.get( 'wgServer' ) + mw.util.getUrl() + '#' + headline.id;
					copyTextToClipboard( outputText );
				} );
				$span.append( ' ', $linkE );
			}

			if ( options.afficheI ) {
				var $linkI = $( '<a href="#" title="' + mw.msg( 'ancretitres-int-description' ) + '">' + mw.msg( 'ancretitres-internal-link-name' ) + '</a>' ).click( function ( e ) {
					e.preventDefault();
					var escapedAnchor = headline.id
						// escaping caractères spéciaux HTML
						// (partiel, '"& ne sont pas escapés pour ne pas dégrader inutilement la lisibilité du lien)
						.replace( /</g, '&lt;' )
						.replace( />/g, '&gt;' )
						// escaping caractères spéciaux MediaWiki
						.replace( /\[/g, '&#91;' )
						.replace( /\]/g, '&#93;' )
						.replace( /\{/g, '&#123;' )
						.replace( /\|/g, '&#124;' )
						.replace( /\}/g, '&#125;' );
					var outputText = '[[' + ( mw.config.get( 'wgPageName' ) + '#' + escapedAnchor ).replace( /_/g, ' ' ) + ']]';
					copyTextToClipboard( outputText );
				} );
				$span.append( ' ', $linkI );
			}

			$( headline ).parent().append( $span );
		} );

	} );

} );

            var target = (mw.config.get('wgServerName') === 'fr.wikiquote.org' ? 'Spécial:Index' : 'Special:Prefixindex')
                + '/' + mw.config.get('wgPageName') + '/';

            var portletId = mw.config.get('skin') === 'timeless' ? 'p-pagemisc' : 'p-tb';
            mw.util.addPortletLink(portletId, mw.util.getUrl(target), 'Sous-pages');
        });
    });

})();

/**
 * Application de [[Wikipédia:Prise de décision/Système de cache]].
 * Un <span class="noarchive"> autour d'un lien l'empêche d'être pris en compte.
 *
 * {{Catégorisation JS|ArchiveLinks}}
 */

{
	mw.hook( 'wikipage.content' ).add( function ( $content ) {
		'use strict';

		var hasNativeClosest = !!Element.prototype.closest;

		$content.find( '.mw-parser-output' ).find( '.external' ).each( function ( _, link ) {
			if ( link.tagName !== 'A' ) {
				return;
			}

			var hostname = link.hostname;

			if ( /(^|\.)wiki([pm]edia|data)\.org$/.test( hostname )
				|| hostname === 'tools.wmflabs.org'
				|| hostname === 'archive.wikiwix.com' 
				|| hostname === 'wikiwix.com'
				|| hostname === 'web.archive.org'
				|| /^archive\.(is|ph|today|li|vn|fo|md)$/.test( hostname )
			) {
				return;
			}

			if ( hasNativeClosest ) {
				if ( link.closest( '.noarchive' ) ) {
					return;
				}
			} else {
				if ( $( link ).closest( '.noarchive' ).length ) {
					return;
				}
			}

			// sécurité : attention à échapper les quotes dans les attributs

			var href = 'https://archive.wikiwix.com/cache/?url=' + encodeURIComponent( link.href );
			var title = 'archive sur Wikiwix';

			var archiveLink = '<a href="' + href + '" title="' + title + '">archive</a>';

			link.insertAdjacentHTML( 'afterend', '<small class="cachelinks">\xA0[' + archiveLink + ']</small>' );
		});
	});
}