Marthee commited on
Commit
bee0ad3
·
verified ·
1 Parent(s): 0a17637

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +11 -6
templates/proposed-GUI.html CHANGED
@@ -4803,13 +4803,15 @@ function callrefreshAPI(){
4803
  return groupedValues;
4804
  }
4805
 
4806
- // Collect all tables from all PDFs as one flat array of arrays
4807
- // Shape: [ [id, type, stop, height, fire, acoustic], ... ]
 
4808
  function getAddedTablesDataSimple_modified() {
4809
- const allRows = [];
4810
 
4811
  const rows = Array.from(document.querySelectorAll('.extraDoorRow'));
4812
  rows.forEach(row => {
 
4813
  const inputs = row.querySelectorAll(
4814
  'input[name="textidname"], ' +
4815
  'input[name="texttypename"], ' +
@@ -4821,12 +4823,15 @@ function getAddedTablesDataSimple_modified() {
4821
 
4822
  if (inputs.length === 6) {
4823
  const values = Array.from(inputs).map(inp => (inp.value || '').trim());
4824
- allRows.push(values);
 
4825
  }
4826
  });
4827
 
4828
- console.log("All table data (flat array):", allRows);
4829
- return allRows;
 
 
4830
  }
4831
 
4832
 
 
4803
  return groupedValues;
4804
  }
4805
 
4806
+
4807
+ // Collect all tables grouped by PDF, but drop the PDF names
4808
+ // Shape: [ [ [id,type,stop,height,fire,acoustic], ... ], ... ]
4809
  function getAddedTablesDataSimple_modified() {
4810
+ const groups = new Map();
4811
 
4812
  const rows = Array.from(document.querySelectorAll('.extraDoorRow'));
4813
  rows.forEach(row => {
4814
+ const pdfName = row.dataset.pdfName || '__no_pdf__';
4815
  const inputs = row.querySelectorAll(
4816
  'input[name="textidname"], ' +
4817
  'input[name="texttypename"], ' +
 
4823
 
4824
  if (inputs.length === 6) {
4825
  const values = Array.from(inputs).map(inp => (inp.value || '').trim());
4826
+ if (!groups.has(pdfName)) groups.set(pdfName, []);
4827
+ groups.get(pdfName).push(values);
4828
  }
4829
  });
4830
 
4831
+ // Return just the arrays of arrays, without the PDF keys
4832
+ const result = Array.from(groups.values());
4833
+ console.log("All table data (grouped, no pdf names):", result);
4834
+ return result;
4835
  }
4836
 
4837