MediaWiki talk:Gadgets-definition

From Wikidata
Jump to navigation Jump to search

Enable Resource Loader[edit]

Since the MediaWiki:Gadget-popups.js contains just a mw.loader.load call, I think its definition should be changed to

* popups[ResourceLoader]|popups.js

to enable Resource Loader. Helder 15:46, 12 November 2012 (UTC)

Please, don't! Popups will break badly if it's loaded via the resource loader (that's a known issue, but apparently nobody is up to restructure it to that point) - Hoo man (talk) 23:14, 12 November 2012 (UTC)[reply]
Well, it is in use on ptwiki (see w:pt:MediaWiki:Gadgets-definition#navigation) and no one reported problems about it. Helder 00:49, 13 November 2012 (UTC)
So? Helder 19:13, 27 February 2013 (UTC)

dependencies=mediawiki.util for MediaWiki:Gadget-enumItems.js[edit]

MediaWiki:Gadget-enumItems.js uses mw.util. The definition should include this dependency:

enumItems[ResourceLoader|dependencies=mediawiki.util]|enumItems.js

instead of

enumItems[ResourceLoader]|enumItems.js

--Fomafix (talk) 09:01, 27 February 2013 (UTC)[reply]

✓ Done Thank you! — Arkanosis 13:24, 27 February 2013 (UTC)[reply]

Remove "Search"?[edit]

With the deployment of the "new" search suggestions system, does it still make sense to keep Search as a gadget? --Yair rand (talk) 20:20, 1 May 2013 (UTC)[reply]

Replace wikEdDiff by Schnark's diff[edit]

I suggest replacing wikEdDiff by Schnark's diff. Advantages:

--Leyo 14:39, 25 July 2013 (UTC)[reply]

+1 --Perhelion (talk) 15:24, 25 July 2013 (UTC)[reply]

Split up gadgets[edit]

It is possible to split up a gadget into several files. mw:Manual:Developing extensions also suggest to split up extensions into several files. At least a separate file for the internationalisation of the gadget would be useful, to have separate revision histories for the internationalisation and for the implementation. The ResourceLoader combines several files to a single module and a single request, so there is no disadvantage for the performance. A requirement for splitting up a gadget is to have not a single closure. Without a closure common variables have to attached to the global object. For internationalisation global object in mw:ResourceLoader/Default modules#mediaWiki.message is suitable. Some gadgets already use mediaWiki.message and are easy to split.

For example the MediaWiki:Gadget-Move.js can split up into MediaWiki:Gadget-Move.i18n.js with the content

switch ( mw.config.get( 'wgUserLanguage' ) ) {
default:
case 'en':
	mw.messages.set( {
		'move':			'Move',
		'close':		'Close'
	} );
	break;
case 'de':
case 'de-at':
case 'de-ch':
case 'de-formal':
	mw.messages.set( {
		'move':			'Verschieben',
		'close':		'Schließen'
	} );
	break;
}

The internationalisation file get loaded by the following line in MediaWiki:Gadgets-definition:

Move[ResourceLoader|dependencies=mediawiki.util,wikibase,jquery.ui.dialog,jquery.spinner]|Move.i18n.js|Move.js

This solution is not perfect, because there is no language fall-back and all languages gets transferred. But this solution already goes into the direction of mw:Gadgets 2.0#Messages with mediaWiki.message. With Gadgets 2.0 the internationalisation messages can moved from the i18n.js file into system messages. --Fomafix (talk) 10:27, 10 December 2013 (UTC)[reply]

Why are dependencies listed separately from the code?[edit]

@Pasleim: Why isn't the list of dependencies included in the script file of each gadget? This makes inclusions in Special:MyPage/common.js like importScript('MediaWiki:Gadget-AuthorityControl.js'); problematic. Petr Matas 07:59, 15 December 2014 (UTC)[reply]

When your use mw.loader.load( 'ext.gadget.gadget' ) the gadget with all depending modules get loaded by a single request. The request gets automatically cached and the cache gets invalided when the code is changed. --Fomafix (talk) 11:40, 15 December 2014 (UTC)[reply]
I tried that and it works nicely except that:
Are there any workarounds for these problems? Petr Matas 15:41, 15 December 2014 (UTC)[reply]
With the ResourceLoader the code gets minimized and cached in the localStorage. When you enable the debug mode with debug=true in the URL. The modules gets loaded by separate requests. As far as I know it is currently not possible to load user scripts as modules. --Fomafix (talk) 16:34, 15 December 2014 (UTC)[reply]


Constraint checks?[edit]

Can we add one that links to the constraint checks for an entity? Ideally, it's activated by default and appears as tab. --- Jura 14:52, 7 July 2015 (UTC)[reply]

+1. Would like it, even was my idea. Matěj Suchánek (talk) 15:02, 7 July 2015 (UTC)[reply]
You mean a new gadget which just adds a tab with a link? Which link? Can you give an example? --Fomafix (talk) 17:10, 7 July 2015 (UTC)[reply]
Do you mean on page Q4115189 a new tab with a link to Special:ConstraintReport/Q4115189? --Fomafix (talk) 17:23, 7 July 2015 (UTC)[reply]
Yes, I suppose a tab in the left bar is meant. Matěj Suchánek (talk) 17:28, 7 July 2015 (UTC)[reply]
No, next to label lister. Try fr:MediaWiki:Gadget-OngletJournal.js. Changes needed:
mw.util.getUrl( 'Special:ConstraintReport/', { mw.config.get( 'wgPageName' ) } ),
and "p-views" instead of "p-cactions"
--- Jura 17:46, 7 July 2015 (UTC)[reply]
I think that should be done in the extension so that it is enabled for everyone. -- Bene* talk 20:32, 7 July 2015 (UTC)[reply]
Would make a more seamless experience. You always get page jumps with gadgets. Sjoerd de Bruin (talk) 20:33, 7 July 2015 (UTC)[reply]
That sounds all good, but rather than wait another six months, can we do something about it now? --- Jura 04:37, 8 July 2015 (UTC)[reply]

Proposal: Add DiffLists.js as a gadget[edit]

I propose that DiffLists.js (MediaWiki:Gadget-DiffLists.js, see Watchlist demo, RecentChanges demo) be made into a gadget. The script replaces autogenerated summaries in watchlists, recent changes, related changes, history pages, and contributions pages with concise versions of the changes to the page, and also allows filtering to only show certain types of changes. --Yair rand (talk) 20:41, 15 June 2016 (UTC)[reply]

We need your input about gadgets and UI stability[edit]

Hello all,

We're starting a consultation about gadgets and how we can improve our workflows to avoid breaking user scripts when we're modifying Wikidata's interface. We would be very happy if the gadgets/user scripts developers could take time to answers these few questions, even if of course anyone is welcomed to add suggestions or questions.

Thank you very much! Lea Lacroix (WMDE) (talk) 15:52, 9 December 2016 (UTC)[reply]

ImageHeader[edit]

As requested I would like to add the following gadget to the list of gadgets: https://www.wikidata.org/wiki/MediaWiki:Gadget-ImageHeader.js

I would like to get approval to add the following change to this page:

  • ImageHeader[ResourceLoader]|ImageHeader.js

 – The preceding unsigned comment was added by Jonas Kress (WMDE) (talk • contribs) at 8. 3. 2017, 10:56‎ (UTC).

✓ Done For reference, users expressed their wish at the project chat. Matěj Suchánek (talk) 14:45, 8 March 2017 (UTC)[reply]

duplicate the current item, minus sitelinks and descriptions[edit]

User:Magnus_Manske/duplicate_item.js. d1g (talk) 02:02, 1 June 2017 (UTC)[reply]

Request constraint check gadget[edit]

I would like to request turning the user script for constraint checks into a gadget. --Jonas Kress (WMDE) (talk) 09:15, 9 June 2017 (UTC)[reply]

@Matěj Suchánek, Multichill, Sjoerddebruin: Can you please have a look? --Lydia Pintscher (WMDE) (talk) 17:08, 15 June 2017 (UTC)[reply]
Are we done with the feedbacks? What text would you like to have displayed in user preferences? Matěj Suchánek (talk) 17:23, 15 June 2017 (UTC)[reply]
I think it should be: Property constraints - Shows property constraints reports for statements on an item page Help:Property_constraints_portal --Jonas Kress (WMDE) (talk) 19:45, 15 June 2017 (UTC)[reply]
✓ Done Matěj Suchánek (talk) 14:29, 16 June 2017 (UTC)[reply]
Thanks! :) --Lydia Pintscher (WMDE) (talk) 14:47, 16 June 2017 (UTC)[reply]

mediawiki.api.*[edit]

Please remove all dependencies on modules with the names mediawiki.api.*. The modules are merged into mediawiki.api by gerrit:434179 and are now deprecated. --Fomafix (talk) 06:56, 6 June 2018 (UTC)[reply]

✓ Done Matěj Suchánek (talk) 07:15, 8 June 2018 (UTC)[reply]

Nearby link gadget[edit]

I would like to add my nearby link script as a gadget. It adds a link in the upper right to Special:Nearby on items with coordinates (P625). e.g. https://www.wikidata.org/wiki/Special:Nearby#/page/Q309331 link/icon added on Q309331 (item for Ohio State University)

I have had this script for a while and it has worked well for me, and find it useful. Aude (talk) 18:38, 18 October 2018 (UTC)[reply]

Make gadget-Merge active by default[edit]

{{Editprotected}} I believe that the gadget Merge has to be active by default (everyone will still be able to turn it off in his Preferences). This is by far the most important gadget for new users. --Borzykh (talk) 17:25, 5 August 2019 (UTC)[reply]

Remove unneeded mediawiki.notify[edit]

{{Edit protected}} Please remove all of the dependencies on mediawiki.notify, which is now loaded by default --DannyS712 (talk) 07:16, 8 April 2020 (UTC)[reply]

Done by Krinkle as GIE (thanks for your hard work!) --DannyS712 (talk) 18:18, 12 April 2020 (UTC)[reply]

Split Wikidata-centric into "read Wikidata" and "change Wikidata"[edit]

It would be super-useful to have a basic split of the gadgets that can be used to change Wikidata and to read Wikidata. --Izno (talk) 17:13, 12 April 2020 (UTC)[reply]

anonymous can't pick language[edit]

I was trying to pick language in Wikidata as anonymous userand failed. This is due to issue in ULS and caches (explained in phab:T161517), anonymous users can't pick language other than English (unless they change the URL and add ?uselang parameter). Sadly it seems like complicated issue that doesn't look like it would be solved any time soon.

However this issue impacts also Commons, but there is a workaround for this there - they have c:MediaWiki:Gadget-AnonymousI18N.js enabled by default for anons which add simple "Language select" menu that works. Lucas Werkmeister, Krinkle would it be possible to import that to here as well?

Thanks, Eran (talk) 06:25, 7 September 2021 (UTC)[reply]

Move moveClaims next to the Move gadget[edit]

It would make sense to me to list th and MoveClaims gadget next to the Move gadget. They're very similar in functionality. Might even be fitting to merge them at some point. 1Veertje (talk) 14:07, 12 January 2022 (UTC)[reply]

MarkAdmins[edit]

markAdmins[ResourceLoader|dependencies=mediawiki.util]|markAdmins.js

change to

markAdmins[ResourceLoader|dependencies=mediawiki.util|targets=desktop,mobile]|markAdmins.js

If you do, then its use can be seen from mobile too. Regards, ZI Jony (Talk) 01:45, 18 January 2022 (UTC)[reply]

Placement of sitelink item search in Vector 2022 skin[edit]

Hi folks,

Currently, when using the Vector 2022 skin in Wikidata, the "Search item by sitelink" feature is incorrectly positioned within the main search input. This has resulted in the feature becoming unusable, as it cannot be activated. (See description of the issue in this ticket)

As the gadget is community-maintained, we are reaching out for a fix from the maintainers of the gadget. Our recommendation from WMDE is to disable the gadget in the Vector 2022 skin until the issue is resolved.

Many thanks. -Mohammed Sadat (WMDE) (talk) 18:31, 9 February 2023 (UTC)[reply]

✓ Done --Matěj Suchánek (talk) 13:48, 11 March 2023 (UTC)[reply]

Watchlistnotice[edit]

@Matěj Suchánek: since your last edit I see the gadget Watchlistnotice just as "⧼gadget-WatchlistNotice⧽" instead of with an explanation. Could you check? Thanks! --Epìdosis 21:31, 5 August 2023 (UTC)[reply]

@Epìdosis: I think there has never been an explanation. Neither MediaWiki:Gadget-WatchlistNotice nor MediaWiki:Gadget-WatchlistNotice/en etc. have ever existed. --Matěj Suchánek (talk) 07:40, 6 August 2023 (UTC)[reply]
@Matěj Suchánek: Thanks for the explanation, evidently I remember something wrong; the gadget was added last November by @Lymantria: with this edit. Maybe an explanation can be added now. --Epìdosis 08:50, 6 August 2023 (UTC)[reply]

quickeditcounter[edit]

The gadget quickeditcounter is obsolet, because MediaWiki now shows an edit counter on the contribution page. Please remove

* quickeditcounter[ResourceLoader|dependencies=mediawiki.api,mediawiki.util]|quickeditcounter.js

from MediaWiki:Gadgets-definition. Fomafix (talk) 11:42, 29 August 2023 (UTC)[reply]

The JavaScript code in MediaWiki:Gadget-quickeditcounter.js gets loaded at least by https://ca.wikipedia.org/wiki/MediaWiki:Gadget-quickeditcounter.js Therefor before deleting a deprecation is needed. --Fomafix (talk) 09:04, 30 August 2023 (UTC)[reply]

PrimarySources[edit]

This gadget throws a fatal JS error since this week: Task 352603. Until this is fixed I suggest that the gadget should be disabled because it blocks the execution of other gagdets. Raymond (talk) 16:56, 2 December 2023 (UTC)[reply]

Please don’t disable the gadget entirely, because that would potentially cause preferences to be lost. Instead, add an impossible load condition that is not evaluated on Special:Preferences (e.g. |actions=none or |namespaces=-2), remove the JS file name from the gadget definition, or simply empty the JS file itself. —Tacsipacsi (talk) 19:07, 2 December 2023 (UTC)[reply]
Good point! Raymond (talk) 20:05, 2 December 2023 (UTC)[reply]
I have just disabled it. --Matěj Suchánek (talk) 11:39, 3 December 2023 (UTC)[reply]
@Matěj Suchánek Thank you. Raymond (talk) 12:01, 3 December 2023 (UTC)[reply]