Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 521508 - doesn't seem to be a way to search packages.gentoo.org from a text-only browser
Summary: doesn't seem to be a way to search packages.gentoo.org from a text-only browser
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: [OLD] gpackages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Packages Website
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-29 14:54 UTC by Donald
Modified: 2015-10-01 14:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to packages.git according to Donald's comments (search.patch,835 bytes, patch)
2015-08-17 18:19 UTC, Felix Janda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Donald 2014-08-29 14:54:49 UTC
The current search feature at packages.gentoo.org is implemented with Javascript in a way that users with plain old text console-based browsers (e.g., links) cannot use.

When I go to the page in `links` ("-no-g" text-only mode -- and probably in graphics mode as well, but I don't use that), I don't see the search box, or any indication of a search feature anywhere on the page (only option then is to use the "categories" link to browse the tree, which is quite inconvenient). Same thing in a "regular" browser, like FF, when Javascript is turned off.

This imposes an unnecessary burden on users with no Javascript capability, whether by choice or not (one group we should consider is users in the process of building a Gentoo installation who only have a text-console-based browser to use).

Google-backend search boxes are trivial to implement in regular HTML (the output won't be as "pretty", but at least it's functional), and there's a standard HTML mechanism for providing "fallback" code when browsers don't have Javascript capabilities (<noscript> element).

So can someone add a non-Javascript search alternative to packages.gentoo.org?


Reproducible: Always

Steps to Reproduce:
1. Go to packages.gentoo.org in a browser with no Javascript capability.
2. Try to search for something.
3. Be disappointed.
Actual Results:  
No search box. No way to search beyond just browsing the entire Portage tree (if you can even figure out that the "categories" link lets you do that).

Expected Results:  
A search box to accept your query and return useful results.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-09-08 05:18:50 UTC
patches welcome.
Comment 2 Donald 2014-09-10 03:30:52 UTC
I have no idea how to submit a patch for a website, but looking at how the current search feature is implemented, it seems that the fix can be as simple as replacing this line (number 43 in the HTML source of the homepage):

  <div id="cse" style="width: 100%;">Loading</div>

by this:

  <div id="cse" style="width: 100%;">
  <form class="search" method="GET" action="http://www.google.com/search">
  <input type="text" name="as_q" value="" size="16" maxlength="127">
  <input type="hidden" name="hl" value="en">
  <input type="hidden" name="as_sitesearch" value="packages.gentoo.org">
  <input type="submit" value="Search">
  </form>
  </div>

(No <noscript> needed. Javascript-enabled browsers will replace the GET search box by the fancy Javascript one, just like they replace the word "Loading" now.)

This can be made more or even less complicated, as desired. (In particular, the size= and maxlength= attributes and the "hl" parameter aren't strictly necessary, and there may be other parameters I don't know about that, for example, make Google return search results with secure links to https://packages.gentoo.org/ -- the code above only returns normal http:// links, even when action="https://www.google.com/search" is used.)

BTW, if you're making a mockup of this to look at (not changing the actual website itself), you might also want to:

  s/="\/media/="http:\/\/packages.gentoo.org\/media/

to the HTML source, so the stylesheet and site logo will be loaded.

I coulda sworn something like this used to be on the site before the current Javascript-based search. If so, then maybe just put the old search-box HTML code in the "cse" div in place of what I have above.
Comment 3 Donald 2015-01-23 03:20:59 UTC
bump...

Come on, it shouldn't take more than 4 months to make this trivial change.
Comment 4 Donald 2015-06-13 02:17:03 UTC
Coming up on a full year. Unbelievable...
Comment 5 Felix Janda 2015-08-17 18:19:36 UTC
Created attachment 409292 [details, diff]
Patch to packages.git according to Donald's comments
Comment 6 Alex Legler (RETIRED) archtester gentoo-dev Security 2015-10-01 14:35:26 UTC
Thank you for your patch. With the upcoming site relaunch that is based on new code, we no longer rely on Google to do package searching. As such, this issue is obsolete.