feat(filterButtons): support template expansions
Summary
Adds the functionality for template expansion upon filter button change.
Usage:
<div data-filter-expansion-template="TemplateName" data-filter-groups="group1,group2">Default content</div>
will lead to wikitext of {{TemplateName|group1=options|group2=options}} where options is a comma-separated list of all active filters for that group.
How did you test this change?
http://darkrai.wiki.tldev.eu/rocketleague/User:SyntacticSalt/Test (http://darkrai.wiki.tldev.eu/commons/MediaWiki:Common.js/FilterButtons.js)
Open questions:
- [x] Should there be a specific behavior for "curated"? Currently, the filter options enabled before switching to "curated" will be used.
- [x] My initial prototype (pre-refactor) tried to further reduce API calls by a) not expanding the template when the filter buttons are equivalent to the default filter button settings b) not expanding the template when perhaps only unrelated filter categories changed Do we want/need that again? - not implemented
Will review tomorrow morning.
Why the need for inversion of the logic?
Why the need for inversion of the logic?
Was only needed for the curated part, reverted the rest