This is a migrated thread and some comments may be shown as answers.

Editor for transcription?

3 Answers 72 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Social_Quotient
Top achievements
Rank 1
Social_Quotient asked on 10 Aug 2009, 06:50 AM
In transcription systems there are often features that let people type faster. Example

"cp " then is passed to a dictionary and then it is replaced with "Chest pain"

typically the spacebar is the trigger to run the lookup in the text area. (kinda like vs) but the thing to consider is that most of the time the words and then spacebar wont result in anything like "hello " is just hello.

a more complex example is

"nv "
is replaced with an entire block of text

"Normal visit for the patient who was in for a common checkup."

Can telerik editors do this, do you have any pointers for me on the client side events to try and hook on to? Any help would be great.

Next there are is another weird function which might be weird for web

We typically let end users customize some key handles like

alt+p
will insert the patient name

so it is similar to the first example but hijacks some keys like alt and ctrl

Thanks for the help ahead of time


3 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 13 Aug 2009, 08:56 AM
Hi strategic coder,

Out of the box, the RadEditor cannot do this, however it does provide all the building blocks needed for someone to implement this functionality.

1. You can attach to keydown/keyup events in the content area, e.g:
http://www.telerik.com/help/aspnet-ajax/editor_attacheventhandler.html

2. Apart from what the letter which the user typed, you can examine what letter precedes it by playing with the browser TextRange object. You can obtain a range object like this:
var range = editor.getSelection().getRange();

You can also manipulate the range - e.g. expand it, and change the selection.
You can learn more about the TextRange object here:
http://www.wrox.com/WileyCDA/Section/JavaScript-DOM-Ranges-Page-2.id-292302.html
http://www.quirksmode.org/dom/range_intro.html
http://msdn.microsoft.com/en-us/library/ms535872(VS.85).aspx

3. Once that you have identified a letter sequence and that you have expanded the selection to engulf it, you can replace it with the new content by simply calling
editor.pasteHtml("Some content");

4. You can also assign shortcuts to execute editor commands, like this (e.g. in the editor OnPageLoad handler):
    editor.addShortCut("InsertPatientName", "ALT+P");

and then by hooking to the OnClientCommandExecuting:

function OnClientCommandExcuting (editor, args)
{
   var commandName = args.get_commandName ?  args.get_commandName() : "";
   if (commandName == "InsertPatientName")
   { 
        editor.pasteHtml("John Smith");
        //Prevent the editor from executing this command further, as it does not exist
       args.set_cancel(true);
   }
}

You can learn more about editor's client events from this demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/clientsideevents/defaultcs.aspx

The Telerik community will certainly benefit from one such implementation, and it will be great if you post your solution as a Code Library once it is complete.

Sincerely yours,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Social_Quotient
Top achievements
Rank 1
answered on 24 Aug 2009, 06:37 AM
I have a sample pretty close to ready. We are converting the json response but then I'll be ready to post a working set.

Do we get telerik points for posting community code?

Thanks
John
0
Rumen
Telerik team
answered on 24 Aug 2009, 07:55 AM
Hi John,

Yes, we grant Telerik points for sharing knowledge, experience and code samples with the community. Once you are ready with the implementation you can post your code in the Code Library section.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Social_Quotient
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Social_Quotient
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or