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

[Solved] Safari 3.1.2 and Ctrl+V

2 Answers 219 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kyle Parker
Top achievements
Rank 1
Kyle Parker asked on 20 Mar 2009, 02:23 PM
I am running into an issue with the "ctrl+v" functionality on a Mac running Safari version 3.1.2.  Using the Telerik web site as an example (http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx) I am attempting to content copied from a Word document and pasting it into the editor body.

Here are the steps I am following:

- Mac OS X 10.5.5
- Safari 3.1.2
- Word document with lots of colors, images, font styles, sizes, etc
- Going to http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx
- Open-Apple A to select all content
- Open-Apple V to paste Word content
- I do not get a dialog box or anything - it simply pastes all of the "ugly" formatted text directly into the editor
- If I click on the format stripper tool, it will remove the formatting
- If I click on the "Paste" icon, it will remove the formatting
- If I right-click and use "Paste" from the context menu, it will NOT remove the formatting
- If I click on the "Paste as plaint text" icon, it will display the popup dialog where I again use Ctrl+V, and it will remove the formatting

While there are work arounds from a user perspective, we cannot trust our users to go through these steps, and in fact, they are finding them and exploiting them to by-pass the style rules we have in place for our web site.  Is there a way on Safari to force Ctrl+V to clean/strip the formatting? 

I have tried the following programmatic approaches:

- Added Javascript code per http://www.telerik.com/help/aspnet-ajax/cleaningwordformattingonpageloadandonsubmit.html - to do the following:
    * ALL
    * SPAN
    * CSS
    * WORD_ALL
    * WORD_NO_FONT

- Added the <contextMenu> options to the tools file to remove the "Paste from Word" or "Paste HTML" options

- Added the StripFormattingOnPaste to AllExceptNewLines

Things work fine in IE and Firefox, just not Safari...

Thanks for any assistance anyone can offer.
Kyle Parker

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 23 Mar 2009, 05:29 PM
Hello Kyle,

The paste problem is due to that it is not possible to handle the paste operation in Safari, because the browser still does not offer an onpaste client-side event.

Since Safari does not support an onpaste event it is not possible to get the pasted content and strip it before its insertion in the content area. For that reason it is not possible to implement the StripFormattingOptions property under Safari and Google Chrome. This property currently works only in Internet Explorer and Firefox 3.x - both browsers offer the onpaste event.

We hope that the guys from Safari will provide an onpaste event soon and we will be able to implement the requested functionality after that.

As a solution you can strip the formatting when submitting the content. You should attach to the OnClientSubmit event and fire the FormatStripper tool as it is demonstrated in this example http://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx

Kind regards,
Rumen
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Kyle Parker
Top achievements
Rank 1
answered on 24 Mar 2009, 01:36 PM
Thank you!  This helped a lot - I was using the OnClientLoad, I just did not see the OnClientSubmit event.

Thanks again,
Kyle
Tags
Editor
Asked by
Kyle Parker
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Kyle Parker
Top achievements
Rank 1
Share this question
or