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

[or-cvs] r10255: [darcs-to-svn @ fix the default settings for not using privo (torbutton/trunk/src/chrome/content)



Author: squires
Date: 2007-05-22 01:23:46 -0400 (Tue, 22 May 2007)
New Revision: 10255

Modified:
   torbutton/trunk/src/chrome/content/preferences.js
   torbutton/trunk/src/chrome/content/torbutton.js
Log:
[darcs-to-svn @ fix the default settings for not using privoxy]

Original author: squires@xxxxxxxxx
Date: 2006-06-01 23:51:19+00:00

Modified: torbutton/trunk/src/chrome/content/preferences.js
===================================================================
--- torbutton/trunk/src/chrome/content/preferences.js	2007-05-22 05:23:41 UTC (rev 10254)
+++ torbutton/trunk/src/chrome/content/preferences.js	2007-05-22 05:23:46 UTC (rev 10255)
@@ -44,28 +44,34 @@
     doc.getElementById('torbutton_panelStyleIcon').setAttribute("disabled", !doc.getElementById('torbutton_displayStatusPanel').checked);
     doc.getElementById('torbutton_usePrivoxy').setAttribute("disabled", doc.getElementById('torbutton_settingsMethod').value != 'recommended');
     var proxy_port;
+    var proxy_host;
     if (doc.getElementById('torbutton_usePrivoxy').checked)
+    {
+        proxy_host = 'localhost';
         proxy_port = 8118;
+    }
     else
-        proxy_port = 9050;
+    {
+        proxy_host = '';
+        proxy_port = 0;
+    }
     if (doc.getElementById('torbutton_settingsMethod').value == 'recommended') {
         torbutton_log(5, "using recommended settings");
         if (!m_socks_pref_exists)
         {
-            doc.getElementById('torbutton_httpProxy').value = 'localhost';
+            doc.getElementById('torbutton_httpProxy').value = proxy_host;
             doc.getElementById('torbutton_httpPort').value = proxy_port;
-            doc.getElementById('torbutton_httpsProxy').value = 'localhost';
+            doc.getElementById('torbutton_httpsProxy').value = proxy_host;
             doc.getElementById('torbutton_httpsPort').value = proxy_port;
-            doc.getElementById('torbutton_ftpProxy').value = 'localhost';
+            doc.getElementById('torbutton_ftpProxy').value = proxy_host;
             doc.getElementById('torbutton_ftpPort').value = proxy_port;
-            doc.getElementById('torbutton_gopherProxy').value = 'localhost';
+            doc.getElementById('torbutton_gopherProxy').value = proxy_host;
             doc.getElementById('torbutton_gopherPort').value = proxy_port;
         } else {
-            // if we decide to disable privoxy by default, change these four lines
-            doc.getElementById('torbutton_httpProxy').value = 'localhost';	// = ''
-            doc.getElementById('torbutton_httpPort').value = proxy_port;	// = 0
-            doc.getElementById('torbutton_httpsProxy').value = 'localhost';	// = ''
-            doc.getElementById('torbutton_httpsPort').value = proxy_port;	// = 0
+            doc.getElementById('torbutton_httpProxy').value = proxy_host;
+            doc.getElementById('torbutton_httpPort').value = proxy_port;
+            doc.getElementById('torbutton_httpsProxy').value = proxy_host;
+            doc.getElementById('torbutton_httpsPort').value = proxy_port;
 
             doc.getElementById('torbutton_ftpProxy').value = '';
             doc.getElementById('torbutton_ftpPort').value = 0;

Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2007-05-22 05:23:41 UTC (rev 10254)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2007-05-22 05:23:46 UTC (rev 10255)
@@ -197,24 +197,31 @@
 // recommended settings.  figure out a way to eliminate the redundancy.
 function torbutton_init_prefs() {
     var proxy_port;
+    var proxy_host;
     torbutton_log(4, "called init_prefs()");
     if (!m_prefs) { torbutton_log(1, "ERROR: m_prefs undefined"); }
     if (m_prefs.getBoolPref('extensions.torbutton.use_privoxy'))
+    {
+        proxy_host = 'localhost';
         proxy_port = 8118;
+    }
     else
-        proxy_port = 9050;
+    {
+        proxy_host = '';
+        proxy_port = 0;
+    }
 
     if (m_prefs.getCharPref('extensions.torbutton.settings_method') == 'recommended')
     {
         torbutton_log(5, "using recommended settings");
         if (m_socks_pref_exists)
         {
-            m_http_proxy = m_https_proxy = 'localhost';
+            m_http_proxy = m_https_proxy = proxy_host;
             m_ftp_proxy = m_gopher_proxy = '';
             m_http_port = m_https_port   = proxy_port;
             m_ftp_port = m_gopher_port   = 0;
         } else {
-            m_http_proxy = m_https_proxy = m_ftp_proxy = m_gopher_proxy = 'localhost';
+            m_http_proxy = m_https_proxy = m_ftp_proxy = m_gopher_proxy = proxy_host;
             m_http_port = m_https_port = m_ftp_port = m_gopher_port = proxy_port;
         }
         m_socks_host = 'localhost';