Cursor is not placed at the end of the object (outside) after inserting a new media from the toolbar in Chrome

4 posts, 0 answers
  1. ido nahmias
    ido nahmias avatar
    64 posts
    Member since:
    May 2006

    Posted 03 Feb 2014 Link to this post

    Cursor is not placed at the end of the object (outside) after inserting a new media from the toolbar in Chrome

    Here is an example taken from the demos- the "welcome" is inserted inside the object tags (marked in Bold) .
    (In IE it's working fine- the "welcome" is placed after the closing tag (</object>) .

    hello<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" width="150" height="150" type="application/x-oleobject">
    <param name="URL" value="/aspnet-ajax/Editor/Img/UserDir/Marketing/Windows XP Startup.mp3"><embed src="/aspnet-ajax/Editor/Img/UserDir/Marketing/Windows XP Startup.mp3" width="150" height="150" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer">welcome</object>

    How can make the cursor to be placed at the end of the object?

    Thanks,
  2. Nikolay
    Admin
    Nikolay avatar
    102 posts

    Posted 06 Feb 2014 Link to this post

    Hi,

    I tried to reproduce the issue but to no avail. For convenience I have recorded a video of the test.

    In order to find the problem, could you provide the reliable steps to reproduce it and the Chrome version that you use?

    Regards,
    Nikolay
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. ido nahmias
    ido nahmias avatar
    64 posts
    Member since:
    May 2006

    Posted 06 Feb 2014 in reply to Nikolay Link to this post

    Thanks for replying.

    Repeat the same steps as you did in the video but at the end of it, click on the html (mode) and then you will notice the that text that was entered is inside the object tags.

    Thanks,
  4. Nikolay
    Admin
    Nikolay avatar
    102 posts

    Posted 06 Feb 2014 Link to this post

    Hi,

    The issue can be workarounded by appending a character after the Object element when it is inserted. Then remove the additional character using a content filter.
    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad" OnClientPasteHtml="OnClientPasteHtml">
    </telerik:RadEditor>
     
    <script type="text/javascript">
        function OnClientPasteHtml(editor, args) {
            if ($telerik.isChrome && args.get_commandName() == "MediaManager") {
                args.set_value(args.get_value() + String.fromCharCode(8203));
            }
        }
     
        function OnClientLoad(editor, args) {
            if ($telerik.isChrome) {
                editor.get_filtersManager().add(new MyFilter());
            }
        }
     
        MyFilter = function() {
            MyFilter.initializeBase(this);
            this.set_isDom(false);
            this.set_enabled(true);
            this.set_name("RadEditor filter");
            this.set_description("RadEditor filter description");
        }
        MyFilter.prototype =
        {
            getHtmlContent: function(content) {
                return content.replace(/(object>)[\u200b]/gm, "$1"); // or content.replace(/[\u200b]/gm, "")
            },
            getDesignContent: function(content) {
                return content;
            }
        }
        MyFilter.registerClass('MyFilter', Telerik.Web.UI.Editor.Filter);
    </script>


    I have logged it in our feedback portal. You can track it and vote for it here

    Regards,
    Nikolay
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top