Internet Explorer - Copy/Cut & Paste Fix
Status: Beta
Brought to you by:
fermads
Hi,
I fixed the copy/cut & paste problem in internet explorer. It's tested in IE7 only at this moment.
1. Change the copy-part of the keyHandler function to this:
else if((keyCode==67 || keyCode == 88) && evt.ctrlKey) { // handle copy and cut
sel = document.selection.createRange();
copy = sel.htmlText;
copy = copy.replace(/<\/P><P>/gi, '\r\n');
copy = copy.replace(/<.*?>/g, '');
copy = copy.replace(/</g, '<');
copy = copy.replace(/>/g, '>');
window.clipboardData.setData('text', copy);
if (keyCode == 88)
document.selection.clear();
evt.returnValue = false;
}
2. Change the line
o = o.replace(/ /g,'');
in function syntaxHighlight to this one:
o = o.replace(/ /g,' ');
Logged In: YES
user_id=1992325
Originator: YES
A little mistake: The first change is NOT in the keyHandler function, but in the metaHandler function!
Sorry...
Logged In: YES
user_id=1308806
Originator: NO
In case you're having trouble finding where this code goes, it's in the codepress/engines/msie.js file.