Changeset 3142 in subversion


Ignore:
Timestamp:
Nov 30, 2009 3:55:57 AM (3 years ago)
Author:
alec
Message:
  • don't refresh messages list on message delete
  • handle threading in mark.inc
  • fix: threads expanding in Google Chrome
  • fix: list options menu not working after options save
Location:
branches/devel-threads
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-threads/THREADS

    r3136 r3142  
    1010      supported by server and implement REFS sorting in Roundcube 
    1111    - use underlined subject for root with unread children (icon is still supported) 
     12    - on deleting messages the whole list isn't refreshed 
    1213 
    1314CHANGES IN RELATION TO TRUNK (for pasting into CHANGELOG after merge) 
     
    2021TODO (must have): 
    2122    - threads caching, 
    22     - after message delete we shouldn't reload the whole list, only the thread 
    23       in which the message was 
    2423    - "Expand All Unread" button 
    2524TODO (other): 
     
    3837TODO (by the way): 
    3938    - use jQuery.inArray instead of find_in_array() (common.js) 
     39    - use only one function (js) to generate messages list 
    4040 
    4141KNOWN ISSUES: 
    42     - after message(s) deletion the whole list is reloaded (see TODO), 
    43     - the same with a new message (check_recent) 
     42    - on new message (check_recent) the whole list is reloaded 
    4443    - css issues on IE6-7 
     44 
  • branches/devel-threads/program/include/rcube_imap.php

    r3129 r3142  
    757757 
    758758    return $this->_fetch_thread_headers($mailbox, $thread_tree, $msg_depth, $has_children, 
    759         $msg_index, $page, $lice); 
     759        $msg_index, $page, $slice); 
    760760    } 
    761761 
  • branches/devel-threads/program/js/app.js

    r3136 r3142  
    176176          this.set_message_coltypes(this.env.coltypes); 
    177177          this.message_list.init(); 
    178           this.enable_command('toggle_status', 'toggle_flag', true); 
     178          this.enable_command('toggle_status', 'toggle_flag', 'menu-open', true); 
    179179           
    180180          if (this.gui_objects.mailcontframe) 
     
    483483        else if (this.env.permaurl) 
    484484          parent.location.href = this.env.permaurl; 
     485        break; 
     486 
     487      case 'menu-open': 
     488        this.triggerEvent('menu-open', {props:props}); 
     489        return false; 
    485490        break; 
    486491 
     
    647652        // mail task 
    648653        if (this.task=='mail') 
    649         { 
    650           if (this.delete_messages() && this.env.threading) 
    651           { 
    652             // It is very hard to re-thread message list if some messages were removed from 
    653             // the middle of a thread (we need to fully implement RFC5256 algorythm, because 
    654             // we are a "disconnected client" if we re-threading without a servers help) 
    655             // Reload message list 
    656             this.list_mailbox(this.env.mailbox, this.env.current_page); 
    657           } 
    658         } 
     654          this.delete_messages(); 
    659655        // addressbook task 
    660656        else if (this.task=='addressbook') 
     
    665661        break; 
    666662 
    667  
    668663      // mail task commands 
    669664      case 'move': 
    670665      case 'moveto': 
    671666        if (this.task == 'mail') 
    672         { 
    673667          this.move_messages(props); 
    674           if (this.env.threading) 
    675           { 
    676             // The same as for 'delete' 
    677             this.list_mailbox(this.env.mailbox, this.env.current_page); 
    678           } 
    679         } 
    680668        else if (this.task == 'addressbook' && this.drag_active) 
    681669          this.copy_contact(null, props); 
     
    15631551    if (this.env.threading) 
    15641552      { 
    1565       // XXX: This assumes that div width is hardcoded to 15px, 
    1566       // Chris did it a bit differently in an original patch, he was adding so much divs as depth is 
    1567       // I replaced logic in list.js:drag_mouse_move() so subject text is picked defferently, so 
    1568       // either method of could be used (that was only the one problem I noted with these added divs). 
    1569       // The same is true for an offline list (program/steps/mail/func.inc:rcmail_message_list()). 
    1570       // Bubble 
     1553      // This assumes that div width is hardcoded to 15px, 
    15711554      var width = message.depth * 15; 
    15721555      if (width) 
     
    18801863    } 
    18811864 
    1882   this.expunge_mailbox = function(mbox) 
    1883     { 
    1884     var lock = false; 
    1885     var add_url = ''; 
    1886      
    1887     // lock interface if it's the active mailbox 
    1888     if (mbox == this.env.mailbox) 
    1889        { 
    1890        lock = true; 
    1891        this.set_busy(true, 'loading'); 
    1892        add_url = '&_reload=1'; 
    1893        } 
    1894  
    1895     // send request to server 
    1896     var url = '_mbox='+urlencode(mbox); 
    1897     this.http_post('expunge', url+add_url, lock); 
    1898     }; 
    1899  
    1900   this.purge_mailbox = function(mbox) 
    1901     { 
    1902     var lock = false; 
    1903     var add_url = ''; 
    1904      
    1905     if (!confirm(this.get_label('purgefolderconfirm'))) 
    1906       return false; 
    1907      
    1908     // lock interface if it's the active mailbox 
    1909     if (mbox == this.env.mailbox) 
    1910        { 
    1911        lock = true; 
    1912        this.set_busy(true, 'loading'); 
    1913        add_url = '&_reload=1'; 
    1914        } 
    1915  
    1916     // send request to server 
    1917     var url = '_mbox='+urlencode(mbox); 
    1918     this.http_post('purge', url+add_url, lock); 
    1919     return true; 
    1920     }; 
    1921  
    1922   // test if purge command is allowed 
    1923   this.purge_mailbox_test = function() 
    1924   { 
    1925     return (this.env.messagecount && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox  
    1926       || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))  
    1927       || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter)))); 
    1928   }; 
    1929  
    19301865  // update parent in a thread 
    19311866  this.update_thread_root = function(uid, flag) 
     
    19651900  } 
    19661901 
     1902  // update thread indicators for all messages in a thread below the specified message 
     1903  // return number of removed/added root level messages 
     1904  this.update_thread = function (uid) 
     1905  { 
     1906    if (!this.env.threading) 
     1907      return 0; 
     1908 
     1909    var rows = this.message_list.rows; 
     1910    var row = rows[uid] 
     1911    var depth = rows[uid].depth; 
     1912    var r, parent, count = 0; 
     1913    var roots = new Array(); 
     1914 
     1915    if (!row.depth) // root message: decrease roots count 
     1916      count--; 
     1917    else if (row.unread) { 
     1918      // update unread_children for thread root 
     1919      var parent = this.find_thread_root(uid); 
     1920      rows[parent].unread_children--; 
     1921      this.set_unread_children(parent); 
     1922      } 
     1923 
     1924    parent = row.parent_uid; 
     1925 
     1926    // childrens 
     1927    row = row.obj.nextSibling; 
     1928    while (row) { 
     1929      if (row.nodeType == 1 && (r = rows[row.uid])) { 
     1930        if (!r.depth || r.depth <= depth) 
     1931          break; 
     1932 
     1933        r.depth--; // move left 
     1934        $('#rcmtab'+r.uid).width(r.depth * 15); 
     1935        if (!r.depth) { // a new root 
     1936          count++; // increase roots count 
     1937          r.parent_uid = 0; 
     1938          if (r.has_children) { 
     1939            // replace 'leaf' with 'collapsed' 
     1940            $('#rcmrow'+r.uid+' '+'.leaf:first') 
     1941              .attr('id', 'rcmexpando' + r.uid) 
     1942              .attr('class', (r.obj.style.display != 'none' ? 'expanded' : 'collapsed')) 
     1943              .bind('mousedown', {uid:r.uid, p:this}, 
     1944                function(e) { return e.data.p.expand_message_row(e, e.data.uid); }); 
     1945 
     1946            r.unread_children = 0; 
     1947            roots[roots.length] = r; 
     1948            } 
     1949          // show if it was hidden 
     1950          if (r.obj.style.display == 'none') 
     1951            $(r.obj).show(); 
     1952          } 
     1953        else { 
     1954          if (r.depth == depth) 
     1955            r.parent_uid = parent; 
     1956          if (r.unread && roots.length) { 
     1957            roots[roots.length-1].unread_children++; 
     1958            } 
     1959          } 
     1960        } 
     1961        row = row.nextSibling; 
     1962      } 
     1963     
     1964    // update unread_children for roots 
     1965    for (var i=0; i<roots.length; i++) 
     1966      this.set_unread_children(roots[i].uid); 
     1967 
     1968    return count; 
     1969  }; 
     1970 
     1971  this.delete_excessive_thread_rows = function() 
     1972  { 
     1973    var rows = this.message_list.rows;     
     1974    var tbody = this.message_list.list.tBodies[0]; 
     1975    var row = tbody.firstChild; 
     1976    var cnt = this.env.pagesize + 1; 
     1977     
     1978    while (row) { 
     1979      if (row.nodeType == 1 && (r = rows[row.uid])) { 
     1980        if (!r.depth && cnt) 
     1981          cnt--; 
     1982 
     1983        if (!cnt) 
     1984          this.message_list.remove_row(row.uid); 
     1985        } 
     1986        row = row.nextSibling; 
     1987      } 
     1988  } 
     1989 
    19671990  // set message icon 
    19681991  this.set_message_icon = function(uid) 
     
    20372060 
    20382061    var rowobj = $(rows[uid].obj); 
    2039     if (rows[uid].unread && rows[uid].classname.indexOf('unread')<0) 
    2040       { 
    2041       rows[uid].classname += ' unread'; 
     2062 
     2063    if (rows[uid].unread && !rowobj.hasClass('unread')) 
    20422064      rowobj.addClass('unread'); 
    2043       } 
    2044     else if (!rows[uid].unread && rows[uid].classname.indexOf('unread')>=0) 
    2045       { 
    2046       rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 
     2065    else if (!rows[uid].unread && rowobj.hasClass('unread')) 
    20472066      rowobj.removeClass('unread'); 
    2048       } 
    2049      
    2050     if (rows[uid].deleted && rows[uid].classname.indexOf('deleted')<0) 
    2051       { 
    2052       rows[uid].classname += ' deleted'; 
     2067     
     2068    if (rows[uid].deleted && !rowobj.hasClass('deleted')) 
    20532069      rowobj.addClass('deleted'); 
    2054       } 
    2055     else if (!rows[uid].deleted && rows[uid].classname.indexOf('deleted')>=0) 
    2056       { 
    2057       rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, ''); 
     2070    else if (!rows[uid].deleted && rowobj.hasClass('deleted')) 
    20582071      rowobj.removeClass('deleted'); 
    2059       } 
    2060  
    2061     if (rows[uid].flagged && rows[uid].classname.indexOf('flagged')<0) 
    2062       { 
    2063       rows[uid].classname += ' flagged'; 
     2072 
     2073    if (rows[uid].flagged && !rowobj.hasClass('flagged')) 
    20642074      rowobj.addClass('flagged'); 
    2065       } 
    2066     else if (!rows[uid].flagged && rows[uid].classname.indexOf('flagged')>=0) 
    2067       { 
    2068       rows[uid].classname = rows[uid].classname.replace(/\s*flagged/, ''); 
     2075    else if (!rows[uid].flagged && rowobj.hasClass('flagged')) 
    20692076      rowobj.removeClass('flagged'); 
    2070       } 
    20712077 
    20722078    this.set_unread_children(uid); 
     
    21562162    }; 
    21572163 
    2158   // Send a specifc request with UIDs of all selected messages 
     2164  // Send a specifc moveto/delete request with UIDs of all selected messages 
    21592165  // @private 
    2160   this._with_selected_messages = function(action, lock, add_url, remove) 
     2166  this._with_selected_messages = function(action, lock, add_url) 
    21612167  { 
    21622168    var a_uids = new Array(); 
     2169    var count = 0; 
    21632170 
    21642171    if (this.env.uid) 
     
    21672174    { 
    21682175      var selection = this.message_list.get_selection(); 
    2169       var rows = this.message_list.rows; 
    21702176      var id; 
    21712177      for (var n=0; n<selection.length; n++) { 
    21722178        id = selection[n]; 
    21732179        a_uids[a_uids.length] = id; 
     2180        count += this.update_thread(id); 
    21742181        this.message_list.remove_row(id, (this.env.display_next && n == selection.length-1)); 
    21752182      } 
     
    21852192    if (this.env.display_next && this.env.next_uid) 
    21862193      add_url += '&_next_uid='+this.env.next_uid; 
     2194 
     2195    if (count < 0) 
     2196      add_url += '&_count='+(count*-1); 
     2197    else if (count > 0)  
     2198      // remove threads from the end of the list 
     2199      this.delete_excessive_thread_rows(); 
    21872200 
    21882201    // send request to server 
     
    23202333    var r_uids = new Array(); 
    23212334    var rows = this.message_list ? this.message_list.rows : new Array(); 
    2322      
     2335    var count = 0; 
     2336 
    23232337    for (var i=0; i<a_uids.length; i++) 
    23242338      { 
     
    23292343          r_uids[r_uids.length] = uid; 
    23302344 
    2331         if (this.env.skip_deleted) 
     2345        if (this.env.skip_deleted) { 
     2346          count += this.update_thread(uid); 
    23322347          this.message_list.remove_row(uid, (this.env.display_next && i == this.message_list.selection.length-1)); 
     2348          } 
    23332349        else 
    23342350          this.set_message(uid, 'deleted', true); 
     
    23372353 
    23382354    // make sure there are no selected rows 
    2339     if (this.env.skip_deleted && !this.env.display_next && this.message_list) 
     2355    if (this.env.skip_deleted && this.message_list) { 
     2356      if(!this.env.display_next) 
    23402357      this.message_list.clear_selection(); 
     2358      if (count < 0) 
     2359        add_url += '&_count='+(count*-1); 
     2360      else if (count > 0)  
     2361        // remove threads from the end of the list 
     2362        this.delete_excessive_thread_rows(); 
     2363      } 
    23412364 
    23422365    add_url = '&_from='+(this.env.action ? this.env.action : ''); 
     
    23742397        this.set_message(uid, 'unread', false); 
    23752398      } 
     2399  }; 
     2400 
     2401 
     2402  /*********************************************************/ 
     2403  /*********       mailbox folders methods         *********/ 
     2404  /*********************************************************/ 
     2405 
     2406  this.expunge_mailbox = function(mbox) 
     2407    { 
     2408    var lock = false; 
     2409    var add_url = ''; 
     2410     
     2411    // lock interface if it's the active mailbox 
     2412    if (mbox == this.env.mailbox) 
     2413       { 
     2414       lock = true; 
     2415       this.set_busy(true, 'loading'); 
     2416       add_url = '&_reload=1'; 
     2417       } 
     2418 
     2419    // send request to server 
     2420    var url = '_mbox='+urlencode(mbox); 
     2421    this.http_post('expunge', url+add_url, lock); 
     2422    }; 
     2423 
     2424  this.purge_mailbox = function(mbox) 
     2425    { 
     2426    var lock = false; 
     2427    var add_url = ''; 
     2428     
     2429    if (!confirm(this.get_label('purgefolderconfirm'))) 
     2430      return false; 
     2431     
     2432    // lock interface if it's the active mailbox 
     2433    if (mbox == this.env.mailbox) 
     2434       { 
     2435       lock = true; 
     2436       this.set_busy(true, 'loading'); 
     2437       add_url = '&_reload=1'; 
     2438       } 
     2439 
     2440    // send request to server 
     2441    var url = '_mbox='+urlencode(mbox); 
     2442    this.http_post('purge', url+add_url, lock); 
     2443    return true; 
     2444    }; 
     2445 
     2446  // test if purge command is allowed 
     2447  this.purge_mailbox_test = function() 
     2448  { 
     2449    return (this.env.messagecount && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox  
     2450      || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))  
     2451      || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter)))); 
    23762452  }; 
    23772453 
  • branches/devel-threads/program/js/common.js

    r2971 r3142  
    293293  else if (typeof e == 'object') 
    294294    e.event = evt; 
    295    
     295 
    296296  if (this._events && this._events[evt] && !this._event_exec) { 
    297297    this._event_exec = true; 
  • branches/devel-threads/program/js/list.js

    r3136 r3142  
    110110    var uid = RegExp.$1; 
    111111    row.uid = uid; 
    112     this.rows[uid] = {uid:uid, id:row.id, obj:row, classname:row.className}; 
     112    this.rows[uid] = {uid:uid, id:row.id, obj:row}; 
    113113 
    114114    // set eventhandlers to table row 
     
    326326  var evtarget = rcube_event.get_target(e); 
    327327  var mod_key = rcube_event.get_modifier(e); 
     328 
    328329  // Don't select this message 
    329330  this.dont_select = true; 
    330331  // Don't treat double click on the expando as double click on the message. 
    331332  row.clicked = 0; 
    332   if (row.expanded) 
    333   { 
     333 
     334  if (row.expanded) { 
    334335    evtarget.className = "collapsed"; 
    335336    if (mod_key == CONTROL_KEY || this.multiexpand) 
     
    338339      this.collapse(row); 
    339340  } 
    340   else 
    341   { 
     341  else { 
    342342    evtarget.className = "expanded"; 
    343343    if (mod_key == CONTROL_KEY || this.multiexpand) 
     
    355355  var r; 
    356356 
    357   while (new_row) 
    358   { 
    359     if (new_row.nodeType == 1) 
    360     { 
     357  while (new_row) { 
     358    if (new_row.nodeType == 1) { 
    361359      var r = this.rows[new_row.uid]; 
    362360      if (r && r.depth <= depth) 
     
    370368}, 
    371369 
    372  
    373370expand: function(row) 
    374371{ 
     
    376373  var last_expanded_parent_depth; 
    377374 
    378   if (row) 
    379   { 
     375  if (row) { 
    380376    row.expanded = true; 
    381377    depth = row.depth; 
    382378    new_row = row.obj.nextSibling; 
    383379  } 
    384   else 
    385   { 
     380  else { 
    386381    var tbody = this.list.tBodies[0]; 
    387382    new_row = tbody.firstChild; 
     
    390385  } 
    391386 
    392   while (new_row) 
    393   { 
    394     if (new_row.nodeType == 1) 
    395     { 
     387  while (new_row) { 
     388    if (new_row.nodeType == 1) { 
    396389      var r = this.rows[new_row.uid]; 
    397       if (r) 
    398       { 
    399         if (row && r.depth <= depth) 
     390      if (r) { 
     391        if (row && (!r.depth || r.depth <= depth)) 
    400392          break; 
    401         if (r.parent_uid) 
    402         { 
     393 
     394        if (r.parent_uid) { 
    403395          var p = this.rows[r.parent_uid]; 
    404           if (p && p.expanded) 
    405           { 
    406             if ((row && p == row) || last_expanded_parent_depth >= p.depth - 1) 
    407             { 
     396          if (p && p.expanded) { 
     397            if ((row && p == row) || last_expanded_parent_depth >= p.depth - 1) { 
    408398              last_expanded_parent_depth = p.depth; 
    409399              $(new_row).show(); 
     
    429419  var r; 
    430420 
    431   if (row) 
    432   { 
     421  if (row) { 
    433422    row.expanded = false; 
    434423    depth = row.depth; 
     
    438427      return false;  
    439428  } 
    440   else 
    441   { 
     429  else { 
    442430    var tbody = this.list.tBodies[0]; 
    443431    new_row = tbody.firstChild; 
     
    446434 
    447435  while (new_row) { 
    448     if (new_row.nodeType == 1) 
    449     { 
     436    if (new_row.nodeType == 1) { 
    450437      var r = this.rows[new_row.uid]; 
    451       if (row && r.depth <= depth) 
    452         break; 
    453       if (row || r.depth) 
    454         new_row.style.display = 'none'; 
    455       if (r.has_children) { 
    456         r.expanded = false; 
    457         var expando = document.getElementById('rcmexpando' + r.uid); 
    458         if (expando) 
    459           expando.className = 'collapsed'; 
     438      if (r) { 
     439        if (row && (!r.depth || r.depth <= depth)) 
     440          break; 
     441 
     442        if (row || r.depth) 
     443          new_row.style.display = 'none'; 
     444        if (r.has_children) { 
     445          r.expanded = false; 
     446          var expando = document.getElementById('rcmexpando' + r.uid); 
     447          if (expando) 
     448            expando.className = 'collapsed'; 
     449        } 
    460450      } 
    461451    } 
     
    471461  var r; 
    472462 
    473   if (row) 
    474   { 
     463  if (row) { 
    475464    row.expanded = true; 
    476465    depth = row.depth; 
    477466    new_row = row.obj.nextSibling; 
    478467  } 
    479   else 
    480   { 
     468  else { 
    481469    var tbody = this.list.tBodies[0]; 
    482470    new_row = tbody.firstChild; 
     
    484472  } 
    485473 
    486   while (new_row) 
    487   { 
    488     if (new_row.nodeType == 1) 
    489     { 
     474  while (new_row) { 
     475    if (new_row.nodeType == 1) { 
    490476      var r = this.rows[new_row.uid]; 
    491       if (row && r.depth <= depth) 
    492         break; 
    493       $(new_row).show(); 
    494       if (r.has_children) 
    495       { 
    496         r.expanded = true; 
    497         var expando = document.getElementById('rcmexpando' + r.uid); 
    498         if (expando) 
    499           expando.className = 'expanded'; 
     477      if (r) { 
     478        if (row && r.depth <= depth) 
     479          break; 
     480 
     481        $(new_row).show(); 
     482        if (r.has_children) { 
     483          r.expanded = true; 
     484          var expando = document.getElementById('rcmexpando' + r.uid); 
     485          if (expando) 
     486            expando.className = 'expanded'; 
     487        } 
    500488      } 
    501489    } 
  • branches/devel-threads/program/steps/mail/check_recent.inc

    r3106 r3142  
    3838 
    3939      $OUTPUT->set_env('messagecount', $all_count); 
    40       $OUTPUT->set_env('pagesize', $IMAP->page_size); 
    4140      $OUTPUT->set_env('pagecount', ceil($all_count/$IMAP->page_size)); 
    4241      $OUTPUT->command('set_unread_count', $mbox_name, $unread_count, ($mbox_name == 'INBOX')); 
  • branches/devel-threads/program/steps/mail/func.inc

    r3137 r3142  
    9494    } 
    9595         
    96   // set current mailbox in client environment 
     96  // set current mailbox and some other vars in client environment 
    9797  $OUTPUT->set_env('mailbox', $mbox_name); 
     98  $OUTPUT->set_env('pagesize', $IMAP->page_size); 
    9899  $OUTPUT->set_env('quota', $IMAP->get_capability('quota')); 
    99100  $OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter()); 
     
    142143 
    143144  // get message headers 
    144   $a_headers = $IMAP->list_headers('', '', $sort_col, $sort_order); 
     145  $a_headers = $IMAP->list_headers('', '', $_SESSION['sort_col'], $_SESSION['sort_order']); 
    145146 
    146147  // add id to message list table if not specified 
     
    368369    $a_show_cols[$f] = 'to'; 
    369370 
    370   $browser = new rcube_browser; 
    371    
    372371  $thead = $head_replace ? rcmail_message_list_head($_SESSION['list_attrib'], $a_show_cols) : NULL; 
    373372   
    374373  $OUTPUT->command('set_message_coltypes', $a_show_cols, $thead); 
     374 
     375  if (empty($a_headers)) 
     376    return; 
    375377 
    376378  // remove 'attachment' and 'flag' columns, we don't need them here 
     
    379381  if(($key = array_search('flag', $a_show_cols)) !== FALSE) 
    380382    unset($a_show_cols[$key]); 
     383 
     384  $browser = new rcube_browser; 
    381385 
    382386  if ($browser->ie && $replace) 
     
    504508      // list options menu link 
    505509      if ($col == 'subject' && !empty($attrib['optionsmenuicon'])) { 
    506           $list_menu = sprintf('<a href="#"><img src="%s%s" id="%s" align="absmiddle" style="%s" title="%s" alt="" /></a>', 
     510          $list_menu = sprintf('<a href="#" onclick="%s"><img src="%s%s" id="%s" align="absmiddle" style="%s" title="%s" alt="" /></a>', 
     511            'return '.JS_OBJECT_NAME.'.command(\'menu-open\', \'messagelistmenu\')', 
    507512            $skin_path, 
    508513            $attrib['optionsmenuicon'], 
  • branches/devel-threads/program/steps/mail/list.inc

    r3129 r3142  
    8383 
    8484// add message rows 
     85rcmail_js_message_list($a_headers, FALSE, TRUE, (bool) $cols); 
    8586if (isset($a_headers) && count($a_headers)) 
    8687{ 
    87   rcmail_js_message_list($a_headers, FALSE, TRUE, (bool) $cols); 
    8888  if ($search_request) 
    8989    $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count)); 
  • branches/devel-threads/program/steps/mail/mark.inc

    r2960 r3142  
    3737  if ($flag == 'DELETED' && $CONFIG['skip_deleted'] && $_POST['_from'] != 'show') { 
    3838    // count messages before changing anything 
    39     $old_count = $IMAP->messagecount(); 
     39    $old_count = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL'); 
    4040    $old_pages = ceil($old_count / $IMAP->page_size); 
    4141    $count = sizeof(explode(',', $uids)); 
     
    7676      } 
    7777 
    78       $msg_count      = $IMAP->messagecount(); 
     78      $msg_count      = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL'); 
    7979      $pages          = ceil($msg_count / $IMAP->page_size); 
    8080      $nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; 
     
    103103      $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); 
    104104 
     105      if ($IMAP->threading) 
     106        $count = get_input_value('_count', RCUBE_INPUT_POST); 
     107 
    105108      // add new rows from next page (if any) 
    106       if (($jump_back || $nextpage_count > 0)) { 
     109      if ($count && ($jump_back || $nextpage_count > 0)) { 
    107110        $sort_col   = isset($_SESSION['sort_col'])   ? $_SESSION['sort_col']   : $CONFIG['message_sort_col']; 
    108111        $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; 
  • branches/devel-threads/program/steps/mail/move_del.inc

    r3106 r3142  
    117117  $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); 
    118118 
     119  if ($IMAP->threading) 
     120    $count = get_input_value('_count', RCUBE_INPUT_POST); 
     121 
    119122  // add new rows from next page (if any) 
    120   if ($addrows && ($jump_back || $nextpage_count > 0)) { 
     123  if ($addrows && $count && ($jump_back || $nextpage_count > 0)) { 
    121124    $sort_col   = isset($_SESSION['sort_col'])   ? $_SESSION['sort_col']   : $CONFIG['message_sort_col']; 
    122125    $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; 
    123126 
    124127    $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order, $count); 
    125     if ($_SESSION['threads']) 
    126       // TODO: count number of roots deleted and slice that many roots from the end of $a_headers  
    127       $OUTPUT->command('message_list.clear'); 
    128     else 
    129       $a_headers = array_slice($a_headers, -$count, $count); 
    130128 
    131129    rcmail_js_message_list($a_headers, false, false); 
  • branches/devel-threads/skins/default/functions.js

    r3124 r3142  
    126126  this.messagemenu = $('#messagemenu'); 
    127127  this.listmenu = $('#listmenu'); 
    128   this.add_listmenulink(); 
    129128} 
    130129 
    131130rcube_mail_ui.prototype = { 
    132  
    133 add_listmenulink: function() 
    134 { 
    135   var ref = rcube_find_object('listmenulink'); 
    136   if (ref) 
    137     ref.onclick = function () { rcmail_ui.show_listmenu() }; 
    138 }, 
    139131 
    140132show_markmenu: function(show) 
     
    223215}, 
    224216 
     217listmenu_open: function(e) 
     218{ 
     219  this.show_listmenu(true); 
     220}, 
     221 
    225222save_listmenu: function() 
    226223{ 
     
    287284  rcube_event.add_listener({ object:rcmail_ui, method:'body_mouseup', event:'mouseup' }); 
    288285  rcube_event.add_listener({ object:rcmail_ui, method:'body_keypress', event:'keypress' }); 
    289   rcube_event.add_listener({ object:rcmail_ui, method:'add_listmenulink', event:'listupdate' }); 
    290 } 
     286  rcmail.addEventListener('menu-open', 'listmenu_open', rcmail_ui); 
     287} 
Note: See TracChangeset for help on using the changeset viewer.