Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

patched mediabox.js inconsistent regarding contextmenu #7501

Closed
fritzmg opened this issue Dec 7, 2014 · 8 comments
Closed

patched mediabox.js inconsistent regarding contextmenu #7501

fritzmg opened this issue Dec 7, 2014 · 8 comments
Labels
Milestone

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Dec 7, 2014

Contao's version of the mediabox.js adds the following patch, to enable the contextmenu on image links by default:

// PATCH: enable the contextmenu
//links.addEvent('contextmenu', function(e){
//  if (this.toString().match(/\.gif|\.jpg|\.jpeg|\.png/i)) e.stop();
//});
// PATCH EOF

However, the contextmenu on the actual image is still disabled. In order to enable it, the following line (#900) needs to be disabled:

preload.addEvent('mousedown', function(e){ e.stop(); }).addEvent('contextmenu', function(e){ e.stop(); });

But may be it would be better to upgrade the mediabox to its newest version. mediabox 1.5.x introduces this option:

clickBlock: true, // Adds an event on right-click to block saving of images from the context menu in most browsers (this can't prevent other ways of downloading, but works as a casual deterent).

When clickBlock is false, both the already patched part and the part I mentioned will be disabled.

@Aybee
Copy link
Contributor

Aybee commented Dec 7, 2014

Where have you found a version 1.5.x of mediabox?

@fritzmg
Copy link
Contributor Author

fritzmg commented Dec 8, 2014

On the website (and Github). However, I just noticed, that there is no stable release yet.

@Aybee
Copy link
Contributor

Aybee commented Dec 8, 2014

Yes I know both sites that's why I asked where you found a 1.5 version. I can't find one, no stable and no alpha or beta.

@fritzmg
Copy link
Contributor Author

fritzmg commented Dec 8, 2014

The master branch contains the 1.5.x version: https://github.com/iaian7/mediaboxAdvanced/blob/master/Source/mediaboxAdv.js

@Aybee
Copy link
Contributor

Aybee commented Dec 8, 2014

Ah, ok, sorry forgot to look at the master. Three years old 😳

@leofeyer leofeyer added this to the 3.2.17 milestone Dec 15, 2014
@fritzmg fritzmg changed the title patched mediabox.js iconsistent regarding contextmenu patched mediabox.js inconsistent regarding contextmenu Dec 17, 2014
@leofeyer
Copy link
Member

Too bad the maintainer did not tag their releases, otherwise we would have known that there is a version 1.5 :(

@leofeyer
Copy link
Member

I have updated the Contao mediabox component accordingly, however, it requires to adjust the moo_mediabox template and can therefore only be included in Contao 4.

So for Contao 3, I have just commented out line 900 in 46e670f to fix the issue.

@fritzmg
Copy link
Contributor Author

fritzmg commented Jan 21, 2015

Sounds good :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants