Hi,
I really hope someone can give me a hand with this. Basically, I want to do exactly what the title of this post says. I've created a plug-in very similar to the provided "Placeholder" plug-in example. I would use the Placeholder example, but it replaces the text selected in the editor, which totally defeats the purpose of my function.
So, here's the scenario:
- I load some content in the editor.
- I select some text in the editor.
- I click a custom button from the tool-bar.
- That opens my plug-in window.
- This window contains a text box and the "OK" button.
- I put a word in the text box (something like "test").
- I click "OK".
** This is where I start getting totally lost in implementation **
- Create a SPAN element around the word selected in the editor.
- In that same SPAN, add the class name attribute and use the text from the plug-in text box as the attributes value.
- This span should also be re-editable from the editor by a db-click.
Now this is EXACTLY what I need. Anybody know how I can accomplish this.
Even a bunch of examples would be fine, especially ones pertaining to selections made in the editor.
TIA,
Eric
I really hope someone can give me a hand with this. Basically, I want to do exactly what the title of this post says. I've created a plug-in very similar to the provided "Placeholder" plug-in example. I would use the Placeholder example, but it replaces the text selected in the editor, which totally defeats the purpose of my function.
So, here's the scenario:
- I load some content in the editor.
- I select some text in the editor.
- I click a custom button from the tool-bar.
- That opens my plug-in window.
- This window contains a text box and the "OK" button.
- I put a word in the text box (something like "test").
- I click "OK".
** This is where I start getting totally lost in implementation **
- Create a SPAN element around the word selected in the editor.
- In that same SPAN, add the class name attribute and use the text from the plug-in text box as the attributes value.
- This span should also be re-editable from the editor by a db-click.
Now this is EXACTLY what I need. Anybody know how I can accomplish this.
Even a bunch of examples would be fine, especially ones pertaining to selections made in the editor.
TIA,
Eric