alecpl
2010-10-01 249db18585959c9ab3e09b6e91f8fec7cd32e9d0
program/js/app.js
@@ -225,17 +225,20 @@
          }
        }
        else if (this.env.action == 'compose') {
          this.enable_command('send-attachment', 'remove-attachment', 'send', 'toggle-editor', true);
          this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'toggle-editor'];
          if (this.env.drafts_mailbox)
            this.env.compose_commands.push('savedraft')
          this.enable_command(this.env.compose_commands, 'identities', true);
          if (this.env.spellcheck) {
            this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); };
            this.env.compose_commands.push('spellcheck')
            this.set_spellcheck_state('ready');
            if ($("input[name='_is_html']").val() == '1')
              this.display_spellcheck_controls(false);
          }
          if (this.env.drafts_mailbox)
            this.enable_command('savedraft', true);
          document.onmouseup = function(e){ return p.doc_mouse_up(e); };
@@ -425,8 +428,7 @@
    }
    // check input before leaving compose step
    if (this.task=='mail' && this.env.action=='compose'
        && (command == 'list' || command == 'mail' || command == 'addressbook' || command == 'settings')) {
    if (this.task=='mail' && this.env.action=='compose' && $.inArray(command, this.env.compose_commands)<0) {
      if (this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
        return false;
    }
@@ -974,11 +976,11 @@
        break;
      case 'identities':
        this.goto_url('identities');
        this.goto_url('settings/identities');
        break;
      case 'folders':
        this.goto_url('folders');
        this.goto_url('settings/folders');
        break;
      // unified command call (command name == function name)
@@ -1292,7 +1294,7 @@
      }
    }
    this.http_post('utils/save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
    this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
    this.set_unread_count_display(id, false);
  };
@@ -1463,7 +1465,7 @@
    if ((found = $.inArray('subject', this.env.coltypes)) >= 0)
      this.set_env('subject_col', found);
    this.http_post('utils/save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' });
    this.http_post('save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' });
  };
  this.check_droptarget = function(id)
@@ -2942,8 +2944,10 @@
      sig_separator = this.env.sig_above && (this.env.compose_mode == 'reply' || this.env.compose_mode == 'forward') ? '---' : '-- ';
    // enable manual signature insert
    if (this.env.signatures && this.env.signatures[id])
    if (this.env.signatures && this.env.signatures[id]) {
      this.enable_command('insert-sig', true);
      this.env.compose_commands.push('insert-sig');
    }
    else
      this.enable_command('insert-sig', false);
@@ -3631,7 +3635,6 @@
    }
  };
  this.delete_contacts = function()
  {
    // exit if no mailbox specified or if selection is empty
@@ -3721,7 +3724,6 @@
    this.enable_command('export', (this.contact_list.rowcount > 0));
  };
  this.group_create = function()
  {
@@ -3856,7 +3858,7 @@
    if (li && (link = li.firstChild) && link.tagName.toLowerCase() == 'a')
      link.innerHTML = prop.name;
    this.env.contactfolders[key].name = this.env.contactgroups[key].name = name;
    this.env.contactfolders[key].name = this.env.contactgroups[key].name = prop.name;
    this.triggerEvent('group_update', { id:prop.id, source:prop.source, name:prop.name, li:li[0] });
  };