Hi! I would like to build a menu of "stock phrases" to insert into a
<textarea mediatype="text/html"> element *at the cursor*...but I don't know if there's any way to get the position of the insert cursor in the textarea. Is this possible? -- --- Francis -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws
-- Francis
|
Francis,
> Hi! I would like to build a menu of "stock phrases" to insert into a > <textarea mediatype="text/html"> element *at the cursor*...but I don't > know if there's any way to get the position of the insert cursor in the > textarea. Is this possible? i did something similar, but not the way you proposed. I didn't find a way to get the cursor position, so i decided to add a plugin to the rich text editor component. How to do this depends from which type of RTE you're using. When i began to create such a functionality, the FCKEditor (now: CKEditor) was the default component for textarea mediatype="text/html". Adding a plugin to the FCKEditor wasn't easy because one has to modify the content of some Orbeon jars (FCKEditor provides a Plugin mechanism, but i didn't find a way to use it without putting the plugin code into the Orbeon jars). Enhancing the YUI RTE using plugins seems much easier, because modifying the YUI RTE and adding plugins (for example, a button that inserts some content at cursor position) is possible without modifying the jars, but by simply adding some javascript to your xforms views. Just search for YUI_RTE_CUSTOM_CONFIG in the mailing list archives, there's some information about this matter. I'm planning to write a short tutorial for the wiki about this topic, but i didn't find the time up to now. But the mailing list archives have the information needed how to modify the YUI RTE. HTH florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Florian - thanks for the reply. I am using the default editor, YUI, and
will look in the archives. Could you briefly describe what the javascript involved entails? Would it ultimately allow programmatic insertion of text at the cursor? I would look forward to an article on this, I'm sure others would appreciate it too. Thanks! On Mon, 24 May 2010 11:15:53 +0200, Florian Schmitt <[hidden email]> wrote: > Francis, > >> Hi! I would like to build a menu of "stock phrases" to insert into a >> <textarea mediatype="text/html"> element *at the cursor*...but I don't >> know if there's any way to get the position of the insert cursor in the >> textarea. Is this possible? > > i did something similar, but not the way you proposed. I didn't find a > way to get the cursor position, so i decided to add a plugin to the > rich text editor component. > > How to do this depends from which type of RTE you're using. When i > began to create such a functionality, the FCKEditor (now: CKEditor) > was the default component for textarea mediatype="text/html". Adding a > plugin to the FCKEditor wasn't easy because one has to modify the > content of some Orbeon jars (FCKEditor provides a Plugin mechanism, > but i didn't find a way to use it without putting the plugin code into > the Orbeon jars). > > Enhancing the YUI RTE using plugins seems much easier, because > modifying the YUI RTE and adding plugins (for example, a button that > inserts some content at cursor position) is possible without modifying > the jars, but by simply adding some javascript to your xforms views. > Just search for YUI_RTE_CUSTOM_CONFIG in the mailing list archives, > there's some information about this matter. > > I'm planning to write a short tutorial for the wiki about this topic, > but i didn't find the time up to now. But the mailing list archives > have the information needed how to modify the YUI RTE. > > HTH > florian Francis -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws
-- Francis
|
> Could you briefly describe what the javascript involved entails? Would it > ultimately allow programmatic insertion of text at the cursor? yes - basically it defines a plugin as descibed on the YUI RTE pages: http://developer.yahoo.com/yui/editor/#plugins As the plugin example shows it's possible to insert plain text as well as markup at the cursor position. Since Orbeon makes the instance data available for JavaScript ¹, it should even be possible to insert content dynamically based on the instance data. florian ¹ http://wiki.orbeon.com/forms/doc/developer-guide/xforms-javascript-integration#TOC-Getting-and-Setting-Controls-Value -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |