• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Insert text into editor problem

R

ragtek

Guest
#1
i'm tryint to insert something into the editor with this is my code:

Code:
    Ragtek.RagtekEditorTemplate.add = function($text)
{
    var $container = $("#ragtek_container");
    var editor = XenForo.getEditorInForm($container.closest("form"));
    if (editor)
            {
                if (editor.execCommand)
                {
                    editor.execCommand("mceInsertContent", false, $text);
                    setTimeout(function() { editor.execCommand("xenForoElastic"); }, 250);
                    setTimeout(function() { editor.execCommand("xenForoElastic"); }, 1000);
                }
                else
                {
                    editor.val(editor.val() + $text);
                }
            }
}
text is set, editor is also set ( editor:Object { editorId="ctrl_message_html", id="ctrl_message_html", more...} )

when i run the function, i'm getting this error:
E.indexOf is not a function

(function(d){var a=/^\s*|\s*$/g,e,c="B...{a.selection.onSetContent.add(f)})}});

tiny_m...c20a874 (Zeile 1