Marthee commited on
Commit
695a867
·
verified ·
1 Parent(s): 1e8058a

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +75 -13
templates/proposed-GUI.html CHANGED
@@ -125,7 +125,12 @@
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>
@@ -151,7 +156,12 @@
151
 
152
  <div id ="relvDocdiv">
153
  <label id="relvDocLabel">Other Relevant Documents</label>
154
- <input type="search" oninput="handleKey(event, this.id)" id="relevantSearchInput">
 
 
 
 
 
155
  <br>
156
  <div id="relvdiv" style="position: relative; max-height: 300px;">
157
  <div id="relvselectid" class="scrollable-container" hidden></div>
@@ -1551,6 +1561,16 @@ function downloadPdf(pdfname,downloadPDFName) {
1551
  .catch(error => console.error('Error fetching PDF:', error));
1552
  }
1553
 
 
 
 
 
 
 
 
 
 
 
1554
  function downloadPDFfromLink(pdfLinksent, downloadPDFName) {
1555
  const encodedURL = encodeURIComponent(pdfLinksent);
1556
  if (document.getElementById('downloadPdfbutton')){
@@ -2950,22 +2970,28 @@ function getData(form) {
2950
 
2951
  dropboxLink=data[6];
2952
  console.log(data[7])
 
 
2953
  // console.log(dropboxLink)
2954
-
2955
-
2956
 
2957
  }
2958
  if (formvalues['selectprojs'].startsWith('2.8') ||formvalues['selectprojs'].startsWith('2.6'))
2959
  { //base64.b64encode(buffer).decode('utf-8') ,pdflink,list1.to_dict(), repeated_labels , not_found]
2960
  // /* data[0]--> img , data[1]-->dataframe (goes to legend lsa ) , data [2] -->pdf dropbox shareable link ,data[3]-> spreadsheetId, data[4],spreadsheeturl */
2961
  // SimilarAreaDictionary=data[1];
2962
- // listofimages=data[0];
2963
  console.log('2.8Daata',data)
2964
  dropboxLink=data[1];
2965
  list1= data[2] // list of pdf markups
2966
  Repeated_Labels2_8=data[3]
2967
  Not_Found2_8=data[4]
2968
- console.log(Repeated_Labels2_8,Not_Found2_8)
 
 
 
 
2969
  }
2970
  if (formvalues['selectprojs'].startsWith('2.2'))
2971
  {
@@ -3000,9 +3026,14 @@ function getData(form) {
3000
  }
3001
 
3002
  // if (!(formvalues['selectprojs'].startsWith('2.8')))
3003
- // {
3004
- ImgSide(data[0],spreadsheetURL,dropboxLink,tomeasureproj)
3005
  if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6')) {
 
 
 
 
 
 
3006
  let messages = [];
3007
  if (Repeated_Labels2_8)
3008
  if (Repeated_Labels2_8.length > 0) {
@@ -3020,17 +3051,20 @@ function getData(form) {
3020
  PopupElement.textContent = messages.join('\n'); // Show both messages if both conditions are met
3021
  ShowPopUp();
3022
  }
 
 
 
3023
  }
3024
 
3025
  // }
3026
 
3027
- // else{
3028
  // console.log(listofimages.length)
3029
- // for(var p=0;p<listofimages.length;p++)
3030
- // {
3031
- // ImgSide(listofimages[p],spreadsheetURLs[p],dropboxLinks[p])
3032
- // }
3033
- // }
3034
  // getlegendstoDirectory()
3035
  //////////////////////////////////////////////////////////////////////////////////////////
3036
  let delrows2 = {
@@ -4735,6 +4769,34 @@ function callrefreshAPI(){
4735
  console.log("Grouped input values:", groupedValues);
4736
  return groupedValues;
4737
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4738
 
4739
  function getAddedTablesDataSimple_modified() {
4740
  const allTablesData = [];
 
125
  <div id ="tomeasurediv">
126
  <div>
127
  <label id="measureLabel">Document To Measure</label>
128
+ <div class="input-containerSearchPaste">
129
  <input type="search" oninput="handleKey(event, this.id)" id="tomeasureSearchInput">
130
+ <i class="fa fa-clipboard clipboard-icon" aria-hidden="true"></i>
131
+ <i class="fa fa-times searchfocusx" aria-hidden="true"></i>
132
+ </div>
133
+ <!-- <input type="search" oninput="handleKey(event, this.id)" id="tomeasureSearchInput"> -->
134
  <!-- <button id="refreshDropboxButtonID"></button> -->
135
  <i hidden class="fa fa-dropbox fa-lg" id="refreshDropboxButtonID">
136
  <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>
 
156
 
157
  <div id ="relvDocdiv">
158
  <label id="relvDocLabel">Other Relevant Documents</label>
159
+ <div class="input-containerSearchPaste">
160
+ <input type="search" oninput="handleKey(event, this.id)" id="relevantSearchInput">
161
+ <i class="fa fa-clipboard clipboard-icon" aria-hidden="true"></i>
162
+ <i class="fa fa-times searchfocusx" aria-hidden="true"></i>
163
+ </div>
164
+ <!-- <input type="search" oninput="handleKey(event, this.id)" id="relevantSearchInput"> -->
165
  <br>
166
  <div id="relvdiv" style="position: relative; max-height: 300px;">
167
  <div id="relvselectid" class="scrollable-container" hidden></div>
 
1561
  .catch(error => console.error('Error fetching PDF:', error));
1562
  }
1563
 
1564
+ function downloadFileXML_BAX(filename, content) {
1565
+ const blob = new Blob([content], { type: "text/plain" });
1566
+ const link = document.createElement("a");
1567
+ link.href = URL.createObjectURL(blob);
1568
+ link.download = filename;
1569
+ document.body.appendChild(link);
1570
+ link.click();
1571
+ document.body.removeChild(link);
1572
+ }
1573
+
1574
  function downloadPDFfromLink(pdfLinksent, downloadPDFName) {
1575
  const encodedURL = encodeURIComponent(pdfLinksent);
1576
  if (document.getElementById('downloadPdfbutton')){
 
2970
 
2971
  dropboxLink=data[6];
2972
  console.log(data[7])
2973
+ BaxFile=data[8];
2974
+ customColsXML=data[9];
2975
  // console.log(dropboxLink)
2976
+ downloadFileXML_BAX('Baxfile.bax',BaxFile)
2977
+ downloadFileXML_BAX('CustomColsfile.xml',customColsXML)
2978
 
2979
  }
2980
  if (formvalues['selectprojs'].startsWith('2.8') ||formvalues['selectprojs'].startsWith('2.6'))
2981
  { //base64.b64encode(buffer).decode('utf-8') ,pdflink,list1.to_dict(), repeated_labels , not_found]
2982
  // /* data[0]--> img , data[1]-->dataframe (goes to legend lsa ) , data [2] -->pdf dropbox shareable link ,data[3]-> spreadsheetId, data[4],spreadsheeturl */
2983
  // SimilarAreaDictionary=data[1];
2984
+ listofimages=data[0];
2985
  console.log('2.8Daata',data)
2986
  dropboxLink=data[1];
2987
  list1= data[2] // list of pdf markups
2988
  Repeated_Labels2_8=data[3]
2989
  Not_Found2_8=data[4]
2990
+ BaxFile= data[5]
2991
+ customColsXML=data[6]
2992
+ console.log(Repeated_Labels2_8,Not_Found2_8)
2993
+ downloadFileXML_BAX('Baxfile.bax',BaxFile)
2994
+ downloadFileXML_BAX('CustomColsfile.xml',customColsXML)
2995
  }
2996
  if (formvalues['selectprojs'].startsWith('2.2'))
2997
  {
 
3026
  }
3027
 
3028
  // if (!(formvalues['selectprojs'].startsWith('2.8')))
3029
+
 
3030
  if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6')) {
3031
+
3032
+ for(var p=0;p<listofimages.length;p++)
3033
+ {
3034
+ ImgSide(listofimages[p],spreadsheetURLs[p],dropboxLinks[p],tomeasureproj)
3035
+ }
3036
+
3037
  let messages = [];
3038
  if (Repeated_Labels2_8)
3039
  if (Repeated_Labels2_8.length > 0) {
 
3051
  PopupElement.textContent = messages.join('\n'); // Show both messages if both conditions are met
3052
  ShowPopUp();
3053
  }
3054
+ // downloadFileXML_BAX('Baxfile.bax',BaxFile)
3055
+ // downloadFileXML_BAX('CustomColsfile.xml',customColsXML)
3056
+
3057
  }
3058
 
3059
  // }
3060
 
3061
+ else{
3062
  // console.log(listofimages.length)
3063
+ for(var p=0;p<listofimages.length;p++)
3064
+ {
3065
+ ImgSide(data[0],spreadsheetURL,dropboxLink,tomeasureproj)
3066
+ }
3067
+ }
3068
  // getlegendstoDirectory()
3069
  //////////////////////////////////////////////////////////////////////////////////////////
3070
  let delrows2 = {
 
4769
  console.log("Grouped input values:", groupedValues);
4770
  return groupedValues;
4771
  }
4772
+ // Clipboard paste with focus preservation
4773
+ document.querySelectorAll('.clipboard-icon').forEach(icon => {
4774
+ icon.addEventListener('mousedown', e => e.preventDefault()); // Prevent blur
4775
+ icon.addEventListener('click', async () => {
4776
+ try {
4777
+ const input = icon.closest('.input-containerSearchPaste').querySelector('input');
4778
+ const text = await navigator.clipboard.readText();
4779
+ input.value = text;
4780
+ input.focus(); // Keep focus on the correct input
4781
+ handleKey({ target: input }, input.id);
4782
+ } catch (err) {
4783
+ console.error('Clipboard access error:', err);
4784
+ alert('Clipboard access is blocked. Try using Ctrl+V.');
4785
+ }
4786
+ });
4787
+ });
4788
+
4789
+ // Clear input on 'x' click, with focus preserved
4790
+ document.querySelectorAll('.searchfocusx').forEach(x => {
4791
+ x.addEventListener('mousedown', e => e.preventDefault()); // Prevent blur
4792
+ x.addEventListener('click', () => {
4793
+ const input = x.closest('.input-containerSearchPaste').querySelector('input');
4794
+ input.value = '';
4795
+ input.focus(); // Keep focus on the correct input
4796
+ handleKey({ target: input }, input.id);
4797
+ });
4798
+ });
4799
+
4800
 
4801
  function getAddedTablesDataSimple_modified() {
4802
  const allTablesData = [];