[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [torbutton/maint-1.2 35/37] Clarify the search option a bit.



Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date: Wed, 7 Apr 2010 15:23:13 -0700
Subject: Clarify the search option a bit.
Commit: c5ed97993244d0a7341d0ed45c73c9ecf07803be

Also add Yahoo. Despite the fact that they like to surrender their users
over to their deaths, they are the 3rd most popular search engine, and
they don't ban Tor.
---
 src/chrome/content/preferences.js       |   10 +++++++++-
 src/chrome/content/preferences.xul      |    3 ++-
 src/chrome/locale/en/torbutton.dtd      |    6 +++---
 src/defaults/preferences/preferences.js |    3 ++-
 4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/chrome/content/preferences.js b/src/chrome/content/preferences.js
index a0501bb..75fe16f 100644
--- a/src/chrome/content/preferences.js
+++ b/src/chrome/content/preferences.js
@@ -286,6 +286,11 @@ function torbutton_prefs_init(doc) {
             doc.getElementById("torbutton_searchEngine").selectedItem =
                 doc.getElementById('torbutton_engine3');
             break;
+        case 4:
+            doc.getElementById("torbutton_searchEngine").selectedItem =
+                doc.getElementById('torbutton_engine4');
+            break;
+
     }
     doc.getElementById('torbutton_noCaptcha').checked = o_torprefs.getBoolPref('dodge_google_captcha');
     doc.getElementById('torbutton_searchEngine').disabled = !o_torprefs.getBoolPref('dodge_google_captcha');
@@ -478,8 +483,11 @@ function torbutton_prefs_save(doc) {
     } else if(doc.getElementById('torbutton_searchEngine').selectedItem ==
             doc.getElementById('torbutton_engine2')) {
         o_torprefs.setIntPref('google_redir_url', 2);
-    } else {
+    } else if(doc.getElementById('torbutton_searchEngine').selectedItem ==
+            doc.getElementById('torbutton_engine3')) {
         o_torprefs.setIntPref('google_redir_url', 3);
+    } else {
+        o_torprefs.setIntPref('google_redir_url', 4);
     }
 
     /*
diff --git a/src/chrome/content/preferences.xul b/src/chrome/content/preferences.xul
index 5c8265d..7683513 100644
--- a/src/chrome/content/preferences.xul
+++ b/src/chrome/content/preferences.xul
@@ -344,7 +344,6 @@
           <checkbox id="torbutton_noCaptcha" label="&torbutton.prefs.dodge_google_captcha;"
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
           <hbox class="indent" align="center">
-             <label value="&torbutton.prefs.search_engine;" control="torbutton_searchEngine"/>
              <radiogroup align="center" orient="horizontal" id="torbutton_searchEngine">
               <radio id="torbutton_engine1" label="&torbutton.prefs.engine1;"
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
@@ -352,6 +351,8 @@
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
               <radio id="torbutton_engine3" label="&torbutton.prefs.engine3;"
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
+              <radio id="torbutton_engine4" label="&torbutton.prefs.engine4;"
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
              </radiogroup>
             </hbox>
 
diff --git a/src/chrome/locale/en/torbutton.dtd b/src/chrome/locale/en/torbutton.dtd
index 20d547a..8dcfb2b 100644
--- a/src/chrome/locale/en/torbutton.dtd
+++ b/src/chrome/locale/en/torbutton.dtd
@@ -98,9 +98,9 @@
 <!ENTITY torbutton.prefs.dtd_optional "(optional)">
 <!ENTITY torbutton.prefs.dtd_crucial "(crucial)">
 <!ENTITY torbutton.prefs.update_torbutton_via_tor "Redirect Torbutton updates through Tor">
-<!ENTITY torbutton.prefs.dodge_google_captcha "Automatically use an alternate search engine when presented with a Google Captcha">
-<!ENTITY torbutton.prefs.search_engine "Search engine:">
+<!ENTITY torbutton.prefs.dodge_google_captcha "Automatically use an alternate search engine when presented with a Google Captcha:">
 <!ENTITY torbutton.prefs.engine1 "ixquick.com">
 <!ENTITY torbutton.prefs.engine2 "Bing.com">
-<!ENTITY torbutton.prefs.engine3 "scroogle.org">
+<!ENTITY torbutton.prefs.engine3 "Yahoo.com">
+<!ENTITY torbutton.prefs.engine4 "scroogle.org">
 <!ENTITY torbutton.prefs.fix_google_srch "Strip platform and language off of Google Search Box queries">
diff --git a/src/defaults/preferences/preferences.js b/src/defaults/preferences/preferences.js
index 895f8d8..661c761 100644
--- a/src/defaults/preferences/preferences.js
+++ b/src/defaults/preferences/preferences.js
@@ -177,7 +177,8 @@ pref("extensions.torbutton.dodge_google_captcha", true);
 pref("extensions.torbutton.asked_google_captcha", false);
 pref("extensions.torbutton.redir_url.1", "https://www.ixquick.com/do/metasearch.pl?query=";);
 pref("extensions.torbutton.redir_url.2", "http://www.bing.com/search?q=";);
-pref("extensions.torbutton.redir_url.3", "https://ssl.scroogle.org/cgi-bin/nbbwssl.cgi?Gw=";);
+pref("extensions.torbutton.redir_url.3", "http://search.yahoo.com/search?p=";);
+pref("extensions.torbutton.redir_url.4", "https://ssl.scroogle.org/cgi-bin/nbbwssl.cgi?Gw=";);
 pref("extensions.torbutton.fix_google_srch", true);
 
 // User agent prefs:
-- 
1.6.5