2 // @name Flickr group search
3 // @namespace http://6v8.gamboni.org/
4 // @description add a direct group search box when you are reading a group thread.
6 // @identifier http://6v8.gamboni.org/IMG/js/flickrgroupsearch.user.js
8 // @creator Pierre Andrews (mortimer.pa@free.fr)
9 // @include http://*flickr.com/groups/*/discuss/*
12 // --------------------------------------------------------------------
14 // This is a Greasemonkey user script.
16 // To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
17 // Then restart Firefox and revisit this script.
18 // Under Tools, there will be a new menu item to "Install User Script".
19 // Accept the default configuration and install.
21 // --------------------------------------------------------------------
22 // Copyright (C) 2006 Pierre Andrews
24 // This program is free software; you can redistribute it and/or
25 // modify it under the terms of the GNU General Public License
26 // as published by the Free Software Foundation; either version 2
27 // of the License, or (at your option) any later version.
29 // This program is distributed in the hope that it will be useful,
30 // but WITHOUT ANY WARRANTY; without even the implied warranty of
31 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 // GNU General Public License for more details.
34 // The GNU General Public License is available by visiting
35 // http://www.gnu.org/copyleft/gpl.html
37 // Free Software Foundation, Inc.
38 // 51 Franklin Street, Fifth Floor
39 // Boston, MA 02110-1301
45 var hint = document.evaluate("//td[@id='Hint']/p/a",
46 document.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null
49 var gp_id = hint.href.split('=');
51 var search = hint.parentNode.appendChild(document.createElement('span'));
52 search.className = "TopicListing";
53 search.innerHTML = '<h4 style="padding-top: 5px;">Or, Search discussions:</h4>\
54 <form method="get" action="/search/groups/">\
55 <input type="hidden" value="'+gp_id+'" name="w"/>\
56 <input type="text" style="width: 130px;" name="q"/>\
57 <input type="submit" value="SEARCH" class="SmallButt"/>\