svncommit
2007-09-27 65fb1a5771d4ac0226ed51fff44f2762848c1e11
program/js/app.js
@@ -1440,10 +1440,8 @@
        {
        id = selection[n];
        a_uids[a_uids.length] = id;
        this.message_list.remove_row(id);
        this.message_list.remove_row(id, (n == selection.length-1));
        }
      this.message_list.select_next();
      }
      
    // also send search request to get the right messages 
@@ -2367,7 +2365,7 @@
        {
        id = selection[n];
        a_cids[a_cids.length] = id;
        this.contact_list.remove_row(id);
        this.contact_list.remove_row(id, (n == selection.length-1));
        }
      // hide content frame if we delete the currently displayed contact
@@ -2407,8 +2405,6 @@
    var p = this;
    this.subscription_list = new rcube_list_widget(this.gui_objects.subscriptionlist, {multiselect:false, draggable:true, keyboard:false});
    this.subscription_list.addEventListener('select', function(o){ p.subscription_select(o); });
    this.subscription_list.addEventListener('mouseover', function(o){ p.subscription_select_parent(o); });
    this.subscription_list.addEventListener('mouseout', function(o){ p.subscription_unselect_parent(o); });
    this.subscription_list.addEventListener('dragstart', function(o){ p.drag_active = true; });
    this.subscription_list.addEventListener('dragend', function(o){ p.subscription_move_folder(o); });
    this.subscription_list.init();
@@ -2467,6 +2463,7 @@
    var reg = RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
    if (this.drag_active && this.check_droptarget(id) &&
        (id != this.env.folder.replace(reg, '')) &&
        (!id.match(new RegExp('^'+RegExp.escape(this.env.folder+this.env.delimiter)))) &&
        (row = document.getElementById(this.get_folder_row_id(id))))
      if (find_in_array(this.env.defaultfolders, id)>=0)
        {
@@ -2562,7 +2559,16 @@
      }
    if (oldname && newname)
      {
      this.http_post('rename-folder', '_folder_oldname='+urlencode(oldname)+'&_folder_newname='+urlencode(newname));
      for (var row in this.env.subscriptionrows)
        if (this.env.subscriptionrows[row][0].match(new RegExp('^'+RegExp.escape(oldname+this.env.delimiter))))
          {
          var subnewname = this.env.subscriptionrows[row][0].replace(new RegExp('^'+RegExp.escape(oldname+this.env.delimiter)), newname+this.env.delimiter);
          this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[row][0])+
                         '&_folder_newname='+urlencode(subnewname));
          }
      }
    };
@@ -2640,11 +2646,16 @@
  // delete a specific mailbox with all its messages
  this.delete_folder = function(folder)
    {
  if (this.edit_folder)
    this.reset_folder_rename();
    if (this.edit_folder)
      this.reset_folder_rename();
    
    if (folder)
      {
      this.http_post('delete-folder', '_mboxes='+urlencode(folder));
      for (var row in this.env.subscriptionrows)
        if (this.env.subscriptionrows[row][0].match(new RegExp('^'+RegExp.escape(folder+this.env.delimiter))))
          this.http_post('delete-folder', '_mboxes='+urlencode(this.env.subscriptionrows[row][0]));
      }
    };