Changeset 29b3973 in github


Ignore:
Timestamp:
Nov 4, 2010 9:48:17 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
30b3022
Parents:
b8d8cbd
Message:
  • Improve responsiveness of messages displaying (#1486986)
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rc50d887 r29b3973  
    6363- Add missing confirmation/error messages on contact/group/message actions (#1486845) 
    6464- Add 'loading' message on message move/copy/delete/mark actions 
     65- Improve responsiveness of messages displaying (#1486986) 
    6566 
    6667RELEASE 0.4.2 
  • program/js/app.js

    r1555ac6 r29b3973  
    211211          this.enable_command('reply-list', this.env.list_post); 
    212212 
    213           if (this.env.next_uid) { 
    214             this.enable_command('nextmessage', 'lastmessage', true); 
    215           } 
    216           if (this.env.prev_uid) { 
    217             this.enable_command('previousmessage', 'firstmessage', true); 
     213          if (this.env.action == 'show') { 
     214            this.http_request('pagenav', '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox), 
     215              this.display_message('', 'loading')); 
    218216          } 
    219217 
     
    45964594      id = type + date.getTime(); 
    45974595 
    4598     // The same message of type 'loading' is already displayed 
    4599     if (type == 'loading' && this.messages[msg]) { 
    4600        this.messages[msg].elements.push(id); 
    4601        return id; 
     4596    if (type == 'loading') { 
     4597      if (!msg) 
     4598        msg = this.get_label('loading'); 
     4599 
     4600      // The same message of type 'loading' is already displayed 
     4601      if (this.messages[msg]) { 
     4602        this.messages[msg].elements.push(id); 
     4603        return id; 
     4604      } 
    46024605    } 
    46034606 
  • program/steps/mail/func.inc

    rc50d887 r29b3973  
    424424function rcmail_messagecount_display($attrib) 
    425425  { 
    426   global $IMAP, $OUTPUT; 
     426  global $RCMAIL; 
    427427 
    428428  if (!$attrib['id']) 
    429429    $attrib['id'] = 'rcmcountdisplay'; 
    430430 
    431   $OUTPUT->add_gui_object('countdisplay', $attrib['id']); 
    432  
    433   return html::span($attrib, rcmail_get_messagecount_text()); 
     431  $RCMAIL->output->add_gui_object('countdisplay', $attrib['id']); 
     432 
     433  $content =  $RCMAIL->action != 'show' ? rcmail_get_messagecount_text() : rcube_label('loading'); 
     434 
     435  return html::span($attrib, $content); 
    434436  } 
    435437 
     
    496498function rcmail_get_messagecount_text($count=NULL, $page=NULL) 
    497499  { 
    498   global $RCMAIL, $IMAP, $MESSAGE; 
    499  
    500   if (isset($MESSAGE->index)) 
    501     { 
    502     return rcube_label(array('name' => 'messagenrof', 
    503         'vars' => array('nr'  => $MESSAGE->index+1, 
    504         'count' => $count!==NULL ? $count : $IMAP->messagecount(NULL, 'ALL')))); // Only messages, no threads here 
    505     } 
     500  global $RCMAIL, $IMAP; 
    506501 
    507502  if ($page===NULL) 
  • program/steps/mail/show.inc

    r83ba22c r29b3973  
    9595  } 
    9696 
    97   // get previous, first, next and last message UID 
    98   if ($RCMAIL->action != 'preview' && $RCMAIL->action != 'print') 
    99     { 
    100     $next = $prev = $first = $last = -1; 
    101  
    102     if ($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] != 'DESC' 
    103         && empty($_REQUEST['_search']) && !$CONFIG['skip_deleted'] && !$IMAP->threading) 
    104       { 
    105       // this assumes that we are sorted by date_DESC 
    106       $cnt = $IMAP->messagecount(); 
    107       $seq = $IMAP->get_id($MESSAGE->uid); 
    108       $MESSAGE->index = $cnt - $seq; 
    109  
    110       $prev = $IMAP->get_uid($seq + 1); 
    111       $first = $IMAP->get_uid($cnt); 
    112       $next = $IMAP->get_uid($seq - 1); 
    113       $last = $IMAP->get_uid(1); 
    114       } 
    115     else  
    116       { 
    117       // Only if we use custom sorting 
    118       $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']); 
    119  
    120       $MESSAGE->index = array_search($IMAP->get_id($MESSAGE->uid), $a_msg_index); 
    121  
    122       $count = count($a_msg_index); 
    123       $prev = isset($a_msg_index[$MESSAGE->index-1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index-1]) : -1; 
    124       $first = $count > 1 ? $IMAP->get_uid($a_msg_index[0]) : -1; 
    125       $next = isset($a_msg_index[$MESSAGE->index+1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index+1]) : -1; 
    126       $last = $count > 1 ? $IMAP->get_uid($a_msg_index[$count-1]) : -1; 
    127       } 
    128  
    129     if ($prev > 0) 
    130       $OUTPUT->set_env('prev_uid', $prev); 
    131     if ($first > 0) 
    132       $OUTPUT->set_env('first_uid', $first); 
    133     if ($next > 0) 
    134       $OUTPUT->set_env('next_uid', $next); 
    135     if ($last > 0) 
    136       $OUTPUT->set_env('last_uid', $last); 
    137  
    138     // Don't need a real messages count value 
    139     $OUTPUT->set_env('messagecount', 1); 
    140     } 
    141  
    14297  if (!$MESSAGE->headers->seen && ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) 
    14398    $RCMAIL->plugins->exec_hook('message_read', array('uid' => $MESSAGE->uid, 
Note: See TracChangeset for help on using the changeset viewer.