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

[Solved] Paste As Plain Text remebering previous paste

1 Answer 130 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 06 Jun 2008, 09:34 AM
Hi
The paste as plain text dialog seems to remember the previously pasted text is it possible to have it so the text on the dialog is cleared each time. Here's how i'm using it.

    <telerik:RadSpell ID="spell1" runat="server" ButtonType="None" />
    <telerik:RadEditor ID="radEditor1" runat="server" StripFormattingOptions="AllExceptNewLines"
        ToolsFile="~/Includes/RadEditorJobAdd.xml" Skin="WebBlue" EditModes="Design"
        Width="505" Height="265" OnClientLoad="OnRadEditorClientLoad">
        <ContextMenus>
            <telerik:EditorContextMenu>
                <telerik:EditorTool Name="Cut" />
                <telerik:EditorTool Name="Copy" />
                <telerik:EditorTool Name="Paste" />
            </telerik:EditorContextMenu>
        </ContextMenus>
        <Content>&nbsp;</Content>
        <SpellCheckSettings SpellCheckProvider="PhoneticProvider" WordIgnoreOptions="RepeatedWords" />
    </telerik:RadEditor>

    <script type="text/javascript"> 
        Telerik.Web.UI.Editor.CommandList.SpellCheck = function(commandName, editor) 
        { 
            var spell = GetRadSpell('<%= spell1.ClientID %>'); 
            spell.spellCheck(new PrometheusTextSource(editor)); 
            return false; 
        }
        var PrometheusTextSource = function(editor) 
        { 
            this._editor = editor; 
        
            this.get_text = function() { return this._editor.get_html(); }; 
            this.set_text = function(value) { this._editor.set_html(value); }; 
        }
        var oldFunction = Telerik.Web.UI.Editor.CommandList["Paste"]; //save the original Paste function
        Telerik.Web.UI.Editor.CommandList["Paste"] = function(commandName, editor, args)
        {
            if (!document.all) {
                editor.fire("PastePlainText");
            }
            else {
                oldFunction(commandName, editor, args);
            }
        };
    </script>

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 10 Jun 2008, 06:25 AM
Hi Naz,

Thank you for the provided code, but I was not able to reproduce the problem - in order to run the code, I had to modify it a little bit due to missing resources.

Could you please open a support ticket and send me a sample runnable project where the problem can be observed, along with a brief description what the expected behavior is and the exact steps to reproduce the problem? I will trace the issue locally and do my best to provide a solution.

Sincerely,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Naz Junaid
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or