Adding manual proxies -r by bill

This commit is contained in:
matt%netscape.com 1999-10-21 19:53:19 +00:00
Родитель 1cad704dd9
Коммит 12d7c924da
3 изменённых файлов: 240 добавлений и 28 удалений

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

@ -24,11 +24,12 @@
<!DOCTYPE window SYSTEM "chrome://pref/locale/pref-proxies.dtd" >
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="return StartUp('Proxies');" title="Sample Prefs Panel">
onload="manualSelected();return StartUp('Proxies');" title="Sample Prefs Panel">
<html:script language="javascript" src="PrefsWindow.js"/>
<html:div flex="100%">
<box id="header" align="horizontal">
<spring style="width:20px"/>
<html:div style="vertical-align: middle;">
@ -44,19 +45,93 @@
<html:fieldset style="width: 100%;">
<!-- &networkHeader.label; Bug in boxes-->
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:0:int:network.proxy.type" />
<html:label for="pref:0:int:network.proxy.type" accesskey="d" tabindex="0">
&directTypeRadio.label;
</html:label>
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:1:int:network.proxy.type" />
<html:label for="pref:1:int:network.proxy.type" accesskey="m" tabindex="0">
&manualTypeRadio.label;
</html:label>
<titledbutton value="&view.label;" align="left" onclick="OpenProxyManualDialog();"/>
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:0:int:network.proxy.type" />
<html:label for="pref:0:int:network.proxy.type" accesskey="d" tabindex="0">
&directTypeRadio.label;
</html:label>
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:1:int:network.proxy.type" />
<html:label for="pref:1:int:network.proxy.type" accesskey="m" tabindex="0">
&manualTypeRadio.label;
</html:label>
<titledbutton value="&view.label;" align="left" onclick="openit();"/>
</html:div>
<html:div id="manual-proxy" style="display: none">
<box align="horizontal">
<html:div>
&ftp.label;
</html:div>
<html:input name="ftpproxy" type="text" id="pref:string:string:network.proxy.http" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="ftpproxyport" type="text" id="pref:string:string:network.proxy.http_port" size="5" />
</box>
<box align="horizontal">
<html:div>
&http.label;
</html:div>
<html:input name="httpproxy" type="text" id="pref:string:string:network.proxy.ftp" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="httpproxyport" type="text" id="pref:string:string:network.proxy.ftp_port" size="5" />
</box>
<!-- Not supporting gopher -->
<!-- <box align="horizontal">
<html:div>
&gopher.label;
</html:div>
<html:input name="gopherproxy" type="text" id="pref:string:string:network.proxy.gopher" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="gopherproxyport" type="text" id="pref:string:string:network.proxy.gopher_port" size="5" />
</box> -->
<!-- Not supporting wais right now -->
<!-- <box align="horizontal">
<html:div>
&wais.label;
</html:div>
<html:input name="waisproxy" type="text" id="pref:string:string:network.proxy.wais" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="waisproxyport" type="text" id="pref:string:string:network.proxy.wais_port" size="5" />
</box> -->
<box align="horizontal">
<html:div>
&direct.label;
</html:div>
</box>
<box align="horizontal">
<html:div>
&noproxy.label;
</html:div>
<html:input name="noproxy" type="text" id="pref:string:string:network.proxy.none" size="30" />
</box>
<!-- No supporting at this point -->
<!-- <box align="horizontal">
<html:div>
&sockhost.label;
</html:div>
<html:input name="sockshost" type="text" id="pref:string:string:network.socks.host" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="socksport" type="text" id="pref:string:string:network.socks.port" size="5" />
</box> -->
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:2:int:network.proxy.type" />
<html:label for="pref:2:int:network.proxy.type" accesskey="a" tabindex="0">
@ -64,6 +139,10 @@
</html:label>
<titledbutton value="&reload.label;" align="left"/>
</html:div>
<html:div>
&configAutoconfigText.label;
<html:input name="" type="text" size="15" id="pref:0:string:network.proxy.autoconfig_url" />
@ -73,3 +152,4 @@
</box>
</html:div>
</window>

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

@ -42,6 +42,20 @@ function StartUp(windowName)
}
//function to open and close the manual prefs
function openit() {
var manualProxy = document.getElementById('manual-proxy');
var formStyle = manualProxy.getAttribute('style');
if (!(formStyle == "display: block; "))
{
manualProxy.setAttribute("style", "display: block;");
}
else {
manualProxy.setAttribute("style", "display: none;");
}
}
function choose() {
var toolkit;
var browser;
@ -108,3 +122,41 @@ function PrefCacheSelectFolder() {
function OpenProxyManualDialog() {
var dialog = window.openDialog("chrome://pref/content/pref-proxy-manual.xul", "", "chrome", {});
}
//dialog function that is not being called yet
function onOK()
{
//dump("\nDoing " + windowName + " startup...\n");
dump("Looking up prefwindow object...\n");
if (prefwindow == null)
{
dump("Creating prefwindow object...\n");
prefwindow = Components.classes['component://netscape/prefwindow'].createInstance(Components.interfaces.nsIPrefWindow);
}
else
{
dump("prefwindow has already been created! Hurrah!\n");
}
if (prefwindow)
{
prefwindow.changePanel("chrome://prefs/content/pref-proxies.xul");
}
return true
}
function startUpProxy() {
doSetOKCancel(onOK, null);
}
function manualSelected() {
manualSelect = document.getElementById('pref:1:int:network.proxy.type');
manualProxy = document.getElementById('manual-proxy');
dump("\n" + manualSelect);
dump("\n" + manualSelect.checked);
if (manualSelect.checked)
manualProxy.setAttribute("style", "display: block");
}

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

@ -24,11 +24,12 @@
<!DOCTYPE window SYSTEM "chrome://pref/locale/pref-proxies.dtd" >
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="return StartUp('Proxies');" title="Sample Prefs Panel">
onload="manualSelected();return StartUp('Proxies');" title="Sample Prefs Panel">
<html:script language="javascript" src="PrefsWindow.js"/>
<html:div flex="100%">
<box id="header" align="horizontal">
<spring style="width:20px"/>
<html:div style="vertical-align: middle;">
@ -44,19 +45,93 @@
<html:fieldset style="width: 100%;">
<!-- &networkHeader.label; Bug in boxes-->
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:0:int:network.proxy.type" />
<html:label for="pref:0:int:network.proxy.type" accesskey="d" tabindex="0">
&directTypeRadio.label;
</html:label>
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:1:int:network.proxy.type" />
<html:label for="pref:1:int:network.proxy.type" accesskey="m" tabindex="0">
&manualTypeRadio.label;
</html:label>
<titledbutton value="&view.label;" align="left" onclick="OpenProxyManualDialog();"/>
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:0:int:network.proxy.type" />
<html:label for="pref:0:int:network.proxy.type" accesskey="d" tabindex="0">
&directTypeRadio.label;
</html:label>
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:1:int:network.proxy.type" />
<html:label for="pref:1:int:network.proxy.type" accesskey="m" tabindex="0">
&manualTypeRadio.label;
</html:label>
<titledbutton value="&view.label;" align="left" onclick="openit();"/>
</html:div>
<html:div id="manual-proxy" style="display: none">
<box align="horizontal">
<html:div>
&ftp.label;
</html:div>
<html:input name="ftpproxy" type="text" id="pref:string:string:network.proxy.http" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="ftpproxyport" type="text" id="pref:string:string:network.proxy.http_port" size="5" />
</box>
<box align="horizontal">
<html:div>
&http.label;
</html:div>
<html:input name="httpproxy" type="text" id="pref:string:string:network.proxy.ftp" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="httpproxyport" type="text" id="pref:string:string:network.proxy.ftp_port" size="5" />
</box>
<!-- Not supporting gopher -->
<!-- <box align="horizontal">
<html:div>
&gopher.label;
</html:div>
<html:input name="gopherproxy" type="text" id="pref:string:string:network.proxy.gopher" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="gopherproxyport" type="text" id="pref:string:string:network.proxy.gopher_port" size="5" />
</box> -->
<!-- Not supporting wais right now -->
<!-- <box align="horizontal">
<html:div>
&wais.label;
</html:div>
<html:input name="waisproxy" type="text" id="pref:string:string:network.proxy.wais" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="waisproxyport" type="text" id="pref:string:string:network.proxy.wais_port" size="5" />
</box> -->
<box align="horizontal">
<html:div>
&direct.label;
</html:div>
</box>
<box align="horizontal">
<html:div>
&noproxy.label;
</html:div>
<html:input name="noproxy" type="text" id="pref:string:string:network.proxy.none" size="30" />
</box>
<!-- No supporting at this point -->
<!-- <box align="horizontal">
<html:div>
&sockhost.label;
</html:div>
<html:input name="sockshost" type="text" id="pref:string:string:network.socks.host" size="20" />
<spring flex="100%"/>
<html:div>
&port.label;
</html:div>
<html:input name="socksport" type="text" id="pref:string:string:network.socks.port" size="5" />
</box> -->
</html:div>
<html:div>
<html:input name="directManualOrAuto" type="radio" id="pref:2:int:network.proxy.type" />
<html:label for="pref:2:int:network.proxy.type" accesskey="a" tabindex="0">
@ -64,6 +139,10 @@
</html:label>
<titledbutton value="&reload.label;" align="left"/>
</html:div>
<html:div>
&configAutoconfigText.label;
<html:input name="" type="text" size="15" id="pref:0:string:network.proxy.autoconfig_url" />
@ -73,3 +152,4 @@
</box>
</html:div>
</window>