Last modified: 2014-08-26 01:29:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72019, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70019 - Add the ability to configure gadgets on a per site or wiki basis
Add the ability to configure gadgets on a per site or wiki basis
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Gadgets (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: gadgets-2.0
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-26 01:15 UTC by mdowdell
Modified: 2014-08-26 01:29 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description mdowdell 2014-08-26 01:15:27 UTC
Something else I'd like add to the gadget feature requests is allowing users to configure a gadget to some extent. A rough comparison might be using $wgExampleExtensionVariable to set something in LocalSettings.php.

As an example of how this might work in a js environment, take http://dev.wikia.com/wiki/AjaxRC which uses ajax to refresh the content of a page. By default this loads on RecentChanges and WikiActivity (something similar to RecentChanges made by Wikia to be more friendly to new users). However, the pages it loads can be altered to any page imaginable. A typical extra place for it to load might be a forum hub to track the latest changes to threads.

Currently, the user sets the variables and imports the script. If this script were moved to a gadget in it's current state there would be no way to configure it unless you did something like add a site dependency and configure it in MediaWiki:Common.js.

I think a better way would to be to add a way to set variables in a gadget preferences page, with a form that can accept pre-determined types, e.g. string (foo), array (foo, bar, baz, ...), number (12345), boolean (checkbox), etc. These variables could then be set using something like mw.user.gadgetPrefs.set( 'ajaxrc-someVar' ) (possibly namespaced to the gadget?) and then accessed by the gadget using mw.user.gadgetPrefs.get( 'ajaxrc-someVar' ) Ideally, this form would show the default values used as well.

A couple of things to mull over if this gets implemented:
- Should we allow configuration on a wiki and/or user basis for default gadgets? Perhaps set sub-defaults, e.g. default < wiki < user
- If global gadgets are introduced gadgets could be identified by hash values rather than names. How could we avoid clashes where the same variable is being inadvertently set twice or more by different scripts?
Comment 1 Helder 2014-08-26 01:29:31 UTC
Customization of gadgets is in the roadmap for Gadgets 2.0 / 3.0:
https://www.mediawiki.org/wiki/Extension:Gadgets/Roadmap#Gadgets_2.0
https://www.mediawiki.org/wiki/Roadmap/2012/April#MediaWiki_infrastructure

For notes on the implementation, see
https://www.mediawiki.org/wiki/User:Salvatore_Ingala/GSoC_2011_application
https://www.mediawiki.org/wiki/User:Salvatore_Ingala/Notes

However, I believe this will only be done after the implementation of global gadgets is finished...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links