MediaWiki:Gadget-AffMasLiens.js

Ocio: Daspò ver salvà, podaria esare neçesario snetare ła cache dal propio navegadore web par vedare i canbiamenti.

  • Firefox / Safari: tegner strucà el boton de łe letare grande Shift e schiciare sora Ricarga, o se nò struca Ctrl-F5 o Ctrl-R (⌘-R so Mac)
  • Google Chrome: strucare Ctrl-Shift-R (⌘-Shift-R so on Mac)
  • Internet Explorer / Edge: tegner strucà el boton Ctrl e schiciare so Ajorna, o sinò Ctrl-F5
  • Opera: Va in tel Menu → Inpostasion (Opera → Prefarense so on Mac) e pò in Privacy & sicuresa → Sneta dati del navegadore → Imajini e file in te ła cache.
/* tolto da [[fr:MediaWiki:Gadget-AffMasLiens.js]] dif n'148422270 */
/* {{Projet:JavaScript/Script|AffMasLiens}} */

/**
 * Permet de masquer, puis d'afficher les liens d'un article pour en améliorer
 * la lisibilité.
 *
 * Pour ce faire, ce script place un switch en haut de page,
 * permettant de masquer ou de réafficher les liens à chaque clique dessus.
 **/

/* globals mw, OO, $ */

if ( mw.config.get( 'wgNamespaceNumber' ) === 0 && mw.config.get( 'wgAction' ) === 'view' ) {
	mw.loader.using( [ 'mediawiki.util', 'oojs-ui-widgets' ], function () {
		'use strict';

		var sheet = mw.util.addCSS( '#mw-content-text a { color: inherit }' );
		sheet.disabled = true;

		var toggleSwitch = new OO.ui.ToggleSwitchWidget(),
			label = new OO.ui.LabelWidget( { label: 'Scondi tuti i lighi' } ),
			layout = new OO.ui.HorizontalLayout( { 'items': [ toggleSwitch, label ] } );

		toggleSwitch.on( 'change', function () {
			if ( toggleSwitch.getValue() ) {
				sheet.disabled = false;
			} else {
				sheet.disabled = true;
			}
		} );

		$( '#firstHeading' ).before( layout.$element.css( 'float', 'right' ) );

	} );
}
Traesto fora da Wikipèdia - L'ençiclopedia łìbara e cołaboradiva in łéngua Vèneta "https://vec.wikipedia.org/w/index.php?title=MediaWiki:Gadget-AffMasLiens.js&oldid=783768"