> or use mw.Title to do it for you.

That how i did it in the categories search in MobileFrontend, it's (in my 
opinion) the easiest solution:
https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/resources/mobile.categories.overlays/CategoryLookupInputWidget.js#L54-L59

Best,
Florian

-----Original-Nachricht-----
Betreff: Re: [Wikitech-l] jQuery UI, opensearch API,    categories and 
autocompletion -- oh my!
Datum: Thu, 07 May 2015 01:16:38 +0000
Von: "Krinkle" <[email protected]>
An: "wikitech-l Wikimedia List" <[email protected]>

> On 6 May 2015, at 20:26, Jack Phoenix <[email protected]> wrote:
>
> On Wed, May 6, 2015 at 9:06 PM, Brad Jorsch (Anomie) 
> <[email protected]>
> wrote:
>
>> On Wed, May 6, 2015 at 1:31 PM, Jack Phoenix <[email protected]>
>> wrote:
>>
>>> How can I totally strip out the "Category:" [..]
>>
>> Hit api.php?action=query&meta=siteinfo&siprop=namespaces to get the
>> localized name of the Category namespace. Or you should be safe just
>> removing everything up to the first colon.
>
>
> Yeah, probably better to avoid the extra HTTP request.
>

Namespace information and variants thereof are readily available via 
mw.config wgNamespaceIds.

You can manually remove any values with id 14 (category), or use mw.Title to 
do it for you.

As for the UI library, I'd recommend using the jquery.suggestions module in 
a MediaWiki context. Avoid jQuery UI.

This is already used for page inputs (e.g. search), and user name inputs 
(e.g. Special:Log).

Creating an instance of it for categories should be straight forward.

You can use mediawiki.searchSuggest or mediawiki.userSuggest as starting 
point:
https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki/mediawiki.userSuggest.js
 
<https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki/mediawiki.userSuggest.js>--
 Krinkle_______________________________________________Wikitech-l mailing 
[email protected]https://lists.wikimedia.org/mailman/listinfo/wikitech-l



_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to