Re: Moving the editor in the DOM

  •  06-17-2009, 4:42 AM

    Re: Moving the editor in the DOM

    Thanks for the links but this is not quite what I am looking for.
     
    UserFloatToolbar.aspx - Unfortunatly this only unclutters the interface when the user is not activly working with an instance of cuteeditor. It requires that each editable area on my page is displayed as a text box with a fixed height and width (I don't want this, I will "...show the user a preview of the page..." and will only show a cute-editor instance when the user clicks on that text.
     
    dad.html - I could adapt this (I would replace the text box with static html which when clicked would spawn a cuteeditor in another window (or DHTML popup).
     
    Example JS: (typed by hand, forgive any errors!)
     
    <!-- editor instance --> 
    <CE:Editor id="ceDynamic" runat="server" EnableStripScriptTags="false" />
    <!-- content placeholders -->
    <div id="placeholder1" onclick="edit('placeholder1')">editable content 1</div>
    <div id="placeholder2" onclick="edit('placeholder2')">editable content 2</div>
     
    <script>
     
    function edit(instance)
    {
                var placeholder = document.getElementById(instance);
     
                //cache content
                var cache = placeholder.innerHTML;
                //clear element
                placeholder.innerHTML = '';

                var dynEdit = document.getElementById('ceDynamic');
                //append the text editor instance to the cleared placeholder !!! This seems to remove the event handlers !!!
                placeholder.appendChild(dynEdit);
                //set the text of the cuteeditor to the snapshot we took earlier
                dynEdit.setHTML(cache);
                //set focus to the cuteeditor control
                dynEdit.FocusDocument();
    }
    </script>
View Complete Thread