 |

InHouse
User
Apr 22, 2008, 8:29 PM
Post #1 of 17
(854 views)
Shortcut
|
|
Pasting MS Word Content
|
Can't Post
|
|
I've looked through this material but can't (yet) find how to strip less-than-helpful code pasted into TinyMCE. I'm thinking that if I can get it to always strip 'class="MsoNormal"' and the rest of the Mso... nonsense then that would make everyone's lives easier. I found a promising thread but it's beyond my meagre skills at this time of night: http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=5824 Any thoughts on this? J.
(This post was edited by Dave on Apr 23, 2008, 8:29 AM)
|
|
|  |
 |

Dave
Staff
/ Moderator

Apr 22, 2008, 9:37 PM
Post #2 of 17
(852 views)
Shortcut
|
|
Re: [InHouse] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Did you try the Paste from Word button? That's the clipboard with the W on it. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

InHouse
User
Apr 23, 2008, 5:59 AM
Post #3 of 17
(843 views)
Shortcut
|
|
Re: [Dave] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Sure have and it works fairly well. I just know my clients. They'll forget to do that and then get mad that their pasted material doesn't look just like their Word doc - even though they've really fouled up the Word internal styling and that's what's causing the problem. If I could just get those codes which are not going to be used anyway, out of the picture then life will be easier all around. We've already created CSS rules for many of the Mso... classes but that does not guarantee proper display. J.
|
|
|  |
 |

Dave
Staff
/ Moderator

Apr 23, 2008, 8:47 AM
Post #4 of 17
(833 views)
Shortcut
|
|
Re: [InHouse] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Ok, well we're using the tinyMce Paste plugin and it has a number of configurable options. You can see them here: http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste And you can modify them in lib/menus/default/edit_functions.php (search for "tinyMCE.init"). Enabling 'paste_auto_cleanup_on_paste' automatically cleans on paste in IE and pops up a paste as text box in mozilla. I'll upgrade tinyMCE for the next release, I see in the changelog they've also fixed the 'paste_use_dialog' to work in IE. Maybe one of those options would work out well? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

equinox69
User
Apr 23, 2008, 7:57 PM
Post #5 of 17
(819 views)
Shortcut
|
|
Re: [InHouse] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
MsWord code is a huge consistent problem, not just here - but in all html - and there's one easy solution: 1) Open up your doc in Word 2) Open up NotePad 3) Copy (ctrl-a) all your text from Word to your clipboard 4) Paste (ctrl-v) your clipboard to NotePad. this removes MOST Word formatting and special characters, etc. 6) Search and replace all apostrophes and quotes with notepads apostrophes and quotes. 5) Copy (ctrl-a) all you notepad text into your html or php page That always takes care of this for me
|
|
|  |
 |

Jake
Staff
/ Moderator

Apr 23, 2008, 8:39 PM
Post #6 of 17
(818 views)
Shortcut
|
|
Re: [equinox69] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Hi equinox69, Thanks for posting those simple instructions - that's a great tip. ----------------------------------------------------------- Cheers, Jake Swanson - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

InHouse
User
Apr 23, 2008, 10:36 PM
Post #7 of 17
(816 views)
Shortcut
|
|
Re: [equinox69] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Quite right equinox69. If I was going to be doing the data entry on this site that would be one of the ways I would approach it. The problem is that there are clients involved. They would not see these extra steps as reasonable. <sigh> J.
|
|
|  |
 |

Dave
Staff
/ Moderator

Apr 24, 2008, 9:47 AM
Post #8 of 17
(803 views)
Shortcut
|
|
Re: [InHouse] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Did you give the 'paste_auto_cleanup_on_paste' a try? Are the users mostly on IE? That will clean on paste in IE and pops up a paste as text box in mozilla. Would that work for the users do you think? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

InHouse
User
Apr 25, 2008, 9:46 AM
Post #9 of 17
(771 views)
Shortcut
|
|
Re: [Dave] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Have now tried this. It looks very promising. It does a nice job of removing all the style formatting while, by default, keeping the lists, paras and line breaks. This forces the client to format things like headers and bold type. I think this is a good starting point. The Paste as Word function does remove the Mso... styles but it leaves normal style calls intact. That's reasonable enough in the hands of capable users of MS Word, but... Cheers, Jayme
|
|
|  |
 |

Dave
Staff
/ Moderator

Apr 25, 2008, 11:02 AM
Post #10 of 17
(769 views)
Shortcut
|
|
Re: [InHouse] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
I think what I'll do is update to a newer version of tinyMCE and add some options for Word filtering to the Admin > General menu. Watch for that in the next couple releases. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

InHouse
User
Apr 28, 2008, 7:44 AM
Post #11 of 17
(745 views)
Shortcut
|
|
Re: [Dave] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Just by way of information: I've done the auto-cleanup-on-paste thing and generally like the effect. However, we've noticed that after doing the paste we are unable to delete any text with either the backspace or DEL keys. We solve this by adding a character first and then deleting. This was seen in FireFox browsers. Another useful note is that after changing the editor behaviour, we can still paste pre-formatted material (such as from web sites) using the Paste from Word interface. The styling is still retained. FYI.
|
|
|  |
 |

virgodesign
User
May 4, 2008, 5:46 PM
Post #12 of 17
(694 views)
Shortcut
|
|
Re: [equinox69] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Hi equinox69 What you want to do in addition to the Paste from Word feature, or pasting from NotePad is to simply have both Microsft and International character sets display properly. To do this use the xml standard: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> instead of <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> In combination with Paste from Word your laughing... (Dave showed me that one, so I can't take the credit) Avrom
|
|
|  |
 |

miked
User
May 14, 2008, 11:19 AM
Post #13 of 17
(564 views)
Shortcut
|
|
Re: [Dave] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
My client does the paste with word just fine, but when she goes in and "edit's" a word or two directly in the CMS editor the text outputted to the website is not the same "font/style" as the rest of the text. Is there an easier way around this versus copying the entire text from the editor, pasting back into Word, making the change(s), copying all again, going back to the editor again, re-pasting all the text in again, saving, and hoping there isn't any weird characters showing up that will need to be found in the editor (always invisible in the editor)? Seems like too many steps must be done just to make a simple change to one or two words.
|
|
|  |
 |

Dave
Staff
/ Moderator

May 14, 2008, 11:24 AM
Post #14 of 17
(561 views)
Shortcut
|
|
Re: [miked] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Hi Mike, Yes, there's a few different ways around that. You click the "Paste As Text" button to get text only - that button looks like a clipboard with a "T" on it. Next, you can select the content and click "Remove Formatting". This wysiwyg button is on the top left of the button bar and looks like an eraser. Also, in the latest version (v1.15) Word content is automatically cleaned up even if you don't click the "Paste from Word" button. Hope that helps! Would one of those options work for you? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

miked
User
May 14, 2008, 11:33 AM
Post #15 of 17
(560 views)
Shortcut
|
|
Re: [Dave] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
Thanks for the quick response Dave, Actually your earlier post of: Microsft and International character sets display properly. To do this use the xml standard: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> I thought you meant change the php code I inserted only, but when I did this to the top of the page all is well. Thanks!
|
|
|  |
 |

Dave
Staff
/ Moderator

May 14, 2008, 11:34 AM
Post #16 of 17
(559 views)
Shortcut
|
|
Re: [miked] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
So it's working now? Great! :) Let me know if you need anything else. :) Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

miked
User
May 14, 2008, 11:40 AM
Post #17 of 17
(557 views)
Shortcut
|
|
Re: [Dave] Inserting a <form> </form>
[In reply to]
|
Can't Post
|
|
LIKE A CHARM! I think this should be the first (and certainly the easiest) check for anyone having the same problem. Thanks, Mike
|
|
|  |
|