- 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
This commit is contained in:
parent
03a0cced19
commit
3d615f2b9c
3 changed files with 27 additions and 18 deletions
|
@ -111,8 +111,13 @@ var Zotero_ProxyEditor = new function() {
|
||||||
|
|
||||||
var hasErrors = proxy.validate();
|
var hasErrors = proxy.validate();
|
||||||
if(hasErrors) {
|
if(hasErrors) {
|
||||||
Components.interfaces.nsIPromptService.getService().alert(window,
|
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||||
Zotero.getString("proxies.error"), Zotero.getString("proxies.error."+hasErrors));
|
.getService(Components.interfaces.nsIPromptService);
|
||||||
|
promptService.alert(
|
||||||
|
window,
|
||||||
|
Zotero.getString("proxies.error"),
|
||||||
|
Zotero.getString("proxies.error." + hasErrors)
|
||||||
|
);
|
||||||
if(window.arguments && window.arguments[0]) proxy.revert();
|
if(window.arguments && window.arguments[0]) proxy.revert();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,25 +95,29 @@ Zotero.Proxies = new function() {
|
||||||
Components.utils.reportError(e);
|
Components.utils.reportError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!proxy) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if transparent is turned off, just save the proxy
|
||||||
if(!transparent) {
|
if(!transparent) {
|
||||||
// if transparent is turned off, just save the proxy
|
|
||||||
proxy.save();
|
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;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -509,7 +509,7 @@ sync.storage.kbRemaining = %SKB remaining
|
||||||
sync.storage.none = None
|
sync.storage.none = None
|
||||||
|
|
||||||
proxies.multiSite = Multi-Site
|
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.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.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).
|
proxies.error.scheme.noHost = A multi-site proxy scheme must contain the host variable (%h).
|
||||||
|
|
Loading…
Add table
Reference in a new issue