Allow API endpoint customization for mw.widgets.TitleWidget
authorSanthosh Thottingal <santhosh.thottingal@gmail.com>
Fri, 25 Nov 2016 07:02:37 +0000 (12:32 +0530)
committerEd Sanders <esanders@wikimedia.org>
Mon, 28 Nov 2016 23:34:48 +0000 (23:34 +0000)
commit950b292d201eec24a052b6e0687866cbcb71dc95
treea0406a9c9e7ffa190166b5961a3f229cf11e993a
parent22b38fbbb94e1dacb39e2611f3952707c7b5e685
Allow API endpoint customization for mw.widgets.TitleWidget

Currently the API is not customizable and always points to
current wiki's api returned by `new mw.Api()`.

This patch allows users to specify their own API object for
querying titles e.g. searching for titles on a different
language Wikipedia when translating pages.

Change-Id: I81811cdd1a0750a8335432eee8f971ab9e0b8ee7
resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js