Results 1 to 3 of 3

Thread: Tiny_mce

  1. #1
    Join Date
    Oct 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tiny_mce

    Hello,
    i have a function, that gives me a selected String in a Textareas. CODE :
    function moveSelectedWord()
    {
    var selectedString = ' ';

    if (window.getSelection) { // recent Mozilla versions
    var selectedString = window.getSelection();
    }
    else if (document.all) { // MSIE 4+
    document.getElementById('TheText').focus();
    var selectedString = document.selection.createRange();
    var TheWord = selectedString.text;
    }
    else if (document.getSelection){ //old Mozilla versions
    var selectedString = document.getSelection();
    }

    alert(TheWord);
    }
    i've made from that textarea a tiny_mce editor and the function dosn't run correctly naymore. Has anybody an idea, where this error from ?

  2. #2
    Join Date
    Oct 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I found it :
    CODE :

    var anySelection = false;
    var inst = tinyMCE.getInstanceById(editor_id);
    var focusElm = inst.getFocusElement();
    var selectedText = inst.selection.getSelectedText();

    how to replace it ???

  3. #3
    Join Date
    Oct 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Guys ;- )
    here is the command :
    tinyMCE.execCommand('mceInsertContent',false,"NewText" +tinyMCE.selectedInstance.selection.getSelectedHTML()+"NewText");

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •