Marthee commited on
Commit
422ab2a
·
verified ·
1 Parent(s): 5ca6b92

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +11 -27
templates/proposed-GUI.html CHANGED
@@ -1960,16 +1960,15 @@ let selectedValues = []; // global
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
- // if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
1965
  // Uncheck all checkboxes before checking the current one
1966
  document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1967
  if (checkbox !== event.target) {
1968
  checkbox.checked = false;
1969
  }
1970
  });
1971
-
1972
- // }
1973
  // Check the current checkbox
1974
  const selectedCheckboxes = Array.from(document.querySelectorAll('input[name="measureCheckbox"]:checked'));
1975
  selectedValues = selectedCheckboxes.map(cb => cb.value);
@@ -1988,44 +1987,29 @@ let selectedValues = []; // global
1988
  item.style.backgroundColor = checkbox.checked ? '#d3f8d3' : '';
1989
  });
1990
  console.log("Selected projects:", selectedValues);
1991
- }
1992
- ////////////////////////////////////////
1993
- else{
1994
- document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1995
- checkbox.checked = false;
1996
- });
1997
 
1998
- // Check the current checkbox
1999
- event.target.checked = true;
2000
 
2001
- // Action when checkbox is clicked (e.g., log the selected project)
2002
- let selectedValue = event.target.value;
2003
- measSelect.value=selectedValue;
2004
- console.log("Selected project:", selectedValue);
2005
 
2006
- // Highlight the selected item
2007
- document.querySelectorAll(".measure-item").forEach(item => {
2008
- item.style.backgroundColor = ''; // Reset background color for all items
2009
- });
2010
- event.target.closest(".measure-item").style.backgroundColor = '#d3f8d3'; // Highlight the selected item
2011
- pdfname = selectedValue;
2012
 
2013
- if (projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.7')) {
 
2014
  // downloadPdf(selectedValue);
2015
  downloadPdf(selectedValue,'DXF_File_:'+selectedValue)
2016
  // window.alert("Measure the purple shape drawn on the PDF using Foxit Reader, Bluebeam, or any other external tool, then enter its area and perimeter in your desired scale.");
2017
  }
2018
- }
2019
- /////////////////////////////////////////////
 
2020
  canvasimg='';
2021
  ry=[[]];
2022
  levelcheckbox.checked=false;
2023
 
2024
  measSelect.style.boxShadow='none';
2025
-
2026
  console.log(projsec.value)
2027
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
2028
-
2029
  document.getElementById("all").style.display = "block";
2030
 
2031
  pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
 
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
1965
  document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1966
  if (checkbox !== event.target) {
1967
  checkbox.checked = false;
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);
 
1987
  item.style.backgroundColor = checkbox.checked ? '#d3f8d3' : '';
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);
1998
  downloadPdf(selectedValue,'DXF_File_:'+selectedValue)
1999
  // window.alert("Measure the purple shape drawn on the PDF using Foxit Reader, Bluebeam, or any other external tool, then enter its area and perimeter in your desired scale.");
2000
  }
2001
+ // else{
2002
+ // window.alert("Measure the purple shape drawn on the PDF using Foxit Reader, Bluebeam, or any other external tool, then enter its area and perimeter in your desired scale.");
2003
+ // }
2004
  canvasimg='';
2005
  ry=[[]];
2006
  levelcheckbox.checked=false;
2007
 
2008
  measSelect.style.boxShadow='none';
2009
+
2010
  console.log(projsec.value)
2011
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
2012
+ pdfname = selectedValue;
2013
  document.getElementById("all").style.display = "block";
2014
 
2015
  pixelArr=[projname.value, projpart.value,projsec.value, pdfname]