Marthee commited on
Commit
96f579c
·
verified ·
1 Parent(s): b0d44a3

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +32 -1
templates/proposed-GUI.html CHANGED
@@ -125,8 +125,11 @@
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>
132
 
@@ -4536,7 +4539,35 @@ function getpopuptext() {
4536
  console.log("Grouped input values:", groupedValues);
4537
  return groupedValues;
4538
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4539
 
 
 
 
 
 
 
4540
 
4541
  </script>
4542
 
 
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
  <i hidden class="fa fa-dropbox fa-lg" id="refreshDropboxButtonID">
134
  <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>
135
 
 
4539
  console.log("Grouped input values:", groupedValues);
4540
  return groupedValues;
4541
  }
4542
+ // Clipboard paste with focus preservation
4543
+ document.querySelector('.clipboard-icon').addEventListener('mousedown', (e) => {
4544
+ e.preventDefault(); // Prevent input blur
4545
+ });
4546
+
4547
+ document.querySelector('.clipboard-icon').addEventListener('click', async () => {
4548
+ try {
4549
+ const text = await navigator.clipboard.readText();
4550
+ const input = document.getElementById('tomeasureSearchInput');
4551
+ input.value = text;
4552
+ input.focus(); // Re-focus after clipboard read
4553
+ handleKey({ target: input }, 'tomeasureSearchInput');
4554
+ } catch (err) {
4555
+ console.error('Clipboard access error:', err);
4556
+ alert('Clipboard access is blocked. Try using Ctrl+V.');
4557
+ }
4558
+ });
4559
+
4560
+ // Clear input on 'x' click, with focus preserved
4561
+ document.querySelector('.searchfocusx').addEventListener('mousedown', (e) => {
4562
+ e.preventDefault(); // Prevent input blur
4563
+ });
4564
 
4565
+ document.querySelector('.searchfocusx').addEventListener('click', () => {
4566
+ const input = document.getElementById('tomeasureSearchInput');
4567
+ input.value = '';
4568
+ input.focus(); // Keep input focused
4569
+ handleKey({ target: input }, 'tomeasureSearchInput');
4570
+ });
4571
 
4572
  </script>
4573