Advertisement
Rengele

Untitled

Jan 11th, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. <script language=JavaScript>
  2. <!--
  3.  
  4. var message="Can't click RETARD!";
  5.  
  6. ///////////////////////////////////
  7. function clickIE4(){
  8. if (event.button==2){
  9. alert(message);
  10. return false;
  11. }
  12. }
  13.  
  14. function clickNS4(e){
  15. if (document.layers||document.getElementById&&!document.all){
  16. if (e.which==2||e.which==3){
  17. alert(message);
  18. return false;
  19. }
  20. }
  21. }
  22.  
  23. if (document.layers){
  24. document.captureEvents(Event.MOUSEDOWN);
  25. document.onmousedown=clickNS4;
  26. }
  27. else if (document.all&&!document.getElementById){
  28. document.onmousedown=clickIE4;
  29. }
  30.  
  31. document.oncontextmenu=new Function("alert(message);return false")
  32.  
  33. // -->
  34. </script>
  35. <script language="javascript">
  36. document.onmousedown=disableclick;
  37. status="Right Click Disabled";
  38. Function disableclick(e)
  39. {
  40. if(event.button==2)
  41. {
  42. alert(status);
  43. return false;
  44. }
  45. }
  46. </script>
  47.  
  48. <script language="JavaScript">
  49.  
  50. //////////F12 disable code////////////////////////
  51. document.onkeypress = function (event) {
  52. event = (event || window.event);
  53. if (event.keyCode == 123) {
  54. //alert('No F-12');
  55. return false;
  56. }
  57. }
  58. document.onmousedown = function (event) {
  59. event = (event || window.event);
  60. if (event.keyCode == 123) {
  61. //alert('No F-keys');
  62. return false;
  63. }
  64. }
  65. document.onkeydown = function (event) {
  66. event = (event || window.event);
  67. if (event.keyCode == 123) {
  68. //alert('No F-keys');
  69. return false;
  70. }
  71. }
  72. /////////////////////end///////////////////////
  73.  
  74.  
  75. //Disable right click script
  76. //visit http://www.rainbow.arch.scriptmania.com/scripts/
  77. var message="Sorry, right-click has been disabled";
  78. ///////////////////////////////////
  79. function clickIE() {if (document.all) {(message);return false;}}
  80. function clickNS(e) {if
  81. (document.layers||(document.getElementById&&!document.all)) {
  82. if (e.which==2||e.which==3) {(message);return false;}}}
  83. if (document.layers)
  84. {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
  85. else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
  86. document.oncontextmenu=new Function("return false")
  87. //
  88. function disableCtrlKeyCombination(e)
  89. {
  90. //list all CTRL + key combinations you want to disable
  91. var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j' , 'w');
  92. var key;
  93. var isCtrl;
  94. if(window.event)
  95. {
  96. key = window.event.keyCode; //IE
  97. if(window.event.ctrlKey)
  98. isCtrl = true;
  99. else
  100. isCtrl = false;
  101. }
  102. else
  103. {
  104. key = e.which; //firefox
  105. if(e.ctrlKey)
  106. isCtrl = true;
  107. else
  108. isCtrl = false;
  109. }
  110. //if ctrl is pressed check if other key is in forbidenKeys array
  111. if(isCtrl)
  112. {
  113. for(i=0; i<forbiddenKeys.length; i++)
  114. {
  115. //case-insensitive comparation
  116. if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
  117. {
  118. alert('Key combination CTRL + '+String.fromCharCode(key) +' has been disabled.');
  119. return false;
  120. }
  121. }
  122. }
  123. return true;
  124. }
  125.  
  126. //ctrl+u not allowed
  127. document.onkeydown = function(e) {
  128. if (e.ctrlKey &&
  129. e.keyCode === 86 ||
  130. (e.keyCode === 67 ||
  131. e.keyCode === 85 ||
  132. e.keyCode === 117)) {
  133. alert('not allowed');
  134. return false;
  135. } else {
  136. return true;
  137. }
  138. };
  139.  
  140. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement