alecpl
2010-05-06 c833ed4053106c9df58b84a441cc4509cda45a38
program/js/app.js
@@ -87,7 +87,7 @@
    if (sel) button_prop.sel = sel;
    if (over) button_prop.over = over;
    this.buttons[command][this.buttons[command].length] = button_prop;
    this.buttons[command][this.buttons[command].length] = button_prop;
  };
  // register a specific gui object
@@ -165,9 +165,10 @@
        if (this.gui_objects.messagelist) {
          this.message_list = new rcube_list_widget(this.gui_objects.messagelist,
            {multiselect:true, multiexpand:true, draggable:true, keyboard:true,
            column_movable:this.env.col_movable, column_fixed:0, dblclick_time:this.dblclick_time});
          this.message_list = new rcube_list_widget(this.gui_objects.messagelist, {
            multiselect:true, multiexpand:true, draggable:true, keyboard:true,
            column_movable:this.env.col_movable, column_fixed:0, dblclick_time:this.dblclick_time
            });
          this.message_list.row_init = function(o){ p.init_message_row(o); };
          this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); });
          this.message_list.addEventListener('click', function(o){ p.msglist_click(o); });
@@ -186,8 +187,7 @@
          this.enable_command('toggle_status', 'toggle_flag', 'menu-open', 'menu-save', true);
          // load messages
          if (this.env.messagecount)
            this.command('list');
          this.command('list');
        }
        if (this.gui_objects.qsearchbox) {
@@ -246,16 +246,6 @@
        // show printing dialog
        else if (this.env.action == 'print')
          window.print();
        if (this.env.messagecount) {
          this.enable_command('select-all', 'select-none', 'expunge', true);
          this.enable_command('expand-all', 'expand-unread', 'collapse-all', this.env.threading);
        }
        if (this.purge_mailbox_test())
          this.enable_command('purge', true);
        this.set_page_buttons();
        // get unread count for each mailbox
        if (this.gui_objects.mailboxlist) {
@@ -1409,15 +1399,13 @@
    var selected = list.get_single_selection() != null;
    // Hide certain command buttons when Drafts folder is selected
    if (this.env.mailbox == this.env.drafts_mailbox) {
      this.enable_command('reply', 'reply-all', 'forward', false);
      this.enable_command('show', 'print', 'open', 'edit', 'download', 'viewsource', selected);
      this.enable_command('delete', 'moveto', 'copy', 'mark', (list.selection.length > 0 ? true : false));
    }
    else {
      this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', 'edit', 'open', 'download', 'viewsource', selected);
      this.enable_command('delete', 'moveto', 'copy', 'mark', (list.selection.length > 0 ? true : false));
    }
    this.enable_command('reply', 'reply-all', 'forward', this.env.mailbox == this.env.drafts_mailbox ? false : selected);
    this.enable_command('show', 'print', 'open', 'edit', 'download', 'viewsource', selected);
    this.enable_command('delete', 'moveto', 'copy', 'mark', (list.selection.length > 0 ? true : false));
    // reset all-pages-selection
    if (selected || list.selection.length != list.rowcount)
      this.select_all_mode = false;
    // start timer for message preview (wait for double click)
    if (selected && this.env.contentframe && !list.multi_selecting)
@@ -4249,13 +4237,13 @@
      // set image according to button state
      if (obj && button.type=='image' && button[state]) {
        button.status = state;
        button.status = state;
        obj.src = button[state];
      }
      // set class name according to button state
      else if (obj && typeof(button[state])!='undefined') {
        button.status = state;
        obj.className = button[state];
        button.status = state;
        obj.className = button[state];
      }
      // disable/enable input buttons
      if (obj && button.type=='input') {
@@ -4845,21 +4833,20 @@
      case 'search':
      case 'list':
        if (this.task == 'mail') {
          if (this.message_list && (response.action == 'list' || response.action == 'search')) {
            this.msglist_select(this.message_list);
            this.expand_threads();
          }
          this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0));
          this.enable_command('purge', this.purge_mailbox_test());
          this.enable_command('expand-all', 'expand-unread', 'collapse-all', this.env.threading && this.env.messagecount);
          if (response.action == 'list')
          if (response.action == 'list' || response.action == 'search') {
            this.msglist_select(this.message_list);
            this.expand_threads();
            this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:this.message_list.rowcount });
          }
        }
        else if (this.task == 'addressbook') {
          this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0));
          if (response.action == 'list') {
          if (response.action == 'list' || response.action == 'search') {
            this.enable_command('group-create', this.env.address_sources[this.env.source].groups);
            this.enable_command('group-rename', 'group-delete', this.env.address_sources[this.env.source].groups && this.env.group);
            this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount });