www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 3d615f2b9c8657514647411f6028fd7b47f082f8
parent 03a0cced194381f4ccd9b2cd3a53c234db50f39b
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 14 Nov 2008 19:15:18 +0000

- Fix errors when auto-saving proxies with transparent setting off (due to proxy variable not being set)
- Fixed display of proxy settings validation failure window
- Tweaked validation failure window title


Diffstat:
Mchrome/content/zotero/preferences/proxyEditor.js | 9+++++++--
Mchrome/content/zotero/xpcom/proxy.js | 34+++++++++++++++++++---------------
Mchrome/locale/en-US/zotero/zotero.properties | 2+-
3 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/chrome/content/zotero/preferences/proxyEditor.js b/chrome/content/zotero/preferences/proxyEditor.js @@ -111,8 +111,13 @@ var Zotero_ProxyEditor = new function() { var hasErrors = proxy.validate(); if(hasErrors) { - Components.interfaces.nsIPromptService.getService().alert(window, - Zotero.getString("proxies.error"), Zotero.getString("proxies.error."+hasErrors)); + var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + promptService.alert( + window, + Zotero.getString("proxies.error"), + Zotero.getString("proxies.error." + hasErrors) + ); if(window.arguments && window.arguments[0]) proxy.revert(); return false; } diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js @@ -95,25 +95,29 @@ Zotero.Proxies = new function() { Components.utils.reportError(e); } + if (!proxy) { + continue; + } + + // if transparent is turned off, just save the proxy if(!transparent) { - // if transparent is turned off, just save the proxy proxy.save(); - } else if(proxy) { - // otherwise, make sure we want it - var io = {site:proxy.hosts[0], proxy:channel.URI.hostPort}; - var window = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator) - .getMostRecentWindow("navigator:browser"); - window.openDialog('chrome://zotero/content/proxy.xul', '', 'chrome,modal', io); - - if(io.add) proxy.save(); - if(io.disable) { - transparent = false; - Zotero.Prefs.set("proxies.transparent", false); - } - break; } + + // otherwise, make sure we want it + var io = {site:proxy.hosts[0], proxy:channel.URI.hostPort}; + var window = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator) + .getMostRecentWindow("navigator:browser"); + window.openDialog('chrome://zotero/content/proxy.xul', '', 'chrome,modal', io); + + if(io.add) proxy.save(); + if(io.disable) { + transparent = false; + Zotero.Prefs.set("proxies.transparent", false); + } + break; } } diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties @@ -509,7 +509,7 @@ sync.storage.kbRemaining = %SKB remaining sync.storage.none = None proxies.multiSite = Multi-Site -proxies.error = Information Validation Error +proxies.error = Invalid Proxy Settings proxies.error.scheme.noHTTP = Valid proxy schemes must start with "http://" or "https://" proxies.error.host.invalid = You must enter a full hostname for the site served by this proxy (e.g., jstor.org). proxies.error.scheme.noHost = A multi-site proxy scheme must contain the host variable (%h).