Firefox context menu missing on right click

23 posts, 0 answers
  1. Naz Junaid
    Naz Junaid avatar
    13 posts
    Member since:
    May 2008

    Posted 28 May 2008 Link to this post

    The firefox context menu is missing on right click allowing people to circumvent the RadEditor paste functions
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 28 May 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Naz Junaid
    Naz Junaid avatar
    13 posts
    Member since:
    May 2008

    Posted 28 May 2008 Link to this post

    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.
  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 02 Jun 2008 Link to this post

    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
  6. Peter Lindquist
    Peter Lindquist avatar
    1 posts
    Member since:
    Jan 2008

    Posted 15 Aug 2008 Link to this post

    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>

  7. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 20 Aug 2008 Link to this post

    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.
  8. arnaud
    arnaud avatar
    104 posts
    Member since:
    Jul 2008

    Posted 04 Nov 2008 Link to this post

    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


  9. Darren Person
    Darren  Person avatar
    4 posts
    Member since:
    Oct 2006

    Posted 04 Nov 2008 Link to this post

    I'd like to request this functionality.  It has severely broken our application - the old editor at least showed the contextmenu in Firefox.
  10. Darren Person
    Darren  Person avatar
    4 posts
    Member since:
    Oct 2006

    Posted 04 Nov 2008 Link to this post

    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
  11. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 07 Nov 2008 Link to this post

    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.
  12. Frank
    Frank avatar
    1 posts
    Member since:
    Sep 2007

    Posted 04 Dec 2008 Link to this post

    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.
  13. Darren Person
    Darren  Person avatar
    4 posts
    Member since:
    Oct 2006

    Posted 04 Dec 2008 Link to this post

    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!
  14. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 08 Dec 2008 Link to this post

    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.
  15. Darren Person
    Darren  Person avatar
    4 posts
    Member since:
    Oct 2006

    Posted 11 Dec 2008 Link to this post

    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!!
  16. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 12 Dec 2008 Link to this post

    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.
  17. Ronak
    Ronak avatar
    108 posts
    Member since:
    Sep 2010

    Posted 13 Feb 2012 Link to this post

    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
  18. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 14 Feb 2012 Link to this post

    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 >>
  19. Ronak
    Ronak avatar
    108 posts
    Member since:
    Sep 2010

    Posted 14 Feb 2012 Link to this post

    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>
  20. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 15 Feb 2012 Link to this post

    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 >>
  21. Alexander Shashkin
    Alexander Shashkin avatar
    15 posts
    Member since:
    May 2010

    Posted 22 Mar 2012 Link to this post

    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.
  22. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 27 Mar 2012 Link to this post

    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.
  23. Alexander Shashkin
    Alexander Shashkin avatar
    15 posts
    Member since:
    May 2010

    Posted 27 Mar 2012 Link to this post

    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.
  24. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 29 Mar 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017