Hi all, i''ve a page with many images on it and i have to disable right click menu on the images of class ''items'' so that''s what i do: $$(''.items'').each(function (img) { img.observe(''mousedown'', function (e) { var button; if (window.event) { button = e.button; } else { button = e.which; } if (button > 1) { e.stop(); return false; } }); img.observe(''mouseup'', function (e) { var button; if (window.event) { button = e.button; } else { button = e.which; } if (button > 1) { e.stop(); return false; } }); }); But right click menu is still working... where''s my mistake? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
that seemed to work for me in FF3, make sure the ''items'' class name is on each img. Also you might want to try the contextmenu event... $$(''.items'').each(function(i) { i.observe(''contextmenu'', function(e) {e.stop();}) }); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
This might catch more: $$(''.items'').each(function(i) { i.observe(''contextmenu'', function(e) {e.stop();}) }).observe(''click'',function(e) { if (e.isRightClick()) e.stop(); }); On Mon, Jun 30, 2008 at 6:56 AM, darrin <darrin.holst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > that seemed to work for me in FF3, make sure the ''items'' class name is > on each img. > > Also you might want to try the contextmenu event... > > $$(''.items'').each(function(i) { > i.observe(''contextmenu'', function(e) {e.stop();}) > }); > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
"contextmenu" (as darrin pointed out) works quite reliably, except for Opera which simply ignores it: $$(''.items'').invoke(''observe'', ''contextmenu'', Event.stop); -- kangax On Jun 29, 12:10 pm, Stefano Esposito <stefano.esposit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > i''ve a page with many images on it and i have to disable right click > menu on the images of class ''items'' so that''s what i do: > > $$(''.items'').each(function (img) { > img.observe(''mousedown'', function (e) { > var button; > if (window.event) { > button = e.button; > } else { > button = e.which; > } > > if (button > 1) { > e.stop(); > return false; > } > }); > img.observe(''mouseup'', function (e) { > var button; > if (window.event) { > button = e.button; > } else { > button = e.which; > } > > if (button > 1) { > e.stop(); > return false; > } > }); > }); > > But right click menu is still working... where''s my mistake?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 30, 2:10 am, Stefano Esposito <stefano.esposit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > i''ve a page with many images on it and i have to disable right click > menu on the images of class ''items'' so that''s what i do:Attempting to disable the context menu is usually done to try and stop people copying text or images from a site. It is futile exercise, as anyone who wants to copy content will work out how to do it without using the context menu. All you end up doing is removing functionality for no good reason, which is a really good way to annoy users. -- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, 29 Jun 2008 23:16:37 -0700 (PDT) RobG <rgqld-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> Attempting to disable the context menu is usually done to try and stop > people copying text or images from a site. It is futile exercise, as > anyone who wants to copy content will work out how to do it without > using the context menu. All you end up doing is removing > functionality for no good reason, which is a really good way to annoy > users.Poor, little Troll :P Thanks for the contextmenu hint, it worked like a charm... not on Opera, of course, but i don''t have to support it, luckily enough. :) Ciao, Stefano --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Actually, RobG is a regular contributer and gives some pretty good advice. I certainly wouldn''t stick a "troll" label on him so quickly. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
> Attempting to disable the context menu is usually done to try and stop > people copying text or images from a site. It is futile exercise, as > anyone who wants to copy content will work out how to do it without > using the context menu. All you end up doing is removing > functionality for no good reason, which is a really good way to annoy > users.Locking down source is a futile effort, but allowing custom context menus is a fabulous feature. I find the Context Menu in Google Documents to be quite a delightful UI option, I would have no use for the standard menu in that view. -- Matt Foster Ajax Engineer Nth Penguin, LLC http://www.nthpenguin.com On Jun 30, 2:16 am, RobG <rg...-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> On Jun 30, 2:10 am, Stefano Esposito <stefano.esposit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > Hi all, > > > i''ve a page with many images on it and i have to disable right click > > menu on the images of class ''items'' so that''s what i do: > > Attempting to disable the context menu is usually done to try and stop > people copying text or images from a site. It is futile exercise, as > anyone who wants to copy content will work out how to do it without > using the context menu. All you end up doing is removing > functionality for no good reason, which is a really good way to annoy > users. > > -- > Rob--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Mon, Jun 30, 2008 at 3:58 PM, Matt Foster <mattfoster01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Locking down source is a futile effort, but allowing custom context > menus is a fabulous feature. I find the Context Menu in Google > Documents to be quite a delightful UI option, I would have no use for > the standard menu in that view.True enough, but this thread is clearly about blocking right-clicks on certain elements (images) for the sole purpose of stopping people from saving the images. -justin (not a troll) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
At the risk of being called a troll, I thought I''d just ask: Why not use image cloaking? Doing that would prevent users from saving images even better than the right-click disable, as it would also prevent them from saving the image by dragging it from the page to their desktop. With cloaking, you''d write some css to place a transparent gif directly over the images you want to protect, so that when users tried to save the image, they''d just end up with the transparent image, instead of the one you don''t want them to save. This would also cover the ol'' drag off the page trick, where the right click option wouldn''t. I''m on the anti-disable-right-click side of the fence, obviously, as there are more features in that contextual menu than just ''save this image''. There''s also ''bookmark this page'', and I''d imagine you''d want your users to have access to that. :) On Jun 29, 11:10 am, Stefano Esposito <stefano.esposit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > i''ve a page with many images on it and i have to disable right click > menu on the images of class ''items'' so that''s what i do: > > $$(''.items'').each(function (img) { > img.observe(''mousedown'', function (e) { > var button; > if (window.event) { > button = e.button; > } else { > button = e.which; > } > > if (button > 1) { > e.stop(); > return false; > } > }); > img.observe(''mouseup'', function (e) { > var button; > if (window.event) { > button = e.button; > } else { > button = e.which; > } > > if (button > 1) { > e.stop(); > return false; > } > }); > }); > > But right click menu is still working... where''s my mistake?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 01 Jul 2008, at 17:26, Jeff Keen wrote:> At the risk of being called a troll, I thought I''d just ask: Why not > use image cloaking? Doing that would prevent users from saving images > even better than the right-click disable, as it would also prevent > them from saving the image by dragging it from the page to their > desktop. > > With cloaking, you''d write some css to place a transparent gif > directly over the images you want to protect, so that when users tried > to save the image, they''d just end up with the transparent image, > instead of the one you don''t want them to save. This would also cover > the ol'' drag off the page trick, where the right click option > wouldn''t. > > I''m on the anti-disable-right-click side of the fence, obviously, as > there are more features in that contextual menu than just ''save this > image''. There''s also ''bookmark this page'', and I''d imagine you''d want > your users to have access to that. :)Still, View Page Source will still get the user what he wants. It''s a fake sense of security. The only way to protect images on your website from distribution, is by visible watermarking (using RMagick for example). Then they can save all they want, the picture will never be usable somewhere else without having your mark on it, no matter how subtle it is. So: watermark the image using RMagick, write it away in a public accessible file (with the watermark) for caching, so you don''t have to run each image through RMagick every time (only the non- watermarked pictures will need to be generated). Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
The only other thing i can think of is actually making Ajax requests and using the css hack of embedding images as binary arrays in css. That way they can only get binary data out of your system. But even that probably has its problems.... bottom line if you dont want people to steal.. then you are probably going to have to use proprietary systems like flash... but then again print screen is always avaialable. If its on the web then its fair game. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon-YEnD+YylA9E@public.gmane.org or 89iroc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org On Tue, Jul 1, 2008 at 10:48 AM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > On 01 Jul 2008, at 17:26, Jeff Keen wrote: > > At the risk of being called a troll, I thought I''d just ask: Why not > use image cloaking? Doing that would prevent users from saving images > even better than the right-click disable, as it would also prevent > them from saving the image by dragging it from the page to their > desktop. > > With cloaking, you''d write some css to place a transparent gif > directly over the images you want to protect, so that when users tried > to save the image, they''d just end up with the transparent image, > instead of the one you don''t want them to save. This would also cover > the ol'' drag off the page trick, where the right click option > wouldn''t. > > I''m on the anti-disable-right-click side of the fence, obviously, as > there are more features in that contextual menu than just ''save this > image''. There''s also ''bookmark this page'', and I''d imagine you''d want > your users to have access to that. :) > > > Still, View Page Source will still get the user what he wants. It''s a fake > sense of security. The only way to protect images on your website from > distribution, is by visible watermarking (using RMagick for example). Then > they can save all they want, the picture will never be usable somewhere else > without having your mark on it, no matter how subtle it is. So: watermark > the image using RMagick, write it away in a public accessible file (with the > watermark) for caching, so you don''t have to run each image through RMagick > every time (only the non-watermarked pictures will need to be generated). > > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---