
Adventure










//Alert: Content is protected !!";
function disable_hot_keys(e)
{
var key2;
if(window.event)
key2 = window.event.keyCode; //IE
else
key2 = e.which; //firefox (97)
if (key2 == 123)//F12 chrome developer key disable
{
show_wccp_pro_message('You are not allowed to print or save this page!!');
return false;
}
var elemtype = e.target.tagName;
elemtype = elemtype.toUpperCase();
if (elemtype == "TEXT" || elemtype == "TEXTAREA" || elemtype == "INPUT" || elemtype == "PASSWORD" || elemtype == "SELECT")
{
elemtype = 'TEXT';
}
if (e.ctrlKey)
{
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox (97)
//if (key != 17) alert(key);
if (elemtype!= 'TEXT' && (key == 97 || key == 65 || key == 67 || key == 99 || key == 88 || key == 120 || key == 26 || key == 85 || key == 86 || key == 43))
{
show_wccp_pro_message('Alert: You are not allowed to copy content or view source');
return false;
}
var ctrl_s_option = 'checked';
if (key == 83 && ctrl_s_option == 'checked')//Ctrl+s 83
{
show_wccp_pro_message('You are not allowed to print or save this page!!');
return false;
}
var ctrl_p_option = 'checked';
if (key == 80 && ctrl_p_option == 'checked')//Ctrl+p 80
{
show_wccp_pro_message('You are not allowed to print or save this page!!');
return false;
}
else
return true;
}
}
"use strict";
document.addEventListener("keydown", function (event) {
//console.log(event);
//document.body.innerHTML = "\n \n which: " + event.which + "\n
\n keyCode: " + event.keyCode + "\n
\n shiftKey: " + event.shiftKey + "\n \n altKey: " + event.altKey + "\n
\n ctrlKey: " + event.ctrlKey + "\n
\n metaKey: " + event.metaKey + "\n ";
if(event.shiftKey){
event = event || window.event;
if (event.stopPropagation)
event.stopPropagation();
event.cancelBubble = true;
return false;
//show_wccp_pro_message('fdgs');
}
});
function disable_copy(e)
{
var excluded_classes = '' + '';
var class_to_exclude = '';
class_to_exclude = e.target.className;
if(class_to_exclude != '' && excluded_classes.includes(class_to_exclude))
{
target.style.cursor = "text";
return true;
}
//disable context menu when shift + right click is pressed
var shiftPressed = 0;
var evt = e?e:window.event;
if (parseInt(navigator.appVersion)>3) {
if (document.layers && navigator.appName=="Netscape")
shiftPressed=(evt.modifiers-0>3);
else
shiftPressed=evt.shiftKey;
if (shiftPressed) {
if (smessage !== "") show_wccp_pro_message(smessage);
var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
if (isFirefox) {alert (smessage);}
return false;
}
}
if(e.which === 2 ){
var clickedTag_a = (e==null) ? event.srcElement.tagName : e.target.tagName;
show_wccp_pro_message(smessage);
return false;
}
var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);
var elemtype = e.target.nodeName;
elemtype = elemtype.toUpperCase();
var checker_IMG = 'checked';
if (elemtype == "IMG" && checker_IMG == 'checked' && e.detail == 2) {show_wccp_pro_message(alertMsg_IMG);return false;}
if (elemtype != "TEXT" && elemtype != "TEXTAREA" && elemtype != "INPUT" && elemtype != "PASSWORD" && elemtype != "SELECT" && elemtype != "EMBED")
{
if (smessage !== "" && e.detail == 2)
show_wccp_pro_message(smessage);
if (isSafari)
return true;
else
return false;
}
}
function disable_copy_ie()
{
var excluded_classes = '' + '';
var class_to_exclude = '';
class_to_exclude = e.target.className;
if(class_to_exclude != '' && excluded_classes.includes(class_to_exclude))
{
target.style.cursor = "text";
return true;
}
var elemtype = window.event.srcElement.nodeName;
elemtype = elemtype.toUpperCase();
if (elemtype == "IMG") {show_wccp_pro_message(alertMsg_IMG);return false;}
if (elemtype != "TEXT" && elemtype != "TEXTAREA" && elemtype != "INPUT" && elemtype != "PASSWORD" && elemtype != "SELECT" && elemtype != "OPTION" && elemtype != "EMBED")
{
//if (smessage !== "") show_wccp_pro_message(smessage);
return false;
}
}
function reEnable()
{
return true;
}
document.onkeydown = disable_hot_keys;
document.onselectstart = disable_copy_ie;
if(navigator.userAgent.indexOf('MSIE')==-1)
{
document.onmousedown = disable_copy;
document.onclick = reEnable;
}
function disableSelection(target)
{
//For IE This code will work
if (typeof target.onselectstart!="undefined")
target.onselectstart = disable_copy_ie;
//For Firefox This code will work
else if (typeof target.style.MozUserSelect!="undefined")
{target.style.MozUserSelect="none";}
//All other (ie: Opera) This code will work
else
target.onmousedown=function(){return false}
target.style.cursor = "default";
}
//Calling the JS function directly just after body load
window.onload = function(){disableSelection(document.body);};
//]]>
Copyright © 2019 | MH Magazine WordPress Theme by MH Themes