inherit
228599
0
Mar 14, 2024 20:28:42 GMT -8
hanton
68
January 2016
hanton
|
Post by hanton on Feb 11, 2017 8:37:53 GMT -8
|
|
#e61919
Support Staff
224482
0
1
May 17, 2024 16:18:36 GMT -8
Scott
23,384
August 2015
socalso
|
Post by Scott on Feb 11, 2017 9:11:03 GMT -8
hanton Add this to your global header to disable, right-click, cut, copy & paste: Note this also disables the keyboard equivalent. not just the right-click. <script type="text/javascript"> $(document).ready(function () { //Disable cut copy paste $('body').bind('cut copy paste', function (e) { e.preventDefault(); }); //Disable mouse right click $("body").on("contextmenu",function(e){ return false; }); }); </script> If you add this code instead to the global header, it will just disable the right-click function: <script type="text/javascript"> $(document).ready(function () { //Disable full page $("body").on("contextmenu",function(e){ return false; }); //Disable part of page $("#id").on("contextmenu",function(e){ return false; }); }); </script> Additionally, this code will disable the cut, copy, paste, and leave the right-click in place: <script type="text/javascript"> $(document).ready(function () { //Disable full page $('body').bind('cut copy paste', function (e) { e.preventDefault(); }); //Disable part of page $('#id').bind('cut copy paste', function (e) { e.preventDefault(); }); }); </script>
Should note as well that this can be easily circumvented if someone disables javascript. And there could be other ways as well.
|
|
inherit
228599
0
Mar 14, 2024 20:28:42 GMT -8
hanton
68
January 2016
hanton
|
Post by hanton on Feb 11, 2017 9:31:16 GMT -8
Will this disable it on the whole site? I'd like to do it at the board or Thread level only
|
|
#e61919
Support Staff
224482
0
1
May 17, 2024 16:18:36 GMT -8
Scott
23,384
August 2015
socalso
|
Post by Scott on Feb 11, 2017 9:54:22 GMT -8
hanton, putting in the global header does do it for whole site. You can just put it in the header for a particular board or category.
|
|
#e61919
Support Staff
224482
0
1
May 17, 2024 16:18:36 GMT -8
Scott
23,384
August 2015
socalso
|
Post by Scott on Feb 11, 2017 10:02:09 GMT -8
hanton, as with any code, after implementing, make sure to test it.
|
|
xx1
Junior Member
Posts: 225
inherit
194450
0
May 2, 2024 5:17:05 GMT -8
xx1
225
May 2013
xx1
|
Post by xx1 on Jan 23, 2023 10:25:39 GMT -8
Thanks Scott, I'll give it a try in the Header.
|
|