alecpl
2010-04-14 58892824a6ee7f9a545372730b615ec9abafbe5c
program/js/app.js
@@ -525,7 +525,7 @@
            this.reset_qsearch();
          this.list_contacts(props);
          this.enable_command('add', 'import', (this.env.address_sources && !this.env.address_sources[props].readonly));
          this.enable_command('add', 'import', (this.env.address_sources && !this.env.address_sources[this.env.source].readonly));
          }
        break;
@@ -1273,6 +1273,9 @@
    if (this.preview_timer)
      clearTimeout(this.preview_timer);
    
    if (this.preview_read_timer)
      clearTimeout(this.preview_read_timer);
    // save folderlist and folders location/sizes for droptarget calculation in drag_move()
    if (this.gui_objects.folderlist && model)
      {
@@ -1438,6 +1441,9 @@
    if (this.preview_timer)
      clearTimeout(this.preview_timer);
    if (this.preview_read_timer)
      clearTimeout(this.preview_read_timer);
    var selected = list.get_single_selection() != null;
    // Hide certain command buttons when Drafts folder is selected
@@ -1464,6 +1470,9 @@
    {
      if (this.preview_timer)
        clearTimeout(this.preview_timer);
      if (this.preview_read_timer)
        clearTimeout(this.preview_read_timer);
    var uid = list.get_single_selection();
    if (uid && this.env.mailbox == this.env.drafts_mailbox)
@@ -1754,24 +1763,25 @@
    var url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url;
    if (action == 'preview' && String(target.location.href).indexOf(url) >= 0)
      this.show_contentframe(true);
    else
      {
    else {
      this.set_busy(true, 'loading');
      target.location.href = this.env.comm_path+url;
      // mark as read and change mbox unread counter
      if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread)
        {
        this.set_message(id, 'unread', false);
        this.update_thread_root(id, 'read');
        if (this.env.unread_counts[this.env.mailbox])
          {
          this.env.unread_counts[this.env.mailbox] -= 1;
          this.set_unread_count(this.env.mailbox, this.env.unread_counts[this.env.mailbox], this.env.mailbox == 'INBOX');
      if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read >= 0) {
        this.preview_read_timer = window.setTimeout(function() {
          ref.set_message(id, 'unread', false);
          ref.update_thread_root(id, 'read');
          if (ref.env.unread_counts[ref.env.mailbox]) {
            ref.env.unread_counts[ref.env.mailbox] -= 1;
            ref.set_unread_count(ref.env.mailbox, ref.env.unread_counts[ref.env.mailbox], ref.env.mailbox == 'INBOX');
          }
        }
          if (ref.env.preview_pane_mark_read > 0)
            ref.http_post('mark', '_uid='+id+'&_flag=read');
        }, this.env.preview_pane_mark_read * 1000);
      }
    };
    }
  };
  this.show_contentframe = function(show)
    {
@@ -3433,8 +3443,7 @@
    else if (group != this.env.group)
      page = this.env.current_page = 1;
    this.select_folder(src, this.env.source);
    this.select_folder(group, this.env.group, 'rcmliG');
    this.select_folder((group ? 'G'+group : src), (this.env.group ? 'G'+this.env.group : this.env.source));
    
    this.env.source = src;
    this.env.group = group;
@@ -3506,7 +3515,7 @@
    if (action && (cid || action=='add') && !this.drag_active)
      {
      this.set_busy(true);
      target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url;
      target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+'&_cid='+urlencode(cid) + add_url;
      }
    return true;
    };
@@ -3729,7 +3738,9 @@
    var key = 'G'+prop.id;
    this.env.contactfolders[key] = this.env.contactgroups[key] = prop;
    var link = $('<a>').attr('href', '#').attr('onclick', "return rcmail.command('listgroup','"+prop.id+"',this)").html(prop.name);
    var link = $('<a>').attr('href', '#')
      .bind('click', function() { return rcmail.command('listgroup', prop.id, this);})
      .html(prop.name);
    var li = $('<li>').attr('id', 'rcmli'+key).addClass('contactgroup').append(link);
    $(this.gui_objects.folderlist).append(li);
    
@@ -4661,6 +4672,13 @@
      addrbook_show_images.disabled = !checkbox.checked;
    }
  this.toggle_preview_pane = function(checkbox)
    {
    var preview_pane_mark_read;
    if (preview_pane_mark_read = document.getElementById('rcmfd_preview_pane_mark_read'))
      preview_pane_mark_read.disabled = !checkbox.checked;
    }
  // display fetched raw headers
  this.set_headers = function(content)
  {