diff options
author | gnhb <gnoahb@gmail.com> | 2010-05-02 16:39:08 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2010-05-02 16:39:08 +0700 |
commit | de77ffdb1e62343a9483c7ab2cdf594ad6dc482d (patch) | |
tree | 8badb1e4a86813c6ecca1775f85707279e173bb1 /usr/local/www/javascript | |
parent | 6fcc9db6a274d78c63b53601ecf9d38eab637101 (diff) | |
download | pfsense-de77ffdb1e62343a9483c7ab2cdf594ad6dc482d.zip pfsense-de77ffdb1e62343a9483c7ab2cdf594ad6dc482d.tar.gz |
Code to save data on a per port(bandwidth, mtu, mru, etc.) basis is working.
Diffstat (limited to 'usr/local/www/javascript')
-rw-r--r-- | usr/local/www/javascript/interfaces_mlppp_edit/interfaces_mlppp_edit.js | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/usr/local/www/javascript/interfaces_mlppp_edit/interfaces_mlppp_edit.js b/usr/local/www/javascript/interfaces_mlppp_edit/interfaces_mlppp_edit.js index 1c60191..a63bde0 100644 --- a/usr/local/www/javascript/interfaces_mlppp_edit/interfaces_mlppp_edit.js +++ b/usr/local/www/javascript/interfaces_mlppp_edit/interfaces_mlppp_edit.js @@ -6,10 +6,14 @@ function update_select_list(new_options, select_list){ var option = option_array[j].split(","); var selected = Boolean(parseInt(option[2])); select_list.options[j] = new Option(option[0], option[1], false, selected); - //this line for testing and debugging + var linklabel = "linklabel" + j.toString(); + var label_text = $(linklabel).innerHTML; + $(linklabel).innerHTML = label_text + " (" + option[1] + ")"; + //for testing and debugging //select_list.options[option_array.length-1+j] = new Option(option[2].toString() +" "+ selected.toString()); + //select_list.options[option_array.length-1+j] = new Option("Link Label: " + linklabel + " Label Text:" + label_text); } - create_change_fields("","link_fields"); + show_hide_linkfields(); } function clear_selected(list_name){ @@ -17,33 +21,18 @@ function clear_selected(list_name){ for(var j=0; j < select_list.options.length; j++){ select_list.options[j].selected = 0; } - - create_change_fields(); - } -function create_change_fields(port, fields_template){ - - // First check if "port" has an associated row already created. If so, hide it. +function show_hide_linkfields(){ var select_list = document.iform["interfaces[]"].options; - var row_id = port + "_params"; - var row = $(fields_template).innerHTML; - var rows_count = $('interfacetable').rows.length; - if (port == null) - for(var j=0; j < select_list.length-1; j++){ - var row_id = select_list[j].value + "_params"; - $('interfacetable').insertRow(rows_count -1); - $('interfacetable').rows[rows_count -1].id = row_id; - $(row_id).innerHTML = row; + for(var j=0; j < select_list.length; j++){ + var linklabel = "link" + j.toString(); if (select_list[j].selected){ - $(other_row).show(); - } else { - $(row_id).hide(); + $(linklabel).show(); + continue; } - name = $('interfacetable').rows[rows_count -1].cells[0].innerHTML; - $('interfacetable').rows[rows_count -1].cells[0].innerHTML = name + " (" + port + ")" + " " + row_id; + $(linklabel).hide(); } - } } @@ -83,8 +72,8 @@ function updateType(t){ $(t).show(); } -function show_more_settings(obj,element_id) { - if (obj.checked) +function show_more_settings(checkbox_obj,element_id) { + if (checkbox_obj.checked) $(element_id).show(); else $(element_id).hide(); |