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

Disabling context menu in FF

1 Answer 98 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Yaniv
Top achievements
Rank 1
Yaniv asked on 18 Sep 2008, 09:16 AM
Hi,

We are trying to remove the context menu in FF but we cannot find the way.
How can it be done?

The reason for removing the context menu is that it doesn't show the editor context menu but it shows the FF context menu which when pasting doesn't perform format stripping.
We did manage to catch the "paste" event but did not succeed in using the fire method for stripping nor for deleting the editor content. All we have succeeded is to show the paste plain text pop up on the "paste" event.

Is there a solution for this issues?

thanks,
yaniv

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 Sep 2008, 04:03 PM
Hi Yaniv,

I was able to successfully disable the Firefox 3 context menu with the following code: 

<script type="text/javascript">
function OnClientLoad(editor, args)
{
   editor.attachEventHandler("oncontextmenu", function(e)
   {
       if (e.preventDefault) e.preventDefault(); 
       if (e.stopPropagation)e.stopPropagation(); 
       return false;
   });
}
</script>
<telerik:radeditor
   runat="server"
   OnClientLoad="OnClientLoad"
   ID="RadEditor1">
</telerik:radeditor>

In the codebehind I also added:

    protected void Page_Load(object sender, EventArgs e)
    {
        RadEditor1.EnsureToolsFileLoaded();
        RadEditor1.ContextMenus.FindByTagName("A").Enabled = false;
       
        RadEditor1.ContextMenus.FindByTagName("*").Enabled = false; 
    }

The problem with the content stripping using the FormatStripper tool of RadEditor is due to that Firefox 3.0 is presenting itself to MS Word as a XML client and the content pasted in the editor has new format different to this one pasted in Firefox 2.0. That is why the regular expressions used by the editor's Paste From Word filters are not stripping the new MS Word XML formatting. This bug is logged in our ToDo list for Q3 and we will fix it.

Thanks to that the guys from Mozilla have provided an onpaste event in the new Firefox 3 there are good changes to control the pasted content in FF as well. This will allow us to provide the StripFormattingOnPaste option for Firefox 3 too which is also logged for Q3 release.

Currently, you can strip the formatting on the server after obtaining the editor's content via the RadEditor1.Content property.


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Yaniv
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or