I am using Joomla 1.7 and I am made a custom button (editor-xtd plugin) that I want to insert some string into the current editor content.
Like in the Readmore button. I have searched through the Readmore code and found :
$js = "
function insertReadmore(editor) {
var content = $getContent
if (content.match(/<hr\s+id=(\"|')system-readmore(\"|')\s*\/*>/i)) {
alert('$present');
return false;
} else {
jInsertEditorText('<hr id=\"system-readmore\" />', editor);
}
}
";
Now when I try to call jInsertEditorText
, I seem to get an error that it's missing.
Some forum suggested I import mootools.js, but that didn't seem to do the trick.
Where can I find it or is there some other approach?
jInsertEditorText is defined by the editor, not in mootools. Try using TinyMCE editor or JCE, both support it fully.