Changeset 374 in subversion


Ignore:
Timestamp:
Nov 21, 2006 3:02:48 AM (7 years ago)
Author:
robin
Message:

Add first and last buttons.

Location:
trunk/roundcubemail
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/app.js

    r368 r374  
    142142          this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'viewsource', 'print', 'load-attachment', true); 
    143143          if (this.env.next_uid) 
     144            { 
    144145            this.enable_command('nextmessage', true); 
     146            this.enable_command('lastmessage', true); 
     147            } 
    145148          if (this.env.prev_uid) 
     149            { 
    146150            this.enable_command('previousmessage', true); 
     151            this.enable_command('firstmessage', true); 
     152            } 
    147153          } 
    148154 
     
    479485        break; 
    480486 
     487      case 'lastpage': 
     488        this.list_page('last'); 
     489        break; 
     490 
    481491      case 'previouspage': 
    482492        this.list_page('prev'); 
     493        break; 
     494 
     495      case 'firstpage': 
     496        this.list_page('first'); 
    483497        break; 
    484498 
     
    657671        break; 
    658672 
     673          case 'lastmessage': 
     674        if (this.env.last_uid) 
     675          this.show_message(this.env.last_uid); 
     676        break; 
     677 
    659678      case 'previousmessage': 
    660679        if (this.env.prev_uid) 
    661680          this.show_message(this.env.prev_uid); 
     681        break; 
     682 
     683      case 'firstmessage': 
     684        if (this.env.first_uid) 
     685          this.show_message(this.env.first_uid); 
    662686        break; 
    663687       
     
    10961120    if (page=='next') 
    10971121      page = this.env.current_page+1; 
     1122    if (page=='last') 
     1123      page = this.env.pagecount; 
    10981124    if (page=='prev' && this.env.current_page>1) 
    10991125      page = this.env.current_page-1; 
     1126    if (page=='first' && this.env.current_page>1) 
     1127      page = 1; 
    11001128       
    11011129    if (page > 0 && page <= this.env.pagecount) 
     
    26352663    { 
    26362664    this.enable_command('nextpage', (this.env.pagecount > this.env.current_page)); 
     2665    this.enable_command('lastpage', (this.env.pagecount > this.env.current_page)); 
    26372666    this.enable_command('previouspage', (this.env.current_page > 1)); 
     2667    this.enable_command('firstpage', (this.env.current_page > 1)); 
    26382668    } 
    26392669 
  • trunk/roundcubemail/program/localization/en_US/labels.inc

    r356 r374  
    9999$labels['printmessage']     = 'Print this message'; 
    100100$labels['previousmessages'] = 'Show previous set of messages'; 
     101$labels['firstmessages']    = 'Show first set of messages'; 
    101102$labels['nextmessages']     = 'Show next set of messages'; 
     103$labels['lastmessages']     = 'Show last set of messages'; 
    102104$labels['backtolist']       = 'Back to message list'; 
    103105$labels['viewsource']       = 'Show source'; 
     
    172174 
    173175$labels['previouspage']   = 'Show previous set'; 
     176$labels['firstpage']      = 'Show first set'; 
    174177$labels['nextpage']       = 'Show next set'; 
     178$labels['lastpage']       = 'Show last set'; 
    175179 
    176180 
  • trunk/roundcubemail/program/steps/mail/show.inc

    r330 r374  
    6161 
    6262  $next = $prev = -1; 
    63   // get previous and next message UID 
     63  // get previous, first, next and last message UID 
    6464  if (!($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] == 'DESC') &&  
    6565      $IMAP->get_capability('sort'))  
     
    7070    $MESSAGE['index'] = array_search((string)$MESSAGE['UID'], $a_msg_index, TRUE); 
    7171    $prev = isset($a_msg_index[$MESSAGE['index']-1]) ? $a_msg_index[$MESSAGE['index']-1] : -1 ; 
     72    $first = count($a_msg_index)>0 ? $a_msg_index[0] : -1; 
    7273    $next = isset($a_msg_index[$MESSAGE['index']+1]) ? $a_msg_index[$MESSAGE['index']+1] : -1 ; 
     74    $last = count($a_msg_index)>0 ? $a_msg_index[count($a_msg_index)-1] : -1; 
    7375    } 
    7476  else 
     
    7779    $seq = $IMAP->get_id($MESSAGE['UID']); 
    7880    $prev = $IMAP->get_uid($seq + 1); 
     81    $first = $IMAP->get_uid($IMAP->messagecount()); 
    7982    $next = $IMAP->get_uid($seq - 1); 
     83    $last = $IMAP->get_uid(1); 
    8084    $MESSAGE['index'] = $IMAP->messagecount() - $seq; 
    8185    } 
     
    8387  if ($prev > 0) 
    8488    $javascript .= sprintf("\n%s.set_env('prev_uid', '%s');", $JS_OBJECT_NAME, $prev); 
     89  if ($first >0) 
     90    $javascript .= sprintf("\n%s.set_env('first_uid', '%s');", $JS_OBJECT_NAME, $first); 
    8591  if ($next > 0) 
    8692    $javascript .= sprintf("\n%s.set_env('next_uid', '%s');", $JS_OBJECT_NAME, $next); 
     93  if ($last >0) 
     94    $javascript .= sprintf("\n%s.set_env('last_uid', '%s');", $JS_OBJECT_NAME, $last); 
    8795 
    8896  $OUTPUT->add_script($javascript); 
  • trunk/roundcubemail/skins/default/templates/addressbook.html

    r267 r374  
    2121 
    2222<div id="abookcountbar"> 
     23<roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstpage" /> 
    2324<roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previouspage" /> 
    2425&nbsp;<roundcube:object name="recordsCountDisplay" />&nbsp; 
    2526<roundcube:button command="nextpage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextpage" /> 
     27<roundcube:button command="lastpage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastpage" /> 
    2628</div> 
    2729 
  • trunk/roundcubemail/skins/default/templates/mail.html

    r334 r374  
    2626 
    2727<div id="messagecountbar"> 
     28<roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstmessages" /> 
    2829<roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" /> 
    2930&nbsp;<roundcube:object name="messageCountDisplay" />&nbsp; 
    3031<roundcube:button command="nextpage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" /> 
     32<roundcube:button command="lastpage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastmessages" /> 
    3133</div> 
    3234 
  • trunk/roundcubemail/skins/default/templates/message.html

    r267 r374  
    1212 
    1313<div id="messagecountbar"> 
     14<roundcube:button command="firstmessage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstmessages" /> 
    1415<roundcube:button command="previousmessage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" /> 
    1516&nbsp;<roundcube:object name="messageCountDisplay" />&nbsp; 
    1617<roundcube:button command="nextmessage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" /> 
     18<roundcube:button command="lastmessage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastmessages" /> 
    1719</div> 
    1820 
Note: See TracChangeset for help on using the changeset viewer.