Marthee commited on
Commit
59d50ac
·
verified ·
1 Parent(s): 51bc830

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +49 -83
templates/proposed-GUI.html CHANGED
@@ -125,7 +125,7 @@
125
  <div id ="tomeasurediv">
126
  <div>
127
  <label id="measureLabel">Document To Measure</label>
128
- <input type="search" oninput="handleKey(event, this.id)" id="tomeasureSearchInput">
129
  <!-- <button id="refreshDropboxButtonID"></button> -->
130
  <i hidden class="fa fa-dropbox fa-lg" id="refreshDropboxButtonID">
131
  <span class="dropboxtip">The console updates projects retrieved from Dropbox automatically at 9:00 am and 9:00 p.m. If you need to access any projects in between, just click on this button. Please note that it will refresh the files related to the project you chose only.</span> </i>
@@ -706,17 +706,7 @@
706
  <div id="Thickness2.7" hidden="until-found">
707
  <label id="modalColumn">Maximum Thickness of Walls</label>
708
  <br>
709
- <!-- <input type="number" id="text002extra" name="text003name" placeholder="Eg: 3" min="0"> -->
710
- <input
711
- type="number"
712
- id="text002extra"
713
- name="text003name"
714
- placeholder="Eg: 3"
715
- min="0"
716
- required
717
- oninvalid="this.setCustomValidity('Please enter the maximum wall thickness.')"
718
- oninput="this.setCustomValidity('')"
719
- >
720
  </div>
721
 
722
  <div id="duplicaterExtra" hidden="until-found">
@@ -1873,7 +1863,6 @@ function getSelectValues(select) {
1873
  //Retrieves list of projects
1874
  var doorSchedulePDF;
1875
  let selectedValues = []; // global
1876
-
1877
  function getproj(){
1878
  getALLMCTNAMES();
1879
 
@@ -1963,12 +1952,13 @@ let selectedValues = []; // global
1963
  relvSelect.removeChild(relvSelect.firstChild);
1964
  }
1965
  }
1966
- // const nameSet = new Set(); // To track unique names
1967
  const nameSetRelv = new Set(); // To track unique names
1968
 
1969
  // Action foconst nameSet = new Set(); // To track unique names
1970
 
1971
  // Action for when the checkbox is clicked
 
1972
  function handleCheckboxChange(event) {
1973
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
1974
  // Uncheck all checkboxes before checking the current one
@@ -1978,15 +1968,19 @@ let selectedValues = []; // global
1978
  }
1979
  });
1980
  }
 
1981
  // Check the current checkbox
1982
  const selectedCheckboxes = Array.from(document.querySelectorAll('input[name="measureCheckbox"]:checked'));
1983
  selectedValues = selectedCheckboxes.map(cb => cb.value);
1984
  measSelect.value = selectedValues.join(', ');
 
1985
 
1986
  console.log("Selected projects:", selectedValues);
1987
 
1988
  // Save the latest selected checkbox PDF name (if only one selected)
1989
  pdfname = selectedValues.length === 1 ? selectedValues[0] : selectedValues.join(', ');
 
 
1990
  // Highlight the selected item
1991
  document.querySelectorAll(".measure-item").forEach(item => {
1992
  const checkbox = item.querySelector('input[name="measureCheckbox"]');
@@ -1994,6 +1988,10 @@ let selectedValues = []; // global
1994
  });
1995
  console.log("Selected projects:", selectedValues);
1996
 
 
 
 
 
1997
  // Show alert immediately to prompt the user
1998
  if (projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.7')) {
1999
  // downloadPdf(selectedValue);
@@ -2006,7 +2004,7 @@ let selectedValues = []; // global
2006
  canvasimg='';
2007
  ry=[[]];
2008
  levelcheckbox.checked=false;
2009
- pdfname=selectedValue;
2010
  measSelect.style.boxShadow='none';
2011
 
2012
  console.log(projsec.value)
@@ -2261,14 +2259,14 @@ let selectedValues = []; // global
2261
  measSelect.appendChild(div);
2262
 
2263
  // Handle duplicates
2264
- // if (nameSet.has(name)) {
2265
- // label.style.color = "red";
2266
- // document.getElementById("TopTextModal").textContent = 'Error: Duplicates Error';
2267
- // PopupElement.textContent = 'Duplicate project names were detected while retrieving the project PDFs. Please visit Dropbox and rename the relevant files that you will be working on to ensure each project has a unique name. Once the renaming is complete, return to the console and click on the Dropbox icon to retrieve the updated project names.';
2268
- // ShowPopUp();
2269
- // } else {
2270
- // nameSet.add(name);
2271
- // }
2272
  }
2273
 
2274
 
@@ -2336,11 +2334,11 @@ let selectedValues = []; // global
2336
 
2337
  relvSelect.appendChild(divRelv);
2338
 
2339
- // if (nameSetRelv.has(name)) {
2340
- // label.style.color = "red";
2341
- // } else {
2342
- // nameSetRelv.add(name);
2343
- // }
2344
  }
2345
 
2346
 
@@ -2647,7 +2645,6 @@ function startDropdownUpdates() {
2647
 
2648
 
2649
  function getData(form) {
2650
-
2651
  document.getElementById("loading").hidden = false;
2652
 
2653
  document.getElementById('measureADRbutton').setAttribute('disabled',true);
@@ -2669,8 +2666,10 @@ function getData(form) {
2669
  formvalues=Object.fromEntries(formData);
2670
 
2671
  console.log(formData,formvalues)
 
2672
  // iterate through entries...
2673
  tomeasureproj=formvalues['measureCheckbox']; //proj name
 
2674
 
2675
 
2676
  if( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ){
@@ -2731,8 +2730,14 @@ function getData(form) {
2731
  }
2732
  else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
2733
  {
 
2734
  answers.push(selectedValues, 0,[] , 0,0,pdfpath , doorSchedulePDF,groupedValues);
2735
- formData.append('answers',JSON.stringify(answers))
 
 
 
 
 
2736
  }
2737
  }
2738
 
@@ -4169,68 +4174,29 @@ dialog_container.style.display = "block";
4169
  };
4170
 
4171
 
4172
- function handleKey(event, id) {
4173
- const ignoredKeys = [
4174
- 'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',
4175
- 'Shift', 'Control', 'Alt', 'Meta', 'Escape', 'Tab'
4176
- ];
4177
-
4178
- if (!ignoredKeys.includes(event.key)) {
4179
- filterFunction(id);
4180
- }
4181
- }
4182
-
4183
  function filterFunction(id) {
4184
- const nameCount = {}; // Track name frequency
4185
- let flagnameset = false;
4186
-
4187
- const input = document.getElementById(id);
4188
- const filter = input.value.toUpperCase();
4189
-
4190
- let items;
4191
  if (id.toString().startsWith('tomeasure'))
4192
- items = document.querySelectorAll("#measureContainer .measure-item");
4193
- else
4194
- items = document.querySelectorAll("#relvselectid .relv-item");
4195
 
4196
- // First pass: count names
4197
- items.forEach(item => {
4198
- const txtValue = item.textContent || item.innerText;
4199
- const name = item.children[1].textContent;
4200
-
4201
- if (txtValue.toUpperCase().includes(filter)) {
4202
- nameCount[name] = (nameCount[name] || 0) + 1;
4203
- item.style.display = "";
 
4204
  } else {
4205
- item.style.display = "none";
4206
  }
4207
- });
4208
-
4209
- // Second pass: apply coloring
4210
- items.forEach(item => {
4211
- const txtValue = item.textContent || item.innerText;
4212
- const name = item.children[1].textContent;
4213
-
4214
- if (txtValue.toUpperCase().includes(filter)) {
4215
- if (nameCount[name] > 1) {
4216
- item.style.color = "red";
4217
- flagnameset = true;
4218
- } else {
4219
- item.style.color = ""; // Reset color for unique names
4220
- }
4221
- }
4222
- });
4223
-
4224
- if (flagnameset) {
4225
- document.getElementById("TopTextModal").textContent = 'Error: Duplicates Error';
4226
- PopupElement.textContent = 'Duplicate project names were detected while retrieving the project PDFs. Please visit Dropbox and rename the relevant files that you will be working on to ensure each project has a unique name. Once the renaming is complete, return to the console and click on the Dropbox icon to retrieve the updated project names.';
4227
- ShowPopUp();
4228
  }
4229
  }
4230
 
4231
 
4232
-
4233
-
4234
  // Call function when show dialog btn is clicked
4235
  var duplicaterExtra = document.getElementById("duplicaterExtra");
4236
  var overlaymeText = document.getElementById("modal-bodyTextp");
 
125
  <div id ="tomeasurediv">
126
  <div>
127
  <label id="measureLabel">Document To Measure</label>
128
+ <input type="search" onkeyup=filterFunction(this.id) id="tomeasureSearchInput">
129
  <!-- <button id="refreshDropboxButtonID"></button> -->
130
  <i hidden class="fa fa-dropbox fa-lg" id="refreshDropboxButtonID">
131
  <span class="dropboxtip">The console updates projects retrieved from Dropbox automatically at 9:00 am and 9:00 p.m. If you need to access any projects in between, just click on this button. Please note that it will refresh the files related to the project you chose only.</span> </i>
 
706
  <div id="Thickness2.7" hidden="until-found">
707
  <label id="modalColumn">Maximum Thickness of Walls</label>
708
  <br>
709
+ <input type="number" id="text002extra" name="text003name" placeholder="Eg: 3" min="0">
 
 
 
 
 
 
 
 
 
 
710
  </div>
711
 
712
  <div id="duplicaterExtra" hidden="until-found">
 
1863
  //Retrieves list of projects
1864
  var doorSchedulePDF;
1865
  let selectedValues = []; // global
 
1866
  function getproj(){
1867
  getALLMCTNAMES();
1868
 
 
1952
  relvSelect.removeChild(relvSelect.firstChild);
1953
  }
1954
  }
1955
+ const nameSet = new Set(); // To track unique names
1956
  const nameSetRelv = new Set(); // To track unique names
1957
 
1958
  // Action foconst nameSet = new Set(); // To track unique names
1959
 
1960
  // Action for when the checkbox is clicked
1961
+
1962
  function handleCheckboxChange(event) {
1963
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
1964
  // Uncheck all checkboxes before checking the current one
 
1968
  }
1969
  });
1970
  }
1971
+
1972
  // Check the current checkbox
1973
  const selectedCheckboxes = Array.from(document.querySelectorAll('input[name="measureCheckbox"]:checked'));
1974
  selectedValues = selectedCheckboxes.map(cb => cb.value);
1975
  measSelect.value = selectedValues.join(', ');
1976
+
1977
 
1978
  console.log("Selected projects:", selectedValues);
1979
 
1980
  // Save the latest selected checkbox PDF name (if only one selected)
1981
  pdfname = selectedValues.length === 1 ? selectedValues[0] : selectedValues.join(', ');
1982
+
1983
+
1984
  // Highlight the selected item
1985
  document.querySelectorAll(".measure-item").forEach(item => {
1986
  const checkbox = item.querySelector('input[name="measureCheckbox"]');
 
1988
  });
1989
  console.log("Selected projects:", selectedValues);
1990
 
1991
+
1992
+
1993
+
1994
+
1995
  // Show alert immediately to prompt the user
1996
  if (projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.7')) {
1997
  // downloadPdf(selectedValue);
 
2004
  canvasimg='';
2005
  ry=[[]];
2006
  levelcheckbox.checked=false;
2007
+
2008
  measSelect.style.boxShadow='none';
2009
 
2010
  console.log(projsec.value)
 
2259
  measSelect.appendChild(div);
2260
 
2261
  // Handle duplicates
2262
+ if (nameSet.has(name)) {
2263
+ label.style.color = "red";
2264
+ document.getElementById("TopTextModal").textContent = 'Error: Duplicates Error';
2265
+ PopupElement.textContent = 'Duplicate project names were detected while retrieving the project PDFs. Please visit Dropbox and rename the relevant files that you will be working on to ensure each project has a unique name. Once the renaming is complete, return to the console and click on the Dropbox icon to retrieve the updated project names.';
2266
+ ShowPopUp();
2267
+ } else {
2268
+ nameSet.add(name);
2269
+ }
2270
  }
2271
 
2272
 
 
2334
 
2335
  relvSelect.appendChild(divRelv);
2336
 
2337
+ if (nameSetRelv.has(name)) {
2338
+ label.style.color = "red";
2339
+ } else {
2340
+ nameSetRelv.add(name);
2341
+ }
2342
  }
2343
 
2344
 
 
2645
 
2646
 
2647
  function getData(form) {
 
2648
  document.getElementById("loading").hidden = false;
2649
 
2650
  document.getElementById('measureADRbutton').setAttribute('disabled',true);
 
2666
  formvalues=Object.fromEntries(formData);
2667
 
2668
  console.log(formData,formvalues)
2669
+
2670
  // iterate through entries...
2671
  tomeasureproj=formvalues['measureCheckbox']; //proj name
2672
+ //console.log('el data el fe form values:::',tomeasureproj)
2673
 
2674
 
2675
  if( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ){
 
2730
  }
2731
  else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
2732
  {
2733
+ console.log('el data el 7ayt3amalaha push:::',selectedValues)
2734
  answers.push(selectedValues, 0,[] , 0,0,pdfpath , doorSchedulePDF,groupedValues);
2735
+ formData.append('answers',JSON.stringify(answers))
2736
+ console.log('el data el fe answers:::',answers)
2737
+ for (let pair of formData.entries()) {
2738
+ console.log(`${pair[0]}: ${pair[1]}`);
2739
+ }
2740
+
2741
  }
2742
  }
2743
 
 
4174
  };
4175
 
4176
 
 
 
 
 
 
 
 
 
 
 
 
4177
  function filterFunction(id) {
4178
+ var input, filter, ul, li, a, i;
4179
+ input = document.getElementById(id);
4180
+ filter = input.value.toUpperCase();
 
 
 
 
4181
  if (id.toString().startsWith('tomeasure'))
4182
+ a = document.querySelectorAll("#measureContainer .measure-item");
 
 
4183
 
4184
+ // a = document.getElementById("measureselectid").children;
4185
+ else
4186
+ // a = document.getElementById("relvselectid").children;
4187
+ a = document.querySelectorAll("#relvselectid .relv-item");
4188
+ // a = div.getElementsByTagName("option");
4189
+ for (i = 0; i < a.length; i++) {
4190
+ txtValue = a[i].textContent || a[i].innerText;
4191
+ if (txtValue.toUpperCase().indexOf(filter) > -1) {
4192
+ a[i].style.display = "";
4193
  } else {
4194
+ a[i].style.display = "none";
4195
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4196
  }
4197
  }
4198
 
4199
 
 
 
4200
  // Call function when show dialog btn is clicked
4201
  var duplicaterExtra = document.getElementById("duplicaterExtra");
4202
  var overlaymeText = document.getElementById("modal-bodyTextp");