maodun1978sohu / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
GNU General Public License v2.0
0 stars 0 forks source link

ADD-ON: MS Word code clean up on paste #129

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is what i have come up after a few hours of trying, basicly it removes
most of the added microsoft word code when you paste some text from word to
the editor directly.
NOTE: i don't know why but i couldn't remove all the eveil code, i am not
that god with regex so please if you can tune the code post it here, also
if somebody can make it work automaticly(on ctr+v action) it would be great.

1. Copy this into your jquery.wysiwyg.js, you can paste it somewhere
between functions like "html" and "removeFormat" around line 302:
http://pastebin.com/f5ffcff41

2. Add this line of code somewhere in your jquery.wysiwyg.css

#div.wysiwyg ul.panel li a.word {background: url('word.gif') no-repeat;}

also chosse an icon for the fucnion, as you can see here i have word.gif
and its 16x16x px

Original issue reported on code.google.com by cindr...@gmail.com on 27 Aug 2009 at 3:56

GoogleCodeExporter commented 9 years ago

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 12:15

GoogleCodeExporter commented 9 years ago
Issue 112 has been merged into this issue.

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 12:17

GoogleCodeExporter commented 9 years ago

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 1:09

GoogleCodeExporter commented 9 years ago
glad i could contribute

Original comment by cindr...@gmail.com on 8 Dec 2009 at 1:26

GoogleCodeExporter commented 9 years ago
Hello,

Is there a way to clean up text copied from Internet or copied from a text 
document
by removing the automatic effects: bold, italic, underline, tabs, and text size 
to
have a simple basic text, no effects

For I have installed this 1.
Copy this into your jquery.wysiwyg.js, you can paste it somewhere
between functions like "html" and "RemoveFormat" around line 302:
http://pastebin.com/f5ffcff41

But its not working 100%

Thank you

Original comment by alex.cam...@gmail.com on 15 Dec 2009 at 5:09

Attachments:

GoogleCodeExporter commented 9 years ago
And another question, why when I ENTER fact, sometimes it creates as a double 
entry,
so I have to SHIFT + ENTER to go back to single line.

Thanks

Original comment by alex.cam...@gmail.com on 15 Dec 2009 at 5:17

GoogleCodeExporter commented 9 years ago
Wysiwyg editors build on top of browser - so details like behavior of ENTER key 
depends 
on used browser.

Original comment by akzhan.a...@gmail.com on 18 Dec 2009 at 3:38

GoogleCodeExporter commented 9 years ago
Issue 167 has been merged into this issue.

Original comment by akzhan.a...@gmail.com on 30 Mar 2010 at 8:31

GoogleCodeExporter commented 9 years ago
Hi there, i just tried to use this solution as a way to solve a similar problem 
that at first i thought was generated by msword. But the hideous code generated 
by MS OUTLOOK are totally different .... and im not good with regex. Can 
cindreta or anyone test this ? 

thanks a lot.

Original comment by bernardo...@gmail.com on 11 Sep 2010 at 10:17

GoogleCodeExporter commented 9 years ago
can you post your code with the solution for MS WORD ?

Original comment by ecolasu...@gmail.com on 11 Sep 2010 at 10:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
hi,

this is the formatting text being added by word. Can someone help on this? 
Thanks

http://paste2.org/p/1217321

Original comment by yejin...@gmail.com on 29 Jan 2011 at 6:46

GoogleCodeExporter commented 9 years ago
If you want to remove formatting code on event "past", read on Issue 210.

Original comment by andrea.d...@gmail.com on 9 Mar 2011 at 1:23

GoogleCodeExporter commented 9 years ago
Check out the solution on stackoverflow. Create a div and then paste into 
innerHTML and then retrieve...

http://stackoverflow.com/questions/2875027/clean-microsoft-word-pasted-text-usin
g-javascript

Original comment by an...@populus.co on 20 Sep 2011 at 4:17