I have a working plugin that changes every occurrence of some words in the text area to another. In this case, it's left to right or vice-versa.
What I want to do is just have button in the toolbar with an 'R' on it that will change the occurrences in the textarea without opening a dialog window. I can't figure it out because I'm not great with Javascript.
Here's the piece of code that works in my dialog box plugin:
function ReplaceAll2()
{
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'left', 'right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'bilateral', 'right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'Left', 'Right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'Bilateral', 'Right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'LEFT', 'RIGHT' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'BILATERAL', 'RIGHT' ) ;
}
The setup stuff I basically grabbed from the findreplace examples.
Can anybody help?
What I want to do is just have button in the toolbar with an 'R' on it that will change the occurrences in the textarea without opening a dialog window. I can't figure it out because I'm not great with Javascript.
Here's the piece of code that works in my dialog box plugin:
function ReplaceAll2()
{
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'left', 'right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'bilateral', 'right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'Left', 'Right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'Bilateral', 'Right' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'LEFT', 'RIGHT' ) ;
ReplaceTextNodes3( oEditor.FCK.EditorDocument.body, 'BILATERAL', 'RIGHT' ) ;
}
The setup stuff I basically grabbed from the findreplace examples.
Can anybody help?