How can I edit this piece of code so that the right- click and the context-menu that have been disabled are re-enabled? I have no knowledge of javascript or any other back-end language. This code is from my university's javaelab website in which they have disabled right click and copy paste.
$.ajax({
type: 'POST',
url: '../flag.checker.php',
success: function(codedata) {
if(codedata == 1) {
console.log("Diasble");
$("body").on("contextmenu",function(e){
window.alert("NOT ALLOWED");
return false;
});
$('body').bind('cut copy paste', function (e) {
e.preventDefault();
window.alert("NOT ALLOWED");
return false;
});
editor.on('paste',function(e){
e.preventDefault();
console.log('Paste is clicked');
});
editor.on('beforeChange',function(instance,changeObj) {
if(changeObj.origin == "paste") {
window.alert("NOT ALLOWED");
changeObj.cancel();
}
});
}
}
});