Browse Source

[darcs-to-svn @ 1.0.2]

Original author: squires@pobox.com
Date: 2006-06-01 19:02:28+00:00

svn:r10251
Scott Squires 13 years ago
parent
commit
c986850b65

+ 15 - 0
src/CHANGELOG

@@ -1,7 +1,22 @@
+1.0.2
+  23 May 2006
+  * bugfix: fixed problem with socks_remote_dns
+  * new: mozilla thunderbird support
+  * new: user may customize proxy settings for nonstandard configurations
+  * new: option to not use privoxy in the standard configuration
+  * new: slovenian translation
+  * new: french translation
+  * new: keyboard shortcut (control-shift-t, changeable via keyconfig)
+  * new: context menu for toolbar button and statusbar panel
+  * new: attractive tor icons
+  * new: about dialog
+  * new: option to display statusbar as an icon instead of text
+
 1.0.1
   16 Mar 2006
   * bugfix: toolbar button tooltips now display the correct status
   * bugfix: set socks5 proxy to tor port (9050) instead of privoxy (8118)
+  * bugfix: allow user to change proxy exclusion list ("no proxy for")
   * new: use socks_remote_dns on firefox versions that have it
   * new: added update functionality through the extensions manager
   * new: added preference: display statusbar panel (yes/no)

+ 49 - 3
src/LICENSE

@@ -1,7 +1,53 @@
 Copyright (c) 2006 Scott Squires, Oleg Ivanov
 
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
 
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+--------------------------------------------------------------------------------
+
+Date: Fri, 3 Mar 2006 03:16:21 +0200
+From: Oleg Ivanov
+To: Scott Squires
+Subject: Re: ProxyButton licensing question
+
+Hello Scott,
+
+I'm glad to support your project so you can use the Proxybutton in any way you
+need under any open source license as it's stated in mozdev's copyright policy.
+I'll just ask you to put in the Tor or it's source code any credits with
+references to me and the original Proxybutton.  Feel free to ask if you have
+any questions regarding the extension - I'll be glad to help you.
+
+On Thursday 02 March 2006 05:01, you wrote:
+> Hello,
+>
+> I am a volunteer for the Tor project, which is a network proxy with strong
+> anonymnity.  We would like to make it easier for users to install and
+> configure the software, and would like a firefox button to enable/disable
+> Tor.  Your extension is very close to what we need, our version would just
+> set the proxy for the user instead of the user needing to enter the
+> information.  So I was wondering what license your software is released under
+> and whether we can use it as a base for this extension.
+>
+> Thanks!
+> --Scott
+
+-- 
+Oleg Ivanov
+mailto: saruman@unigsm.com
+ICQ #69991809

+ 4 - 0
src/chrome.manifest

@@ -1,7 +1,11 @@
 content torbutton chrome/content/
 overlay chrome://browser/content/browser.xul chrome://torbutton/content/torbutton.xul
+overlay chrome://messenger/content/messenger.xul chrome://torbutton/content/torbutton_tb.xul
+overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://torbutton/content/torbutton_tb.xul
 
 locale torbutton en-US chrome/locale/en-US/
+locale torbutton sl-SI chrome/locale/sl-SI/
+locale torbutton fr-FR chrome/locale/fr-FR/
 
 skin torbutton classic/1.0 chrome/skin/
 style chrome://global/content/customizeToolbar.xul chrome://torbutton/skin/torbutton.css

+ 17 - 0
src/chrome/content/about.xul

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
+<!DOCTYPE overlay SYSTEM "chrome://torbutton/locale/torbutton.dtd">
+
+<dialog id="torbutton-about"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html="http://www.w3.org/1999/xhtml"
+        title="&torbutton.about.title;"
+        buttons="accept"
+        persist="screenX screenY">
+
+    <script type="application/x-javascript" src="torbutton.js" />
+    <label value="Torbutton" style="font-weight: bold;"/>
+    <label value="Scott Squires"/>
+    <label value="http://freehaven.net/~squires/torbutton/"/>
+</dialog>

+ 20 - 1
src/chrome/content/contents.rdf

@@ -10,17 +10,36 @@
     <Description about="urn:mozilla:package:torbutton"
                  chrome:athor="Scott Squires"
 		 chrome:displayName="Torbutton"
-		 chrome:description="Torbutton provides a button to easily enable or disable the tor proxy"
                  chrome:extension="true"
                  chrome:name="torbutton">
     </Description>
 
     <Seq about="urn:mozilla:overlays">
+        <!-- firefox -->
         <li resource="chrome://browser/content/browser.xul"/>
+        <!-- thunderbird -->
+        <li resource="chrome://messenger/content/messenger.xul"/>
+        <li resource="chrome://messenger/content/messengercompose/messengercompose.xul"/>
+        <!-- torbutton -->
+	<li resource="chrome://torbutton/content/torbutton.xul"/>
     </Seq>
     
+    <!-- firefox -->
     <Seq about="chrome://browser/content/browser.xul">
         <li>chrome://torbutton/content/torbutton.xul</li>
     </Seq>
 
+    <!-- thunderbird -->
+    <Seq about="chrome://messenger/content/messenger.xul">
+        <li>chrome://torbutton/content/torbutton_tb.xul</li>
+    </Seq>
+    <Seq about="chrome://messenger/content/messengercompose/messengercompose.xul">
+        <li>chrome://torbutton/content/torbutton_tb.xul</li>
+    </Seq>
+
+    <!-- torbutton -->
+    <Seq about="chrome://torbutton/content/torbutton.xul">
+	<li>chrome://torbutton/content/popup.xul</li>
+    </Seq>
+
 </RDF>

+ 32 - 0
src/chrome/content/popup.xul

@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://torbutton/skin/torbutton.css" type="text/css"?>
+
+<!DOCTYPE overlay SYSTEM "chrome://torbutton/locale/torbutton.dtd">
+
+<overlay id="torbutton-popup-overlay"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+    <stringbundleset id="torbutton-stringbundleset">
+        <stringbundle id="torbutton-bundle" src="chrome://torbutton/locale/torbutton.properties"/>
+    </stringbundleset>
+
+    <popup id="torbutton-context-menu">
+        <menuitem id="torbutton-toggle"
+                  label="&torbutton.context_menu.toggle;"
+                  accesskey="&torbutton.context_menu.toggle.key;"
+                  insertafter="context-stop"
+                  key="torbutton-toggle-key"
+                  oncommand="torbutton_toggle()"/>
+        <menuitem id="torbutton-preferences"
+                  label="&torbutton.context_menu.preferences;"
+                  accesskey="&torbutton.context_menu.preferences.key;"
+                  insertafter="context-stop"
+                  oncommand="torbutton_open_prefs_dialog()"/>
+        <menuitem id="torbutton-about"
+                  label="&torbutton.context_menu.about;"
+                  accesskey="&torbutton.context_menu.about.key;"
+                  insertafter="context-stop"
+                  oncommand="torbutton_open_about_dialog()"/>
+    </popup>
+
+</overlay>

+ 160 - 0
src/chrome/content/preferences.js

@@ -0,0 +1,160 @@
+// preferences dialog functions
+//   torbutton_prefs_set_field_attributes() -- initialize dialog fields
+//   torbutton_prefs_init() -- on dialog load
+//   torbutton_prefs_save() -- on dialog save
+
+var m_prefs_inited = false;
+var m_prefs = false;
+var m_socks_pref_exists = false;
+var m_tb_logger = false;
+
+function torbutton_prefs_init_globals() {
+    if (!m_prefs) {
+        m_prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                            .getService(Components.interfaces.nsIPrefBranch);
+    }
+
+    m_socks_pref_exists = true;
+    try {
+        m_prefs.getBoolPref('network.proxy.socks_remote_dns');
+    } catch (rErr) {
+        // no such preference
+        m_socks_pref_exists = false;
+    }
+
+    if (!m_tb_logger) {
+        try {
+            var logMngr = Components.classes["@mozmonkey.com/debuglogger/manager;1"]
+                                    .getService(Components.interfaces.nsIDebugLoggerManager);
+            m_tb_logger = logMngr.registerLogger("torbutton_prefs");
+        } catch (exErr) {
+            m_tb_logger = false;
+        }
+    }
+
+    m_prefs_inited = true;
+}
+
+function torbutton_prefs_set_field_attributes(doc)
+{
+    torbutton_log(4, "called prefs_set_field_attributes()");
+
+    doc.getElementById('torbutton_panelStyle').setAttribute("disabled", !doc.getElementById('torbutton_displayStatusPanel').checked);
+    doc.getElementById('torbutton_panelStyleText').setAttribute("disabled", !doc.getElementById('torbutton_displayStatusPanel').checked);
+    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;
+    if (doc.getElementById('torbutton_usePrivoxy').checked)
+        proxy_port = 8118;
+    else
+        proxy_port = 9050;
+    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_httpPort').value = proxy_port;
+            doc.getElementById('torbutton_httpsProxy').value = 'localhost';
+            doc.getElementById('torbutton_httpsPort').value = proxy_port;
+            doc.getElementById('torbutton_ftpProxy').value = 'localhost';
+            doc.getElementById('torbutton_ftpPort').value = proxy_port;
+            doc.getElementById('torbutton_gopherProxy').value = 'localhost';
+            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_ftpProxy').value = '';
+            doc.getElementById('torbutton_ftpPort').value = 0;
+            doc.getElementById('torbutton_gopherProxy').value = '';
+            doc.getElementById('torbutton_gopherPort').value = 0;
+        }
+        doc.getElementById('torbutton_socksHost').value = 'localhost';
+        doc.getElementById('torbutton_socksPort').value = 9050;
+
+        doc.getElementById('torbutton_httpProxy').disabled = true;
+        doc.getElementById('torbutton_httpPort').disabled = true;
+        doc.getElementById('torbutton_httpsProxy').disabled = true;
+        doc.getElementById('torbutton_httpsPort').disabled = true;
+        doc.getElementById('torbutton_ftpProxy').disabled = true;
+        doc.getElementById('torbutton_ftpPort').disabled = true;
+        doc.getElementById('torbutton_gopherProxy').disabled = true;
+        doc.getElementById('torbutton_gopherPort').disabled = true;
+        doc.getElementById('torbutton_socksHost').disabled = true;
+        doc.getElementById('torbutton_socksPort').disabled = true;
+    } else {
+        doc.getElementById('torbutton_httpProxy').disabled = false;
+        doc.getElementById('torbutton_httpPort').disabled = false;
+        doc.getElementById('torbutton_httpsProxy').disabled = false;
+        doc.getElementById('torbutton_httpsPort').disabled = false;
+        doc.getElementById('torbutton_ftpProxy').disabled = false;
+        doc.getElementById('torbutton_ftpPort').disabled = false;
+        doc.getElementById('torbutton_gopherProxy').disabled = false;
+        doc.getElementById('torbutton_gopherPort').disabled = false;
+        doc.getElementById('torbutton_socksHost').disabled = false;
+        doc.getElementById('torbutton_socksPort').disabled = false;
+    }
+}
+
+function torbutton_prefs_init(doc) {
+    var checkbox_displayStatusPanel = doc.getElementById('torbutton_displayStatusPanel');
+// return; 
+
+    if (!m_prefs_inited) {
+        torbutton_prefs_init_globals();
+    }
+    torbutton_log(4, "called prefs_init()");
+    sizeToContent();
+
+    doc.getElementById('torbutton_displayStatusPanel').checked = m_prefs.getBoolPref('extensions.torbutton.display_panel');
+    var panel_style = doc.getElementById('torbutton_panelStyle');
+    var panel_style_pref = m_prefs.getCharPref('extensions.torbutton.panel_style');
+    if (panel_style_pref == 'text')
+        panel_style.selectedItem = doc.getElementById('torbutton_panelStyleText');
+    else if (panel_style_pref == 'iconic')
+        panel_style.selectedItem = doc.getElementById('torbutton_panelStyleIcon');
+    // doc.getElementById('torbutton_panelStyle').value = m_prefs.getCharPref('extensions.torbutton.panel_style');
+    var settings_method = doc.getElementById('torbutton_settingsMethod');
+    var settings_method_pref = m_prefs.getCharPref('extensions.torbutton.settings_method');
+    if (settings_method_pref == 'recommended')
+        settings_method.selectedItem = doc.getElementById('torbutton_useRecommendedSettings');
+    else if (settings_method_pref == 'custom')
+        settings_method.selectedItem = doc.getElementById('torbutton_useCustomSettings');
+    // doc.getElementById('torbutton_settingsMethod').value = m_prefs.getCharPref('extensions.torbutton.settings_method');
+    doc.getElementById('torbutton_usePrivoxy').checked = m_prefs.getBoolPref('extensions.torbutton.use_privoxy');
+    doc.getElementById('torbutton_httpProxy').value = m_prefs.getCharPref('extensions.torbutton.http_proxy');
+    doc.getElementById('torbutton_httpPort').value = m_prefs.getIntPref('extensions.torbutton.http_port');
+    doc.getElementById('torbutton_httpsProxy').value = m_prefs.getCharPref('extensions.torbutton.https_proxy');
+    doc.getElementById('torbutton_httpsPort').value = m_prefs.getIntPref('extensions.torbutton.https_port');
+    doc.getElementById('torbutton_ftpProxy').value = m_prefs.getCharPref('extensions.torbutton.ftp_proxy');
+    doc.getElementById('torbutton_ftpPort').value = m_prefs.getIntPref('extensions.torbutton.ftp_port');
+    doc.getElementById('torbutton_gopherProxy').value = m_prefs.getCharPref('extensions.torbutton.gopher_proxy');
+    doc.getElementById('torbutton_gopherPort').value = m_prefs.getIntPref('extensions.torbutton.gopher_port');
+    doc.getElementById('torbutton_socksHost').value = m_prefs.getCharPref('extensions.torbutton.socks_host');
+    doc.getElementById('torbutton_socksPort').value = m_prefs.getIntPref('extensions.torbutton.socks_port');
+    // doc.getElementById('torbutton_warnUponExcludedSite').checked = m_prefs.getBoolPref('extensions.torbutton.prompt_before_visiting_excluded_sites');
+
+    torbutton_prefs_set_field_attributes(doc);
+}
+
+function torbutton_prefs_save(doc) {
+    torbutton_log(4, "called prefs_save()");
+    m_prefs.setBoolPref('extensions.torbutton.display_panel', doc.getElementById('torbutton_displayStatusPanel').checked);
+    m_prefs.setCharPref('extensions.torbutton.panel_style', doc.getElementById('torbutton_panelStyle').value);
+    m_prefs.setCharPref('extensions.torbutton.settings_method', doc.getElementById('torbutton_settingsMethod').value);
+    m_prefs.setBoolPref('extensions.torbutton.use_privoxy', doc.getElementById('torbutton_usePrivoxy').checked);
+    m_prefs.setCharPref('extensions.torbutton.http_proxy', doc.getElementById('torbutton_httpProxy').value);
+    m_prefs.setIntPref('extensions.torbutton.http_port', doc.getElementById('torbutton_httpPort').value);
+    m_prefs.setCharPref('extensions.torbutton.https_proxy', doc.getElementById('torbutton_httpsProxy').value);
+    m_prefs.setIntPref('extensions.torbutton.https_port', doc.getElementById('torbutton_httpsPort').value);
+    m_prefs.setCharPref('extensions.torbutton.ftp_proxy', doc.getElementById('torbutton_ftpProxy').value);
+    m_prefs.setIntPref('extensions.torbutton.ftp_port', doc.getElementById('torbutton_ftpPort').value);
+    m_prefs.setCharPref('extensions.torbutton.gopher_proxy', doc.getElementById('torbutton_gopherProxy').value);
+    m_prefs.setIntPref('extensions.torbutton.gopher_port', doc.getElementById('torbutton_gopherPort').value);
+    m_prefs.setCharPref('extensions.torbutton.socks_host', doc.getElementById('torbutton_socksHost').value);
+    m_prefs.setIntPref('extensions.torbutton.socks_port', doc.getElementById('torbutton_socksPort').value);
+    // m_prefs.setBoolPref('extensions.torbutton.prompt_before_visiting_excluded_sites', doc.getElementById('torbutton_warnUponExcludedSite').checked);
+}

+ 98 - 2
src/chrome/content/preferences.xul

@@ -12,8 +12,104 @@
         onload="torbutton_prefs_init(document)"
         ondialogaccept="torbutton_prefs_save(document)" >
 
-    <script type="application/x-javascript" src="torbutton.js" />
-    <checkbox id="torbutton_displayStatusPanel" label="&torbutton.prefs.display_panel;" />
+    <script type="application/x-javascript" src="torbutton.js"/>
+    <script type="application/x-javascript" src="preferences.js"/>
+    <groupbox>
+        <caption label="&torbutton.prefs.display_settings;"/>
+        <checkbox id="torbutton_displayStatusPanel" label="&torbutton.prefs.display_panel;" 
+                  oncommand="torbutton_prefs_set_field_attributes(document)"/>
+        <label class="indent" control="torbutton_panelStyle" value="&torbutton.prefs.panel_format;"/>
+        <radiogroup class="indent" id="torbutton_panelStyle">
+            <radio value="text" id="torbutton_panelStyleText" label="&torbutton.prefs.panel_text_format;"/>
+            <radio value="iconic" id="torbutton_panelStyleIcon" label="&torbutton.prefs.panel_icon_format;"/>
+        </radiogroup>
+    </groupbox>
+    <groupbox>
+        <caption label="&torbutton.prefs.tor_settings;"/>
+        <radiogroup id="torbutton_settingsMethod">
+            <radio value="recommended" id="torbutton_useRecommendedSettings"
+                   label="&torbutton.prefs.recommended_settings;"
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
+                <checkbox class="indent" id="torbutton_usePrivoxy"
+                   label="&torbutton.prefs.use_privoxy;"
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
+            <radio value="custom" id="torbutton_useCustomSettings"
+                   label="&torbutton.prefs.custom_settings;"
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
+<!--
+        <checkbox id="torbutton_useRecommendedSettings" label="&torbutton.prefs.recommended_settings;"
+                  oncommand="torbutton_prefs_set_field_attributes(document)"/>
+-->
+                <grid class="indent" flex="1">
+                    <columns>
+                    <column/>
+                    <column flex="1"/>
+                </columns>
+                <rows>
+                    <row align="center">
+                        <hbox align="center" pack="end">
+                            <label value="&torbutton.prefs.proxy.host.http;" control="torbutton_httpProxy"/>
+                        </hbox>
+                        <hbox align="center">
+                            <textbox id="torbutton_httpProxy" preftype="string" flex="1"/>
+                            <label value="&torbutton.prefs.proxy.port;" control="torbutton_httpPort"/>
+                            <textbox id="torbutton_httpPort" size="5"/>
+                        </hbox>
+                    </row>
+                    <row align="center">
+                        <hbox align="center" pack="end">
+                            <label value="&torbutton.prefs.proxy.host.https;" control="torbutton_httpsProxy"/>
+                        </hbox>
+                        <hbox align="center">
+                            <textbox id="torbutton_httpsProxy" preftype="string" flex="1"/>
+                            <label value="&torbutton.prefs.proxy.port;" control="torbutton_httpsPort"/>
+                            <textbox id="torbutton_httpsPort" size="5"/>
+                        </hbox>
+                    </row>
+                    <row align="center">
+                        <hbox align="center" pack="end">
+                            <label value="&torbutton.prefs.proxy.host.ftp;" control="torbutton_ftpProxy"/>
+                        </hbox>
+                        <hbox align="center">
+                            <textbox id="torbutton_ftpProxy" preftype="string" flex="1"/>
+                            <label value="&torbutton.prefs.proxy.port;" control="torbutton_ftpPort"/>
+                            <textbox id="torbutton_ftpPort" size="5"/>
+                        </hbox>
+                    </row>
+                    <row align="center">
+                        <hbox align="center" pack="end">
+                            <label value="&torbutton.prefs.proxy.host.gopher;" control="torbutton_gopherProxy"/>
+                        </hbox>
+                        <hbox align="center">
+                            <textbox id="torbutton_gopherProxy" preftype="string" flex="1"/>
+                            <label value="&torbutton.prefs.proxy.port;" control="torbutton_gopherPort"/>
+                            <textbox id="torbutton_gopherPort" size="5"/>
+                        </hbox>
+                    </row>
+                    <row align="center">
+                        <hbox align="center" pack="end">
+                            <label value="&torbutton.prefs.proxy.host.socks;" control="torbutton_socksHost"/>
+                        </hbox>
+                        <hbox align="center">
+                            <textbox id="torbutton_socksHost" flex="1"/>
+                            <label value="&torbutton.prefs.proxy.port;" control="torbutton_socksPort"/>
+                            <textbox id="torbutton_socksPort" size="5"/>
+                        </hbox>
+                    </row>
+                </rows>
+            </grid>
+        </radiogroup>
+<!--
+        <label value="&torbutton.prefs.non_socks;" control="nonsocks_proxy"/>
+        <textbox id="nonsocks_proxy"/>
+        <label value="&torbutton.prefs.port;" control="nonsocks_port"/>
+        <textbox id="nonsocks_port"/>
+        <label value="&torbutton.prefs.socks;" control="socks_host"/>
+        <textbox id="socks_host"/>
+        <label value="&torbutton.prefs.port;" control="socks_port"/>
+        <textbox id="socks_port"/>
+-->
+    </groupbox>
 <!--
     <checkbox id="torbutton_warnUponExcludedSite" label="&torbutton.prefs.prompt_before_visiting_excluded_sites;" />
     <description>

+ 142 - 58
src/chrome/content/torbutton.js

@@ -1,3 +1,4 @@
+var m_debug = true;
 var m_toolbutton = false;
 var m_statuspanel = false;
 var m_wasinited = false;
@@ -6,6 +7,16 @@ var m_stringbundle = false;
 var m_tb_logger = false;
 var m_socks_pref_exists = false;
 var m_exclusion_list = "";
+var m_http_proxy = false;
+var m_http_port = false;
+var m_https_proxy = false;
+var m_https_port = false;
+var m_ftp_proxy = false;
+var m_ftp_port = false;
+var m_gopher_proxy = false;
+var m_gopher_port = false;
+var m_socks_host = false;
+var m_socks_port = false;
 
 var torbutton_pref_observer =
 {
@@ -33,6 +44,20 @@ var torbutton_pref_observer =
             case "extensions.torbutton.display_panel":
                 torbutton_set_panel_view();
                 break;
+            case "extensions.torbutton.panel_style":
+                torbutton_set_panel_style();
+                break;
+            case "extensions.torbutton.http_proxy":
+            case "extensions.torbutton.http_port":
+            case "extensions.torbutton.ssl_proxy":
+            case "extensions.torbutton.ssl_port":
+            case "extensions.torbutton.ftp_proxy":
+            case "extensions.torbutton.ftp_port":
+            case "extensions.torbutton.gopher_proxy":
+            case "extensions.torbutton.gopher_port":
+            case "extensions.torbutton.socks_host":
+            case "extensions.torbutton.socks_port":
+                torbutton_init_prefs();
             case "network.proxy.http":
             case "network.proxy.http_port":
             case "network.proxy.ssl":
@@ -59,6 +84,12 @@ function torbutton_set_panel_view() {
     document.getElementById('torbutton-panel').setAttribute('collapsed', !display_panel);
 }
 
+function torbutton_set_panel_style() {
+    var panel_style = m_prefs.getCharPref('extensions.torbutton.panel_style');
+    torbutton_log(4, 'setting panel style: ' + panel_style);
+    document.getElementById('torbutton-panel').setAttribute('class','statusbarpanel-'+panel_style);
+}
+
 function torbutton_toggle() {
     torbutton_log(1, 'called toggle()');
     if (!m_wasinited) {
@@ -86,8 +117,6 @@ function torbutton_set_status() {
 }
 
 function torbutton_init() {
-    torbutton_log(1, 'called init()');
-
     if (!m_tb_logger) {
         try {
             var logMngr = Components.classes["@mozmonkey.com/debuglogger/manager;1"]
@@ -97,6 +126,8 @@ function torbutton_init() {
             m_tb_logger = false;
         }
     }
+
+    torbutton_log(1, 'called init()');
     
     // load localization strings
     if (!m_stringbundle) {
@@ -113,9 +144,23 @@ function torbutton_init() {
     }
 
     if (!m_prefs) {
-    	torbutton_init_pref_objs();
+        torbutton_init_pref_objs();
+    }
+
+    // check if this version of Firefox has the socks_remote_dns option
+    m_socks_pref_exists = true;
+    try {
+        m_prefs.getBoolPref('network.proxy.socks_remote_dns');
+        torbutton_log(3, "socks_remote_dns is available");
+    } catch (rErr) {
+        // no such preference
+        m_socks_pref_exists = false;
+        torbutton_log(3, "socks_remote_dns is unavailable");
     }
 
+    // initialize preferences before we start our prefs observer
+    torbutton_init_prefs();
+
     if (!m_toolbutton) {
         torbutton_init_toolbutton();
     } else {
@@ -135,15 +180,6 @@ function torbutton_init() {
         torbutton_log(5, 'skipping pref observer init');
     }
     
-    // check if this version of Firefox has the socks_remote_dns option
-    m_socks_pref_exists = true;
-    try {
-        m_prefs.getCharPref("network.proxy.socks_remote_dns");
-    } catch (rErr) {
-        // no such preference
-        m_socks_pref_exists = false;
-    }
-
     torbutton_set_panel_view();
     torbutton_log(2, 'setting torbutton status from proxy prefs');
     torbutton_set_status();
@@ -151,14 +187,70 @@ function torbutton_init() {
 }
 
 function torbutton_init_pref_objs() {
+    torbutton_log(4, "called init_pref_objs()");
     m_prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                              .getService(Components.interfaces.nsIPrefBranch);
+                        .getService(Components.interfaces.nsIPrefBranch);
+}
+
+// this function duplicates a lot of code in preferences.js for deciding our
+// recommended settings.  figure out a way to eliminate the redundancy.
+function torbutton_init_prefs() {
+    var proxy_port;
+    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_port = 8118;
+    else
+        proxy_port = 9050;
+
+    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_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_port = m_https_port = m_ftp_port = m_gopher_port = proxy_port;
+        }
+        m_socks_host = 'localhost';
+        m_socks_port = 9050;
+    } else {
+        m_http_proxy   = m_prefs.getCharPref('extensions.torbutton.http_proxy');
+        m_http_port    = m_prefs.getIntPref('extensions.torbutton.http_port');
+        m_https_proxy  = m_prefs.getCharPref('extensions.torbutton.https_proxy');
+        m_https_port   = m_prefs.getIntPref('extensions.torbutton.https_port');
+        m_ftp_proxy    = m_prefs.getCharPref('extensions.torbutton.ftp_proxy');
+        m_ftp_port     = m_prefs.getIntPref('extensions.torbutton.ftp_port');
+        m_gopher_proxy = m_prefs.getCharPref('extensions.torbutton.gopher_proxy');
+        m_gopher_port  = m_prefs.getIntPref('extensions.torbutton.gopher_port');
+        m_socks_host   = m_prefs.getCharPref('extensions.torbutton.socks_host');
+        m_socks_port   = m_prefs.getIntPref('extensions.torbutton.socks_port');
+    }
+    torbutton_log(1, 'http_port='+m_http_port);
+    // m_prefs.setCharPref('extensions.torbutton.http_proxy',   m_http_proxy);
+    // m_prefs.setIntPref('extensions.torbutton.http_port',     m_http_port);
+    // m_prefs.setCharPref('extensions.torbutton.https_proxy',  m_https_proxy);
+    // m_prefs.setIntPref('extensions.torbutton.https_port',    m_https_port);
+    // m_prefs.setCharPref('extensions.torbutton.ftp_proxy',    m_ftp_proxy);
+    // m_prefs.setIntPref('extensions.torbutton.ftp_port',      m_ftp_port);
+    // m_prefs.setCharPref('extensions.torbutton.gopher_proxy', m_gopher_proxy);
+    // m_prefs.setIntPref('extensions.torbutton.gopher_port',   m_gopher_port);
+    // m_prefs.setCharPref('extensions.torbutton.socks_host',   m_socks_host);
+    // m_prefs.setIntPref('extensions.torbutton.socks_port',    m_socks_port);
 }
 
 function torbutton_init_toolbutton() {
     torbutton_log(4, 'init_toolbutton(): looking for button element');
     if (document.getElementById("torbutton-button")) {
         m_toolbutton = document.getElementById("torbutton-button");
+    } else if (document.getElementById("torbutton-button-tb")) {
+        m_toolbutton = document.getElementById("torbutton-button-tb");
+    } else if (document.getElementById("torbutton-button-tb-msg")) {
+        m_toolbutton = document.getElementById("torbutton-button-tb-msg");
     } else {
         torbutton_log(1, 'ERROR (init): failed to find torbutton-button');
     }
@@ -173,28 +265,6 @@ function torbutton_init_statuspanel() {
     }
 }
 
-// preferences dialog functions
-//   torbutton_prefs_init() -- on dialog load
-//   torbutton_prefs_save() -- on dialog save
-
-function torbutton_prefs_init(doc) {
-    var checkbox_displayStatusPanel = doc.getElementById('torbutton_displayStatusPanel');
-    
-    sizeToContent();
-
-    if (!m_prefs) {
-        torbutton_init_pref_objs();
-    }
-
-    doc.getElementById('torbutton_displayStatusPanel').checked = m_prefs.getBoolPref('extensions.torbutton.display_panel');
-    // doc.getElementById('torbutton_warnUponExcludedSite').checked = m_prefs.getBoolPref('extensions.torbutton.prompt_before_visiting_excluded_sites');
-}
-
-function torbutton_prefs_save(doc) {
-    m_prefs.setBoolPref('extensions.torbutton.display_panel', doc.getElementById('torbutton_displayStatusPanel').checked);
-    // m_prefs.setBoolPref('extensions.torbutton.prompt_before_visiting_excluded_sites', doc.getElementById('torbutton_warnUponExcludedSite').checked);
-}
-
 function torbutton_check_status() {
     // make sure we have the latest proxy exclusion list
     m_exclusion_list = m_prefs.getCharPref("network.proxy.no_proxies_on");
@@ -206,19 +276,19 @@ function torbutton_check_status() {
          remote_dns = true;
     }
 
-    return ( (m_prefs.getIntPref("network.proxy.type")           == 1)           &&
-             (m_prefs.getCharPref("network.proxy.http")          == "localhost") &&
-             (m_prefs.getIntPref("network.proxy.http_port")      == 8118)        &&
-             (m_prefs.getCharPref("network.proxy.ssl")           == "localhost") &&
-             (m_prefs.getIntPref("network.proxy.ssl_port")       == 8118)        &&
-             (m_prefs.getCharPref("network.proxy.ftp")           == "localhost") &&
-             (m_prefs.getIntPref("network.proxy.ftp_port")       == 8118)        &&
-             (m_prefs.getCharPref("network.proxy.gopher")        == "localhost") &&
-             (m_prefs.getIntPref("network.proxy.gopher_port")    == 8118)        &&
-             (m_prefs.getCharPref("network.proxy.socks")         == "localhost") &&
-             (m_prefs.getIntPref("network.proxy.socks_port")     == 9050)        &&
-             (m_prefs.getIntPref("network.proxy.socks_version")  == 5)           &&
-             (m_prefs.getBoolPref("network.proxy.share_proxy_settings") == false) &&
+    return ( (m_prefs.getIntPref("network.proxy.type")           == 1)              &&
+             (m_prefs.getCharPref("network.proxy.http")          == m_http_proxy)   &&
+             (m_prefs.getIntPref("network.proxy.http_port")      == m_http_port)    &&
+             (m_prefs.getCharPref("network.proxy.ssl")           == m_https_proxy)  &&
+             (m_prefs.getIntPref("network.proxy.ssl_port")       == m_https_port)   &&
+             (m_prefs.getCharPref("network.proxy.ftp")           == m_ftp_proxy)    &&
+             (m_prefs.getIntPref("network.proxy.ftp_port")       == m_ftp_port)     &&
+             (m_prefs.getCharPref("network.proxy.gopher")        == m_gopher_proxy) &&
+             (m_prefs.getIntPref("network.proxy.gopher_port")    == m_gopher_port)  &&
+             (m_prefs.getCharPref("network.proxy.socks")         == m_socks_host)   &&
+             (m_prefs.getIntPref("network.proxy.socks_port")     == m_socks_port)   &&
+             (m_prefs.getIntPref("network.proxy.socks_version")  == 5)              &&
+             (m_prefs.getBoolPref("network.proxy.share_proxy_settings") == false)   &&
              (remote_dns == true) );
 }
 
@@ -230,16 +300,16 @@ function torbutton_disable_tor() {
 function torbutton_enable_tor() {
     torbutton_log(2, 'called enable_tor()');
 
-    m_prefs.setCharPref("network.proxy.http", "localhost");
-    m_prefs.setIntPref("network.proxy.http_port", 8118);
-    m_prefs.setCharPref("network.proxy.ssl", "localhost");
-    m_prefs.setIntPref("network.proxy.ssl_port", 8118);
-    m_prefs.setCharPref("network.proxy.ftp", "localhost");
-    m_prefs.setIntPref("network.proxy.ftp_port", 8118);
-    m_prefs.setCharPref("network.proxy.gopher", "localhost");
-    m_prefs.setIntPref("network.proxy.gopher_port", 8118);
-    m_prefs.setCharPref("network.proxy.socks", "localhost");
-    m_prefs.setIntPref("network.proxy.socks_port", 9050);
+    m_prefs.setCharPref("network.proxy.http",         m_http_proxy);
+    m_prefs.setIntPref("network.proxy.http_port",     m_http_port);
+    m_prefs.setCharPref("network.proxy.ssl",          m_https_proxy);
+    m_prefs.setIntPref("network.proxy.ssl_port",      m_https_port);
+    m_prefs.setCharPref("network.proxy.ftp",          m_ftp_proxy);
+    m_prefs.setIntPref("network.proxy.ftp_port",      m_ftp_port);
+    m_prefs.setCharPref("network.proxy.gopher",       m_gopher_proxy);
+    m_prefs.setIntPref("network.proxy.gopher_port",   m_gopher_port);
+    m_prefs.setCharPref("network.proxy.socks",        m_socks_host);
+    m_prefs.setIntPref("network.proxy.socks_port",    m_socks_port);
     m_prefs.setIntPref("network.proxy.socks_version", 5);
     m_prefs.setBoolPref("network.proxy.share_proxy_settings", false);
     if (m_socks_pref_exists) {
@@ -267,6 +337,7 @@ function torbutton_update_status(nMode) {
             m_statuspanel.style.color = "#F00";
             m_statuspanel.setAttribute('label', label);
             m_statuspanel.setAttribute('tooltiptext', tooltip);
+            m_statuspanel.setAttribute('tbstatus', 'off');
         }
     } else {
         if (m_toolbutton) {
@@ -281,13 +352,26 @@ function torbutton_update_status(nMode) {
             m_statuspanel.style.color = "#390";
             m_statuspanel.setAttribute('label', label);
             m_statuspanel.setAttribute('tooltiptext', tooltip);
+            m_statuspanel.setAttribute('tbstatus', 'on');
         }
     }
 }
 
+function torbutton_open_prefs_dialog() {
+    window.openDialog("chrome://torbutton/content/preferences.xul","torbutton-preferences","centerscreen, chrome");
+}
+
+function torbutton_open_about_dialog() {
+    window.openDialog("chrome://torbutton/content/about.xul","torbutton-about","cneterscreen, chrome");
+}
+
 function torbutton_log(nLevel, sMsg) {
     if (m_tb_logger) {
         var rDate = new Date();
         m_tb_logger.log(nLevel, rDate.getTime()+': '+sMsg);
+    } else if (m_debug) {
+        var rDate = new Date();
+        dump("ERROR: m_tb_logger undefined ");
+        dump(rDate.getTime()+': '+sMsg+"\n");
     }
 }

+ 16 - 4
src/chrome/content/torbutton.xul

@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://torbutton/skin/torbutton.css" type="text/css"?> 
+<?xul-overlay href="chrome://torbutton/content/popup.xul"?>
 
 <!DOCTYPE overlay SYSTEM "chrome://torbutton/locale/torbutton.dtd">
 
@@ -19,16 +20,27 @@
         <toolbarbutton 
             id="torbutton-button" 
             class="toolbarbutton-1" 
+            label="Torbutton"
             tooltiptext="&torbutton.button.tooltip;" 
-            label="&torbutton.button.label;"
+            context="torbutton-context-menu"
             oncommand="torbutton_toggle();" />
     </toolbarpalette>
 
+    <commandset id="mainCommandSet">
+        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle();"/>
+    </commandset>
+
+    <keyset id="mainKeyset">
+        <key id="torbutton-toggle-key" modifiers="control shift" key="T"
+             command="torbutton-toggle-cmd"/>
+    </keyset>
+
     <statusbar id="status-bar">
         <statusbarpanel	id="torbutton-panel"
-			label="torbutton"
 			insertbefore="statusbar-updates"
-			onclick="torbutton_toggle()" />
-    </statusbar>
+                        context="torbutton-context-menu"
+			onclick="if (event.button == 0) torbutton_toggle()"/>
 
+        <popup id="torbutton-context-menu"/>
+   </statusbar>
 </overlay>

+ 56 - 0
src/chrome/content/torbutton_tb.xul

@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://torbutton/skin/torbutton.css" type="text/css"?> 
+<?xul-overlay href="chrome://torbutton/content/popup.xul"?>
+
+<!DOCTYPE overlay SYSTEM "chrome://torbutton/locale/torbutton.dtd">
+
+<overlay id="torbutton-overlay"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+    <script type="application/x-javascript" src="chrome://torbutton/content/torbutton.js" />
+    <script language="JavaScript">
+        //onLoad Hander
+        try{window.addEventListener("load", torbutton_init, false);}catch(e){}
+    </script>
+
+    <stringbundleset id="torbutton-stringbundleset">
+        <stringbundle id="torbutton-bundle" src="chrome://torbutton/locale/torbutton.properties"/>
+    </stringbundleset>
+
+    <toolbarpalette id="MailToolbarPalette">
+        <toolbarbutton 
+            id="torbutton-button-tb" 
+            class="toolbarbutton-1" 
+            label="Torbutton"
+            tooltiptext="&torbutton.button.tooltip;" 
+            context="torbutton-context-menu"
+            oncommand="torbutton_toggle();" />
+    </toolbarpalette>
+
+    <toolbarpalette id="MsgComposeToolbarPalette">
+        <toolbarbutton 
+            id="torbutton-button-tb-msg" 
+            class="toolbarbutton-1" 
+            label="Torbutton"
+            tooltiptext="&torbutton.button.tooltip;" 
+            context="torbutton-context-menu"
+            oncommand="torbutton_toggle();" />
+    </toolbarpalette>
+
+    <commandset id="mainCommandSet">
+        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle();"/>
+    </commandset>
+
+    <keyset id="mainKeyset">
+        <key id="torbutton-toggle-key" modifiers="control shift" key="T"
+             command="torbutton-toggle-cmd"/>
+    </keyset>
+
+    <statusbar id="status-bar">
+        <statusbarpanel	id="torbutton-panel"
+			insertbefore="statusbar-updates"
+                        context="torbutton-context-menu"
+			onclick="if (event.button == 0) torbutton_toggle()"/>
+
+        <popup id="torbutton-context-menu"/>
+   </statusbar>
+</overlay>

+ 25 - 7
src/chrome/locale/en-US/torbutton.dtd

@@ -1,7 +1,25 @@
-<!ENTITY torbutton.prefs.title "Torbutton Preferences">
-<!ENTITY torbutton.prefs.display_panel "Display Tor proxy setting in the status bar">
-<!ENTITY torbutton.button.label "Torbutton">
-<!ENTITY torbutton.button.tooltip "Turn Tor on/off">
-
-<!-- all text below this point is not used yet and does not need to be translated -->
-<!ENTITY torbutton.prefs.prompt_before_visiting_excluded_sites "Prompt user before visiting sites in the proxy exclusion list">
+<!ENTITY torbutton.prefs.title			"Torbutton Preferences">
+<!ENTITY torbutton.prefs.display_settings	"Display Settings">
+<!ENTITY torbutton.prefs.display_panel		"Display Tor proxy setting in the status bar">
+<!ENTITY torbutton.prefs.panel_format		"Status bar display format:">
+<!ENTITY torbutton.prefs.panel_text_format	"Text">
+<!ENTITY torbutton.prefs.panel_icon_format	"Icon">
+<!ENTITY torbutton.prefs.tor_settings		"Proxy Settings">
+<!ENTITY torbutton.prefs.recommended_settings	"Use the recommended proxy settings for my version of Firefox">
+<!ENTITY torbutton.prefs.use_privoxy		"Use Privoxy">
+<!ENTITY torbutton.prefs.custom_settings	"Use custom proxy settings">
+<!ENTITY torbutton.prefs.proxy.host.http	"HTTP Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.https	"SSL Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.ftp		"FTP Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.gopher	"Gopher Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.socks	"SOCKS Host:">
+<!ENTITY torbutton.prefs.proxy.port		"Port:">
+<!ENTITY torbutton.about.title			"About Torbutton">
+<!ENTITY torbutton.context_menu.toggle		"Toggle Tor status">
+<!ENTITY torbutton.context_menu.toggle.key	"T">
+<!ENTITY torbutton.context_menu.preferences	"Preferences...">
+<!ENTITY torbutton.context_menu.preferences.key	"P">
+<!ENTITY torbutton.context_menu.about		"About Torbutton...">
+<!ENTITY torbutton.context_menu.about.key	"A">
+<!ENTITY torbutton.button.label			"Torbutton">
+<!ENTITY torbutton.button.tooltip		"Click to initialize Torbutton">

+ 2 - 0
src/chrome/locale/en-US/torbutton.properties

@@ -4,3 +4,5 @@ torbutton.panel.tooltip.disabled = Click to enable Tor
 torbutton.panel.tooltip.enabled = Click to disable Tor
 torbutton.panel.label.disabled = Tor Disabled
 torbutton.panel.label.enabled = Tor Enabled
+extensions.{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}.description = Torbutton provides a button to easily enable or disable the tor proxy
+

+ 19 - 0
src/chrome/locale/fr-FR/contents.rdf

@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
+
+  <!-- skins supplied by this package -->
+  <RDF:Seq about="urn:mozilla:locale:root">
+    <RDF:li resource="urn:mozilla:locale:fr-FR"/>
+  </RDF:Seq>
+
+  <!-- locale information -->
+  <RDF:Description about="urn:mozilla:locale:fr-FR">
+    <chrome:packages>
+      <RDF:Seq about="urn:mozilla:locale:fr-FR:packages">
+        <RDF:li resource="urn:mozilla:locale:fr-FR:torbutton"/>
+      </RDF:Seq>
+    </chrome:packages>
+  </RDF:Description>
+
+</RDF:RDF>

+ 25 - 0
src/chrome/locale/fr-FR/torbutton.dtd

@@ -0,0 +1,25 @@
+<!ENTITY torbutton.prefs.title			"Préférences de Tor">
+<!ENTITY torbutton.prefs.display_settings	"Réglages de l'affichage">
+<!ENTITY torbutton.prefs.display_panel		"Afficher le status de Tor dans la barre d'état">
+<!ENTITY torbutton.prefs.panel_format		"Affichage dans la barre de status :">
+<!ENTITY torbutton.prefs.panel_text_format	"Texte">
+<!ENTITY torbutton.prefs.panel_icon_format	"Icône">
+<!ENTITY torbutton.prefs.tor_settings		"Réglages du proxy">
+<!ENTITY torbutton.prefs.recommended_settings	"Utiliser les réglages recommandés pour ma version de Firefox">
+<!ENTITY torbutton.prefs.use_privoxy		"Utiliser Privoxy">
+<!ENTITY torbutton.prefs.custom_settings	"Utiliser des réglages personnalisés pour le proxy">
+<!ENTITY torbutton.prefs.proxy.host.http	"Proxy HTTP :">
+<!ENTITY torbutton.prefs.proxy.host.https	"Proxy SSL :">
+<!ENTITY torbutton.prefs.proxy.host.ftp		"Proxy FTP :">
+<!ENTITY torbutton.prefs.proxy.host.gopher	"Proxy gopher:">
+<!ENTITY torbutton.prefs.proxy.host.socks	"Hôte SOCKS :">
+<!ENTITY torbutton.prefs.proxy.port		"Port :">
+<!ENTITY torbutton.about.title			"À propos de Torbutton">
+<!ENTITY torbutton.context_menu.toggle		"Inverser le status">
+<!ENTITY torbutton.context_menu.toggle.key	"I">
+<!ENTITY torbutton.context_menu.preferences	"Préférences&#8230;">
+<!ENTITY torbutton.context_menu.preferences.key	"P">
+<!ENTITY torbutton.context_menu.about		"À propos de Torbutton&#8230;">
+<!ENTITY torbutton.context_menu.about.key	"O">
+<!ENTITY torbutton.button.label			"Torbutton">
+<!ENTITY torbutton.button.tooltip		"Cliquer pour initialiser Torbutton">

+ 7 - 0
src/chrome/locale/fr-FR/torbutton.properties

@@ -0,0 +1,7 @@
+torbutton.button.tooltip.disabled = Activer Tor
+torbutton.button.tooltip.enabled = Désactiver Tor
+torbutton.panel.tooltip.disabled = Cliquer pour activer Tor
+torbutton.panel.tooltip.enabled = Cliquer pour désactiver Tor
+torbutton.panel.label.disabled = Tor Désactivé
+torbutton.panel.label.enabled = Tor Activé
+extensions.{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}.description=Un bouton pour activer ou désactiver facilement le proxy tor

+ 19 - 0
src/chrome/locale/sl-SI/contents.rdf

@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
+
+  <!-- skins supplied by this package -->
+  <RDF:Seq about="urn:mozilla:locale:root">
+    <RDF:li resource="urn:mozilla:locale:sl-SI"/>
+  </RDF:Seq>
+
+  <!-- locale information -->
+  <RDF:Description about="urn:mozilla:locale:sl-SI">
+    <chrome:packages>
+      <RDF:Seq about="urn:mozilla:locale:sl-SI:packages">
+        <RDF:li resource="urn:mozilla:locale:sl-SI:torbutton"/>
+      </RDF:Seq>
+    </chrome:packages>
+  </RDF:Description>
+
+</RDF:RDF>

+ 25 - 0
src/chrome/locale/sl-SI/torbutton.dtd

@@ -0,0 +1,25 @@
+<!ENTITY torbutton.prefs.title			"Torbutton nastavitve">
+<!ENTITY torbutton.prefs.display_settings	"Nastavitve prikaza">
+<!ENTITY torbutton.prefs.display_panel		"Prikaži nastavitev anonimizacije v statusni vrstici">
+<!ENTITY torbutton.prefs.panel_format		"Način prikaza v statusni vrstici:">
+<!ENTITY torbutton.prefs.panel_text_format	"besedilo">
+<!ENTITY torbutton.prefs.panel_icon_format	"ikona">
+<!ENTITY torbutton.prefs.tor_settings		"Nastavitve posredniškega (proxy) strežnika">
+<!ENTITY torbutton.prefs.recommended_settings	"Uporabi priporočene nastavitve posredniškega strežnika za mojo različico Firefoxa">
+<!ENTITY torbutton.prefs.use_privoxy		"Uporabi tudi povezavo preko Privoxy-a">
+<!ENTITY torbutton.prefs.custom_settings	"Uporabi nastavitve proxy strežnika po meri">
+<!ENTITY torbutton.prefs.proxy.host.http	"HTTP posredniški strežnik:">
+<!ENTITY torbutton.prefs.proxy.host.https	"SSL posredniški strežnik:">
+<!ENTITY torbutton.prefs.proxy.host.ftp		"FTP posredniški strežnik:">
+<!ENTITY torbutton.prefs.proxy.host.gopher	"Gopher posredniški strežnik:">
+<!ENTITY torbutton.prefs.proxy.host.socks	"SOCKS gostitelj:">
+<!ENTITY torbutton.prefs.proxy.port		"vrata:">
+<!ENTITY torbutton.about.title			"O razširitvi Torbutton">
+<!ENTITY torbutton.context_menu.toggle		"Zamenjaj status anonimizacije">
+<!ENTITY torbutton.context_menu.toggle.key	"T">
+<!ENTITY torbutton.context_menu.preferences	"Nastavitve...">
+<!ENTITY torbutton.context_menu.preferences.key	"P">
+<!ENTITY torbutton.context_menu.about		"O razširitvi Torbutton...">
+<!ENTITY torbutton.context_menu.about.key	"A">
+<!ENTITY torbutton.button.label			"Torbutton">
+<!ENTITY torbutton.button.tooltip		"Klikni za inicializiranje razširitve Torbutton">

+ 7 - 0
src/chrome/locale/sl-SI/torbutton.properties

@@ -0,0 +1,7 @@
+torbutton.button.tooltip.disabled = Vključi anonimizacijo
+torbutton.button.tooltip.enabled = Izključi anonimizacijo
+torbutton.panel.tooltip.disabled = Klikni za vklop anonimizacije
+torbutton.panel.tooltip.enabled = Klikni za izklop anonimizacije
+torbutton.panel.label.disabled = Anonimizacija izključena
+torbutton.panel.label.enabled = Anonimizacija vključena
+extensions.{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}.description = Torbutton razširitev omogoča enostavno vključitev ali izključitev povezave preko anonimizacijskega omrežja Tor

+ 16 - 3
src/chrome/skin/contents.rdf

@@ -16,16 +16,29 @@
     </Description>
 
     <Seq about="urn:mozilla:stylesheets">
-        <li resource="chrome://browser/content/browser.xul"/>
         <li resource="chrome://global/content/customizeToolbar.xul"/>
+        <!-- firefox --> 
+        <li resource="chrome://browser/content/browser.xul"/>
+        <!-- thunderbird -->
+        <li resource="chrome://messenger/content/messenger.xul"/>
+        <li resource="chrome://messenger/content/messengercompose/messengercompose.xul"/>
+    </Seq>
+
+    <Seq about="chrome://global/content/customizeToolbar.xul">
+        <li>chrome://torbutton/skin/torbutton.css</li>
     </Seq>
 
-    <!-- FireFox -->  
+    <!-- firefox -->  
     <Seq about="chrome://browser/content/browser.xul">
         <li>chrome://torbutton/skin/torbutton.css</li>
     </Seq>
 
-    <Seq about="chrome://global/content/customizeToolbar.xul">
+    <!-- thunderbird -->
+    <Seq about="chrome://messenger/content/messenger.xul">
         <li>chrome://torbutton/skin/torbutton.css</li>
     </Seq>
+    <Seq about="chrome://messenger/content/messengercompose/messengercompose.xul">
+        <li>chrome://torbutton/skin/torbutton.css</li>
+    </Seq>
+
 </RDF>

BIN
src/chrome/skin/tor-16-red.png


BIN
src/chrome/skin/tor-16.png


BIN
src/chrome/skin/tor-24-red.png


BIN
src/chrome/skin/tor-24.png


BIN
src/chrome/skin/tor.png


+ 63 - 6
src/chrome/skin/torbutton.css

@@ -1,18 +1,75 @@
 #torbutton-button {
-  list-style-image: url("chrome://torbutton/skin/bigbutton.png");
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
 }
 #torbutton-button[tbstatus="on"] {
-  list-style-image: url("chrome://torbutton/skin/bigbutton_gr.png");
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
 }
 #torbutton-button[tbstatus="off"] {
-  list-style-image: url("chrome://torbutton/skin/bigbutton.png");
+  list-style-image: url("chrome://torbutton/skin/tor-24-red.png");
 }
 toolbar[iconsize="small"] #torbutton-button {
-  list-style-image: url("chrome://torbutton/skin/smallbutton.png");
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
 }
 toolbar[iconsize="small"] #torbutton-button[tbstatus="on"] {
-  list-style-image: url("chrome://torbutton/skin/smallbutton_gr.png");
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
 }
 toolbar[iconsize="small"] #torbutton-button[tbstatus="off"] {
-  list-style-image: url("chrome://torbutton/skin/smallbutton.png");
+  list-style-image: url("chrome://torbutton/skin/tor-16-red.png");
+}
+
+#torbutton-panel {
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
+}
+#torbutton-panel[tbstatus="on"] {
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
+}
+#torbutton-panel[tbstatus="off"] {
+  list-style-image: url("chrome://torbutton/skin/tor-24-red.png");
+}
+toolbar[iconsize="small"] #torbutton-panel {
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
+}
+toolbar[iconsize="small"] #torbutton-panel[tbstatus="on"] {
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
+}
+toolbar[iconsize="small"] #torbutton-panel[tbstatus="off"] {
+  list-style-image: url("chrome://torbutton/skin/tor-16-red.png");
+}
+
+#torbutton-button-tb {
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
+}
+#torbutton-button-tb[tbstatus="on"] {
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
+}
+#torbutton-button-tb[tbstatus="off"] {
+  list-style-image: url("chrome://torbutton/skin/tor-24-red.png");
+}
+toolbar[iconsize="small"] #torbutton-button-tb {
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
+}
+toolbar[iconsize="small"] #torbutton-button-tb[tbstatus="on"] {
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
+}
+toolbar[iconsize="small"] #torbutton-button-tb[tbstatus="off"] {
+  list-style-image: url("chrome://torbutton/skin/tor-16-red.png");
+}
+
+#torbutton-button-tb-msg {
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
+}
+#torbutton-button-tb-msg[tbstatus="on"] {
+  list-style-image: url("chrome://torbutton/skin/tor-24.png");
+}
+#torbutton-button-tb-msg[tbstatus="off"] {
+  list-style-image: url("chrome://torbutton/skin/tor-24-red.png");
+}
+toolbar[iconsize="small"] #torbutton-button-tb-msg {
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
+}
+toolbar[iconsize="small"] #torbutton-button-tb-msg[tbstatus="on"] {
+  list-style-image: url("chrome://torbutton/skin/tor-16.png");
+}
+toolbar[iconsize="small"] #torbutton-button-tb-msg[tbstatus="off"] {
+  list-style-image: url("chrome://torbutton/skin/tor-16-red.png");
 }

+ 16 - 0
src/defaults/preferences/preferences.js

@@ -0,0 +1,16 @@
+// pref("extensions.torbutton.prompt_before_visiting_excluded_sites",true);
+pref("extensions.torbutton.display_panel",true);
+pref("extensions.torbutton.panel_style",'text');
+pref("extensions.torbutton.settings_method",'recommended');
+pref("extensions.torbutton.use_privoxy",true);
+pref("extensions.torbutton.http_proxy","");
+pref("extensions.torbutton.http_port",0);
+pref("extensions.torbutton.https_proxy","");
+pref("extensions.torbutton.https_port",0);
+pref("extensions.torbutton.ftp_proxy","");
+pref("extensions.torbutton.ftp_port",0);
+pref("extensions.torbutton.gopher_proxy","");
+pref("extensions.torbutton.gopher_port",0);
+pref("extensions.torbutton.socks_host","");
+pref("extensions.torbutton.socks_port",0);
+pref("extensions.{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}.description", "chrome://torbutton/locale/torbutton.properties");

+ 0 - 2
src/defaults/preferences/torbutton.js

@@ -1,2 +0,0 @@
-// pref("extensions.torbutton.prompt_before_visiting_excluded_sites",true);
-pref("extensions.torbutton.display_panel",true);

+ 16 - 10
src/install.rdf

@@ -2,27 +2,33 @@
 <RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
          xmlns:NC="http://home.netscape.com/NC-rdf#"
          xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-  <RDF:Description RDF:about="urn:mozilla:extension:file:torbutton.jar"
-                   em:package="content/"
-                   em:locale="locale/en-US/"
-                   em:skin="skin/" />
+  <RDF:Description RDF:about="urn:mozilla:extension:file:torbutton.jar">
+                   <em:package>content/</em:package>
+                   <em:locale>locale/en-US/</em:locale>
+                   <em:locale>locale/sl-SI/</em:locale>
+                   <em:locale>locale/fr-FR/</em:locale>
+                   <em:skin>skin/</em:skin>
+  </RDF:Description>
   <RDF:Description RDF:about="urn:mozilla:install-manifest"
                    em:name="Torbutton"
                    em:creator="Scott Squires"
-                   em:description="Torbutton provides a button to easily enable or disable the tor proxy"
                    em:id="{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}"
-                   em:version="1.0.1"
-                   em:homepageURL="http://zargon.hobbesnet.org/~squires/torbutton/"
-                   em:updateURL="http://zargon.hobbesnet.org/~squires/torbutton/update.rdf"
+                   em:version="1.0.2"
+                   em:homepageURL="http://freehaven.net/~squires/torbutton/"
+                   em:updateURL="http://freehaven.net/~squires/torbutton/update.rdf"
                    em:optionsURL="chrome://torbutton/content/preferences.xul"
-                   em:aboutURL="chrome://torbutton/content/about.xul"
-                   em:iconURL="chrome://torbutton/skin/bigbutton_gr.png">
+                   em:iconURL="chrome://torbutton/skin/tor.png">
     <em:targetApplication RDF:resource="rdf:#$QkNYY"/>
     <em:file RDF:resource="urn:mozilla:extension:file:torbutton.jar"/>
     <em:file RDF:resource="rdf:#$ZkNYY"/>
+    <em:file RDF:resource="rdf:#$YkNYY"/>
   </RDF:Description>
   <RDF:Description RDF:about="rdf:#$QkNYY"
                    em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
                    em:minVersion="0.9"
                    em:maxVersion="1.5.0.*" />
+  <RDF:Description RDF:about="rdf:#$YkNYY"
+                   em:id="{3550f703-e582-4d05-9a08-453d09bdfdc6}"
+                   em:minVersion="1.0"
+                   em:maxVersion="1.5.0.*" />
 </RDF:RDF>