Thank you a lot.
I don’t know what is !important but it works, the trailing .. do not seem too important ![]()
This is how the CSS and Scripts are now and we get the desire behavior: none of the images in the site can be downloaded using the right click over them and the download links in the lightbox are hidden.
Thanks for your guidance.
CSS
.image-source-link
{
display: none !important;
}
Header scripts:
<script type="text/discourse-plugin" version="0.8">
api.onPageChange((url, title) => {
$("img").on("contextmenu", function(e) {
e.preventDefault();
});
});
</script>
<script type="text/discourse-plugin" version="0.8">
api.onPageChange((url, title) => {
$("body").on("contextmenu", ".cooked img, .mfp-figure, .lightbox-wrapper", function(e) {
e.preventDefault();
});
});
</script>
The first one seems to disable the context menu on other images in the site like icons or avatar thumnails.
The second one works for images in a post and the lightbox.