Page MenuHomePhabricator

Gadget user configuration
Closed, ResolvedPublic

Description

Author: lambdav

Description:
Currently, MediaWiki gadgets enable to extends the user interface.

There is no mean to let each user configure some gadget options.

It would be possible to make gadget user configuration by loading a user script file (for example, User:xxxx/gadget-config.js) before the first gadget script.


Version: unspecified
Severity: enhancement

Details

Reference
bz21897

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:55 PM
bzimport set Reference to bz21897.

I get your point.

Variables set in User:Xxxx/vector.js are loaded after the gadget so they don't affect.
A way around this, for now, would be put the gadget in an addOnloadHook.

This way the gadget is postponed, thus loading after the user-script.

rd232 wrote:

(In reply to comment #1)

I get your point.

Variables set in User:Xxxx/vector.js are loaded after the gadget so they don't
affect.
A way around this, for now, would be put the gadget in an addOnloadHook.

This way the gadget is postponed, thus loading after the user-script.

It's worth noting that Twinkle does this very effectively; per-user options are stored in the user's /twinkleoptions.js, and configured via a script preference panel accessible via Wikipedia:Twinkle/Preferences.

Just for the benefit of people searching for bugs on this topic:

See [[mw:User:Salvatore_Ingala/Notes]] for some work Salvatore has been doing on this.

According to https://www.mediawiki.org/w/index.php?title=Roadmap&oldid=577532#Support_2 , the dev team is aware of this work and plans to look at it at some point.

Krinkle claimed this task.
Krinkle subscribed.

Since a few years now, there exists the userjs- prefix in the preferences database which gadgets may read from mw.user.options and set using mw.Api.

The requirement is that the gadget presents its own contextual user interface for this, but at least these settings are kept private, shared across a users devices, and readable and saveable in a quick and easy way (standard JSON). Perhaps good enough from the 2009 perspective when the task was filed.

https://www.mediawiki.org/wiki/Manual:User_preferences#Gadget_and_user_script_preferences