Commit graph

11 commits

Author SHA1 Message Date
Reedy 01f6a6c34e Namespace extension
Bug: T278278
Change-Id: I49b57e68079c998419e235b1727eea8c121c234b
2022-03-05 17:03:35 +00:00
Siddharth VP 1f7b9d90df Support JSON files in gadgets
The parsed content of JSON files in the gadget is made available from the
gadget's JS files via require(). That is, MediaWiki:Gadget-data.json (or
Gadget:data.json) is available as `require('./data.json')`. This is
supported for both MediaWikiGadgetsDefinitionRepo and
GadgetDefinitionNamespaceRepo. The JSON parsing is done server-side.

JSON can only be used in "package" gadgets - in which the JS files can
also be invoked via require().

Also added a test for GadgetResourceLoaderModule.

Bug: T198758
Depends-On: Ib4556d09c4d393269e32771aab00f59a5f630e1b
Depends-On: Id4589a597ccfc4266b3e63d10f75b146aa7a287a
Change-Id: I21acb46cdd244a39b5cc6963aa763f0113bd1e38
2021-12-27 17:33:21 +00:00
Bartosz Dziewoński ea786ce9dc Re-apply "Make each gadget a separate preference, instead of one huge multiselect"
Previously attempted in 82281d82d0,
reverted in 7c4ac597e2.

This gives each section and each gadget's entry an `id` attribute,
which can be used for linking, as requested in T126962. Existing user
options still match the new preferences.

It also probably makes future improvements easier. No one understands
multiselects with subsections.

Bug: T126962
Change-Id: Ie96fd94c994d05ab8507920fa560c7ed9c1f9b69
2021-11-05 23:15:45 +01:00
Krinkle 7c4ac597e2 Revert "Make each gadget a separate preference, instead of one huge multiselect"
This reverts commit 82281d82d0.

Bug: T126962
Bug: T292777
Change-Id: I7c858b8c4bc12626ea1d53374ea4d75862f684ff
2021-10-07 19:52:18 +00:00
Bartosz Dziewoński 82281d82d0 Make each gadget a separate preference, instead of one huge multiselect
This gives each section and each gadget's entry an `id` attribute,
which can be used for linking, as requested in T126962. Existing user
options still match the new preferences.

It also probably makes future improvements easier. No one understands
multiselects with subsections.

Bug: T126962
Change-Id: Ifaca96e288c475017636c2408712d6a20aa77da9
2021-09-30 18:39:41 +02:00
libraryupgrader b5e7230698 build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: Id55b598a81bd22cbe0f415f32fd28ba3825bf61e
2021-07-22 20:01:41 +00:00
Umherirrender e9f6ea3492 Reduce message parse in GadgetHooks::getPreferences (second time)
Multiselect can build by message keys only and allows to parse them.

This reverts fix for T32182, there is no way to handle the dir on each
item/checkbox at the moment

Reintroduce Iccd6202c443bd699aa3a911c8ba36a2b7bcdcfed (reverted by
I1cf3c7c61e9e90567587350639590691add1af34)

Bug: T58633
Bug: T278650
Depends-On: I8f52f21ae2641ddcad1aa85ce6bf14de1a09ab4b
Change-Id: If71008195f58faff9f302f7ea2bf9dbb1a527844
2021-05-28 20:52:58 +02:00
Jforrester b50309db2c Revert "Reduce message parse in GadgetHooks::getPreferences"
This reverts commit 662c63882c.

Reason for revert: plain() is too plain for our needs, sadly.

Change-Id: I1cf3c7c61e9e90567587350639590691add1af34
2021-04-21 21:55:32 +00:00
Umherirrender 662c63882c Reduce message parse in GadgetHooks::getPreferences
Multiselect can build by message keys only

This reverts fix for T32182, there is no way to handle the dir on each
item/checkbox at the moment

Bug: T58633
Bug: T278650
Depends-On: Ie983757081dc39f3685ba5b01b02bd124880e1af
Change-Id: Iccd6202c443bd699aa3a911c8ba36a2b7bcdcfed
2021-04-20 18:49:19 +00:00
James D. Forrester ed181c2db0 build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: I61896470e0dc9cffd3e8fff8b45e2231ef4265f3
2019-10-09 16:24:09 -07:00
Max Semenik 7d1b74d8c7 Split tests to unit and integration
Change-Id: Ib703086c38b6b1ca13f37504c5b6eab6834694b8
2019-07-23 02:23:41 -07:00