Forum closed. New forum available at http://community.wymeditor.org/

clipboard

Support forum for WYMeditor.

clipboard

Postby scottsanders on Tue May 19, 2009 6:33 am

hey guys! i'm trying to find a way to make the WYMeditor display plain unstyled text when i paste it from the clipboard. I find when I try to copy text from a word processor, or another webpage, it carries with it the styles and formatting. I would like to limit the editor to the styles that I set for it, and so cant have carried across styles from other sources. any ideas?
scottsanders
 
Posts: 4
Joined: Tue May 19, 2009 6:28 am

Re: clipboard

Postby mr_lundis on Tue Jun 02, 2009 7:49 am

Hi Scott, and welcome to the forum!
This is what the "Paste from Word" dialogue is for. I wish we could've cleaned pastes automatically, but Mozilla-based browsers prevents access to the clipboard.

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: clipboard

Postby scottsanders on Mon Jun 15, 2009 1:48 pm

Thanks for your reply mr_lundis!

The issue I was having was with not just Word clipboard text, but also when a user copies content from a webpage.

Is there any way to run a function that strips all tags from all pasted text, or is this where the Mozilla hurdle comes in? Do they give no way to know when text is pasted?

The company I work for uses Lotus iNotes web based email system, and they have a rich text editor that removes all formatting (apart from line breaks) from pasted text. I use Firefox in this system on my Mac, and it seems to work fine? So there must be some way?

I know if you paste it into a normal textbox it removes the formatting, could that provide some options?

I'm sure I'm showing my ignorance with these suggestions, but thought it couldn't hurt to try :)

Thanks for all your help, I look forward to your reply!

Scott
scottsanders
 
Posts: 4
Joined: Tue May 19, 2009 6:28 am

Re: clipboard

Postby mr_lundis on Fri Jun 19, 2009 10:40 am

Hi again!
Have you tried the paste from word dialogue? Using it should clear all formating from the text.

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: clipboard

Postby scottsanders on Tue Sep 08, 2009 9:23 am

mr_lundis wrote:Hi again!
Have you tried the paste from word dialogue? Using it should clear all formating from the text.

Cheers! ;)

Thanks for your suggestions. While the Paste form Word dialog would do it, its an option that I would like to eliminate. The editor is not for me, but for a client who will have many different users using the editor and many of them wouldn't think to use the "Paste from Word" dialog, they'd just use a keyboard short cut which results in formatted text. They'd also think this was "okay" and it will result in the horrible word HTML appearing on the website and stuffing up validation of the website.

Any way to make it run the Paste From Word dialog without having to click the button?
scottsanders
 
Posts: 4
Joined: Tue May 19, 2009 6:28 am

Re: clipboard

Postby mantis on Mon Oct 05, 2009 7:31 am

This is something I'm also having an issue with. It's an end user issue really but their stupidity and laziness is beginning to make my job very difficult. I've removed the HTML viewer to stop those who think they're clever from coding in the editor itself as well. I work in a context where end users despite being trained and told to use the "paste from word" button and not to paste directly into the editor still somehow manage to do so. They deny it of course but the MS font family styles and other html flotsam that gets dumped into the database says otherwise and this of course makes a mess of the lovely site I've created. I'd like it to function like an editor that can't be pasted directly into, if at all possible. If this isn't possible then can you give me a working snippet of code that illustrates how to include the tidy plugin in v0.5 of the editor as I believe this will also strip out all the unwanted code. Thanks in advance... Keep up the great work guys the editor is fantastic! 8)
mantis
 
Posts: 11
Joined: Fri Jun 29, 2007 1:50 pm
Location: South Africa

Re: clipboard

Postby mr_lundis on Mon Oct 05, 2009 3:43 pm

This is a rather complex issue due to the different browser policies... A possible solution would be to create a plugin that cleans the generated code more thoroughly, eliminating any kind of bad code (and MS Word residue) when the WYM update function gets called. This could of course also be done on the server side. The drawback to this kind of approach is that you risk eliminating perfectly valid code if you're not very careful.

As always any kind contributions are welcome. ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron