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

Firefox context menu missing on right click

22 Answers 389 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Naz Junaid
Top achievements
Rank 1
Naz Junaid asked on 28 May 2008, 04:09 PM
The firefox context menu is missing on right click allowing people to circumvent the RadEditor paste functions

22 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 28 May 2008, 04:14 PM
Hello Naz,

The reason for that the editor displays the default context menu of Firefox is that the default context menu of RadEditor contains tools that are unusable in Firefox due to its security restraints (e.g. Cut, Copy, Paste). On the other hand, using the built-in FireFox spellchecker that provides its suggestions in the [browser] context menu is very commonly used. This is why, upon customer request, we modified the [default] context menu behavior in FireFox.


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Naz Junaid
Top achievements
Rank 1
answered on 28 May 2008, 04:26 PM
Is there any way to get this context menu back as I've set it up so it displays the Paste as plain text dialog on CTRL+V and I want this to be displayed if someone right clicks on the control.
0
Rumen
Telerik team
answered on 02 Jun 2008, 03:10 PM
Hi Naz,

RadEditor for ASP.NET AJAX does not offer currently the requested feature. If anyone else request this option, we will consider providing a way to enable the editor's context menu in Firefox.


Sincerely,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Peter Lindquist
Top achievements
Rank 2
answered on 15 Aug 2008, 09:43 PM
I sure as heck request it.  In general all the stop gaps I've tried to put in place to strip Word formatting have failed in Firefox becasue of not being able to supress those context menus.  This has probably caused at least 50% of my recent hair loss.

We have a serious problem at one of my clients where staff were using MSWord to "set up" pages, and then they copy and paste into the editor.  All the stripping options and defaults on paste worked great on IE however...

  • Drag and drop was never accounted for.  Users can drag and drop from Word or some other source into the editor and all default stripping is skipped - THIS IS A SERIOUS FLAW IN THE EDITOR.  I had to work around it by adding handlers to trap the drag drop event to supress it and add additional handlers to catch dragstart and dragend if the drag is initiated from within the editor window to keep that functionality.
  • This all fixed all my problems, but only in IE,  Firefox and Safari still were allowing pasting and/or dragdrops with now paste filtering.  I understand all the complexities and security issues with the cross browser, but there still has to be a solid answer to fix this issue.  I've been able to replace the standard paste function specifically in Moz based browsers to fire the "PastePlainText" function; however, that context menu "paste" bypasses it.

In terms of a site that highly needs to keep a ridged format and design to maintain a professional appearance, but in an environment where multiple browsers must be accounted for, we more time and effort put into a better solution than all this custom work I've had to do.  And even then, there still is that Firefox context menu that I just can't find a workaround for.

 <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
var isInternalDrop = false;
var oldMozPaste = null;
function EditorInitialize(editor, args)
{
var element = document.all ? editor.get_document().body : editor.get_document();
if (document.all){
$telerik.addExternalHandler(element, "drop", DropCheck);
$telerik.addExternalHandler(element, "dragstart", InternalDrgStart);
$telerik.addExternalHandler(element, "dragend", InternalDrgEnd);
}else{
element.addEventListener("dragdrop", DropCheck, true);
//Catch paste functions for Moz based browsers
oldMozPaste = Telerik.Web.UI.Editor.CommandList["Paste"];
Telerik.Web.UI.Editor.CommandList["Paste"] = function(commandName, editor, args)
{
editor.fire("PastePlainText");
};
}
}
function InternalDrgStart(e)
{
isInternalDrop = true;
}
function InternalDrgEnd(e)
{
isInternalDrop = false;
}
function DropCheck(e)
{
if (isInternalDrop==false){
e.cancelBubble = true;
return (false);
}else{
return (true);
}
}
function MozDropCheck(e)
{
alert("sdfsdf");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<rcaTelerik:RadScriptManager ID="rsmMain" runat="server"></rcaTelerik:RadScriptManager>
<rcaTelerik:RadEditor ID="reContent" runat="server" OnClientLoad="EditorInitialize" StripFormattingOptions="All"></rcaTelerik:RadEditor>
</div>
</form>
</body>
</html>

0
Rumen
Telerik team
answered on 20 Aug 2008, 09:30 AM
Hi Peter,

Straight to the points:
  1. You can strip the MS Word content on drag and drop by using the following code:

    <script type="text/javascript">
    function OnClientLoad(editor, args)
    {
       var element = document.all ? editor.get_document().body : editor.get_document();
       var eventHandler  = document.all ? "drop" : "dragdrop";
       $telerik.addExternalHandler(element, eventHandler, function(e)
       {
           setTimeout(function()
           {
            alert("before stripping" + editor.get_html(true));
            editor.fire("SelectAll");
            editor.fire("FormatStripper", {value : "WORD_ALL"}); //strips the MS Word formatting
            alert("after stripping" + editor.get_html(true));
          }, 300);
       });
    }
    </script>
    <telerik:radeditor
       runat="server"
       OnClientLoad="OnClientLoad"
       ID="RadEditor1">
    </telerik:radeditor>

    By the way have you seen the requested functionality implemented in another web editor? If anyone else request it we could consider its implementation in the control.
     
  2. I have good news that the guys from Mozilla have provided an onpaste event in the new Firefox 3 and there are good changes to control the pasted content in FF as well, which will allow us to provide the StripFormattingOnPaste option for Firefox 3. We need further research and time, but the chances are good that it will be possible to implement this functionality.

    Please, also note that the editor's Word stripping filters do not work properly in Firefox 3.
    The problem 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 problem will be fixed in the Q3 release of RadEditor.

Kind regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
arnaud
Top achievements
Rank 1
answered on 04 Nov 2008, 07:05 PM
Hi Rumen,

Did you postponed the fix for firefox or is it still incoming with the Q3 release ? (I see nothing new in the Q3 beta right now).

Thank you


0
Darren Person
Top achievements
Rank 1
answered on 04 Nov 2008, 09:23 PM
I'd like to request this functionality.  It has severely broken our application - the old editor at least showed the contextmenu in Firefox.
0
Darren Person
Top achievements
Rank 1
answered on 04 Nov 2008, 09:43 PM
You should also note that we don't just use the Contextmenu for Cut/Copy/Paste, but we also have custom dialog's that are called from there.  Just removing the ability to have a contextMenu for the editor in Firefox is ridiculous given that we had it in the old version.  I was more than happy with the "use control+X" for the security management.  It was clear and concise versus the fact that it's now confusing.  No one understands why the menu would work in IE and not in Firefox.

We seem to be able to bring up the contextMenu on elements, just not for the body of the editor.  We tried TagName="*" as well as TagName="BODY"

No luck...  Please bring this back with Q3 ASAP
0
Georgi Tunev
Telerik team
answered on 07 Nov 2008, 04:24 PM
Hi Darren Person,

The main reason for removing the context menu in Firefox was explained in the initial reply by Rumen in this thread. We understand your scenario and we logged this issue with highest priority in our ToDo list. We will do our best to provide an easy option to switch the context menu on and off in Firefox for Q3 SP1



Sincerely yours,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Frank
Top achievements
Rank 1
answered on 04 Dec 2008, 01:04 PM
Hello,

I'm glad that telerik provides a solution for this soon, since we are missing this feature as well. We used the contextmenu to enable the Telerik Link Manager and other functions. In IE, this seems to work perfectly, but in Firefox you can only set link properties via contextmenu when the link is already set.

In other words: we need this very urgently! :)

Thanks in advance!

Frank H.
0
Darren Person
Top achievements
Rank 1
answered on 04 Dec 2008, 01:26 PM
Hi there - do you have a timeline for this - you said Q3 SP1, but that came and went and this fix wasn't put in place.  Will there be a Q4 release or do we have to wait until Q1 of 2009?  I am getting a lot of user complaints about this as it also held our Paste Plain text feature that they commonly use.  Any information would be appreciated so that I can set my customers expectations accordingly.

Thanks!
0
Tervel
Telerik team
answered on 08 Dec 2008, 04:57 PM
Hello Darren,

Please use the following couple of lines of code while the functionality is included (one way or another) back in the editor.

<telerik:radeditor runat="server"                   
            ID="RadEditor1" OnClientLoad="OnClientLoad">                                   
                  <Content> 
                   Content... 
                  </Content>                     
           </telerik:radeditor> 
                                               
           <script> 
          function OnClientLoad(editor) 
          { 
               var toolAdapter = editor.get_toolAdapter(); 
               toolAdapter.isIE = true;         
          }         
           </script> 

Best regards,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Darren Person
Top achievements
Rank 1
answered on 11 Dec 2008, 11:26 PM
That worked!  Not sure what the ramifications are of always telling the editor that you are using IE - any ideas?  In the meantime, this was a great work around so that you for replying!!
0
Tervel
Telerik team
answered on 12 Dec 2008, 08:40 AM
Hello Darren,

This is a *safe* workaround. Please note that the toolAdapter.isIE = true;  is set not on the RadEditor as such, but on its tool adapter (the object that controls tool rendering). We examined the code for side effects and we are confident there will not be any negative ones with the current Telerik.Web.UI version.

Best wishes,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ronak
Top achievements
Rank 1
answered on 13 Feb 2012, 07:14 PM
Hi did this issue has been resolved as i am in same situation where i am using RadEditor for moss and i would like only one options for paste which PastePlainText i get it working in IE but other browser does not show Context Menu so users still can paste by right click.

Please advise

Thanks
0
Rumen
Telerik team
answered on 14 Feb 2012, 12:19 PM
Hello,

To enable the PastePlainText option in all browsers open the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/5.x.x.0__1f131a624888eeed/Resources/ToolsFile.xml and ListToolsFile.xml files of RadEditor for MOSS and register the following contextmenu tags:

<contextMenus>
  <contextMenu forElement="HTML">
    <tool Name="PastePlainText" />
  </contextMenu>
  <contextMenu forElement="BODY">
    <tool Name="PastePlainText" />
  </contextMenu>
  <contextMenu forElement="P">
    <tool Name="PastePlainText" />
  </contextMenu>
</contextMenus>



All the best,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ronak
Top achievements
Rank 1
answered on 14 Feb 2012, 03:16 PM
Thanks Rumen for your Quick reply i would like to also use cut and copy options in all browser too.so here is my Toolsfile look like but if try to cut or copy it popup alert saying use clrt+X to cut In FF please advise

Thanks
Ronak
<contextMenus>
  <contextMenu forElement="HTML">
    <tool name="Cut"/>
    <tool name="Copy"/>
    <tool Name="PastePlainText" />
  </contextMenu>
  <contextMenu forElement="BODY">
    <tool name="Cut"/>
    <tool name="Copy"/>
    <tool Name="PastePlainText" />
  </contextMenu>
  <contextMenu forElement="P">
    <tool name="Cut"/>
    <tool name="Copy"/>
    <tool Name="PastePlainText" />
  </contextMenu>
</contextMenus>
0
Rumen
Telerik team
answered on 15 Feb 2012, 03:46 PM
Hello,

This is a limitation of the Mozilla and WebKit browsers.

Please, note that to protect users' private information, unprivileged scripts cannot invoke the Cut, Copy, and Paste commands in the Mozilla, Safari / Chrome and Opera rich text editor, so the corresponding buttons will not work. You can cut and paste content in Firefox, Safari /Chrome and Opera only using the Ctrl+X and Ctrl+V shortcut or the Paste from Word dialog.
You can also paste content from the browsers menu: Edit -> Paste.
More information is available in this help article: Cleaning Word Formatting.

The Cut, Copy and Paste commands could be executed via JavaScript code only under Internet Explorer.

Kind regards,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Alexander Shashkin
Top achievements
Rank 1
answered on 22 Mar 2012, 10:04 PM
Hello,
I found that RadEditor doesn't allows context menu in default configuration in IE.
Is there any simple way to enable context menu in IE for all tags?

Right now I use next code in my skin file:
<ContextMenus>
    <telerik:EditorContextMenu>
        <telerik:EditorTool Name="Cut" />
        <telerik:EditorTool Name="Copy" />
        <telerik:EditorTool Name="Paste" />
        <telerik:EditorTool Name="PastePlainText" />
    </telerik:EditorContextMenu>
</ContextMenus>

It works, but I will prefer to just enable standard context menu of browser if it is possible.
0
Rumen
Telerik team
answered on 27 Mar 2012, 12:49 PM
Hi,

If you want to enable the default browser's content menu and disable the built-in context menus of RadEditor, you can do that using the following script:

<script type="text/javascript">
    function OnClientLoad(editor) {
        editor.get_toolAdapter().enableContextMenus(false);
    }
</script>
<telerik:RadEditor ID="RadEditor" OnClientLoad="OnClientLoad" runat="server"/>


All the best,
Rumen
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alexander Shashkin
Top achievements
Rank 1
answered on 27 Mar 2012, 01:26 PM
Hi Rumen,
Thanks for you reply. I'm sure this code works, but I can't use it because it will force me to update every RadEditor in project.
0
Rumen
Telerik team
answered on 29 Mar 2012, 04:08 PM
Hi,

You can put the JavaScript file in a JavaScript file and use Theme / Skin file to control multiple editors from a single location.

All the best,
Rumen
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Naz Junaid
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Naz Junaid
Top achievements
Rank 1
Peter Lindquist
Top achievements
Rank 2
arnaud
Top achievements
Rank 1
Darren Person
Top achievements
Rank 1
Georgi Tunev
Telerik team
Frank
Top achievements
Rank 1
Tervel
Telerik team
Ronak
Top achievements
Rank 1
Alexander Shashkin
Top achievements
Rank 1
Share this question
or