RCFilters: Export config vars in the RL modules where possible
authorRoan Kattouw <roan.kattouw@gmail.com>
Sat, 9 Feb 2019 22:59:10 +0000 (14:59 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Sun, 10 Feb 2019 03:36:16 +0000 (03:36 +0000)
commitbf4f9d0313495dd67a53b9925edf9a3cc6ef36fe
treee22b634ae75c5454f93129662d88fec62113b520
parenta9ebecb9214b1e9ab81cb63cd0bcdd3ac487d0a5
RCFilters: Export config vars in the RL modules where possible

Right now there are only a few settings that don't depend on the request
context, but we can at least export those. The tag data in
particular can get pretty big.

Downgrade the type hint for ChangeTags::tagDescription() and
tagLongDescriptionMessage() from IContextSource to MessageLocalizer, so
we can pass a ResourceLoaderContext to these functions. (Since
IContextSource extends MessageLocalizer, this won't break any callers.)

truncateTagDescription() can't be downgraded to MessageLocalizer because
it needs a Language object, so hack up a fake RequestContext when
calling it. It would be nice if this weren't necessary; perhaps we can
move getLanguage() from IContextSource up into MessageLocalizer?

Bug: T201574
Change-Id: I9b66e35de826a07aa9551ba285e64e4852293229
includes/changetags/ChangeTags.php
includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialWatchlist.php
resources/Resources.php
resources/src/mediawiki.rcfilters/Controller.js
resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
resources/src/mediawiki.rcfilters/ui/FilterWrapperWidget.js
resources/src/mediawiki.rcfilters/ui/WatchlistTopSectionWidget.js