[Pkg-mozext-commits] [SCM] Debian packaging for toggle-proxy branch, master, updated. debian/1.5-2-11-ga226d52
David Prévot
taffit at debian.org
Wed Jul 17 23:09:21 UTC 2013
The following commit has been merged in the master branch:
commit 3413a4f8baaab79b628d030286a2a1e3c006459a
Author: David Prévot <taffit at debian.org>
Date: Wed Jul 17 18:45:17 2013 -0400
Imported Upstream version 1.8
diff --git a/chrome.manifest b/chrome.manifest
index 99746ef..f0768b8 100755
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -4,9 +4,9 @@ skin toggleproxy classic/1.0 chrome/skin/
overlay chrome://browser/content/browser.xul chrome://toggleproxy/content/toggleproxy.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://messenger/content/messenger.xul chrome://toggleproxy/content/toggleproxy.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
+style chrome://global/content/customizeToolbar.xul chrome://toggleproxy/skin/toggleproxy.css
locale toggleproxy en-US chrome/locale/en-US/
locale toggleproxy fr-FR chrome/locale/fr-FR/
locale toggleproxy nl-NL chrome/locale/nl-NL/
-
diff --git a/chrome/content/toggleproxy.js b/chrome/content/toggleproxy.js
index 7c3a8ab..72ec789 100755
--- a/chrome/content/toggleproxy.js
+++ b/chrome/content/toggleproxy.js
@@ -18,36 +18,70 @@ var toggleproxy = {
// Grab proxy icon
var proxyButton = document.getElementById("toggleproxy-status");
+ // Grab toolbar icon
+ var proxyToolbarButton = document.getElementById("toggleproxy-toolbar-button");
+
if (proxyStatus==0) // No proxy
{
proxyButton.setAttribute("tooltiptext", this.language_tooltip_noproxy);
proxyButton.setAttribute("class", "toggleproxy-status-noproxy");
+ if (proxyToolbarButton != null) // toolbar button activated, if not result will be null
+ {
+ proxyToolbarButton.setAttribute("tooltiptext", this.language_tooltip_noproxy);
+ proxyToolbarButton.setAttribute("state", "no");
+ }
+
}
else if (proxyStatus==1) // Manual proxy
{
proxyButton.setAttribute("tooltiptext", this.language_tooltip_manual);
proxyButton.setAttribute("class", "toggleproxy-status-manualproxy");
+ if (proxyToolbarButton != null) // toolbar button activated, if not result will be null
+ {
+ proxyToolbarButton.setAttribute("tooltiptext", this.language_tooltip_manual);
+ proxyToolbarButton.setAttribute("state", "manual");
+ }
}
else if (proxyStatus==4) // Auto-detect proxy
{
proxyButton.setAttribute("tooltiptext", this.language_tooltip_auto);
proxyButton.setAttribute("class", "toggleproxy-status-autoproxy");
+ if (proxyToolbarButton != null) // toolbar button activated, if not result will be null
+ {
+ proxyToolbarButton.setAttribute("tooltiptext", this.language_tooltip_auto);
+ proxyToolbarButton.setAttribute("state", "auto-detect");
+ }
}
else if (proxyStatus==5) // System proxy
{
proxyButton.setAttribute("tooltiptext", this.language_tooltip_system);
proxyButton.setAttribute("class", "toggleproxy-status-systemproxy");
+ if (proxyToolbarButton != null)
+ {
+ proxyToolbarButton.setAttribute("tooltiptext", this.language_tooltip_system);
+ proxyToolbarButton.setAttribute("state", "system");
+ }
}
else if (proxyStatus==2) // Auto proxy (URL)
{
- proxyButton.setAttribute("tooltiptext", this.language_tooltip_autourl);
+ proxyButton.setAttribute("tooltiptext", this.language_tooltip_system);
proxyButton.setAttribute("class", "toggleproxy-status-autourl");
+ if (proxyToolbarButton != null) // toolbar button activated, if not result will be null
+ {
+ proxyToolbarButton.setAttribute("tooltiptext", this.language_tooltip_system);
+ proxyToolbarButton.setAttribute("state", "auto-proxy");
+ }
}
},
// Called when Firefox loads
onLoad : function()
{
+ if (this.prefs.getBoolPref("debug"))
+ {
+ this.consoleService.logStringMessage("DEBUG: onLoad");
+ }
+
// get locale display information
this.language_preferences_title = this.language.GetStringFromName("toggleproxy_preferencess_title");
this.language_tooltip_auto = this.language.GetStringFromName("toggleproxy_tooltip_auto");
@@ -58,13 +92,14 @@ var toggleproxy = {
this.updateIcon();
},
+
// Called on icon click
onClick : function(e)
{
if (this.prefs.getBoolPref("debug"))
{
- this.consoleService.logStringMessage("onClick: button " + e.button);
+ this.consoleService.logStringMessage("DEBUG: onClick: button " + e.button);
}
if (e.button == 0) { this.toggleProxy(); } // left click
@@ -72,12 +107,25 @@ var toggleproxy = {
e.preventDefault();
},
+ // Called on toolbar click
+ onToolbar : function(e)
+ {
+ if (this.prefs.getBoolPref("debug"))
+ {
+ this.consoleService.logStringMessage("DEBUG: onToolbar pressed " + e);
+ }
+
+ this.toggleProxy();
+ e.preventDefault();
+ },
+
// open the preferences window
openPreferences : function()
{
try
{
- window.openDialog('chrome://toggleproxy/content/toggleproxyPref.xul', this.language_preferences_title, 'chrome,centerscreen,dependent');
+ var features = "chrome,titlebar,toolbar,centerscreen,modal,dependent";
+ window.openDialog('chrome://toggleproxy/content/toggleproxyPref.xul', this.language_preferences_title, features);
}
catch (rErr) // catch and display any errors
{
@@ -94,6 +142,11 @@ var toggleproxy = {
var optionTwo = this.prefs.getIntPref('toggletwo');
var modified = false;
+ if (this.prefs.getBoolPref("debug"))
+ {
+ this.consoleService.logStringMessage("DEBUG: toggleProxy");
+ }
+
// check first toggle, if it isn't set to toggle one set it to that value
if (proxyStatus != optionOne)
{
diff --git a/chrome/content/toggleproxy.xul b/chrome/content/toggleproxy.xul
index 4e253bd..6ad6788 100755
--- a/chrome/content/toggleproxy.xul
+++ b/chrome/content/toggleproxy.xul
@@ -1,9 +1,8 @@
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://toggleproxy/skin/toggleproxy.css"
- type="text/css"?>
+<?xml-stylesheet href="chrome://toggleproxy/skin/toggleproxy.css" type="text/css"?>
- <overlay id="toggleproxyOverlay"
+<overlay id="toggleproxyOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript"
@@ -25,9 +24,21 @@
/>
</statusbarpanel>
</statusbar>
-
+
<keyset id="mainKeyset">
<key id="key_toggleProxy" key="x" modifiers="alt" oncommand="toggleproxy.toggleProxy()"/>
</keyset>
+ <!-- Firefox Toolbar Element -->
+ <toolbarpalette id="BrowserToolbarPalette">
+ <toolbarbutton
+ id="toggleproxy-toolbar-button"
+ class="toolbarbutton-1 chromeclass-toolbar-additional"
+ label="Toggle Proxy"
+ tooltiptext="Toggle Proxy Tooltip"
+ oncommand="toggleproxy.onToolbar(event);"
+ />
+ </toolbarpalette>
+
</overlay>
+
diff --git a/chrome/content/toggleproxyPref.xul b/chrome/content/toggleproxyPref.xul
index 3f26a3d..e3d32e9 100644
--- a/chrome/content/toggleproxyPref.xul
+++ b/chrome/content/toggleproxyPref.xul
@@ -1,13 +1,36 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://toggleproxy/locale/toggleproxy.dtd">
-<prefwindow
+<prefwindow id="toggleproxy-preferences"
title="&pref.title;"
buttons="accept,cancel"
onload="toggle_prefs.onload();"
ondialogaccept="toggle_prefs.unload();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <prefpane id="toggleproxypref" label="&pref.title;">
+ <groupbox>
+ <caption label="&pref.onelabel;" />
+ <radiogroup id="toggleproxy_toggleone">
+ <radio value="0" label="&pref.radiozero;" />
+ <radio value="4" label="&pref.radioone;" />
+ <radio value="5" label="&pref.radiotwo;" />
+ <radio value="1" label="&pref.radiothree;" />
+ <radio value="2" label="&pref.radiofour;" />
+ </radiogroup>
+ </groupbox>
+ <groupbox>
+ <caption label="&pref.twolabel;" />
+ <radiogroup id="toggleproxy_toggletwo">
+ <radio value="0" label="&pref.radiozero;" />
+ <radio value="4" label="&pref.radioone;" />
+ <radio value="5" label="&pref.radiotwo;" />
+ <radio value="1" label="&pref.radiothree;" />
+ <radio value="2" label="&pref.radiofour;" />
+ </radiogroup>
+ </groupbox>
+ </prefpane>
+
<script type="application/x-javascript">
<![CDATA[
var toggle_prefs = {
@@ -17,6 +40,14 @@
{
this.prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.toggleproxy.");
+ if (document.documentElement.getButton("accept").hidden == true)
+ {
+ document.documentElement.getButton("accept").hidden = false;
+ document.documentElement.getButton("accept").disabled = false;
+ document.documentElement.getButton("cancel").hidden = false;
+ document.documentElement.getButton("cancel").disabled = false;
+ }
+
document.getElementById("toggleproxy_toggleone").value = this.prefs.getIntPref("toggleone");
document.getElementById("toggleproxy_toggletwo").value = this.prefs.getIntPref("toggletwo");
},
@@ -33,31 +64,5 @@
</script>
<script type="application/x-javascript" src="chrome://toggleproxy/content/customizeShortcuts.js" />
-
- <prefpane id="toggleproxypref" label="&pref.title;">
- <groupbox>
- <caption label="&pref.onelabel;" />
- <radiogroup id="toggleproxy_toggleone">
- <radio value="0" label="&pref.radiozero;" />
- <radio value="4" label="&pref.radioone;" />
- <radio value="5" label="&pref.radiotwo;" />
- <radio value="1" label="&pref.radiothree;" />
- <radio value="2" label="&pref.radiofour;" />
- </radiogroup>
- </groupbox>
- <groupbox>
- <caption label="&pref.twolabel;" />
- <radiogroup id="toggleproxy_toggletwo">
- <radio value="0" label="&pref.radiozero;" />
- <radio value="4" label="&pref.radioone;" />
- <radio value="5" label="&pref.radiotwo;" />
- <radio value="1" label="&pref.radiothree;" />
- <radio value="2" label="&pref.radiofour;" />
- </radiogroup>
- </groupbox>
-
- </prefpane>
</prefwindow>
-
-
diff --git a/chrome/locale/en-US/toggleproxy.dtd b/chrome/locale/en-US/toggleproxy.dtd
index ff3e531..b912bd6 100644
--- a/chrome/locale/en-US/toggleproxy.dtd
+++ b/chrome/locale/en-US/toggleproxy.dtd
@@ -6,4 +6,3 @@
<!ENTITY pref.radiotwo "Use system proxy settings">
<!ENTITY pref.radiothree "Manual proxy configuration">
<!ENTITY pref.radiofour "Automatic proxy configuration URL">
-
diff --git a/chrome/locale/fr-FR/toggleproxy.dtd b/chrome/locale/fr-FR/toggleproxy.dtd
index 71b9db8..2f9f1d5 100644
--- a/chrome/locale/fr-FR/toggleproxy.dtd
+++ b/chrome/locale/fr-FR/toggleproxy.dtd
@@ -6,4 +6,3 @@
<!ENTITY pref.radiotwo "Utiliser les parametres proxy du systeme">
<!ENTITY pref.radiothree "Configuration manuelle du proxy">
<!ENTITY pref.radiofour "Adresse de configuration automatique du proxy">
-
diff --git a/chrome/skin/all.png b/chrome/skin/all.png
new file mode 100644
index 0000000..d41d86b
Binary files /dev/null and b/chrome/skin/all.png differ
diff --git a/chrome/skin/toggleproxy.css b/chrome/skin/toggleproxy.css
index b0db081..aeb85ad 100755
--- a/chrome/skin/toggleproxy.css
+++ b/chrome/skin/toggleproxy.css
@@ -1,3 +1,5 @@
+ at namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
+
.toggleproxy-status-autoproxy {
list-style-image: url("chrome://toggleproxy/skin/home.png");
}
@@ -17,3 +19,26 @@
.toggleproxy-status-systemproxy {
list-style-image: url("chrome://toggleproxy/skin/system.png");
}
+
+#toggleproxy-toolbar-button {
+ list-style-image: url("all.png") !important;
+}
+
+#toggleproxy-toolbar-button {
+ -moz-image-region: rect(0px 16px 16px 0px);
+}
+#toggleproxy-toolbar-button[state="no"] {
+ -moz-image-region: rect(0px 16px 16px 0px);
+}
+#toggleproxy-toolbar-button[state="manual"] {
+ -moz-image-region: rect(0px 33px 16px 17px);
+}
+#toggleproxy-toolbar-button[state="auto-detect"] {
+ -moz-image-region: rect(0px 50px 16px 34px);
+}
+#toggleproxy-toolbar-button[state="system"] {
+ -moz-image-region: rect(0px 67px 16px 51px);
+}
+#toggleproxy-toolbar-button[state="auto-proxy"] {
+ -moz-image-region: rect(0px 86px 16px 70px);
+}
diff --git a/defaults/preferences/toggleproxypref.js b/defaults/preferences/toggleproxypref.js
index 22a6093..72c693c 100644
--- a/defaults/preferences/toggleproxypref.js
+++ b/defaults/preferences/toggleproxypref.js
@@ -1,9 +1,6 @@
// debug messages available
pref("extensions.toggleproxy.debug", false);
-// update prefernces on ok button being pressed
-pref("browser.preferences.instantApply", false);
-
// toggle one default proxy setting = manual
pref("extensions.toggleproxy.toggleone", 1);
diff --git a/install.rdf b/install.rdf
index e0bc585..ae1f5e1 100755
--- a/install.rdf
+++ b/install.rdf
@@ -8,15 +8,15 @@
<!-- Required Items -->
<em:id>toggleproxy at quirkyquipu.co.uk</em:id>
<em:name>Toggle Proxy</em:name>
- <em:version>1.5</em:version>
+ <em:version>1.8</em:version>
<em:type>2</em:type>
-
+
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
- <em:maxVersion>11.*</em:maxVersion>
+ <em:maxVersion>19.*</em:maxVersion>
</Description>
</em:targetApplication>
@@ -25,7 +25,7 @@
<Description>
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>3.0</em:minVersion>
- <em:maxVersion>11.*</em:maxVersion>
+ <em:maxVersion>19.*</em:maxVersion>
</Description>
</em:targetApplication>
@@ -41,7 +41,7 @@
<em:name>Toggle Proxy</em:name>
<em:description>Toggle Proxy voegt een statusbalkpictogram toe voor het omschakelen tussen twee proxyinstellingen die in de voorkeuren kunnen worden ingesteld.</em:description>
</Description>
- </em:localized>
+ </em:localized>
<em:localized>
<Description>
@@ -49,8 +49,8 @@
<em:name>Toggle Proxy</em:name>
<em:description>Basculer Proxy ajoute une icone de barre d'etat pour alterner entre deux parametres de proxy qui peut etre defini dans les preferences ou via un raccourci clavier.</em:description>
</Description>
- </em:localized>
-
+ </em:localized>
+
</Description>
</RDF>
-
\ No newline at end of file
+
--
Debian packaging for toggle-proxy
More information about the Pkg-mozext-commits
mailing list