Last modified: 2014-02-12 23:46:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21956, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19956 - Suggestions in search for Wikipedia Mobile
Suggestions in search for Wikipedia Mobile
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
Feature requests (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Nobody - You can work on this!
:
: 29559 (view as bug list)
Depends on: 32082
Blocks: 27411
  Show dependency treegraph
 
Reported: 2009-07-27 17:39 UTC by Michael
Modified: 2014-02-12 23:46 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
The source code for a working example (3.95 KB, application/zip)
2011-09-29 23:48 UTC, Ross
Details

Description Michael 2009-07-27 17:39:12 UTC
Is it possible to have a "suggested searches" thing for the search box?  I.e. typing "Fra-" gives "France" as one of the first ones, or something.
Comment 1 Mark A. Hershberger 2011-02-14 21:49:27 UTC
I'm guessing you'll have to wait quite a while more on this one.
Comment 2 Tomasz Finc 2011-08-03 20:45:12 UTC
*** Bug 29559 has been marked as a duplicate of this bug. ***
Comment 3 Ross 2011-09-29 23:48:50 UTC
Created attachment 9128 [details]
The source code for a working example

This is a problem made easy by Wikipedia's existing API. I have a working example (modified after mobile.wikipedia.org) at http://rossbender.com/temp/testwiki/ - try it on your mobile phone! See also my personal site's example (a stripped down version): http://rossbender.com/random/wikipedia/

The changes attached are minimal to the already existing page at mobile.wikipedia.org. I'm using that as comparison instead of en.m.wikipedia.org for simplicity's sake only--the changes would be similar there. If you compare the HTML source from mobile.wikipedia.org with the source attached that you will see I have only added 4 lines in the <head> (meta tag for mobile compatibility, 1 link to an external stylesheet, and 2 links to external Javascript files) and 1 line in the <body> (results div).

(Note that the wikiapi.php file is only necessary on my server because I cannot do cross-domain XML requests in Javascript. So the wikiapi.php file simply returns the results of the Wikipedia API results.)

I personally prefer the results being displayed as part of the page, but adding the same effect to a dropdown box is not difficult using http://jqueryui.com/demos/autocomplete/. For my own personal site I had actually started with that but preferred to opt for the more simplistic version.

I would be happy to help out with this where necessary. Autocomplete for search engines nowadays is basically a must (read more on my thoughts here: http://rossbender.com/2011/09/25/mobile-wikipedia-search/).

Let me know if there's anything more I can do to help. Thanks!
Comment 4 Patrick Reilly 2011-09-30 22:11:42 UTC
Ross great work!

How hard do you think it would be to remove the dependency on jQuery?
Comment 5 Ross 2011-10-04 19:52:05 UTC
I updated the page at http://www.rossbender.com/temp/testwiki/ to be jQuery independent (see the JavaScript file at http://www.rossbender.com/temp/testwiki/main.js compared to the old one: http://www.rossbender.com/temp/testwiki/mainJquery.js ).

I removed a few "nice-ities" such as the window automatically scrolling to the top as well as the colored background on a touch event. They wouldn't be super difficult to add back in but I figured those would be more of a site-wide design rather than through the plugin.
Comment 6 Tomasz Finc 2011-10-26 01:07:08 UTC
This feature will be launching shortly. Ideally this week.
Comment 7 Tomasz Finc 2011-10-26 01:07:42 UTC
as a beta
Comment 8 Tomasz Finc 2011-10-31 19:24:47 UTC
Feature is out in beta: http://blog.wikimedia.org/2011/10/27/wikimedia-mobile-opt-in-beta/
Comment 9 Tomasz Finc 2012-01-19 12:28:32 UTC
Feature has been out in production for a bit.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links