Added CTRL key shortcuts for elCode

SVN revision: 1811
This commit is contained in:
2007-03-20 20:24:58 +00:00
parent c9971f627e
commit 8633d7852e
2 changed files with 66 additions and 16 deletions
+47
View File
@@ -107,3 +107,50 @@ function queryHeading(text)
tag = 'H' + heading;
elcode1(text, tag, '', selection);
}
function elKeyInit()
{
document.onkeypress = elKeyPress;
}
function elKeyPress(evt)
{
evt = (evt) ? evt : window.event;
if (evt.ctrlKey && !evt.shiftKey && !evt.altKey) {
if (String.fromCharCode(evt.charCode) == "b") {
elcode(document.form1.Text, 'B','');
return false;
}
if (String.fromCharCode(evt.charCode) == "i") {
elcode(document.form1.Text, 'I','');
return false;
}
if (String.fromCharCode(evt.charCode) == "u") {
elcode(document.form1.Text, 'U','');
return false;
}
if (String.fromCharCode(evt.charCode) == "c") {
elcode(document.form1.Text, 'CODE','');
return false;
}
if (String.fromCharCode(evt.charCode) == "t") {
elcode(document.form1.Text, 'TABLE','');
return false;
}
if (String.fromCharCode(evt.charCode) == "l") {
elcode(document.form1.Text, 'LIST','');
return false;
}
if (String.fromCharCode(evt.charCode) == "h") {
queryHeading(document.form1.Text);
return false;
}
if (String.fromCharCode(evt.charCode) == "p") {
window.open('upload.html','','top=280,left=350,width=500,height=120,dependent=yes,menubar=no,status=no,scrollbars=no,location=no,resizable=yes');
return false;
}
}
return true;
}