Discussion utilisateur:H4stings/wef-history.js

wef-history.js permet d'afficher dans les pages d'historique de Wikipédia les modifications de l'élément Wikidata correspondant.

L'auteur est H4stings (d · c · b), sur la base des gadgets développés par Vlsergey (d · c · b).

Ce script a pour cousin wef-watchlist.js, pour les listes de suivi.

This script displays changes of the corresponding Wikidata item in the history page of Wikipedia.

Its author is H4stings, from the WE Framework written by Vlsergey.

Translations have been done in :

Fonctionnalités modifier

Tout est déjà dit. Émoticône sourire

Installation modifier

  1. Ajouter dans votre fichier common.js la ligne suivante : importScript('Utilisateur:H4stings/wef-history.js');
  2. Accédez à n'importe quelle page d'historique d'un article (de l'espace principal) : c'est bon.
  1. Quelles sont les modifications affichées ?
    • Par défaut, les modifications de libellés, d'alias et de liens interwikis (versions linguistiques de l'article) sont masqués pour les autres langues que le Français.
    • Pour afficher l'une ou l'autre de ces types de modifications, il faut précéder la ligne importScript de la ligne suivante :
      • pour afficher toutes les modifications : var afficherTout = True;
      • pour afficher uniquement les modifications de libellés : var cacherModifLabel = false;
      • pour afficher uniquement les modifications d'alias : var cacherModifAlias = false;
      • pour afficher uniquement les modifications de liens interwikis (= création ou renommage d'articles) : var cacherModifLiens = false;
    • Si vous utilisez également le script wef-watchlist.js, les variables ont le même nom ! Inutile de les répéter.

Adaptation to Czech wiki modifier

Hi H4stings, I tried your code on cswiki, but it does not seems to work. I copy&pasted your whole code to my common.js instead of simple import (it didn't work at all) and when I visit some history page I receive some notifications in the upper-right corner of the screen (that is ok so far), but no WD changes appear and when I check the Firebug console I can see some "Unknown error" in the log: printscreen. Am I doing something wrong? Thanks for reply, thanks for developing this tool and sorry for writing in English --YjM (discuter) 16 juin 2016 à 14:56 (CEST)Répondre

Hi YjM, thank for your interest ! My first impression is that the script works well but does not know where display the wikidata lines. The script do not understand dates written in Czech ("10. 6. 2016, 09:05"), we have to adapt the following line to Czech history pages : var d = new Date( parseInt(resH[3]), parseInt(i18n.revMonthes[resH[2]]-1), parseInt(pad(resH[1])), parseInt(resH[4]), parseInt(resH[5]), 0);. If you do not know how to do, I'll try this evening or tomorrow. — H4stings d 16 juin 2016 à 16:09 (CEST)Répondre
I've just worked on cs:Wikipedista:H4stings/wef-history.js, it seems OK now (with importScript('User:H4stings/wef-history.js'); in my cs:Wikipedista:H4stings/common.js).
You can copy/paste on your user space to adapt moreover. There is still the "dico" variable ("wbsetsitelink-add" : "Lien ajouté", "wbsetsitelink-set" : "Lien modifié", etc.) to translate if you want to. — H4stings d 16 juin 2016 à 16:43 (CEST)Répondre

Adaptation to italian wiki modifier

I have copied you version on it.wiki here but probably I have some problem. I'm not expert, but maybe something don't work in function insertChang. Can you check? Thanks. --ValterVB (discuter) 18 juin 2016 à 12:29 (CEST)Répondre

Hi ValterVB. I confirm it does not work if you just copy/paste the script. There is at least one line to adapt for each version of wikipedia: the reH variable. I will work on adaptation to italian wiki today or tomorrow and I keep you posted. Cheers. H4stings d 18 juin 2016 à 14:37 (CEST)Répondre
Notification ValterVB : it:Utente:H4stings/wef-history.js works well for me, let me know if it is OK for you. ÉmoticôneH4stings d 18 juin 2016 à 17:30 (CEST)Répondre
Great, now it work, I copy it in my page so I can translate it in Italian. Merci. --ValterVB (discuter) 18 juin 2016 à 17:57 (CEST)Répondre
You're welcome ! — H4stings d 18 juin 2016 à 19:09 (CEST)Répondre

Improvements modifier

Do you think is possible to add a list of user to exclude? So we can exclude edits of the more active BOT. --ValterVB (discuter) 18 juin 2016 à 21:10 (CEST)Répondre

Hi. Yes sure, it should not be very complicated to code. Firstly we create a list of users to exclude (like the "months" array). Secondly we test in generateWatchlistLine function if "jEntry.user" is in the exclude array (like the current summary test).
In the same idea, we could also add a test to exclude edits when summary contains "BOT" word. It is easy to do. — H4stings d 19 juin 2016 à 11:01 (CEST)Répondre
Notification ValterVB : I've done it : [1]. It works well for me. Users you want to exclude have to be listed in exludeUsers array (where I wrote "B0ttle"). — H4stings d 19 juin 2016 à 15:44 (CEST)Répondre
Yes, work well also for me. --ValterVB (discuter) 19 juin 2016 à 18:53 (CEST)Répondre

Testing on nowiki modifier

Here's a diff showing the changes I made when porting it to nowiki. To make porting a little easier, I think the language code should be made a constant defined at the top. It's also easier to work with long lists when there's linebreaks between each item ;) One issue that bothers me somewhat is that the date format will depend on user language, not site language. Danmichaelo (discuter) 26 juin 2016 à 19:21 (CEST)Répondre

@Danmichaelo : Great work ! Thanks for the advices and the changes you did. You are true about the language code in variable, it is in my todo list Émoticône (when I did the script I did not think others wikipedias will use it...). To be continued. I'll work on the script in the next few days I think. — H4stings d 27 juin 2016 à 11:11 (CEST)Répondre

Testing/adaption to enwiki modifier

Hi! Thanks for this great tool, I did a crude adaption and translation to the English Wikipedia. [2] Seems to work, so far. Sebotic (discuter) 28 juin 2016 à 01:13 (CEST)Répondre

Hi, I'm really glad if my script can help for people from every Wikipedias. I tried to finish the translation to English here: en:User:H4stings/wef-history.js, but you did 90% of the work. ÉmoticôneH4stings d 28 juin 2016 à 09:18 (CEST)Répondre

Demande de fonctionnalité : Bouton afficher/masquer modifier

Bonjour H4stings Émoticône,

ce gadget est génial mais parfois je recherche une modification et je sais qu’elle a été faite dans wikipédia et non dans wikidata. Je pense qu’avoir un bouton pour pouvoir choisir de masquer temporairement les diffs ajoutés par le gadget pourrait être une fonctionnalité intéressante.

Est-ce que ça sera possible de rajouter ce bouton ? — Metamorforme42 (discuter) 24 octobre 2016 à 14:53 (CEST)Répondre

Hello, je suis en vacances là, je tache de voir ce que je peux faire quand je rentre. Émoticône H4stings d 26 octobre 2016 à 09:41 (CEST)Répondre
Super, bonnes vacances alors ÉmoticôneMetamorforme42 (discuter) 26 octobre 2016 à 15:13 (CEST)Répondre

Installation suite à la suppression des fonctions obsolète modifier

cf. Wikipédia:Le Bistro/28 avril 2017#Comme un problème de javascript....

Pour info j'ai remplacé importScript(...) par :

mw.loader.load("/w/index.php?title=Utilisateur:H4stings/wef-history.js&action=raw&ctype=text/javascript");

Je n'ai en fait pas regardé si c'était cassé avant que je le change, mais en tout cas là ça marche. Turb (discuter) 28 avril 2017 à 23:24 (CEST)Répondre

Retour à la page de l’utilisateur « H4stings/wef-history.js ».