Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script language=JavaScript>
- <!--
- var message="Can't click RETARD!";
- ///////////////////////////////////
- function clickIE4(){
- if (event.button==2){
- alert(message);
- return false;
- }
- }
- function clickNS4(e){
- if (document.layers||document.getElementById&&!document.all){
- if (e.which==2||e.which==3){
- alert(message);
- return false;
- }
- }
- }
- if (document.layers){
- document.captureEvents(Event.MOUSEDOWN);
- document.onmousedown=clickNS4;
- }
- else if (document.all&&!document.getElementById){
- document.onmousedown=clickIE4;
- }
- document.oncontextmenu=new Function("alert(message);return false")
- // -->
- </script>
- <script language="javascript">
- document.onmousedown=disableclick;
- status="Right Click Disabled";
- Function disableclick(e)
- {
- if(event.button==2)
- {
- alert(status);
- return false;
- }
- }
- </script>
- <script language="JavaScript">
- //////////F12 disable code////////////////////////
- document.onkeypress = function (event) {
- event = (event || window.event);
- if (event.keyCode == 123) {
- //alert('No F-12');
- return false;
- }
- }
- document.onmousedown = function (event) {
- event = (event || window.event);
- if (event.keyCode == 123) {
- //alert('No F-keys');
- return false;
- }
- }
- document.onkeydown = function (event) {
- event = (event || window.event);
- if (event.keyCode == 123) {
- //alert('No F-keys');
- return false;
- }
- }
- /////////////////////end///////////////////////
- //Disable right click script
- //visit http://www.rainbow.arch.scriptmania.com/scripts/
- var message="Sorry, right-click has been disabled";
- ///////////////////////////////////
- function clickIE() {if (document.all) {(message);return false;}}
- function clickNS(e) {if
- (document.layers||(document.getElementById&&!document.all)) {
- if (e.which==2||e.which==3) {(message);return false;}}}
- if (document.layers)
- {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
- else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
- document.oncontextmenu=new Function("return false")
- //
- function disableCtrlKeyCombination(e)
- {
- //list all CTRL + key combinations you want to disable
- var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j' , 'w');
- var key;
- var isCtrl;
- if(window.event)
- {
- key = window.event.keyCode; //IE
- if(window.event.ctrlKey)
- isCtrl = true;
- else
- isCtrl = false;
- }
- else
- {
- key = e.which; //firefox
- if(e.ctrlKey)
- isCtrl = true;
- else
- isCtrl = false;
- }
- //if ctrl is pressed check if other key is in forbidenKeys array
- if(isCtrl)
- {
- for(i=0; i<forbiddenKeys.length; i++)
- {
- //case-insensitive comparation
- if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
- {
- alert('Key combination CTRL + '+String.fromCharCode(key) +' has been disabled.');
- return false;
- }
- }
- }
- return true;
- }
- //ctrl+u not allowed
- document.onkeydown = function(e) {
- if (e.ctrlKey &&
- e.keyCode === 86 ||
- (e.keyCode === 67 ||
- e.keyCode === 85 ||
- e.keyCode === 117)) {
- alert('not allowed');
- return false;
- } else {
- return true;
- }
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement