alecpl
2008-04-11 6d2714b3b3660f8a4efbb9c53e00b76245c2bcc2
program/js/app.js
@@ -179,7 +179,6 @@
          {
          this.enable_command('compose', 'add-contact', false);
          parent.rcmail.show_contentframe(true);
          parent.rcmail.mark_message('read', this.env.uid);
          }
        if ((this.env.action=='show' || this.env.action=='preview') && this.env.blockedobjects)
@@ -1569,6 +1568,28 @@
    this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
  };
  // set class to read/unread
  this.mark_as_read_from_preview = function(uid)
  {
    var icn_src;
    var rows = parent.rcmail.message_list.rows;
    if(rows[uid].unread)
      {
        rows[uid].unread = false;
        rows[uid].classname = rows[uid].classname.replace(/\s*unread/, '');
        parent.rcmail.set_classname(rows[uid].obj, 'unread', false);
        if (rows[uid].replied && parent.rcmail.env.repliedicon)
         icn_src = parent.rcmail.env.repliedicon;
        else if (parent.rcmail.env.messageicon)
          icn_src = parent.rcmail.env.messageicon;
   if (rows[uid].icon && icn_src)
          rows[uid].icon.src = icn_src;
      }
  }
  
  // mark all message rows as deleted/undeleted
  this.toggle_delete_status = function(a_uids)
@@ -2118,6 +2139,22 @@
    };
  // handler for mouse events on address-fields
  this.ksearch_onmousemove = function(li)
    {
    var last = document.getElementById('rcmksearchSelected');
    if (last)
      {
        last.removeAttribute('id');
        this.set_classname(last, 'selected', false);
      }
    li.setAttribute('id', 'rcmksearchSelected');
    this.set_classname(li, 'selected', true);
    this.ksearch_selected = li._rcm_id;
    };
  this.insert_recipient = function(id)
  {
    if (!this.env.contacts[id] || !this.ksearch_input)
@@ -2208,7 +2245,8 @@
        li = document.createElement('LI');
        li.innerHTML = a_results[i].replace(/</, '&lt;').replace(/>/, '&gt;');
        li.onmousedown = function(e){ ref.insert_recipient(this._rcm_id); ref.ksearch_pane.show(0); return rcube_event.cancel(e); };
        li.style.cursor = 'pointer';
        li.onmouseover = function(e){ ref.ksearch_onmousemove(this); };
       li.style.cursor = 'pointer';
        li._rcm_id = a_result_ids[i];
        ul.appendChild(li);
        }
@@ -3237,16 +3275,13 @@
    this.set_page_buttons();
    };
  // replace content of quota display
  this.set_quota = function()
  this.set_quota = function(content)
    {
    if (this.gui_objects.quotadisplay &&
        this.gui_objects.quotadisplay.attributes.getNamedItem('display') &&
        this.gui_objects.quotadisplay.attributes.getNamedItem('id'))
      this.http_request('quotadisplay', '_display='+
      this.gui_objects.quotadisplay.attributes.getNamedItem('display').nodeValue+
      '&_id='+this.gui_objects.quotadisplay.attributes.getNamedItem('id').nodeValue, false);
     };
    if (this.gui_objects.quotadisplay && content)
      this.gui_objects.quotadisplay.innerHTML = content;
    };
  // update the mailboxlist
@@ -3291,7 +3326,12 @@
      }
    };
  // update parent's mailboxlist (from preview)
  this.set_unread_count_from_preview = function(mbox, count, set_title)
  {
    parent.rcmail.set_unread_count(mbox, count, set_title);
  }
  // add row to contacts list
  this.add_contact_row = function(cid, cols, select)
    {
@@ -3453,26 +3493,37 @@
    // process the response data according to the sent action
    switch (request_obj.__action)
      {
      case 'delete':
      case 'moveto':
        if (this.env.action=='show')
          this.command('list');
        else if (this.message_list)
          this.message_list.init();
        break;
      case 'purge':
      case 'expunge':
   if (!this.env.messagecount)
         {
       // clear preview pane content
       if (this.env.contentframe)
         this.show_contentframe(false);
       // disable commands useless when mailbox is empty
       this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource',
         'print', 'load-attachment', 'purge', 'expunge', 'select-all', 'select-none', 'sort', false);
     }
   break;
      case 'list':
        if (this.env.messagecount)
     this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox));
   this.msglist_select(this.message_list);
      case 'check-recent':
      case 'getunread':
   this.enable_command('sort', (this.env.messagecount > 0));
   this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0));
   this.enable_command('purge', (this.env.messagecount && (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox)));
      case 'expunge':
        this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false);
        break;
   break;
      }