Because some people can forget you told them NOT to paste directly from word to the wysiwyg editor, I would like to add a javascript to the fckeditor wysiwyg iframe that blocks these functions.
What is blocked exactly?
- users can't paste using Ctrl+V
- users can't reach the right click menu the regular way, they need to click both mouse buttons simultaneously.
HTML example:
Code: Select all
<__html>
<head>
<__script__ language="JavaScript1.1">
function noCopyMouse(e) {
var isRight = (e.button) ? (e.button == 2) : (e.which == 3);
if(isRight) {
alert('please don't paste from word! If you need to access the right mouse menu for a different task, just click your left and right mouse button simultaneously and the menu will appear');
return false;
}
return true;
}
function noCopyKey(e) {
var forbiddenKeys = new Array('v');
var keyCode = (e.keyCode) ? e.keyCode : e.which;
var isCtrl;
if(window.event)
isCtrl = e.ctrlKey
else
isCtrl = (window.Event) ? ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK) : false;
if(isCtrl) {
for(i = 0; i < forbiddenKeys.length; i++) {
if(forbiddenKeys[i] == String.fromCharCode(keyCode).toLowerCase()) {
alert('Please don't paste directly from word!');
return false;
}
}
}
return true;
}
</__script>
</head>
</__body>
<input type="text" onmousedown="noCopyMouse(event);" onkeydown="noCopyKey(event);">
<__body>
</__html>
/admin/editcontent.php
/modules/FCKeditorX/FCKeditor/editor/fckeditor.html
/modules/FCKeditorX/FCKeditor/editor/fckeditor.original.html
and a couple more....
Has anybody got an idea as to where I can find the <input type="hidden" id="content_en" name="content_en" ..... tag?
I believe this is the one to enter the onmousedown code in but I can't find it...
Greetings,
Manuel