Skip to content

Commit

Permalink
Merge pull request #1141 from AI4Bharat/analytic-org-ui
Browse files Browse the repository at this point in the history
Analytic org UI
  • Loading branch information
aparna-aa authored Jan 17, 2025
2 parents bcc9972 + 8c764c0 commit 38dc506
Showing 1 changed file with 124 additions and 1 deletion.
125 changes: 124 additions & 1 deletion src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ const TranscriptionRightPanel = ({
}, [currentIndexToSplitTextBlock, selectionStart, limit, currentOffset]);

const changeTranscriptHandler = (event, index, updateAcoustic = false) => {

const {
target: { value },
currentTarget,
Expand Down Expand Up @@ -1012,6 +1013,38 @@ const TranscriptionRightPanel = ({
? classes.boxHighlight
: ""
}`}
onKeyDown={(event) => {

if ( event.shiftKey && event.key == "<") {
const textArea = textRefs.current[index];
console.log("helo");

if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newStart = Math.max(start - 1, 0);
textArea.setSelectionRange(newStart, end);
event.preventDefault();
}
}
else if (event.shiftKey && event.key == ">") {
const textArea = textRefs.current[index];
if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newEnd = Math.min(end + 1, textArea.value.length);
textArea.setSelectionRange(start, newEnd);


event.preventDefault();
}
}
}}



dir={enableRTL_Typing ? "rtl" : "ltr"}
onMouseUp={(e) =>
onMouseUp(e, index + idxOffset)
Expand Down Expand Up @@ -1045,6 +1078,36 @@ const TranscriptionRightPanel = ({
false
);
}}
onKeyDown={(event) => {

if ( event.shiftKey && event.key == "<") {
const textArea = textRefs.current[index];
console.log("helo");

if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newStart = Math.max(start - 1, 0);
textArea.setSelectionRange(newStart, end);
event.preventDefault();
}
}
else if (event.shiftKey && event.key == ">") {
const textArea = textRefs.current[index];
if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newEnd = Math.min(end + 1, textArea.value.length);
textArea.setSelectionRange(start, newEnd);


event.preventDefault();
}
}
}}

onMouseUp={(e) => onMouseUp(e, index + idxOffset)}
value={item.text}
dir={enableRTL_Typing ? "rtl" : "ltr"}
Expand Down Expand Up @@ -1103,6 +1166,37 @@ const TranscriptionRightPanel = ({
? classes.boxHighlight
: ""
}`}
onKeyDown={(event) => {

if (event.shiftKey && event.key == "<") {
const textArea = textRefs.current[index];
console.log("helo");

if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newStart = Math.max(start - 1, 0);
textArea.setSelectionRange(newStart, end);
event.preventDefault();
}
}
else if ( event.shiftKey && event.key == ">") {
const textArea = textRefs.current[index];
if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newEnd = Math.min(end + 1, textArea.value.length);
textArea.setSelectionRange(start, newEnd);


event.preventDefault();
}
}
}}


dir={enableRTL_Typing ? "rtl" : "ltr"}
onFocus={() =>
showAcousticText &&
Expand Down Expand Up @@ -1132,7 +1226,36 @@ const TranscriptionRightPanel = ({
true
);
}}
onFocus={() =>
onKeyDown={(event) => {

if ( event.shiftKey && event.key == "<") {
const textArea = textRefs.current[index];
console.log("helo");

if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newStart = Math.max(start - 1, 0);
textArea.setSelectionRange(newStart, end);
event.preventDefault();
}
}
else if (event.shiftKey && event.key == ">") {
const textArea = textRefs.current[index];
if (textArea) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;

const newEnd = Math.min(end + 1, textArea.value.length);
textArea.setSelectionRange(start, newEnd);
event.preventDefault();
}
}
}}


onFocus={() =>
showAcousticText &&
populateAcoustic(index + idxOffset)
}
Expand Down

0 comments on commit 38dc506

Please sign in to comment.