jebin2 commited on
Commit
5289cc5
Β·
1 Parent(s): 8c3ad14
comic_panel_extractor/static/annotator.html CHANGED
@@ -250,6 +250,7 @@
250
  width: 100%;
251
  margin-top: 10px;
252
  }
 
253
  /* Navigation Controls */
254
  .image-nav {
255
  display: flex;
@@ -563,10 +564,12 @@
563
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
564
  padding: 30px;
565
  }
 
566
  #outputModal .modal-content {
567
  height: 85vh;
568
  background: black;
569
- overflow: hidden; /* Xterm handles its own scrollbar */
 
570
  padding: 15px;
571
  box-sizing: border-box;
572
  }
@@ -645,19 +648,19 @@
645
  <div class="section-title" style="display: none;">Image Selection</div>
646
 
647
  <!-- <div class="image-nav"> -->
648
- <!-- <button class="btn btn-ghost btn-sm" id="prevBtn" disabled>
649
  ← Prev
650
  </button> -->
651
- <!-- <div class="nav-counter" id="currentImageDisplay">
652
  No image
653
  </div> -->
654
 
655
- <!-- <div class="form-field">
656
  <select class="form-select" id="imageSelect">
657
  <option value="">Choose an image...</option>
658
  </select>
659
  </div> -->
660
- <!-- <button class="btn btn-ghost btn-sm" id="nextBtn" disabled>
661
  Next β†’
662
  </button> -->
663
  <!-- </div> -->
@@ -892,7 +895,7 @@
892
  socket.onmessage = function (event) {
893
  if (!term) return;
894
  const data = JSON.parse(event.data);
895
- term.write(data.data+"\n");
896
  };
897
 
898
  class ComicAnnotator {
@@ -1030,7 +1033,7 @@
1030
  try {
1031
  this.openXterm();
1032
  const response = await fetch('/api/annotate/train?recreate_dataset=true');
1033
-
1034
  if (!response.ok) {
1035
  throw new Error(`Server error: ${response.status}`);
1036
  }
@@ -1062,16 +1065,16 @@
1062
  document.getElementById('closeModal').addEventListener('click', async (e) => {
1063
  this.closeTrainModal()
1064
  });
1065
-
1066
  // NEW: Add resize listener to refit terminal on window resize
1067
  window.addEventListener('resize', () => {
1068
- if (document.getElementById('outputModal').style.display === 'block' && fitAddon) {
1069
- try {
1070
- fitAddon.fit();
1071
- } catch (e) {
1072
- console.error("Error fitting terminal on resize:", e);
 
1073
  }
1074
- }
1075
  });
1076
  }
1077
 
@@ -1740,17 +1743,17 @@
1740
  indicator = document.createElement('div');
1741
  indicator.id = 'modeIndicator';
1742
  indicator.style.cssText = `
1743
- position: fixed;
1744
- top: 120px;
1745
- right: 20px;
1746
- z-index: 1001;
1747
- padding: 8px 16px;
1748
- border-radius: 6px;
1749
- font-size: 13px;
1750
- font-weight: 500;
1751
- pointer-events: none;
1752
- transition: opacity 0.3s ease;
1753
- `;
1754
  document.body.appendChild(indicator);
1755
  }
1756
 
@@ -2329,7 +2332,7 @@
2329
  // Other key handlers
2330
  switch (e.key) {
2331
  case 'Delete':
2332
- // case 'Backspace':
2333
  e.preventDefault();
2334
  this.deleteSelectedBox();
2335
  break;
 
250
  width: 100%;
251
  margin-top: 10px;
252
  }
253
+
254
  /* Navigation Controls */
255
  .image-nav {
256
  display: flex;
 
564
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
565
  padding: 30px;
566
  }
567
+
568
  #outputModal .modal-content {
569
  height: 85vh;
570
  background: black;
571
+ overflow: hidden;
572
+ /* Xterm handles its own scrollbar */
573
  padding: 15px;
574
  box-sizing: border-box;
575
  }
 
648
  <div class="section-title" style="display: none;">Image Selection</div>
649
 
650
  <!-- <div class="image-nav"> -->
651
+ <!-- <button class="btn btn-ghost btn-sm" id="prevBtn" disabled>
652
  ← Prev
653
  </button> -->
654
+ <!-- <div class="nav-counter" id="currentImageDisplay">
655
  No image
656
  </div> -->
657
 
658
+ <!-- <div class="form-field">
659
  <select class="form-select" id="imageSelect">
660
  <option value="">Choose an image...</option>
661
  </select>
662
  </div> -->
663
+ <!-- <button class="btn btn-ghost btn-sm" id="nextBtn" disabled>
664
  Next β†’
665
  </button> -->
666
  <!-- </div> -->
 
895
  socket.onmessage = function (event) {
896
  if (!term) return;
897
  const data = JSON.parse(event.data);
898
+ term.write(data.data + "\n");
899
  };
900
 
901
  class ComicAnnotator {
 
1033
  try {
1034
  this.openXterm();
1035
  const response = await fetch('/api/annotate/train?recreate_dataset=true');
1036
+
1037
  if (!response.ok) {
1038
  throw new Error(`Server error: ${response.status}`);
1039
  }
 
1065
  document.getElementById('closeModal').addEventListener('click', async (e) => {
1066
  this.closeTrainModal()
1067
  });
1068
+
1069
  // NEW: Add resize listener to refit terminal on window resize
1070
  window.addEventListener('resize', () => {
1071
+ if (document.getElementById('outputModal').style.display === 'block' && fitAddon) {
1072
+ try {
1073
+ fitAddon.fit();
1074
+ } catch (e) {
1075
+ console.error("Error fitting terminal on resize:", e);
1076
+ }
1077
  }
 
1078
  });
1079
  }
1080
 
 
1743
  indicator = document.createElement('div');
1744
  indicator.id = 'modeIndicator';
1745
  indicator.style.cssText = `
1746
+ position: fixed;
1747
+ top: 120px;
1748
+ right: 20px;
1749
+ z-index: 1001;
1750
+ padding: 8px 16px;
1751
+ border-radius: 6px;
1752
+ font-size: 13px;
1753
+ font-weight: 500;
1754
+ pointer-events: none;
1755
+ transition: opacity 0.3s ease;
1756
+ `;
1757
  document.body.appendChild(indicator);
1758
  }
1759
 
 
2332
  // Other key handlers
2333
  switch (e.key) {
2334
  case 'Delete':
2335
+ // case 'Backspace':
2336
  e.preventDefault();
2337
  this.deleteSelectedBox();
2338
  break;