Advertisement
artterror

anti

Jan 11th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.83 KB | None | 0 0
  1. <script id="wpcp_disable_selection" type="text/javascript">
  2. //<![CDATA[
  3. var image_save_msg='You Can Not Save images!';
  4.     var no_menu_msg='Context Menu disabled!';
  5.     var smessage = "Content is protected !!";
  6. function disableEnterKey(e){
  7.     if (e.ctrlKey){
  8.     var key;
  9.     if(window.event)
  10.          key = window.event.keyCode;     //IE
  11.     else
  12.          key = e.which;     //firefox (97)
  13.    //if (key != 17) alert(key);
  14.     if (key == 97 || key == 65 || key == 67 || key == 99 || key == 88 || key == 120 || key == 26 || key == 85  || key == 86 || key == 83 || key == 43)
  15.     {
  16.          show_wpcp_message('You are not allowed to copy content or view source');
  17.          return false;
  18.     }else
  19.         return true;
  20.     }
  21. }
  22. function disable_copy(e){  
  23.     var elemtype = e.target.nodeName;
  24.     var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);
  25.     elemtype = elemtype.toUpperCase();
  26.     var checker_IMG = '';
  27.     if (elemtype == "IMG" && checker_IMG == 'checked' && e.detail >= 2) {show_wpcp_message(alertMsg_IMG);return false;}
  28.     if (elemtype != "TEXT" && elemtype != "TEXTAREA" && elemtype != "INPUT" && elemtype != "PASSWORD" && elemtype != "SELECT" && elemtype != "OPTION" && elemtype != "EMBED")
  29.     {
  30.         if (smessage !== "" && e.detail == 2)
  31.             show_wpcp_message(smessage);
  32.        
  33.         if (isSafari)
  34.             return true;
  35.         else
  36.             return false;
  37.     }  
  38. }
  39. function disable_copy_ie(){
  40.     var elemtype = window.event.srcElement.nodeName;
  41.     elemtype = elemtype.toUpperCase();
  42.     if (elemtype == "IMG") {show_wpcp_message(alertMsg_IMG);return false;}
  43.     if (elemtype != "TEXT" && elemtype != "TEXTAREA" && elemtype != "INPUT" && elemtype != "PASSWORD" && elemtype != "SELECT" && elemtype != "OPTION" && elemtype != "EMBED")
  44.     {
  45.         //alert(navigator.userAgent.indexOf('MSIE'));
  46.             //if (smessage !== "") show_wpcp_message(smessage);
  47.         return false;
  48.     }
  49. }  
  50. function reEnable(){
  51.     return true;
  52. }
  53. document.onkeydown = disableEnterKey;
  54. document.onselectstart = disable_copy_ie;
  55. if(navigator.userAgent.indexOf('MSIE')==-1){
  56.     document.onmousedown = disable_copy;
  57.     document.onclick = reEnable;
  58. }
  59. function disableSelection(target){
  60.    //For IE This code will work
  61.    if (typeof target.onselectstart!="undefined")
  62.    target.onselectstart = disable_copy_ie;
  63.    
  64.    //For Firefox This code will work
  65.    else if (typeof target.style.MozUserSelect!="undefined")
  66.    {target.style.MozUserSelect="none";}
  67.    
  68.    //All other  (ie: Opera) This code will work
  69.    else
  70.    target.onmousedown=function(){return false}
  71.    target.style.cursor = "default";
  72. }
  73. //Calling the JS function directly just after body load
  74. window.onload = function(){disableSelection(document.body);};
  75. //]]>
  76. </script>
  77.     <script id="wpcp_disable_Right_Click" type="text/javascript">
  78.     //<![CDATA[
  79.     document.ondragstart = function() { return false;}
  80.     /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  81.     Disable context menu on images by GreenLava Version 1.0
  82.     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
  83.         function nocontext(e) {
  84.            return false;
  85.         }
  86.         document.oncontextmenu = nocontext;
  87.     //]]>
  88.     </script>
  89. <style>
  90. .unselectable {
  91.     -moz-user-select:none;
  92.     -webkit-user-select:none;
  93.     cursor: default;
  94. }
  95. html{
  96.     -webkit-touch-callout: none;
  97.     -webkit-user-select: none;
  98.     -khtml-user-select: none;
  99.     -moz-user-select: none;
  100.     -ms-user-select: none;
  101.     user-select: none;
  102.     -webkit-tap-highlight-color: rgba(0,0,0,0);
  103. }
  104. </style>
  105. <script id="wpcp_css_disable_selection" type="text/javascript">
  106.     var e = document.getElementsByTagName('body')[0];
  107.     if(e) {
  108.         e.setAttribute('unselectable',on);
  109.     }
  110. </script>
  111.  
  112.     <div id="wpcp-error-message" class="msgmsg-box-wpcp warning-wpcp hideme"><span>error: </span>Content is protected !!</div>
  113.     <script>
  114.     var timeout_result;
  115.     function show_wpcp_message(smessage)
  116.     {
  117.         if (smessage !== "")
  118.             {
  119.             var smessage_text = '<span>Alert: </span>'+smessage;
  120.             document.getElementById("wpcp-error-message").innerHTML = smessage_text;
  121.             document.getElementById("wpcp-error-message").className = "msgmsg-box-wpcp warning-wpcp showme";
  122.             clearTimeout(timeout_result);
  123.             timeout_result = setTimeout(hide_message, 3000);
  124.             }
  125.     }
  126.     function hide_message()
  127.     {
  128.         document.getElementById("wpcp-error-message").className = "msgmsg-box-wpcp warning-wpcp hideme";
  129.     }
  130.     </script>
  131.     <style type="text/css">
  132.     #wpcp-error-message {
  133.         direction: ltr;
  134.         text-align: center;
  135.         transition: opacity 900ms ease 0s;
  136.         z-index: 99999999;
  137.     }
  138.     .hideme {
  139.         opacity:0;
  140.         visibility: hidden;
  141.     }
  142.     .showme {
  143.         opacity:1;
  144.         visibility: visible;
  145.     }
  146.     .msgmsg-box-wpcp {
  147.         border-radius: 10px;
  148.         color: #555;
  149.         font-family: Tahoma;
  150.         font-size: 11px;
  151.         margin: 10px;
  152.         padding: 10px 36px;
  153.         position: fixed;
  154.         width: 255px;
  155.         top: 50%;
  156.         left: 50%;
  157.         margin-top: -10px;
  158.         margin-left: -130px;
  159.         -webkit-box-shadow: 0px 0px 34px 2px rgba(242,191,191,1);
  160.         -moz-box-shadow: 0px 0px 34px 2px rgba(242,191,191,1);
  161.         box-shadow: 0px 0px 34px 2px rgba(242,191,191,1);
  162.     }
  163.     .msgmsg-box-wpcp span {
  164.         font-weight:bold;
  165.         text-transform:uppercase;
  166.     }
  167.     .error-wpcp {       background:#ffecec url('http://www.urbane.co.id/wp-content/plugins/wp-content-copy-protector/images/error.png') no-repeat 10px 50%;
  168.         border:1px solid #f5aca6;
  169.     }
  170.     .success {
  171.         background:#e9ffd9 url('http://www.urbane.co.id/wp-content/plugins/wp-content-copy-protector/images/success.png') no-repeat 10px 50%;
  172.         border:1px solid #a6ca8a;
  173.     }
  174.     .warning-wpcp {
  175.         background:#ffecec url('http://www.urbane.co.id/wp-content/plugins/wp-content-copy-protector/images/warning.png') no-repeat 10px 50%;
  176.         border:1px solid #f5aca6;
  177.     }
  178.     .notice {
  179.         background:#e3f7fc url('http://www.urbane.co.id/wp-content/plugins/wp-content-copy-protector/images/notice.png') no-repeat 10px 50%;
  180.         border:1px solid #8ed9f6;
  181.     }
  182.     </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement