[Netpass-devel] NetPass/www/htdocs/OSSTemplate/js network.js,1.2,1.3
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2005-05-08 02:35:57
|
Update of /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1361/www/htdocs/OSSTemplate/js Modified Files: network.js Log Message: more work on network cfg UI, removed some unused code Index: network.js =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js/network.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- network.js 6 May 2005 20:13:35 -0000 1.2 +++ network.js 8 May 2005 02:35:47 -0000 1.3 @@ -110,4 +110,105 @@ } document.forms[0].submit(); + +} + +function network_onblur_addHaNPServer(o) { + var RN = "network_onblur_addServer"; + dbg(1, RN); + var servs = document.getElementById('haNPServers'); + if (servs && o && o.value != "") { + var exists = false; + for(var i = 0 ; i < servs.options.length ; i++) { + if (servs.options[i].value == o.value) exists = true; + } + if (!exists) { + var no = new Option(o.value, o.value, false, false); + servs.options[servs.options.length] = no; + unHighLightList("haNPServers"); + servs.options[servs.options.length-1].selected = true; + sortList("haNPServers"); + } else { + dbg (1, RN + ": server already exists: " + o.value); + } + } + if (o) o.value = "Add Server..."; + return false; +} + +function network_onfocus_addHaNPServer(o) { + var RN = "network_onblur_addHaNPServer"; + dbg(1, RN); + if (o && o.value == "Add Server...") o.value = ''; +} + +function network_onclick_delHaNPServer() { + var RN = "network_delHaNPServer"; + dbg (1, RN); + + var servs = document.getElementById('haNPServers'); + if (servs) { + for(var i = servs.options.length-1 ; i >= 0 ; i--) { + if (servs.options[i].selected) + if (servs.options[i].value != network_ourHostname) { + dbg(1, RN + ": del " + servs.options[i].value); + servs.options[i] = undefined; + } + } + } + return false; +} + +function network_onclick_cfgSwitch() { + var switches = document.getElementById('switches'); + if (switches) { + for(var i = 0 ; i < switches.options.length ; i++) { + if (switches.options[i].selected) { + document.location.href = 'switch.mhtml?switch=' + + switches.options[i].value; + } + } + } + return false; +} + +function network_onclick_delSwitch() { + var switches = document.getElementById('switches'); + if (switches) { + for(var i = switches.options.length-1 ; i >= 0 ; i--) { + if (switches.options[i].selected) + switches.options[i] = undefined; + } + } + return false; +} + + +function network_onblur_addSwitch(o) { + var RN = "network_onblur_addSwitch"; + dbg(1, RN); + var servs = document.getElementById('switches'); + if (servs && o && o.value != "") { + var exists = false; + for(var i = 0 ; i < servs.options.length ; i++) { + if (servs.options[i].value == o.value) exists = true; + } + if (!exists) { + var no = new Option(o.value, o.value, false, false); + servs.options[servs.options.length] = no; + unHighLightList("switches"); + servs.options[servs.options.length-1].selected = true; + sortList("switches"); + } else { + dbg (1, RN + ": switch already exists: " + o.value); + } + } + if (o) o.value = "Add Switch..."; + return false; +} + +function network_onfocus_addSwitch(o) { + var RN = "network_onblur_addSwitch"; + dbg(1, RN); + if (o && o.value == "Add Switch...") o.value = ''; } |