|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Re: LiveWorks Digest, Vol 8, Issue 2Thanks! Sorry for the newbie question, but I'm rather new to the Ephox
editor and to Java. Do I just add this piece to the customFunctionality.jsp file and it will get loaded along with the EditLiveJavaEditor? Katrina Smith IS Technical Specialist Labcorp Web Technologies 336-436-8829 ext 68829 smithk1@... >>> liveworks-request@... 5/2/2008 1:00:06 PM >>> Send LiveWorks mailing list submissions to liveworks@... To subscribe or unsubscribe via the World Wide Web, visit http://liveworks.ephox.com/mailman/listinfo/liveworks or, via email, send a message with subject or body 'help' to liveworks-request@... You can reach the person managing the list at liveworks-owner@... When replying, please edit your Subject line so it is more specific than "Re: Contents of LiveWorks digest..." Today's Topics: 1. Re: Restricting pasting of images (Dylan Just) 2. Re: Restricting pasting of images (Andrew Herron) 3. Re: Restricting pasting of images (Adrian Sutton) 4. Re: Restricting pasting of images (Adrian Sutton) ---------------------------------------------------------------------- Message: 1 Date: Thu, 1 May 2008 19:41:18 -0400 From: "Dylan Just" <dylan.just@...> Subject: Re: [Liveworks] Restricting pasting of images To: "LiveWorks Discussion" <liveworks@...> Message-ID: <FE7FA9EDB459FD468E020D6609E0EF7304C7B054@...> Content-Type: text/plain; charset="iso-8859-1" Hi, Katrina, As per Adrian's suggestion, here is paste filter code that will remove any HTML/XHTML images from the pasted content. public String filterIn(String source) { Pattern pattern = Pattern.compile("<img.*?/?>", Pattern.DOTALL); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); } Note that, pasting screenshots on windows gives us the raw image data, and doesn't go through the paste filter. As such, they will not be filtered out. At this stage, I'm unaware of a way to get around this - it may require a new feature for EditLive. Kind regards, Dylan Just Software Engineer Global: +1 (650) 292 9659 x705? Australia: +61 (7) 3858 0100 www.ephox.com -----Original Message----- From: liveworks-bounces@... [mailto:liveworks-bounces@...] On Behalf Of Adrian Sutton Sent: Thursday, 1 May 2008 7:27 PM To: LiveWorks Discussion Subject: Re: [Liveworks] Restricting pasting of images Hi Katrina, > Is there a way to > restrict the images from being pasted through an Ephox setting? Has > anyone else had this issue and what's the recommended approach for > resolving it? There isn't a simple setting for this though it can be done through our advanced APIs and we have had customers do this successfully before. The key point is to use a paste filter as described in this liveworks article: http://liveworks.ephox.com/2008/01/15/filtering-pasted-content/ The article provides a very simplistic filter that changes "cat" to "dog" whereas you'd want to filter out any img tags from the content but the concept is the same. Hope that helps, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ ------------------------------ Message: 2 Date: Thu, 1 May 2008 19:58:39 -0400 From: "Andrew Herron" <andrew.herron@...> Subject: Re: [Liveworks] Restricting pasting of images To: "LiveWorks Discussion" <liveworks@...> Message-ID: <FE7FA9EDB459FD468E020D6609E0EF7304C7B060@...> Content-Type: text/plain; charset="iso-8859-1" The way to get around it is to completely override our TransferHandler. This is a fairly advanced technique, but we do have a plugin showing how to do it: http://liveworks.ephox.com/2007/04/02/using-drag-and-drop-to-insert-multiple-files-into-editlive/ Taking that code, instead of importing with DataFlavor.javaFileListFlavor you want to check for DataFlavor.imageFlavor and imports that use it. If you remove the rest of the drag and drop code (leaving just the delegate sections) you can also remove the Java 1.6 restriction as it will work on any JRE EditLive! supports. Regards, Andy --- Andrew Herron, Senior Software Engineer Global: +1 (650) 292 9659 x705 Australia: +61 (7) 3858 0100 Ephox <http://www.ephox.com> | Ephox Blogs <http://people.ephox.com> -----Original Message----- From: liveworks-bounces@... [mailto:liveworks-bounces@...] On Behalf Of Dylan Just Sent: Friday, 2 May 2008 9:41 AM To: LiveWorks Discussion Subject: Re: [Liveworks] Restricting pasting of images Hi, Katrina, As per Adrian's suggestion, here is paste filter code that will remove any HTML/XHTML images from the pasted content. public String filterIn(String source) { Pattern pattern = Pattern.compile("<img.*?/?>", Pattern.DOTALL); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); } Note that, pasting screenshots on windows gives us the raw image data, and doesn't go through the paste filter. As such, they will not be filtered out. At this stage, I'm unaware of a way to get around this - it may require a new feature for EditLive. Kind regards, Dylan Just Software Engineer Global: +1 (650) 292 9659 x705? Australia: +61 (7) 3858 0100 www.ephox.com -----Original Message----- From: liveworks-bounces@... [mailto:liveworks-bounces@...] On Behalf Of Adrian Sutton Sent: Thursday, 1 May 2008 7:27 PM To: LiveWorks Discussion Subject: Re: [Liveworks] Restricting pasting of images Hi Katrina, > Is there a way to > restrict the images from being pasted through an Ephox setting? Has > anyone else had this issue and what's the recommended approach for > resolving it? There isn't a simple setting for this though it can be done through our advanced APIs and we have had customers do this successfully before. The key point is to use a paste filter as described in this liveworks article: http://liveworks.ephox.com/2008/01/15/filtering-pasted-content/ The article provides a very simplistic filter that changes "cat" to "dog" whereas you'd want to filter out any img tags from the content but the concept is the same. Hope that helps, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ ------------------------------ Message: 3 Date: Fri, 02 May 2008 06:51:30 +0100 From: Adrian Sutton <adrian.sutton@...> Subject: Re: [Liveworks] Restricting pasting of images To: LiveWorks Discussion <liveworks@...> Message-ID: <C4406A72.42FF%adrian.sutton@...> Content-Type: text/plain; charset="US-ASCII" Thanks for that Dylan. > Note that, pasting screenshots on windows gives us the raw image data, and > doesn't go through the paste filter. As such, they will not be filtered out. > At this stage, I'm unaware of a way to get around this - it may require a new > feature for EditLive. This has been fixed in 6.4, it will pass an img tag to the paste filter which this filter would then strip out. Regards, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> ------------------------------ Message: 4 Date: Fri, 02 May 2008 09:19:56 +0100 From: Adrian Sutton <adrian.sutton@...> Subject: Re: [Liveworks] Restricting pasting of images To: LiveWorks Discussion <liveworks@...> Message-ID: <C4408D3C.431F%adrian.sutton@...> Content-Type: text/plain; charset="US-ASCII" > As per Adrian's suggestion, here is paste filter code that will remove any > HTML/XHTML images from the pasted content. To close the loop on this, I've packaged this up as a plugin which can be downloaded directly from LiveWorks ( http://liveworks.ephox.com/plugins/filter-images/). The source code is included and includes a few minor tweaks on Dylan's code. Regards, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> ------------------------------ _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ End of LiveWorks Digest, Vol 8, Issue 2 *************************************** ----------------------------------------- This e-mail and any attachments may contain CONFIDENTIAL information, including PROTECTED HEALTH INFORMATION. If you are not the intended recipient, any use or disclosure of this information is STRICTLY PROHIBITED; you are requested to delete this e-mail and any attachments, notify the sender immediately, and notify the LabCorp Privacy Officer at privacyofficer@... or call (877) 23-HIPAA / (877) 234-4722. _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ |
|
|
Re: LiveWorks Digest, Vol 8, Issue 2Hi Katrina,
Yes, with some slight modifications. Use the installation code from the Filter Images plugin page, but instead of "elj" you need to use "eljInstance". Regards, Andy --- Andrew Herron, Senior Software Engineer Global: +1 (650) 292 9659 x705 Australia: +61 (7) 3858 0100 Ephox <http://www.ephox.com> | Ephox Blogs <http://people.ephox.com> -----Original Message----- From: liveworks-bounces@... [mailto:liveworks-bounces@...] On Behalf Of Katrina Smith Sent: Wednesday, 7 May 2008 9:25 PM To: liveworks@...; liveworks-request@... Subject: Re: [Liveworks] LiveWorks Digest, Vol 8, Issue 2 Thanks! Sorry for the newbie question, but I'm rather new to the Ephox editor and to Java. Do I just add this piece to the customFunctionality.jsp file and it will get loaded along with the EditLiveJavaEditor? Katrina Smith IS Technical Specialist Labcorp Web Technologies 336-436-8829 ext 68829 smithk1@... >>> liveworks-request@... 5/2/2008 1:00:06 PM >>> Send LiveWorks mailing list submissions to liveworks@... To subscribe or unsubscribe via the World Wide Web, visit http://liveworks.ephox.com/mailman/listinfo/liveworks or, via email, send a message with subject or body 'help' to liveworks-request@... You can reach the person managing the list at liveworks-owner@... When replying, please edit your Subject line so it is more specific than "Re: Contents of LiveWorks digest..." Today's Topics: 1. Re: Restricting pasting of images (Dylan Just) 2. Re: Restricting pasting of images (Andrew Herron) 3. Re: Restricting pasting of images (Adrian Sutton) 4. Re: Restricting pasting of images (Adrian Sutton) ---------------------------------------------------------------------- Message: 1 Date: Thu, 1 May 2008 19:41:18 -0400 From: "Dylan Just" <dylan.just@...> Subject: Re: [Liveworks] Restricting pasting of images To: "LiveWorks Discussion" <liveworks@...> Message-ID: <FE7FA9EDB459FD468E020D6609E0EF7304C7B054@...> Content-Type: text/plain; charset="iso-8859-1" Hi, Katrina, As per Adrian's suggestion, here is paste filter code that will remove any HTML/XHTML images from the pasted content. public String filterIn(String source) { Pattern pattern = Pattern.compile("<img.*?/?>", Pattern.DOTALL); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); } Note that, pasting screenshots on windows gives us the raw image data, and doesn't go through the paste filter. As such, they will not be filtered out. At this stage, I'm unaware of a way to get around this - it may require a new feature for EditLive. Kind regards, Dylan Just Software Engineer Global: +1 (650) 292 9659 x705? Australia: +61 (7) 3858 0100 www.ephox.com -----Original Message----- From: liveworks-bounces@... [mailto:liveworks-bounces@...] On Behalf Of Adrian Sutton Sent: Thursday, 1 May 2008 7:27 PM To: LiveWorks Discussion Subject: Re: [Liveworks] Restricting pasting of images Hi Katrina, > Is there a way to > restrict the images from being pasted through an Ephox setting? Has > anyone else had this issue and what's the recommended approach for > resolving it? There isn't a simple setting for this though it can be done through our advanced APIs and we have had customers do this successfully before. The key point is to use a paste filter as described in this liveworks article: http://liveworks.ephox.com/2008/01/15/filtering-pasted-content/ The article provides a very simplistic filter that changes "cat" to "dog" whereas you'd want to filter out any img tags from the content but the concept is the same. Hope that helps, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ ------------------------------ Message: 2 Date: Thu, 1 May 2008 19:58:39 -0400 From: "Andrew Herron" <andrew.herron@...> Subject: Re: [Liveworks] Restricting pasting of images To: "LiveWorks Discussion" <liveworks@...> Message-ID: <FE7FA9EDB459FD468E020D6609E0EF7304C7B060@...> Content-Type: text/plain; charset="iso-8859-1" The way to get around it is to completely override our TransferHandler. This is a fairly advanced technique, but we do have a plugin showing how to do it: http://liveworks.ephox.com/2007/04/02/using-drag-and-drop-to-insert-mult iple-files-into-editlive/ Taking that code, instead of importing with DataFlavor.javaFileListFlavor you want to check for DataFlavor.imageFlavor and imports that use it. If you remove the rest of the drag and drop code (leaving just the delegate sections) you can also remove the Java 1.6 restriction as it will work on any JRE EditLive! supports. Regards, Andy --- Andrew Herron, Senior Software Engineer Global: +1 (650) 292 9659 x705 Australia: +61 (7) 3858 0100 Ephox <http://www.ephox.com> | Ephox Blogs <http://people.ephox.com> -----Original Message----- From: liveworks-bounces@... [mailto:liveworks-bounces@...] On Behalf Of Dylan Just Sent: Friday, 2 May 2008 9:41 AM To: LiveWorks Discussion Subject: Re: [Liveworks] Restricting pasting of images Hi, Katrina, As per Adrian's suggestion, here is paste filter code that will remove any HTML/XHTML images from the pasted content. public String filterIn(String source) { Pattern pattern = Pattern.compile("<img.*?/?>", Pattern.DOTALL); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); } Note that, pasting screenshots on windows gives us the raw image data, and doesn't go through the paste filter. As such, they will not be filtered out. At this stage, I'm unaware of a way to get around this - it may require a new feature for EditLive. Kind regards, Dylan Just Software Engineer Global: +1 (650) 292 9659 x705? Australia: +61 (7) 3858 0100 www.ephox.com -----Original Message----- From: liveworks-bounces@... [mailto:liveworks-bounces@...] On Behalf Of Adrian Sutton Sent: Thursday, 1 May 2008 7:27 PM To: LiveWorks Discussion Subject: Re: [Liveworks] Restricting pasting of images Hi Katrina, > Is there a way to > restrict the images from being pasted through an Ephox setting? Has > anyone else had this issue and what's the recommended approach for > resolving it? There isn't a simple setting for this though it can be done through our advanced APIs and we have had customers do this successfully before. The key point is to use a paste filter as described in this liveworks article: http://liveworks.ephox.com/2008/01/15/filtering-pasted-content/ The article provides a very simplistic filter that changes "cat" to "dog" whereas you'd want to filter out any img tags from the content but the concept is the same. Hope that helps, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ ------------------------------ Message: 3 Date: Fri, 02 May 2008 06:51:30 +0100 From: Adrian Sutton <adrian.sutton@...> Subject: Re: [Liveworks] Restricting pasting of images To: LiveWorks Discussion <liveworks@...> Message-ID: <C4406A72.42FF%adrian.sutton@...> Content-Type: text/plain; charset="US-ASCII" Thanks for that Dylan. > Note that, pasting screenshots on windows gives us the raw image data, and > doesn't go through the paste filter. As such, they will not be filtered out. > At this stage, I'm unaware of a way to get around this - it may require a new > feature for EditLive. This has been fixed in 6.4, it will pass an img tag to the paste filter which this filter would then strip out. Regards, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> ------------------------------ Message: 4 Date: Fri, 02 May 2008 09:19:56 +0100 From: Adrian Sutton <adrian.sutton@...> Subject: Re: [Liveworks] Restricting pasting of images To: LiveWorks Discussion <liveworks@...> Message-ID: <C4408D3C.431F%adrian.sutton@...> Content-Type: text/plain; charset="US-ASCII" > As per Adrian's suggestion, here is paste filter code that will remove any > HTML/XHTML images from the pasted content. To close the loop on this, I've packaged this up as a plugin which can be downloaded directly from LiveWorks ( http://liveworks.ephox.com/plugins/filter-images/). The source code is included and includes a few minor tweaks on Dylan's code. Regards, Adrian Sutton. ______________________ Adrian Sutton, CTO US: +1 (650) 292 9659 x717 UK: +44 (20) 8123 0617 x717 Ephox <http://www.ephox.com/> Ephox Blogs <http://planet.ephox.com/>, Personal Blog <http://www.symphonious.net/> ------------------------------ _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ End of LiveWorks Digest, Vol 8, Issue 2 *************************************** ----------------------------------------- This e-mail and any attachments may contain CONFIDENTIAL information, including PROTECTED HEALTH INFORMATION. If you are not the intended recipient, any use or disclosure of this information is STRICTLY PROHIBITED; you are requested to delete this e-mail and any attachments, notify the sender immediately, and notify the LabCorp Privacy Officer at privacyofficer@... or call (877) 23-HIPAA / (877) 234-4722. _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ _______________________________________________ LiveWorks mailing list LiveWorks@... http://liveworks.ephox.com/mailing-list/ |
| Free Forum Powered by Nabble | Forum Help |