case 'src/compose.php':
$js = '<script language="JavaScript" type="text/javascript">' .
"\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 pos = -1;\n".
"while( pos == -1 && i < f ) {\n".
default:
$js = '<script language="JavaScript" type="text/javascript">' .
"\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 pos = -1;\n".
"while( pos == -1 && i < f ) {\n".
$reply_citation_start = getPref($data_dir, $username, 'reply_citation_start');
$reply_citation_end = getPref($data_dir, $username, 'reply_citation_end');
+// who is using those darn block comments? poo!
+
+// Load preference for cursor behavior for replies
+//
+$reply_focus = getPref($data_dir, $username, 'reply_focus', '');
+
/* left refresh rate, strtolower makes 1.0.6 prefs compatible */
$left_refresh = getPref($data_dir, $username, 'left_refresh', SMPREF_NONE );
$left_refresh = strtolower($left_refresh);
'refresh' => SMOPT_REFRESH_NONE
);
+ $optvals[SMOPT_GRP_MESSAGE][] = array(
+ 'name' => 'reply_focus',
+ 'caption' => _("Cursor Position when Replying"),
+ 'type' => SMOPT_TYPE_STRLIST,
+ 'refresh' => SMOPT_REFRESH_NONE,
+ 'posvals' => array('' => _("To: field"),
+ 'focus' => _("Focus in body"),
+ 'select' => _("Select body"))
+ );
+
$optvals[SMOPT_GRP_MESSAGE][] = array(
'name' => 'strip_sigs',
'caption' => _("Strip signature when replying"),