Changeset 2473589
- Timestamp:
- 02/12/2021 09:01:55 AM (5 years ago)
- Location:
- disable-right-click-and-content-copy-protection/trunk
- Files:
-
- 3 edited
-
disable-right-click-and-content-copy-protection.php (modified) (1 diff)
-
drcacc_disable.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-right-click-and-content-copy-protection/trunk/disable-right-click-and-content-copy-protection.php
r2340461 r2473589 6 6 Tags: prevent right click, disable right click, stop image saving with right click, copyright protection, no copy paste. 7 7 Author: Meet Makadia 8 Version: 1. 38 Version: 1.4 9 9 Author URI: https://profiles.wordpress.org/immeet94/ 10 10 */ -
disable-right-click-and-content-copy-protection/trunk/drcacc_disable.js
r2340448 r2473589 1 1 jQuery( document ).ready( function( event ) { 2 jQuery( document ).bind( "contextmenu", function() { 3 return false; 4 }); 2 3 window.onload = function(){drcacc_disableSelection(document.body);}; 4 document.oncontextmenu = drcacc_nocontext; 5 document.onkeydown = drcacc_disableEnterKey; 6 document.onselectstart = drcacc_disableCopyIE; 7 if(navigator.userAgent.indexOf('MSIE')==-1) { 8 document.onmousedown = drcacc_disableCopy; 9 document.onclick = drcacc_reEnable; 10 } 5 11 6 jQuery( 'img' ).bind( "contextmenu", function() {12 function drcacc_nocontext(e) { 7 13 return false; 8 }); 14 } 15 16 function drcacc_disableSelection(target){ 17 //For IE 18 if (typeof target.onselectstart!="undefined") 19 target.onselectstart = drcacc_disableCopyIE; 20 21 //For Firefox 22 else if (typeof target.style.MozUserSelect!="undefined") 23 {target.style.MozUserSelect="none";} 24 25 //All other 26 else 27 target.onmousedown=function(){return false} 28 target.style.cursor = "default"; 29 } 9 30 10 jQuery(document).keydown(function(e){ 11 e.preventDefault(); 12 }); 31 function drcacc_disableCopyIE() { 32 var e = e || window.event; 33 var elemtype = window.event.srcElement.nodeName; 34 elemtype = elemtype.toUpperCase(); 35 if (elemtype == "IMG") {return false;} 36 if (elemtype != "TEXT" && elemtype != "TEXTAREA" && elemtype != "INPUT" && elemtype != "PASSWORD" && elemtype != "SELECT" && elemtype != "OPTION" && elemtype != "EMBED"){ 37 return false; 38 } 39 } 40 41 function drcacc_disableEnterKey(e){ 42 var elemtype = e.target.tagName; 43 elemtype = elemtype.toUpperCase(); 44 if (elemtype == "TEXT" || elemtype == "TEXTAREA" || elemtype == "INPUT" || elemtype == "PASSWORD" || elemtype == "SELECT" || elemtype == "OPTION" || elemtype == "EMBED"){ 45 elemtype = 'TEXT'; 46 } 47 48 if (e.ctrlKey){ 49 var key; 50 if(window.event) 51 key = window.event.keyCode; //IE 52 else 53 key = e.which; 54 55 if (elemtype!= 'TEXT' && (key == 26 || key == 43 || key == 65 || key == 67 || key == 73 || key == 83 || key == 85 || key == 86 || key == 88 || key == 97 || key == 99 || key == 120)){ 56 return false; 57 }else 58 return true; 59 } 60 } 61 62 function drcacc_disableCopy(e){ 63 var e = e || window.event; 64 var elemtype = e.target.tagName; 65 elemtype = elemtype.toUpperCase(); 66 67 if (elemtype == "TEXT" || elemtype == "TEXTAREA" || elemtype == "INPUT" || elemtype == "PASSWORD" || elemtype == "SELECT" || elemtype == "OPTION" || elemtype == "EMBED"){ 68 elemtype = 'TEXT'; 69 } 70 var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor); 71 if (elemtype == "IMG" && e.detail >= 2) {show_wpcp_message(alertMsg_IMG);return false;} 72 if (elemtype != "TEXT") { 73 if (isSafari) 74 return true; 75 else 76 return false; 77 } 78 } 79 80 function drcacc_reEnable(){ 81 return true; 82 } 13 83 14 84 }); -
disable-right-click-and-content-copy-protection/trunk/readme.txt
r2340461 r2473589 6 6 Donate link: https://www.paypal.me/Immeet94 7 7 Requires at least: 3.9 8 Tested up to: 5. 49 Version: 1. 38 Tested up to: 5.6.1 9 Version: 1.4 10 10 License: GPLv2 or later 11 11 … … 18 18 19 19 == Changelog == 20 = 1.4 = 21 * search and password input type fix 20 22 21 23 = 1.3 =
Note: See TracChangeset
for help on using the changeset viewer.