What would you like done?
I know this is ridiculous but my users are photographers and many of them are older folks and don’t understand how easy this is to bypass, so just go with me here.
I do not want to turn off pointer events because I still want the users to be able to zoom in to the full size image, and I don’t want to disable right click globally and reduce functionality.
I have tried this script for the thumbnail which only works when you refresh the page
<script type="text/javascript">
$(document).ready(function(){
$("img").bind("contextmenu",function(e){
return false;
});
});
</script>
Any creative ideas on how to get this working without losing functionality?
When do you need it done?
ASAP
What is your budget, in $ USD that you can offer for this task?
$100
3 Likes
fefrei
(Felix Freiberger)
September 5, 2018, 7:03pm
2
The onPageChange
event should help you:
So, you want to create Discourse themes? Not sure where to start? Or maybe you have created Discourse themes before, but want to learn how to do even more cool things. Well, you’ve come to the right place
Developer’s guide to Discourse Themes
Subjects include a general overview of Discourse themes, creating and sharing Discourse themes, theme development examples, searching for and finding information / examples in the Discourse repository, and best practices.
Prerequisites:
…
It’s executed whenever the user navigates in Discourse. $(document).ready
isn’t enough because Discourse normally avoids full page reloads.
Something like this could work for you:
<script type="text/discourse-plugin" version="0.8">
api.onPageChange((url, title) => {
$("img").bind("contextmenu",function(e) {
return false;
});
});
</script>
This doesn’t handle posts that are inserted into the page by infinite scrolling, but maybe it’s enough to appease your users
(I understand this is a marketplace post and you are looking for a fully baked solution. This isn’t that, but I thought it might still help.)
3 Likes
I think this was already answered elsewhere?
Yes, I’m not sure where the replies went, but I do not need this anymore.
Thank you @fefrei for chiming in.
This what I ultimately went with
<script type="text/discourse-plugin" version="0.8">
const TopicRoute = require("discourse/routes/topic").default;
TopicRoute.reopen({
activate: function() {
this._super();
Em.run.next(function() {
$('body').on('contextmenu', '.cooked img, .mfp-img', function(e){ return false; });
});
}
});
</script>
8 Likes
system
(system)
Closed
October 6, 2018, 12:54am
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.