From 2eb7993da4ebb286b413fd50f2720a735bc4bcf8 Mon Sep 17 00:00:00 2001 From: robiscool Date: Wed, 18 Aug 2010 00:44:25 -0700 Subject: snort, fix home image link, add js_rowhelper from 2.0 upstearm --- config/snort/javascript/row_helper.js | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 config/snort/javascript/row_helper.js (limited to 'config/snort/javascript') diff --git a/config/snort/javascript/row_helper.js b/config/snort/javascript/row_helper.js new file mode 100644 index 00000000..d8b4ffb4 --- /dev/null +++ b/config/snort/javascript/row_helper.js @@ -0,0 +1,71 @@ +// Global Variables +var rowname = new Array(4999); +var rowtype = new Array(4999); +var newrow = new Array(4999); +var rowsize = new Array(4999); + +for (i = 0; i < 4999; i++) { + rowname[i] = ''; + rowtype[i] = ''; + newrow[i] = ''; + rowsize[i] = '30'; +} + +var field_counter_js = 0; +var loaded = 0; +var is_streaming_progress_bar = 0; +var temp_streaming_text = ""; + +var addRowTo = (function() { + return (function (tableId) { + var d, tbody, tr, td, bgc, i, ii, j; + d = document; + tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0); + tr = d.createElement("tr"); + for (i = 0; i < field_counter_js; i++) { + td = d.createElement("td"); + if(rowtype[i] == 'textbox') { + td.innerHTML=" "; + } else if(rowtype[i] == 'select') { + td.innerHTML=" "; + } else if(rowtype[i] == 'select_source') { + td.innerHTML=" "; + } else { + td.innerHTML=" "; + } + tr.appendChild(td); + } + td = d.createElement("td"); + td.rowSpan = "1"; + + td.innerHTML = ''; + tr.appendChild(td); + tbody.appendChild(tr); + totalrows++; + }); +})(); + +function removeRow(el) { + var cel; + while (el && el.nodeName.toLowerCase() != "tr") + el = el.parentNode; + + if (el && el.parentNode) { + cel = el.getElementsByTagName("td").item(0); + el.parentNode.removeChild(el); + } +} + +function find_unique_field_name(field_name) { + // loop through field_name and strip off -NUMBER + var last_found_dash = 0; + for (var i = 0; i < field_name.length; i++) { + // is this a dash, if so, update + // last_found_dash + if (field_name.substr(i,1) == "-" ) + last_found_dash = i; + } + if (last_found_dash < 1) + return field_name; + return(field_name.substr(0,last_found_dash)); +} -- cgit v1.2.3