diff options
author | whizkidzz <github@digitsolutions.nl> | 2012-04-06 16:01:17 +0200 |
---|---|---|
committer | whizkidzz <github@digitsolutions.nl> | 2012-04-06 16:01:17 +0200 |
commit | de69fab34c3aa4bfab61e47cfefac45fd1583f04 (patch) | |
tree | 0313f5b1f615f8b60a550ea0be2d5ea57e29eaa6 /usr | |
parent | 74fa57aacf90d175936c0a71b0aab0a7c71b8db1 (diff) | |
download | pfsense-de69fab34c3aa4bfab61e47cfefac45fd1583f04.zip pfsense-de69fab34c3aa4bfab61e47cfefac45fd1583f04.tar.gz |
Added interface_selection for use in tinydns
Corrected the use of objectsize so that if its "undefined" the correct "rowsize[]" is used
which if used outside the for loop was also "undefined"
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/javascript/row_helper_dynamic.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr/local/www/javascript/row_helper_dynamic.js b/usr/local/www/javascript/row_helper_dynamic.js index e5e5c6f..d3f2681 100755 --- a/usr/local/www/javascript/row_helper_dynamic.js +++ b/usr/local/www/javascript/row_helper_dynamic.js @@ -25,17 +25,18 @@ var temp_streaming_text = ""; var addRowTo = (function() { return (function (tableId, objectSize) { var $ = jQuery; - var d, tbody, tr, td, bgc, i, ii, j, className; + var d, tbody, tr, td, bgc, i, ii, j, size, className; d = document; tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0); tr = d.createElement("tr"); totalrows++; - if (!objectSize) - objectSize = rowsize[i]; + size = objectSize; for (i = 0; i < field_counter_js; i++) { + if (!objectSize) + size = rowsize[i]; td = d.createElement("td"); if(typeof(rowtype[i]) == 'function') { - td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input>" + rowtype[i](rowname[i], objectSize, totalrows) + " "; + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input>" + rowtype[i](rowname[i], size, totalrows) + " "; } else if(rowtype[i] == 'textbox') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " size='" + rowsize[i] + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'textbox,ipv4v6') { @@ -44,12 +45,14 @@ var addRowTo = (function() { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select " + rowhelper_onChange + " name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; } else if(rowtype[i] == 'select,ipv4v6') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select " + rowhelper_onChange + " name='" + rowname[i] + totalrows + "' class='ipv4v6' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; + } else if(rowtype[i] == 'interfaces_selection') { + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select " + rowhelper_onChange + " name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; } else if(rowtype[i] == 'select_source') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select " + rowhelper_onChange + " name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; } else if(rowtype[i] == 'checkbox') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " type='checkbox'name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'input') { - td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " class='formfld unknown' size='" + objectSize + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " class='formfld unknown' size='" + size + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'password') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " class='formfld pwd' type='password' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } |