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
Родитель f2b05ea812
Коммит f7ad9ff91a
2 изменённых файлов: 11 добавлений и 8 удалений

Просмотреть файл

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

Просмотреть файл

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