|
@@ -153,8 +153,16 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
|
|
case 'src/compose.php':
|
|
case 'src/compose.php':
|
|
$js = '<script language="JavaScript" type="text/javascript">' .
|
|
$js = '<script language="JavaScript" type="text/javascript">' .
|
|
"\n<!--\n" .
|
|
"\n<!--\n" .
|
|
- "function checkForm() {\n".
|
|
|
|
- "var f = document.forms.length;\n".
|
|
|
|
|
|
+ "function checkForm() {\n";
|
|
|
|
+
|
|
|
|
+ global $action, $reply_focus;
|
|
|
|
+ if (strpos($action, 'reply') !== FALSE && $reply_focus)
|
|
|
|
+ {
|
|
|
|
+ if ($reply_focus == 'select') $js .= "document.forms['compose'].body.select();}\n";
|
|
|
|
+ else if ($reply_focus == 'focus') $js .= "document.forms['compose'].body.focus();}\n";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ $js .= "var f = document.forms.length;\n".
|
|
"var i = 0;\n".
|
|
"var i = 0;\n".
|
|
"var pos = -1;\n".
|
|
"var pos = -1;\n".
|
|
"while( pos == -1 && i < f ) {\n".
|
|
"while( pos == -1 && i < f ) {\n".
|
|
@@ -312,8 +320,16 @@ function compose_Header($color, $mailbox) {
|
|
default:
|
|
default:
|
|
$js = '<script language="JavaScript" type="text/javascript">' .
|
|
$js = '<script language="JavaScript" type="text/javascript">' .
|
|
"\n<!--\n" .
|
|
"\n<!--\n" .
|
|
- "function checkForm() {\n".
|
|
|
|
- "var f = document.forms.length;\n".
|
|
|
|
|
|
+ "function checkForm() {\n";
|
|
|
|
+
|
|
|
|
+ global $action, $reply_focus;
|
|
|
|
+ if (strpos($action, 'reply') !== FALSE && $reply_focus)
|
|
|
|
+ {
|
|
|
|
+ if ($reply_focus == 'select') $js .= "document.forms['compose'].body.select();}\n";
|
|
|
|
+ else if ($reply_focus == 'focus') $js .= "document.forms['compose'].body.focus();}\n";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ $js .= "var f = document.forms.length;\n".
|
|
"var i = 0;\n".
|
|
"var i = 0;\n".
|
|
"var pos = -1;\n".
|
|
"var pos = -1;\n".
|
|
"while( pos == -1 && i < f ) {\n".
|
|
"while( pos == -1 && i < f ) {\n".
|