ydshieh HF staff commited on
Commit
b51c028
1 Parent(s): a513724

Update transcript-tracer.js

Browse files
Files changed (1) hide show
  1. transcript-tracer.js +8 -4
transcript-tracer.js CHANGED
@@ -569,21 +569,25 @@ function handleSelection() {
569
  // adjustment
570
  var targetEndIndex = parseInt(wordIndex)+1;
571
  if (!need_adjustment) targetEndIndex = wordIndex;
572
- targetEndIndex = targetEndIndex.toString()
573
 
574
  if (targetEndIndex < ttLinkedDataByMediaUrl[mediaUrl].wordTimings.length) {
575
  endSeconds = ttLinkedDataByMediaUrl[mediaUrl].wordTimings[targetEndIndex].startSeconds;
576
  }
577
 
578
  var endWordIndex = parseInt(wordIndex);
579
- if (need_adjustment) endWordIndex = endWordIndex - 1;
580
- endWordIndex = endWordIndex.toString()
581
  // ? How to get this
582
  // var endWordElement = startWordElement;
583
 
584
  console.log(endSeconds);
585
 
586
-
 
 
 
 
587
  // Mark selection
588
  // if (ttCurrentEvent.currentWordIndexes.length > 0) {
589
  // for (const wordIndex of ttCurrentEvent.currentWordIndexes) {
 
569
  // adjustment
570
  var targetEndIndex = parseInt(wordIndex)+1;
571
  if (!need_adjustment) targetEndIndex = wordIndex;
572
+ targetEndIndex = targetEndIndex.toString();
573
 
574
  if (targetEndIndex < ttLinkedDataByMediaUrl[mediaUrl].wordTimings.length) {
575
  endSeconds = ttLinkedDataByMediaUrl[mediaUrl].wordTimings[targetEndIndex].startSeconds;
576
  }
577
 
578
  var endWordIndex = parseInt(wordIndex);
579
+ if (!need_adjustment) endWordIndex = endWordIndex - 1;
580
+ endWordIndex = endWordIndex.toString();
581
  // ? How to get this
582
  // var endWordElement = startWordElement;
583
 
584
  console.log(endSeconds);
585
 
586
+ console.log(startWordElement);
587
+ console.log(startWordIndex);
588
+ console.log(endWordIndex);
589
+ console.log(temp);
590
+
591
  // Mark selection
592
  // if (ttCurrentEvent.currentWordIndexes.length > 0) {
593
  // for (const wordIndex of ttCurrentEvent.currentWordIndexes) {