summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-10-22 17:41:22 +0000
committeralecpl <alec@alec.pl>2008-10-22 17:41:22 +0000
commit06343d189ea9a58713fff0482b7cb8e48190f8a0 (patch)
tree7faa05e711b807794e5e8efd3d5b926885f6a506 /program
parentfe7618f1baf08fe8f579b2efdbb7e5200b60e6d4 (diff)
- Added option focus_on_new_message (#1485374)
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js10
-rw-r--r--program/localization/en_GB/labels.inc1
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/localization/pl_PL/labels.inc1
-rw-r--r--program/localization/ru_RU/labels.inc1
-rw-r--r--program/steps/mail/check_recent.inc3
-rw-r--r--program/steps/settings/func.inc9
-rw-r--r--program/steps/settings/save_prefs.inc1
8 files changed, 26 insertions, 1 deletions
diff --git a/program/js/app.js b/program/js/app.js
index fc99871b1..6994d1893 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3582,6 +3582,16 @@ function rcube_webmail()
}
};
+ // notifies that a new message(s) has hit the mailbox
+ this.new_message_focus = function()
+ {
+ // focus main window
+ if (this.env.framed && window.parent)
+ window.parent.focus();
+ else
+ window.focus();
+ }
+
// add row to contacts list
this.add_contact_row = function(cid, cols, select)
{
diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc
index f8f19d386..48656c214 100644
--- a/program/localization/en_GB/labels.inc
+++ b/program/localization/en_GB/labels.inc
@@ -232,6 +232,7 @@ $labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Full RFC 2047 (other)';
$labels['advancedoptions'] = 'Advanced options';
+$labels['focusonnewmessage'] = 'Focus browser window on new message';
$labels['messagesdisplaying'] = 'Displaying Messages';
$labels['messagescomposition'] = 'Composing Messages';
$labels['folder'] = 'Folder';
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 1fdf75389..904450b44 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -290,6 +290,7 @@ $labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Full RFC 2047 (other)';
$labels['advancedoptions'] = 'Advanced options';
+$labels['focusonnewmessage'] = 'Focus browser window on new message';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folders';
diff --git a/program/localization/pl_PL/labels.inc b/program/localization/pl_PL/labels.inc
index d8c94f414..ecf430f4d 100644
--- a/program/localization/pl_PL/labels.inc
+++ b/program/localization/pl_PL/labels.inc
@@ -231,6 +231,7 @@ $labels['skipdeleted'] = 'Ukryj wiadomości oznaczone do usunięcia';
$labels['autosavedraft'] = 'Automatyczny zapis tworzonej wiadomości';
$labels['everynminutes'] = 'co $n minut';
$labels['never'] = 'nigdy';
+$labels['focusonnewmessage'] = 'Informuj przeglądarkę o nowej wiadomości';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Foldery';
$labels['foldername'] = 'Nazwa folderu';
diff --git a/program/localization/ru_RU/labels.inc b/program/localization/ru_RU/labels.inc
index 17a2a8a86..9578844c4 100644
--- a/program/localization/ru_RU/labels.inc
+++ b/program/localization/ru_RU/labels.inc
@@ -237,6 +237,7 @@ $labels['2231folding'] = 'RFC 2231 (только для новейших про
$labels['miscfolding'] = 'RFC 2047/2231 (наибольшая совместимость)';
$labels['2047folding'] = 'RFC 2047 (для старых программ)';
$labels['advancedoptions'] = 'Дополнительные настройки';
+$labels['focusonnewmessage'] = 'Фокусировать окно браузера при новом сообщении';
$labels['folder'] = 'Папка';
$labels['folders'] = 'Папки';
$labels['foldername'] = 'Имя папки';
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index e84d7ba9e..07313c156 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -41,6 +41,9 @@ foreach ($a_mailboxes as $mbox_name)
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text());
$OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota()));
+ if (rcmail::get_instance()->config->get('focus_on_new_message',true))
+ $OUTPUT->command('new_message_focus');
+
// add new message headers to list
$a_headers = array();
for ($i=$recent_count, $id=$count_all-$recent_count+1; $i>0; $i--, $id++)
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 6e8c6b509..1b28d3b17 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -148,6 +148,13 @@ function rcmail_user_prefs_form($attrib)
$table = new html_table(array('cols' => 2));
+ if (!isset($no_override['focus_on_new_message'])) {
+ $field_id = 'rcmfd_focus_on_new_message';
+ $input_focus_on_new_message = new html_checkbox(array('name' => '_focus_on_new_message', 'id' => $field_id, 'value' => 1));
+ $table->add('title', html::label($field_id, Q(rcube_label('focusonnewmessage'))));
+ $table->add(null, $input_focus_on_new_message->show($config['focus_on_new_message']?1:0));
+ }
+
// show config parameter for preview pane
if (!isset($no_override['preview_pane'])) {
$field_id = 'rcmfd_preview';
@@ -294,7 +301,7 @@ function rcmail_user_prefs_form($attrib)
$table->add('title', html::label($field_id, Q(rcube_label('skipdeleted'))));
$table->add(null, $input_purge->show($config['skip_deleted']?1:0));
}
-
+
// Trash purging on logout
if (!isset($no_override['logout_purge'])) {
$field_id = 'rcmfd_logout_purge';
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index beeb1df0f..3f6328d0d 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -30,6 +30,7 @@ $a_user_prefs = array(
'htmleditor' => isset($_POST['_htmleditor']) ? TRUE : FALSE,
'inline_images' => isset($_POST['_inline_images']) ? TRUE : FALSE,
'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE,
+ 'focus_on_new_message' => isset($_POST['_focus_on_new_message']) ? TRUE : FALSE,
'read_when_deleted' => isset($_POST['_read_when_deleted']) ? TRUE : FALSE,
'skip_deleted' => isset($_POST['_skip_deleted']) ? TRUE : FALSE,
'flag_for_deletion' => isset($_POST['_flag_for_deletion']) ? TRUE : FALSE,