Revize ba94b8c1
Přidáno uživatelem Lukáš Vlček před téměř 3 roky(ů)
webapp/contexts/AnnotationContext.tsx | ||
---|---|---|
232 | 232 |
type, |
233 | 233 |
position: selectionInfo.startPositionOriginalDocument, |
234 | 234 |
length: selectionInfo.selectionLengthOriginalDocument, |
235 |
selectedText: selectionInfo.selectedText, |
|
235 | 236 |
}) |
236 | 237 |
.catch((e) => |
237 | 238 |
ShowToast('Tato část textu je již touto značkou anotována', 'warning') |
webapp/utils/selectionUtils.ts | ||
---|---|---|
6 | 6 |
startPositionOriginalDocument: number; |
7 | 7 |
endPositionOriginalDocument: number; |
8 | 8 |
selectionLengthOriginalDocument: number; |
9 |
|
|
10 |
selectedText: string; |
|
9 | 11 |
} |
10 | 12 |
const idAttributeName = 'aswi-tag-id'; |
11 | 13 |
|
... | ... | |
87 | 89 |
} |
88 | 90 |
|
89 | 91 |
const length = endPosition - startPosition + 1; |
92 |
const text = selection.toString(); |
|
90 | 93 |
|
91 | 94 |
return { |
92 | 95 |
endElementId: endId, |
... | ... | |
94 | 97 |
startPositionOriginalDocument: startPosition, |
95 | 98 |
endPositionOriginalDocument: endPosition, |
96 | 99 |
selectionLengthOriginalDocument: length, |
100 |
selectedText: text, |
|
97 | 101 |
}; |
98 | 102 |
} |
Také k dispozici: Unified diff
Selection - selected text