1 |
Seen Curtis' blog today... nice to hear there will finally be a |
2 |
search thing on the redesign. |
3 |
|
4 |
So, i have some code to propose for that feature, that i had |
5 |
already mentionned on getoo-dev@ last time it was discussed, but |
6 |
that i have reworked a bit since. It is here in action: |
7 |
http://tdegreni.free.fr/gentoosearch/ |
8 |
With the code actually in a JS file: |
9 |
http://tdegreni.free.fr/gentoosearch/GentooSearch.js |
10 |
|
11 |
The idea is to have a text search field (sure...) plus two levels |
12 |
of select menus to target the search. The second level depends on |
13 |
what was selected on the first: |
14 |
* Website (using Google): |
15 |
-> All www.gentoo.org |
16 |
-> Documentation |
17 |
-> Projects pages |
18 |
-> GWN: Weekly News |
19 |
-> GLEP: Enhanc. Prop. |
20 |
-> GLSA: Security Ann. |
21 |
-> Dev. Handbook |
22 |
-> The Doc |
23 |
-> Dev. pages |
24 |
* Forums (using phpBB): |
25 |
-> All |
26 |
-> ...each individual forum... |
27 |
* Mailing Lists (using GMane): |
28 |
-> All |
29 |
-> ...each ML which has GMane archives... |
30 |
* Bugs (using the bugs.g.o): |
31 |
-> All bugs |
32 |
-> Open bugs |
33 |
-> Closed bugs |
34 |
* Packages (using packages.g.o): |
35 |
-> All (there is not much to refine here) |
36 |
* Wiki (using gentoo-wiki.org): |
37 |
-> English wiki |
38 |
|
39 |
It now has support for I18N, which allows adding/removing/renaming |
40 |
some options of the 2nd select menu depending on the browser |
41 |
language. For now, i've used that for french only, in order to: |
42 |
- rename some entries, like "All" becoming "Tous" |
43 |
- for "Website", add a search for all french pages of www.g.o, one |
44 |
for french documentation, one for french GWN, and one for french |
45 |
dev handbook. |
46 |
- for "Forums", bump the French forum higher in the list |
47 |
- for "Wiki", add search on fr.gentoo-wiki.org |
48 |
|
49 |
The code is now all in the JS file, and only requires an onload |
50 |
event in the HTML page. I had made this change because i was |
51 |
thinking to make it a GreaseMonkey script at the end if there was |
52 |
finally no search form on wwwredesign, but anyway it also has the |
53 |
benefit to show the form only in JS-enabled browsers, which is good |
54 |
since it is required (sure we could think of having a simpler form |
55 |
for non-JS browsers). |
56 |
|
57 |
I think it is now a bit cleaner that it used to be, and would only |
58 |
require little modification to be usable on wwwredesign. If you |
59 |
think it worths it, feel free to do whatever is needed for |
60 |
copyright or license (i've put that code in public domain). And |
61 |
sure i'm available for questions/requests. |
62 |
|
63 |
Hope that helps, |
64 |
|
65 |
-- |
66 |
TGL. |
67 |
-- |
68 |
www-redesign@g.o mailing list |