Open GoogleCodeExporter opened 8 years ago
I had this same issue (not really an issue, just a desired funtionality) and
was able
to add some basic styling (bold, italic, underline).
First I included the small js-hotkeys jquery plugin in my js files
(http://code.google.com/p/js-hotkeys/). Then I added this code in
enable_design_mode
function:
$(self.iframe_doc).bind('keydown', 'Ctrl+b',function (evt){
self.editor_cmd("bold");
return false; });
$(self.iframe_doc).bind('keydown', 'Ctrl+i',function (evt){
self.editor_cmd("italic"); return false; });
$(self.iframe_doc).bind('keydown', 'Ctrl+u',function (evt){
self.editor_cmd("underline"); return false; });
This binds keydown events to the rte iframe. The self.editor_cmd("bold") bit
applies
the style, and 'return false;' stops normal action from happening (the Bookmarks
sidebar, etc.)
My code just does bold, italic, and underline, but you could easily add more
basic
functions (strikethrough, justifyright, indent, subscript, etc.) just using the
basic
execCommand values (here's a good list:
http://www.quirksmode.org/dom/execCommand.html).
I would like, however, to be able to call up the link function (lwrte_link) on a
Ctrl+L keypess, but haven't yet figure out how to do that. If anyone could
advise me
on this it'd be appreciated.
Original comment by CharlieK...@gmail.com
on 25 Nov 2009 at 1:20
Original issue reported on code.google.com by
cfxcha...@gmail.com
on 3 Jun 2009 at 7:23