diff options
Diffstat (limited to 'wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js')
-rw-r--r-- | wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js index c288f11f..e9a141a3 100644 --- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js +++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js @@ -1,6 +1,7 @@ // Generated by CoffeeScript 1.3.3 (function() { - var isNumber; + var isNumber, + __slice = [].slice; console.log("start_b"); @@ -73,8 +74,9 @@ _ref = basic_table['columns']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { column = _ref[_i]; - the_id = process_id("column_" + column); - header += "<th id=\"" + the_id + "\">" + column + "</th>"; + console.log("column:", column); + the_id = process_id("column", column.t); + header += "<th id=\"" + the_id + "\">" + column.n + "</th>"; } header += "</thead>"; rows = [ @@ -104,7 +106,7 @@ for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { column = _ref1[_k]; console.log("apple:", column); - the_id = process_id(column + "_" + row.vn); + the_id = process_id(column.t, row.vn); console.log("the_id:", the_id); row_line += "<td id=\"" + the_id + "\"> </td>"; } @@ -117,12 +119,23 @@ console.log("table is:", table); return $("#stats_table").append(table); }; - process_id = function(value) { + process_id = function() { + var processed, value, values, _i, _len; + values = 1 <= arguments.length ? __slice.call(arguments, 0) : []; /* Make an id or a class valid javascript by, for example, eliminating spaces */ - console.log("value:", value); - value = value.replace(" ", "_"); - return value; + + processed = ""; + for (_i = 0, _len = values.length; _i < _len; _i++) { + value = values[_i]; + console.log("value:", value); + value = value.replace(" ", "_"); + if (processed.length) { + processed += ":"; + } + processed += value; + } + return processed; }; $('#primary').change(edit_data_change); console.log("loaded"); |