On Wed, May 6, 2015 at 6:31 PM, Jack Phoenix <jack(a)countervandalism.net>
wrote:
Hi all,
I'm trying to build an autocompletion thingy that suggests categories based
on user input using the opensearch API [1]. It sounds like a relatively
simple thing and I was able to hack something that somewhat works in a few
minutes...there's just one gotcha: this thing is supposed to suggest
nothing but categories, so I don't need nor want the "Category:" label (or
its localized equivalent) to show up.
I've been able to manipulate the result set so that whenever the user
clicks on a suggestion, whatever gets inserted into the <input> is
correct...but what is *displayed* to the user still includes the
"Category:" part in it. The various ways how I've been able to remove the
"Category:" part from the value have been more or less hacky and
inefficient.
What am I doing wrong here [2]? How can I totally strip out the "Category:"
part and pretend it doesn't exist and never did?
[1]
https://www.mediawiki.org/wiki/API:Opensearch
[2]
https://www.mediawiki.org/wiki/User:Jack_Phoenix/AutocompleteTest
Thanks and regards,
--
Jack Phoenix
MediaWiki developer
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l