Bug #302486 --> Port the Firefox changes for: PAC edit box plays games with URI fixup as you type

to Thunderbird.
This commit is contained in:
scott%scott-macgregor.org 2005-08-29 16:39:14 +00:00
parent e39bb24871
commit 2290538cdc
2 changed files with 11 additions and 8 deletions

View File

@ -39,6 +39,11 @@ var gConnectionsDialog = {
beforeAccept: function ()
{
var proxyTypePref = document.getElementById("network.proxy.type");
if (proxyTypePref.value == 2) {
this.doAutoconfigURLFixup();
return true;
}
if (proxyTypePref.value != 1)
return true;
@ -58,6 +63,7 @@ var gConnectionsDialog = {
proxyPortPref.value = httpProxyPortPref.value;
}
}
return true;
},
@ -147,17 +153,15 @@ var gConnectionsDialog = {
pps.configureFromPAC(autoURL.value);
},
writeAutoconfigURL: function ()
doAutoconfigURLFixup: function ()
{
var autoURL = document.getElementById("networkProxyAutoconfigURL");
var autoURLPref = document.getElementById("network.proxy.autoconfig_url");
var URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
.getService(Components.interfaces.nsIURIFixup);
try {
return URIFixup.createFixupURI(autoURL.value, 0).spec;
}
catch(ex) {
}
return undefined;
autoURLPref.value = autoURL.value = URIFixup.createFixupURI(autoURL.value, 0).spec;
} catch(ex) {}
},
readHTTPProxyServer: function ()

View File

@ -157,8 +157,7 @@
</grid>
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/>
<hbox class="indent" flex="1" align="center">
<textbox id="networkProxyAutoconfigURL" flex="1" preference="network.proxy.autoconfig_url"
onsynctopreference="return gConnectionsDialog.writeAutoconfigURL();"/>
<textbox id="networkProxyAutoconfigURL" flex="1" preference="network.proxy.autoconfig_url"/>
<button id="autoReload" label="&reload.label;" accesskey="&reload.accesskey;"
oncommand="gConnectionsDialog.reloadPAC();"
preference="pref.advanced.proxies.disable_button.reload"/>