tag:blogger.com,1999:blog-2759089075903299499.post3237202300216374668..comments2023-04-15T16:26:26.226+10:00Comments on AntsCode: Strip Formatting on Paste using YUI Rich Text EditorAnthonyhttp://www.blogger.com/profile/00680252080248363199noreply@blogger.comBlogger64125tag:blogger.com,1999:blog-2759089075903299499.post-71650811687787068262011-01-22T19:44:31.546+11:002011-01-22T19:44:31.546+11:00cleanpaste works fine without formatting,but once ...cleanpaste works fine without formatting,but once the cleaned content is inserted into rte (rich text editor) if u select the text and right click your mouse, the context is getting disappeard and is replaced by a character which is mentioned in execCommand(). It would be great if some one wil help me for the same. myid(charan.cse@gmail.com)Cherryhttps://www.blogger.com/profile/15952084260690291593noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-77774471423712737582011-01-14T10:34:46.751+11:002011-01-14T10:34:46.751+11:00Thanks for your hard work with this, it is incredi...Thanks for your hard work with this, it is incredibly useful.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-48350742879159306002010-12-16T20:07:41.041+11:002010-12-16T20:07:41.041+11:00Hi Anthony,
I am facing one strange issue. I am p...Hi Anthony,<br /> I am facing one strange issue. I am pasting some text from word document to YUI Editor and i have used CleanPaste utility.In IE whatever the text i am pasting is replacing by the unformatted text but in firefox its duplicating the content which are inside the editor.<br /><br />So need your help.<br /><br />Regards<br />KamAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-32767485468508489962010-11-26T04:47:36.675+11:002010-11-26T04:47:36.675+11:00Hi Anthony,
I am facing a issue with CleanPaste u...Hi Anthony,<br /> I am facing a issue with CleanPaste utility. I have modified the cleanPaste library for removal of most of the tags but whatever the contents i am copying from word document is not shown in same line which line it should be and breaked into multiple line.<br /><br />these are the tags i am using....<br /><br /> // Remove additional MS Word content<br />// html = Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-61480963012899684352010-11-10T18:58:19.878+11:002010-11-10T18:58:19.878+11:00The call to execCommand('inserthtml', &quo...The call to execCommand('inserthtml', "<div id='Cleaner'>_</div>") seems to fail if you paste text from Word into the middle of an existing paragraph. Any idea why?Gordonhttps://www.blogger.com/profile/05450686179384668891noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-8956557781631602262010-11-09T11:18:35.761+11:002010-11-09T11:18:35.761+11:00For those with IE8 errors on line 85, switching to...For those with IE8 errors on line 85, switching to a setInterval method seemed to work for me. It looks like IE8 was taking too long to create the container div and didn't make it before the setTimeout occurred.<br /><br />My code looks something like this:<br /><br />containerCreatedInterval = window.setInterval(function() {<br /> if (this.Editor._getDoc().getElementById("Cleaner"Gordonhttps://www.blogger.com/profile/05450686179384668891noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-42283370011331783772010-10-27T07:28:09.461+11:002010-10-27T07:28:09.461+11:00I love you. This just saved me a few days of work!...I love you. This just saved me a few days of work!Davidhttps://www.blogger.com/profile/15298788572673764483noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-18713512879357804852010-08-18T20:34:01.851+10:002010-08-18T20:34:01.851+10:00Hi, I found that in IE when you make right mouse c...Hi, I found that in IE when you make right mouse click test in RTF is removed. In other browsers right click is disabled.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-55115547027681369232010-08-10T23:54:50.219+10:002010-08-10T23:54:50.219+10:00Thanks Anthony - this looks cool. Do you have or k...Thanks Anthony - this looks cool. Do you have or know of a standalone version that will work with other editors?Cronhttp://blog.crondesign.com/noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-7488662911055719162010-07-28T07:34:38.711+10:002010-07-28T07:34:38.711+10:00Thanks for the great project here!
I experience t...Thanks for the great project here!<br /><br />I experience the following error with Safari and Chrome (webkit?) from line 85 of CleanPaste.js using the example html -><br /><br />"TypeError: Result of expression 'container' [null] is not an object."<br /><br />---<br /><br />I'll dig into it, but want to see if anyone has travelled this path already :)<br /><br />Thanks kevin collinshttps://www.blogger.com/profile/00937934877234965222noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-33072653272625786692010-07-02T04:26:36.585+10:002010-07-02T04:26:36.585+10:00Heya .. thanks a lot for this script!
One issue i ...Heya .. thanks a lot for this script!<br />One issue i am facing is with IE8, wherein if i do a CTRL+V (it works on Context menu paste) and paste a text into an editor that already has some text, it is giing a JS error saying Object required (line 85). Also sometimes if there is text already and i paste some text, the whole text gets repeated, so each time i do a paste the text in the editor Lost Soul ( Nitin Pande )https://www.blogger.com/profile/05287149460823671847noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-90387948751104142812010-06-09T07:14:54.882+10:002010-06-09T07:14:54.882+10:00Yes.Yes.Anthonyhttps://www.blogger.com/profile/00680252080248363199noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-43024861349965957112010-06-09T04:12:46.464+10:002010-06-09T04:12:46.464+10:00does it support simpleeditor as well?does it support simpleeditor as well?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-27410447184092173132010-05-24T20:19:41.354+10:002010-05-24T20:19:41.354+10:00Regarding the comments stripping, that regexp work...Regarding the comments stripping, that regexp worked much better for me<br /><br />/<(?:--[\s\S]*?--\s*)?>\s*/gi<br /><br />Regards.Franciscohttps://www.blogger.com/profile/13175031256334754721noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-53266882754044146532010-02-04T22:03:41.468+11:002010-02-04T22:03:41.468+11:00Hey Anthony,
first I'd like to thank you for ...Hey Anthony,<br /><br />first I'd like to thank you for this great addon for the YUI RTE. It's very bad how often people copy and paste some texts from Word documents into online Richtext editors.<br /><br />I have an enhancement for one regular expression found in the CleanHTML method of the CleanPaste addon:<br /><br />At line 127 the RegExp might be extended to<br /><br />html = Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-58471407308617810362009-11-25T06:55:27.521+11:002009-11-25T06:55:27.521+11:00Hi Paul. See the 4 steps at the top of this post. ...Hi Paul. See the 4 steps at the top of this post. For each YUI editor you need to add this line of javascript:<br /><br />var cleanPaste = new CleanPaste(myEditor);<br /><br />Where "myEditor" is the variable name of the editor.<br /><br />Cheers,<br />Anthony.Anthonyhttps://www.blogger.com/profile/00680252080248363199noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-71814911754414615012009-11-25T02:47:36.142+11:002009-11-25T02:47:36.142+11:00Anthony. I'm not a js programmer. I'm tr...Anthony. I'm not a js programmer. I'm trying to use your code in an app that has multiple YUI editors on a page. I can see the CleanPaste.js in the header, but when I paste into the editor the text is not getting cleaned.Paul Yuhttps://www.blogger.com/profile/16842371422044147540noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-78235575313647645392009-11-07T21:06:53.360+11:002009-11-07T21:06:53.360+11:00Anthony,
It appears that with IE8 the onbeforepas...Anthony,<br /><br />It appears that with IE8 the onbeforepaste event fires on right click.<br /><br />All the modern browsers that I've tested except opera 10 support the onpaste event<br /><br />IE 8.06 - Yes<br />IE 7 - Yes<br />IE 6 - <b>No</b><br />FF 3.5.3 - Yes<br />Chrome 3.0.1 - Yes<br />Opera 10.01 - <b>No</b><br />Safari (on a Mac) - Yes<br /><br />Would it be possible to test for Unknownhttps://www.blogger.com/profile/11269557534189012378noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-75091968412633045432009-11-06T07:10:32.266+11:002009-11-06T07:10:32.266+11:00Thanks Allan. There is code in the script to try a...Thanks Allan. There is code in the script to try and disable the context menu, as it contains a Paste item which would bypass the script.<br /><br />I'll take another look and see what's going on.<br /><br />Anthony.Anthonyhttps://www.blogger.com/profile/00680252080248363199noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-16875651906403741772009-11-05T22:56:59.668+11:002009-11-05T22:56:59.668+11:00Anthony,
Thanks for your efforts with this they a...Anthony,<br /><br />Thanks for your efforts with this they are most appreciated.<br /><br />I'm getting similar behavior to Lars. I'm using IE 8.0.6 on WinXP with your unchanged example.htm<br />Select a word and right click it - the word is replaced with an underscore on a new line. Using the keyboard (Ctrl+X) works okay <br /><br />FF 3.5.3 the right click is ignored<br />Chrome 3.0.1 -Unknownhttps://www.blogger.com/profile/11269557534189012378noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-30062165158794110302009-11-05T07:04:45.226+11:002009-11-05T07:04:45.226+11:00Thanks Lars. I tested in FF 3.0.15 (Windows) by le...Thanks Lars. I tested in FF 3.0.15 (Windows) by left-clicking on some selected text, however it worked fine for me.<br /><br />Are you on a different platform? Does the problem occur for you in the Example.htm provided with the script? Or only in your implementation?<br /><br />Anthony.Anthonyhttps://www.blogger.com/profile/00680252080248363199noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-5615194574444783792009-11-04T23:07:19.175+11:002009-11-04T23:07:19.175+11:00Hey Anthony,
Using the latest FF and have confirm...Hey Anthony,<br /><br />Using the latest FF and have confirmed it in FF 3.0 as well, I have identified that it happens when you use the contextmenu event.Anonymoushttps://www.blogger.com/profile/00976818553751369143noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-76739914913578613292009-11-04T09:14:25.046+11:002009-11-04T09:14:25.046+11:00Hi Lars, sorry for the delay. Can you tell me whic...Hi Lars, sorry for the delay. Can you tell me which browser & version you are using where the problem occurs?<br /><br />Thanks, Anthony.Anthonyhttps://www.blogger.com/profile/00680252080248363199noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-12380843923075974352009-11-04T08:44:49.536+11:002009-11-04T08:44:49.536+11:00Hi GuruFocus, sorry for the long delay. I tested t...Hi GuruFocus, sorry for the long delay. I tested the paragraph you sent me in Firefox (v3.0), however I did not experience the same problem. Perhaps you can attach a sample word document to the Issue Tracker in CodePlex and I'll try that.<br /><br />Regarding your second problem about xml nodes etc still being there, it sounds like you have not correctly initialised the clean paste script. Anthonyhttps://www.blogger.com/profile/00680252080248363199noreply@blogger.comtag:blogger.com,1999:blog-2759089075903299499.post-53144494069482055312009-10-29T01:40:32.050+11:002009-10-29T01:40:32.050+11:00Great Stuff. Many thanks for this. I found that I ...Great Stuff. Many thanks for this. I found that I got better results using the multi line replace described here:<br /><br />http://wolfram.kriesing.de/blog/index.php/2008/javascript-multiline-replaceSimonHhttps://www.blogger.com/profile/13595614507726195534noreply@blogger.com