浏览代码

Added 'no focus' option for compose screen

pdontthink 21 年之前
父节点
当前提交
4517827b5e
共有 3 个文件被更改,包括 16 次插入1 次删除
  1. 2 0
      ChangeLog
  2. 12 0
      functions/page_header.php
  3. 2 1
      include/options/display.php

+ 2 - 0
ChangeLog

@@ -73,6 +73,8 @@ Version 1.5.1 -- CVS
   - Added "trailing text" for options built by SquirrelMail (text placed
     after text and select list inputs on options pages)
   - Custom option page values now repopulate correctly
+  - Added "no focus" option for compose page in display preferences (setting
+    reply focus to "No focus" also affects composing new messages)
 
 Version 1.5.0
 --------------------

+ 12 - 0
functions/page_header.php

@@ -206,6 +206,12 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
             {
                 if ($reply_focus == 'select') $js .= "document.forms['compose'].body.select();}\n";
                 else if ($reply_focus == 'focus') $js .= "document.forms['compose'].body.focus();}\n";
+                else if ($reply_focus == 'none') $js .= "}\n";
+            }
+            // no reply focus also applies to composing new messages
+            else if ($reply_focus == 'none')
+            {
+                $js .= "}\n";
             }
             else
                 $js .= "var f = document.forms.length;\n".
@@ -380,6 +386,12 @@ function compose_Header($color, $mailbox) {
             {
                 if ($reply_focus == 'select') $js .= "document.forms['compose'].body.select();}\n";
                 else if ($reply_focus == 'focus') $js .= "document.forms['compose'].body.focus();}\n";
+                else if ($reply_focus == 'none') $js .= "}\n";
+            }
+            // no reply focus also applies to composing new messages
+            else if ($reply_focus == 'none')
+            {
+                $js .= "}\n";
             }
             else
                 $js .= "var f = document.forms.length;\n".

+ 2 - 1
include/options/display.php

@@ -415,7 +415,8 @@ function load_optpage_data_display() {
         'refresh' => SMOPT_REFRESH_NONE,
         'posvals' => array('' => _("To: field"),
                            'focus' => _("Focus in body"),
-                           'select' => _("Select body"))
+                           'select' => _("Select body"),
+                           'none' => _("No focus"))
     );
 
     $optvals[SMOPT_GRP_MESSAGE][] = array(