Plugin Directory

Changeset 2473589


Ignore:
Timestamp:
02/12/2021 09:01:55 AM (5 years ago)
Author:
immeet94
Message:

update the new nersion and fix the issue

Location:
disable-right-click-and-content-copy-protection/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • disable-right-click-and-content-copy-protection/trunk/disable-right-click-and-content-copy-protection.php

    r2340461 r2473589  
    66Tags: prevent right click, disable right click, stop image saving with right click, copyright protection, no copy paste.
    77Author: Meet Makadia
    8 Version: 1.3
     8Version: 1.4
    99Author URI: https://profiles.wordpress.org/immeet94/
    1010*/
  • disable-right-click-and-content-copy-protection/trunk/drcacc_disable.js

    r2340448 r2473589  
    11jQuery( 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    }
    511
    6     jQuery( 'img' ).bind( "contextmenu", function() {
     12    function drcacc_nocontext(e) {
    713        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    }
    930
    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    }
    1383
    1484});
  • disable-right-click-and-content-copy-protection/trunk/readme.txt

    r2340461 r2473589  
    66Donate link:  https://www.paypal.me/Immeet94
    77Requires at least: 3.9
    8 Tested up to: 5.4
    9 Version: 1.3
     8Tested up to: 5.6.1
     9Version: 1.4
    1010License: GPLv2 or later
    1111
     
    1818
    1919== Changelog ==
     20= 1.4 =
     21* search and password input type fix
    2022 
    2123= 1.3 =
Note: See TracChangeset for help on using the changeset viewer.