- Improve responsiveness of messages displaying (#1486986)
1 files added
4 files modified
| | |
| | | - Add option to place replies in the folder of the message being replied to (#1485945) |
| | | - Add missing confirmation/error messages on contact/group/message actions (#1486845) |
| | | - Add 'loading' message on message move/copy/delete/mark actions |
| | | - Improve responsiveness of messages displaying (#1486986) |
| | | |
| | | RELEASE 0.4.2 |
| | | ------------- |
| | |
| | | this.enable_command(this.env.message_commands, this.env.uid); |
| | | this.enable_command('reply-list', this.env.list_post); |
| | | |
| | | if (this.env.next_uid) { |
| | | this.enable_command('nextmessage', 'lastmessage', true); |
| | | } |
| | | if (this.env.prev_uid) { |
| | | this.enable_command('previousmessage', 'firstmessage', true); |
| | | if (this.env.action == 'show') { |
| | | this.http_request('pagenav', '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox), |
| | | this.display_message('', 'loading')); |
| | | } |
| | | |
| | | if (this.env.blockedobjects) { |
| | |
| | | var date = new Date(), |
| | | id = type + date.getTime(); |
| | | |
| | | // The same message of type 'loading' is already displayed |
| | | if (type == 'loading' && this.messages[msg]) { |
| | | this.messages[msg].elements.push(id); |
| | | return id; |
| | | if (type == 'loading') { |
| | | if (!msg) |
| | | msg = this.get_label('loading'); |
| | | |
| | | // The same message of type 'loading' is already displayed |
| | | if (this.messages[msg]) { |
| | | this.messages[msg].elements.push(id); |
| | | return id; |
| | | } |
| | | } |
| | | |
| | | var ref = this, |
| | |
| | | |
| | | function rcmail_messagecount_display($attrib) |
| | | { |
| | | global $IMAP, $OUTPUT; |
| | | global $RCMAIL; |
| | | |
| | | if (!$attrib['id']) |
| | | $attrib['id'] = 'rcmcountdisplay'; |
| | | |
| | | $OUTPUT->add_gui_object('countdisplay', $attrib['id']); |
| | | $RCMAIL->output->add_gui_object('countdisplay', $attrib['id']); |
| | | |
| | | return html::span($attrib, rcmail_get_messagecount_text()); |
| | | $content = $RCMAIL->action != 'show' ? rcmail_get_messagecount_text() : rcube_label('loading'); |
| | | |
| | | return html::span($attrib, $content); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | function rcmail_get_messagecount_text($count=NULL, $page=NULL) |
| | | { |
| | | global $RCMAIL, $IMAP, $MESSAGE; |
| | | |
| | | if (isset($MESSAGE->index)) |
| | | { |
| | | return rcube_label(array('name' => 'messagenrof', |
| | | 'vars' => array('nr' => $MESSAGE->index+1, |
| | | 'count' => $count!==NULL ? $count : $IMAP->messagecount(NULL, 'ALL')))); // Only messages, no threads here |
| | | } |
| | | global $RCMAIL, $IMAP; |
| | | |
| | | if ($page===NULL) |
| | | $page = $IMAP->list_page; |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | +-----------------------------------------------------------------------+ |
| | | | program/steps/mail/pagenav.inc | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2009, Roundcube Dev. - Switzerland | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | | | Updates message page navigation controls | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id: show.inc 4176 2010-11-04 09:59:55Z alec $ |
| | | |
| | | */ |
| | | |
| | | $uid = get_input_value('_uid', RCUBE_INPUT_GET); |
| | | $cnt = $IMAP->messagecount(NULL, 'ALL'); // Only messages, no threads here |
| | | |
| | | if ($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] != 'DESC' |
| | | && empty($_REQUEST['_search']) && !$CONFIG['skip_deleted'] && !$IMAP->threading |
| | | ) { |
| | | // this assumes that we are sorted by date_DESC |
| | | $seq = $IMAP->get_id($uid); |
| | | $index = $cnt - $seq; |
| | | |
| | | $prev = $IMAP->get_uid($seq + 1); |
| | | $first = $IMAP->get_uid($cnt); |
| | | $next = $IMAP->get_uid($seq - 1); |
| | | $last = $IMAP->get_uid(1); |
| | | } |
| | | else { |
| | | // Only if we use custom sorting |
| | | $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']); |
| | | |
| | | $index = array_search($IMAP->get_id($uid), $a_msg_index); |
| | | |
| | | $count = count($a_msg_index); |
| | | $prev = isset($a_msg_index[$index-1]) ? $IMAP->get_uid($a_msg_index[$index-1]) : -1; |
| | | $first = $count > 1 ? $IMAP->get_uid($a_msg_index[0]) : -1; |
| | | $next = isset($a_msg_index[$index+1]) ? $IMAP->get_uid($a_msg_index[$index+1]) : -1; |
| | | $last = $count > 1 ? $IMAP->get_uid($a_msg_index[$count-1]) : -1; |
| | | } |
| | | |
| | | // Set UIDs and activate navigation buttons |
| | | if ($prev > 0) { |
| | | $OUTPUT->set_env('prev_uid', $prev); |
| | | $OUTPUT->command('enable_command', 'previousmessage', 'firstmessage', true); |
| | | } |
| | | if ($next > 0) { |
| | | $OUTPUT->set_env('next_uid', $next); |
| | | $OUTPUT->command('enable_command', 'nextmessage', 'lastmessage', true); |
| | | } |
| | | if ($first > 0) |
| | | $OUTPUT->set_env('first_uid', $first); |
| | | if ($last > 0) |
| | | $OUTPUT->set_env('last_uid', $last); |
| | | |
| | | // Don't need a real messages count value |
| | | $OUTPUT->set_env('messagecount', 1); |
| | | |
| | | // Set rowcount text |
| | | $OUTPUT->command('set_rowcount', rcube_label(array( |
| | | 'name' => 'messagenrof', |
| | | 'vars' => array('nr' => $index+1, 'count' => $cnt) |
| | | ))); |
| | | |
| | | $OUTPUT->send(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // get previous, first, next and last message UID |
| | | if ($RCMAIL->action != 'preview' && $RCMAIL->action != 'print') |
| | | { |
| | | $next = $prev = $first = $last = -1; |
| | | |
| | | if ($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] != 'DESC' |
| | | && empty($_REQUEST['_search']) && !$CONFIG['skip_deleted'] && !$IMAP->threading) |
| | | { |
| | | // this assumes that we are sorted by date_DESC |
| | | $cnt = $IMAP->messagecount(); |
| | | $seq = $IMAP->get_id($MESSAGE->uid); |
| | | $MESSAGE->index = $cnt - $seq; |
| | | |
| | | $prev = $IMAP->get_uid($seq + 1); |
| | | $first = $IMAP->get_uid($cnt); |
| | | $next = $IMAP->get_uid($seq - 1); |
| | | $last = $IMAP->get_uid(1); |
| | | } |
| | | else |
| | | { |
| | | // Only if we use custom sorting |
| | | $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']); |
| | | |
| | | $MESSAGE->index = array_search($IMAP->get_id($MESSAGE->uid), $a_msg_index); |
| | | |
| | | $count = count($a_msg_index); |
| | | $prev = isset($a_msg_index[$MESSAGE->index-1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index-1]) : -1; |
| | | $first = $count > 1 ? $IMAP->get_uid($a_msg_index[0]) : -1; |
| | | $next = isset($a_msg_index[$MESSAGE->index+1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index+1]) : -1; |
| | | $last = $count > 1 ? $IMAP->get_uid($a_msg_index[$count-1]) : -1; |
| | | } |
| | | |
| | | if ($prev > 0) |
| | | $OUTPUT->set_env('prev_uid', $prev); |
| | | if ($first > 0) |
| | | $OUTPUT->set_env('first_uid', $first); |
| | | if ($next > 0) |
| | | $OUTPUT->set_env('next_uid', $next); |
| | | if ($last > 0) |
| | | $OUTPUT->set_env('last_uid', $last); |
| | | |
| | | // Don't need a real messages count value |
| | | $OUTPUT->set_env('messagecount', 1); |
| | | } |
| | | |
| | | if (!$MESSAGE->headers->seen && ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) |
| | | $RCMAIL->plugins->exec_hook('message_read', array('uid' => $MESSAGE->uid, |
| | | 'mailbox' => $mbox_name, 'message' => $MESSAGE)); |