For faster navigation, this Iframe is preloading the Wikiwand page for Utilisateur:Golmore/WatchlistNotifs.js.

Utilisateur:Golmore/WatchlistNotifs.js

//Idée et code original de [[User:Lepsyleon]]
// Remplacer "Liste de suivi" par "Liste de suivi (nombre de pages suivies non lues)" 
// quand toutes les pages de la LDS ne sont pas marquées comme étant visitées.

// Le nombre de pages suivies non lues inclut les articles modifiés via Wikidata selon que
// l'option "Voir les modifications de Wikidata dans votre liste de suivi" est cochée ou non dans les préférences.

// Installation : insérer le code importScript('Utilisateur:Golmore/WatchlistNotifs.js'); dans votre common.js

var tps_refresh = 10; // Rafraîchir la page toutes les 10 secondes

window.RenameLdS = function () {
var LdSLi = new mw.Api();

// Définir si l'option "Voir les modifications de Wikidata dans votre liste de suivi" est cochée dans les préférences
var WDoption = mw.user.options.get('wlshowwikibase');

// Cas 1 : connaître le nombre d'éléments non lus dans la LdS suite modifs faites UNIQUEMENT sur WP fr (avec limite max de 500 selon l'API:Watchlist)
if (!WDoption) {
	LdSLi.get( {action: 'query', list: 'watchlist', wlprop: '', wlshow: 'unread', wllimit: '500'}).done( function( data ) {
	if (!data.query.watchlist.length) {
	$('#pt-watchlist').find('a').text('Liste de suivi').css({ "font-weight": "", "color": "",});
    }
	else {
	$('#pt-watchlist').find('a').text('Liste de suivi (' +  data.query.watchlist.length + ')').css({"font-weight": "700",});
	}
	} );
}
// Fin du cas 1

// Cas 2 : connaître le nombre d'éléments non lus dans la LdS suite modifs faites sur WP fr ET Wikidata
// Rq : dans les préférences, l'option "Voir les modifications de Wikidata dans votre liste de suivi" est alors cochée
else {
	LdSLi.get({action: 'query', meta: 'userinfo', uiprop: 'unreadcount'}).done(function (data) {
	if (!data.query.userinfo.unreadcount) {
	$('#pt-watchlist').find('a').text('Liste de suivi').css({ "font-weight": "", "color": "",});
	}
	else {
	$('#pt-watchlist').find('a').text('Liste de suivi (' + data.query.userinfo.unreadcount + ')').css({"font-weight": "700", "color": "",});
	}
    });
}
// Fin du cas 2

setTimeout("RenameLdS();", tps_refresh * 1000);	
};
 
mw.loader.using(['mediawiki.api', 'user.options'], function () {
	$(document).ready(function () { RenameLdS(); } );
} );
{{bottomLinkPreText}} {{bottomLinkText}}
Utilisateur:Golmore/WatchlistNotifs.js
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?