Changeset 35541
- Timestamp:
- 2021-10-01T13:37:21+13:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/TranscriptionItemEditor.vue
r35538 r35541 13 13 <li v-for="(word, index) in words" :key="word.id" class="word-container"> 14 14 <input :size="word.word.length === 0 ? 1 : word.word.length" :ref="word.id" 15 class="editor-word" v-model="word.word" type="text" onpaste="return false;":class="{ 'word-highlight-applied': word.shouldHighlight }"15 class="editor-word" v-model="word.word" type="text" :class="{ 'word-highlight-applied': word.shouldHighlight }" 16 16 @beforeinput="onEditorBeforeInput($event, index)" @focusout="onEditorFocusOut(index)" @focus="onEditorFocus(index)" /> 17 17 <span> </span> … … 299 299 } 300 300 else if (event.data.includes(" ")) { 301 // TODO: Split input 301 let wordsToAdd = event.data.split(" "); 302 wordsToAdd = wordsToAdd.filter(w => w.trim().length > 0).map(w => w.trim()); 303 const sharedTime = (word.endTime - word.startTime) / wordsToAdd.length; 304 305 if (wordsToAdd.length === 0) { 306 return; 307 } 308 309 word.endTime = word.startTime + sharedTime; 310 let newStartTime = word.endTime; 311 312 for (let i = 0; i < wordsToAdd.length; i++) { 313 const newWord = new Word(wordsToAdd[i], newStartTime, newStartTime + sharedTime); 314 newStartTime += sharedTime; 315 316 this.words.splice(index + i + 1, 0, newWord); 317 } 318 319 event.preventDefault(); 302 320 } 303 321 }
Note:
See TracChangeset
for help on using the changeset viewer.