From c56d6db639dde7831337abccd02ddd6bf80e6d85 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 21 Mar 2007 18:05:52 +0000 Subject: [PATCH] Added CTRL+P and CTRL+S shortcuts SVN revision: 1812 --- scripts/elcode.js | 15 ++++++++++++++- src/elogd.c | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/elcode.js b/scripts/elcode.js index 72c3361a..2ed18867 100755 --- a/scripts/elcode.js +++ b/scripts/elcode.js @@ -146,10 +146,23 @@ function elKeyPress(evt) queryHeading(document.form1.Text); return false; } - if (String.fromCharCode(evt.charCode) == "p") { + if (String.fromCharCode(evt.charCode) == "m") { 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; } + if (String.fromCharCode(evt.charCode) == "p") { + document.form1.jcmd.value = "Preview"; + chkform(); + cond_submit(); + return false; + } + if (String.fromCharCode(evt.charCode) == "s") { + document.form1.jcmd.value = "Submit"; + chkform(); + cond_submit(); + document.form1.Text.focus(); + return false; + } } return true; diff --git a/src/elogd.c b/src/elogd.c index 28f655e5..90a11f19 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -9215,7 +9215,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL if (isparam("inlineatt") && *getparam("inlineatt")) strcpy(script, " OnLoad=\"document.form1.Text.focus();\""); - strcat(script, " OnLoad=\"elKeyInit();\""); + strcat(script, " OnLoad=\"elKeyInit();\" OnFocus=\"elKeyInit();\""); if (getcfg(lbs->name, "Use Lock", str, sizeof(str)) && atoi(str) == 1) rsprintf("\n", script); @@ -9849,7 +9849,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL sprintf(str, "window.open('upload.html', '',"); strlcat(str, "'top=280,left=350,width=500,height=120,dependent=yes,", sizeof(str)); strlcat(str, "menubar=no,status=no,scrollbars=no,location=no,resizable=yes')", sizeof(str)); - ricon("image", loc("Insert image CTRL+P"), str); + ricon("image", loc("Insert image CTRL+M"), str); rsprintf(" "); ricon("quote", loc("Insert quote"), "elcode(document.form1.Text, 'QUOTE','')");