This is a migrated thread and some comments may be shown as answers.

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

3 Answers 15 Views
Editor
This is a migrated thread and some comments may be shown as answers.
ido nahmias
Top achievements
Rank 1
ido nahmias asked on 03 Feb 2014, 04:11 PM
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,

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 06 Feb 2014, 09:50 AM
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.
0
ido nahmias
Top achievements
Rank 1
answered on 06 Feb 2014, 09:59 AM
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,
0
Nikolay
Telerik team
answered on 06 Feb 2014, 01:25 PM
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.
Tags
Editor
Asked by
ido nahmias
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
ido nahmias
Top achievements
Rank 1
Share this question
or