MediaWiki talk:Gadget-dataDrainer.js

Latest comment: 2 months ago by Pigsonthewing in topic Feature request: Remove references
/**********************************************************************************
***********************************************************************************
**                _       _        _____            _                            **
**               | |     | |      |  __ \          (_)                           **
**             __| | __ _| |_ __ _| |  | |_ __ __ _ _ _ __   ___ _ __            **
**            / _` |/ _` | __/ _` | |  | | '__/ _` | | '_ \ / _ \ '__|           **
**           | (_| | (_| | || (_| | |__| | | | (_| | | | | |  __/ |              **
**            \__,_|\__,_|\__\__,_|_____/|_|  \__,_|_|_| |_|\___|_|    v1.0      **
**                                                                               **
** ----------------------------------------------------------------------------- **
**  How To use :                                                                 **
**   Add to your common.js [[Special:MyPage/common.js]],                         **
**   importScript( 'MediaWiki:Gadget-dataDrainer.js' );                          **
**                                                                               **
**  Links :                                                                      **
**    [[User:Jitrixis/dataDrainer.js]]                                           **
**    [[User talk:Jitrixis/dataDrainer.js]]                                      **
**                                                                               **
**  Read me :                                                                    **
**   -This tool allows you to delete the data of an item.                        **
**   -You can choose what you want to delete : labels and/or descriptions        **
**    and or aliases and or sitelinks                                            **
**   -When you have choosed your options type the verification code to prevent   **
**    vandalisms then click on "Empty" button.                                   **
**   -If you have checked the sitelinks option a dialog ask you if you're really **
**    sure to delete all sitelinks because they can only be once on wikidata.    **
**   -Then a checklist will show you again the selected options.                 **
**   -Finally a prompt ask you the reason of this deletion.                      **
**                                                                               **
**  Permission :                                                                 **
**   +----------------------------------------------------------------------+    **
**   |     Groups     |  Labels  |  Descriptions  |  Aliases  |  Sitelinks  |    **
**   +----------------+----------+----------------+-----------+-------------+    **
**   |  sysop         |    OK    |       OK       |    OK     |     OK      |    **
**   |  patroll       |    OK    |       OK       |    OK     |     XX      |    **
**   |  user          |    XX    |       XX       |    XX     |     XX      |    **
**   +----------------------------------------------------------------------+    **
**                                                                               **
***********************************************************************************
**********************************************************************************/

--Jitrixis (talk) 21:48, 28 January 2013 (UTC)Reply

Translations
edit

  • See the original translation in English under.
  • Then copy this example and translate.
  • And add a new section on this talk with your translation.

A translation example :

		'en': {
			'box-title': 'Empty',
			'box-cancel': 'Close',
			'box-deleted': 'Deleted',
			'canceled': 'Deletion canceled',
			'box-captcha': 'Enter the number for emptying:',
			'warning-message': 'Attention! you fully drain this item. Only administrators and patrollers can use this feature. Please check and verify what you want to clear. A verification code is request to run the script.',
			'labels': 'Labels',
			'descriptions': 'Descriptions',
			'aliases': 'Aliases',
			'sitelinks': 'Sitelinks',
			'unauthorized': 'You\'re not authorize to use this script !',
			'locked-option': 'This option is locked. Ask to a sysop !',
			'captcha-wrong': 'The security code is uncorect !',
			'nothing-check': 'There is nothing to do !',
			'sitelinks-check': 'Are you sur to delete all sitelinks ! They can be once on wikidata !',
			'checklist': 'This deletion list will be executed',
			'reason': 'Write here the reason why you want to drain this item :'
		},

Translatation status :

Language Translation By
en   Done Jitrixis
fr   Done Jitrixis

Please report any bugs you find. Thanks --Jitrixis (talk) 16:20, 8 November 2012 (UTC)Reply

Should we use this tool? edit

Should we use this tool? As items should not be reused to prevent confusion, whats the exact purpose of the script? --Sk!d (talk) 22:50, 28 January 2013 (UTC)Reply

This is handy tool if somebody has found conflicts and moved links to another item, so then there is many wrong labels and descriptions. Example. --Stryn (talk) 11:21, 6 February 2013 (UTC)Reply

autopatrolled edit

{{Editprotected}} there're no autopatrolled users now.--GZWDer (talk) 13:38, 19 February 2014 (UTC)Reply

  Not done When using {{Editprotected}}, please request a specific code change. Thanks, The Anonymouse [talk] 06:00, 26 February 2014 (UTC)Reply

{{Editprotected}} Per issue raised on Wikidata:Project_chat#Easy way to clean up wrong descriptions, please replace all mentions of "autopatrolled" to "autoconfirmed". I also propose to completely remove the permission requirement as vandalisms are easy to be reversed.--GZWDer (talk) 16:40, 5 February 2017 (UTC)Reply

  Support all users independent of their group should be allowed to use this gadget --Pasleim (talk) 09:17, 30 May 2017 (UTC)Reply

I made the necessary changes in my local copy of the script, and it's working. So could an admin please make these changes to this script? (You can just copypaste all the text from User:Jon Harald Søby/dataDrainer.js to here if you want.) Jon Harald Søby (talk) 21:35, 25 June 2017 (UTC)Reply

  Done Applied your changes, I still think this gadget should have some threshold. Matěj Suchánek (talk) 06:32, 26 June 2017 (UTC)Reply

Tag edits edit

{{Editprotected}}

Please insert the following after line 202:

'tags': 'datadrainer',

Somehow this present in other parts of the code, but missing there. It's consistent with the way WEF framework tags its edits [1].
--- Jura 22:22, 27 October 2016 (UTC)Reply

@Jura1: I have tried applying this fix but no tag was assigned to my edit, so this needs someone's more skilled eyes, like Fomafix'. Matěj Suchánek (talk) 08:51, 13 November 2016 (UTC)Reply
I don't know how to create tags. --Fomafix (talk) 09:53, 13 November 2016 (UTC)Reply
If you mean "create a new tag by which edits can be tagged", I have already done it (datadrainer). Matěj Suchánek (talk) 10:08, 13 November 2016 (UTC)Reply
The code seemed to resemble the one from the WEF gadget. I couldn't find another sample though.
--- Jura 10:15, 13 November 2016 (UTC)Reply
This discussion stalled 1.5 years ago. Please have new request and discussion if it is still needed. --Jarekt (talk) 17:08, 18 January 2018 (UTC)Reply
  Done --Matěj Suchánek (talk) 14:20, 29 August 2019 (UTC)Reply

pl translation edit

Polish (pl) translation. Sp5uhe (talk) 07:48, 6 February 2017 (UTC)Reply

		'pl': {
			'box-title': 'Wyczyść',
			'box-cancel': 'Zamknij',
			'box-deleted': 'Usunięte',
			'canceled': 'Usuwanie anulowane',
			'box-captcha': 'Aby wyczyścić wpisz liczbę:',
			'warning-message': 'Uwaga! Usiłujesz usunąć wszystkie dane z tego elementu. Wyłącznie administratorzy i użytkownicy, których edycje są automatycznie przeglądane, mogą użyć tego polecenia. Upewnij się, że chcesz usunąć całkowicie dane. Do uruchomienia skryptu wymagane jest wpisanie kodu weryfikacyjnego.',
			'labels': 'Etykiety',
			'descriptions': 'Opisy',
			'aliases': 'Aliasy',
			'sitelinks': 'Linki do witryn',
			'unauthorized': 'Nie masz wystarczających uprawnień, aby uruchomić ten skrypt!',
			'locked-option': 'Ta funkcja jest zablokowana. Poproś o pomoc administratora!',
			'captcha-wrong': 'Kod bezpieczeństwa nie jest prawidłowy!',
			'nothing-check': 'Nie ma nic do zrobienia!',
			'sitelinks-check': 'Czy jesteś pewien, że chcesz usunąć wszystkie linki do witryny?',
			'checklist': 'Dane z listy zostaną usunięte',
			'reason': 'Podaj przyczynę dla której chcesz usunąć wszystkie dane dla tego elementu:',
		},
  Done Matěj Suchánek (talk) 14:05, 6 February 2017 (UTC)Reply

nb and nn translations edit

{{Editprotected}} Please add the following translations:

		'nb': {
			'box-title': 'Tøm',
			'box-cancel': 'Lukk',
			'box-deleted': 'Slettet',
			'canceled': 'Sletting avbrutt',
			'box-captcha': 'Skriv inn tallet for å tømme:',
			'warning-message': 'Obs! Du vil tømme dette elementet fullstendig. Kun administratorer og autobekreftede brukere kan bruke denne funksjonen. Sjekk og bekreft at du ønsker å tømme det. En bekreftelseskode kreves for å kjøre skriptet.',
			'labels': 'Etiketter',
			'descriptions': 'Beskrivelser',
			'aliases': 'Aliaser',
			'sitelinks': 'Sidelenker',
			'unauthorized': 'Du har ikke tillatelse til å bruke dette skriptet!',
			'locked-option': 'Dette valget er låst. Spør en administrator!',
			'captcha-wrong': 'Sikkerhetskoden er feil!',
			'nothing-check': 'Ingenting skal gjøres!',
			'sitelinks-check': 'Er du sikker på at du vil slette alle sidelenker?',
			'checklist': 'Denne slettelista vil utføres',
			'reason': 'Skriv inn en begrunnelse for at du vil tømme dette elementet:'
		},
		'nn': {
			'box-title': 'Tøm',
			'box-cancel': 'Lukk',
			'box-deleted': 'Sletta',
			'canceled': 'Sletting avbrutt',
			'box-captcha': 'Skriv inn talet for å tømma:',
			'warning-message': 'Obs! Du vil tømma dette elementet fullstendig. Berre administratorar og autostadfesta brukarar kan nytta denne funksjonen. Sjekk og stadfest at du ynskjer å tømma det. Ein stadfestingskode krevjast for å køyra skriptet.',
			'labels': 'Etikettar',
			'descriptions': 'Skildringar',
			'aliases': 'Aliasar',
			'sitelinks': 'Sidelenkjer',
			'unauthorized': 'Du har ikkje løyve til å nytta dette skriptet!',
			'locked-option': 'Dette valet er låst. Spør ein administrator!',
			'captcha-wrong': 'Sikkerheitskoden er feil!',
			'nothing-check': 'Ingenting skal gjerast!',
			'sitelinks-check': 'Er du sikker på at du vil sletta alle sidelenkjene?',
			'checklist': 'Denne slettelista vil verte utført',
			'reason': 'Skriv inn ei grunngjeving for at du vil tømma dette elementet:'
		},

Jon Harald Søby (talk) 21:52, 25 June 2017 (UTC)Reply

  Done Matěj Suchánek (talk) 06:32, 26 June 2017 (UTC)Reply

Script location edit

{{Editprotected}} Lines 13, 16 and 17 in the script's description should be changed to point to this location, instead of Jitrixis' user script (which just points to this one). Jon Harald Søby (talk) 21:54, 25 June 2017 (UTC)Reply

  Done Matěj Suchánek (talk) 06:32, 26 June 2017 (UTC)Reply

Script rewritten edit

Hi, with the help of @0x010C: and @Tpt:, I rewrote this script entirely to

  • use OOui for the interface
  • remove the captcha
  • replace the "autoconfirmed" group requirement with the "rollbacker" one (but I think we should scrap this requirement altogether.)
  • otherwise modernize the script

The new version is here. It would be great if some people can test it so I can replace the current version. Also, some of the messages were changed so the texts are only in French and English right now, so if you can contribute to translations, it would be great :)

Ping @Jitrixis: who wrote the v1.0 version ;) -Ash Crow (talk)

@Ash Crow: Looks great. :) Only needs some padding around the options I think and we're good to go. Sjoerd de Bruin (talk) 11:00, 11 February 2018 (UTC)Reply
(Finally) Done. Please ping me if you have any trouble. -Ash Crow (talk) 20:07, 21 September 2018 (UTC)Reply

it translation edit

{{Editprotected}} Please add the following translations:

		'it': {
			'box-title': 'Svuota',
			'box-cancel': 'Chiudi',
			'box-deleted': 'Dati cancellati',
			'canceled': 'Cancellazione annullata',
			'box-captcha': 'Per svuotare, inserisci il numero seguente:',
			'warning-message': 'Attenzione! Svuoterai completamente una parte di questo elemento. Solo amministratori e autoverificati possono disporre di questa funzionalità. Verifica che l\'operazione sia corretta. Per completare l\'operazione è richiesto un codice di verifica.',
			'labels': 'Etichette',
			'descriptions': 'Descrizioni',
			'aliases': 'Alias',
			'sitelinks': 'Collegamenti',
			'unauthorized': 'Non sei autorizzato a usare questo script!',
			'locked-option': 'Questa opzione è bloccata. Contatta un amministratore!',
			'captcha-wrong': 'Il codice di verifica non corrisponde!',
			'nothing-check': 'Nessuna opzione è selezionata!',
			'sitelinks-check': 'Sei sicuro di voler rimuovere tutti i collegamenti?',
			'checklist': 'I seguenti dati verranno cancellati',
			'reason': 'Inserisci la motivazione per cui stai cancellando i dati:'
		},

--Horcrux92 (talk) 11:20, 20 March 2018 (UTC)Reply

  Done --Pasleim (talk) 11:28, 20 March 2018 (UTC)Reply
@Horcrux92:: Can you please provide a translation for the new version as well? Here are the messages:
      'en': {
        'link-title': 'Empty',
        'box-title': 'Empty the item',
        'action-cancel': 'Cancel',
        'action-save': 'Empty',
        'canceled': 'Deletion canceled',
        'notif-done':  'Action done.',
        'notif-fail': 'Action failed.',
        'warning-message': 'Caution! You will fully drain this item. Only administrators and rollbackers can use this feature. Please check and verify what you want to clear.',
        'labels': 'Labels',
        'descriptions': 'Descriptions',
        'aliases': 'Aliases',
        'sitelinks': 'Sitelinks',
        'locked-option': 'This option is locked. Ask an administrator!',
        'nothing-check': 'There is nothing to do!',
      },
-Ash Crow (talk) 10:08, 20 May 2018 (UTC)Reply
@Ash Crow: Here it is:
      'it': {
        'link-title': 'Svuota',
        'box-title': 'Svuota l\'elemento',
        'action-cancel': 'Annulla',
        'action-save': 'Svuota',
        'canceled': 'Cancellazione annullata',
        'notif-done':  'Cancellazione eseguita.',
        'notif-fail': 'Cancellazione fallita.',
        'warning-message': 'Attenzione! Stai per svuotare completamente questo elemento. Questa funzionalità è riservata ad amministratori e rollbacker. Per favore, verifica ciò che intendi rimuovere.',
        'labels': 'Etichette',
        'descriptions': 'Descrizioni',
        'aliases': 'Alias',
        'sitelinks': 'Collegamenti',
        'locked-option': 'Questa opzione è bloccata. Contatta un amministratore!',
        'nothing-check': 'Non hai selezionato alcuna opzione!',
      },
--Horcrux92 (talk) 10:16, 20 May 2018 (UTC)Reply

Translations edit

While I'm at it, I will soon push the new version that has been in test since last Wikimania. Can somebody please provide the translations for these lines in the already existing languages?

'en': {
        'link-title': 'Empty',
        'box-title': 'Empty the item',
        'action-cancel': 'Cancel',
        'action-save': 'Empty',
        'canceled': 'Deletion canceled',
        'notif-done':  'Action done.',
        'notif-fail': 'Action failed.',
        'warning-message': 'Caution! You will fully drain this item. Only administrators and rollbackers can use this feature. Please check and verify what you want to clear and do not repurpose the item.',
        'labels': 'Labels',
        'descriptions': 'Descriptions',
        'aliases': 'Aliases',
        'sitelinks': 'Sitelinks',
        'locked-option': 'This option is locked. Ask an administrator!',
        'nothing-check': 'There is nothing to do!',
      },

@Sp5uhe, Jon Harald Søby:, you provided the existing translations for pl, nb and nn, can you please give the new ones? -Ash Crow (talk) 10:40, 20 May 2018 (UTC)Reply

@Stryn, Grondin:, same for fi and ca, if you please -Ash Crow (talk) 10:56, 20 May 2018 (UTC)Reply
To prevent this, the tool is reserved to rollbackers and sysop, who are supposed to already know that fact. -Ash Crow (talk) 11:22, 20 May 2018 (UTC)Reply
Yeah, but if we'd be sure about it .. 'warning-message' could include "Do not repurpose items."
BTW, could you add the tagging feature ? MediaWiki_talk:Gadget-dataDrainer.js#Tag_edits
--- Jura 11:27, 20 May 2018 (UTC)Reply
OK, I added the warning. @Horcrux92:, would you be so kind as to re-translate the warning-message? Sorry to bother you twice in a day. @Jura1:: I added the tag feature but it doesn't seem to work. -Ash Crow (talk) 12:59, 20 May 2018 (UTC)Reply
What do you mean with "repurpose items"? --Horcrux92 (talk) 13:03, 20 May 2018 (UTC)Reply

Here in Finnish:

'fi': {
        'link-title': 'Tyhjennä',
        'box-title': 'Tyhjennä kohde',
        'action-cancel': 'Peruuta',
        'action-save': 'Tyhjennä',
        'canceled': 'Poisto peruutettu',
        'notif-done':  'Toiminto suoritettu.',
        'notif-fail': 'Toiminto epäonnistui.',
        'warning-message': 'Huomio! Olet tyhjentämässä tätä kohdetta. Vain ylläpitäjät ja palauttajat voivat käyttää tätä toimintoa. Tarkista ja vahvista mitä haluat tyhjentää äläkä uudelleenkäytä tätä kohdetta eri tarkoitukseen.',
        'labels': 'Nimet',
        'descriptions': 'Kuvaukset',
        'aliases': 'Aliakset',
        'sitelinks': 'Sivustolinkit',
        'locked-option': 'Tämä valinta on lukittu. Kysy ylläpitäjää!',
        'nothing-check': 'Mitään ei tehty!',
      },

Stryn (talk) 10:24, 21 May 2018 (UTC)Reply

It stopped working for me edit

Hello, for some reason I can't find this gadget anymore. I found it quite useful for cleaning up items with many wrong labels (e.g. set with tools like nameGuzzler). -Valentina.Anitnelav (talk) 16:43, 31 October 2018 (UTC)Reply

It has just worked for me. Have you lost the way to activate it or to drain an item. If you were looking to Special:Preferences, this gadget has never been listed there. Matěj Suchánek (talk) 18:38, 31 October 2018 (UTC)Reply
It is still in my commons.js (I deleted and readded the line after it stopped working), but the link disappeared from the menu next to the watchlist-star and does not appear again. - Valentina.Anitnelav (talk) 19:03, 31 October 2018 (UTC)Reply
It's possible another script (or even the interface) is broken which breaks this gadget as well. Try mw:Help:Locating broken scripts and ignore "content security policy" reports. Matěj Suchánek (talk) 15:45, 1 November 2018 (UTC)Reply
I had a look at the edit history of this page. It seems that the threshold for users to use this gadget was raised from autoconfirmed to rollbacker [2]. This is it, probably. Is there a reason it was raised? -Valentina.Anitnelav (talk) 12:20, 2 November 2018 (UTC)Reply
It isn't working for me too. Queryzo (talk) 18:56, 15 November 2018 (UTC)Reply

@Ash Crow: Could you please have a look? Thank you --Vojtěch Dostál (talk) 15:48, 24 December 2018 (UTC)Reply

The change from autoconfirmed to rollbacker happened more than three years ago, so I doubt it is the reason you have trouble (and I have no idea why it was changed in the first place (ping @Jitrixis:). The gadget works fine for me, so I guess that, as Matěj Suchánek suggested, you may have another broken gadget interfering. -Ash Crow (talk) 17:25, 24 December 2018 (UTC)Reply
@Ash Crow, Jitrixis: Thank you. I am only an autoconfirmed user and I just installed the gadget so it could well be that it's not working because of my inadequate rights.--Vojtěch Dostál (talk) 08:06, 25 December 2018 (UTC)Reply
@Ash Crow: It seems that autoconfirmed users were included in June 2017[3] per the discussion above[4]. It seems they were excluded again in September 2018 [5]. -Valentina.Anitnelav (talk) 10:42, 25 December 2018 (UTC)Reply
@Vojtěch Dostál, Valentina.Anitnelav: OK got it. I thought that in the September 2018 the change was only in the description because I did not touch the "group()" function (which defines user rights), but that function was actually hijacked lower in the code and only used in the edit message. I changed to autoconfirmed everywhere, so it should work now. -Ash Crow (talk) 18:10, 25 December 2018 (UTC)Reply
I confirm it works for me now. Thank you very much Ash Crow! --Vojtěch Dostál (talk) 18:16, 25 December 2018 (UTC)Reply

Greek translation edit

Greek translation

'el': {
        'link-title': 'Άδειο',
        'box-title': 'Άδειασε το αντικείμενο',
        'action-cancel': 'Άκυρο',
        'action-save': 'Άδειο',
        'canceled': 'Η διαγραφή ακυρώθηκε',
        'notif-done':  'Η ενέργεια έγινε.',
        'notif-fail': 'Η ενέργεια απέτυχε.',
        'warning-message': 'Προσοχή! Θα αδειάσετε πλήρως αυτό το αντικείμενο. Μόνο οι διαχειριστές και οι αυτοεπιβεβαιωμένοι χρήστες μπορούν να χρησιμοποιήσουν αυτήν τη δυνατότητα. Ελέγξτε και επαληθεύστε τι θέλετε να αδειάσετε και μην επανατοποθετήσετε το αντικείμενο.',
        'labels': 'Ετικέτες',
        'descriptions': 'Περιγραφές',
        'aliases': 'Αλλώνυμα',
        'sitelinks': 'Διασύνδεσμοι',
        'locked-option': 'Αυτή η επιλογή είναι κλειδωμένη. Ρωτήστε έναν διαχειριστή!',
        'nothing-check': 'Δεν υπάρχει τίποτα να κάνει!',
      },

Xaris333 (talk) 13:42, 4 January 2019 (UTC)Reply

  Done (Use {{Edit protected}} whevever you request a change to the interface.) Matěj Suchánek (talk) 14:02, 6 January 2019 (UTC)Reply

Link not showing edit

Hello,

I just added this gadget to my common.js ; however the link for it does not show in the left hand-side menu (where i understand there should be a “Empty” link). Playing around with `debug=true`, I saw the link popping once ; however clicking on it was triggering another gadget (!) (LabelLister if I recall). I have emptied my Common.js of all scripts, and deactivated all gadgets that add PortletLinks, still nothing. The Firefox network console confirms that the JS is loaded.

Thanks, Jean-Fred (talk) 13:15, 17 June 2020 (UTC)Reply

Your common.js works for me. The tool will display "Empty" link in the same menu where for instance "Merge" has its link, next to the search field. --Matěj Suchánek (talk) 15:00, 18 June 2020 (UTC)Reply

sv translation edit

{{Editrequest}}

		'sv': {
			'box-title': 'Töm',
			'box-cancel': 'Stäng',
			'box-deleted': 'Raderad',
			'canceled': 'Radering avbröts',
			'box-captcha': 'Ange numret som ska tömmas:',
			'warning-message': 'OBS! du tömmer objektet fullständigt. Endast administratörer och patrullörer kan använda den här funktionen. Kontrollera och bekräfta vad du vill rensa. En bekräftelse begärs för att köra skriptet.',
			'labels': 'Etiketter',
			'descriptions': 'Beskrivningar',
			'aliases': 'Alias',
			'sitelinks': 'Webbplatslänkar',
			'unauthorized': 'Du har inte behörighet att använda det här skriptet!',
			'locked-option': 'Det är alternativet är låst. Fråga en systemadministratör!',
			'captcha-wrong': 'Säkerhetskoden är felaktig!',
			'nothing-check': 'Det finns inget att göra!',
			'sitelinks-check': 'Är du säker på att du vill radera alla webbplatslänkar! Du kan göra det på Wikidata!',
			'checklist': 'Denna raderingslista kommer utföras',
			'reason': 'Skriv här orsaken till att du vill tömma det här objektet:'
		},

--Sabelöga (talk) 01:20, 24 July 2021 (UTC)Reply

  Done --Matěj Suchánek (talk) 13:53, 24 July 2021 (UTC)Reply

Feature request: Remove references edit

Please add an option to remove all references, and only references.

Use case 1: An item is cited only to various Wikipedias, and I have proper sources to add

Use case 2: I duplicate an item, but need to replace all the citations.

Thank you. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:44, 12 February 2024 (UTC)Reply

Return to "Gadget-dataDrainer.js" page.