alecpl
2008-10-06 a164a2e64b65fbe0729f6d4326b0219f1914c139
program/js/app.js
@@ -821,22 +821,27 @@
      case 'compose':
        var url = this.env.comm_path+'&_action=compose';
       
        if (this.task=='mail' && this.env.mailbox==this.env.drafts_mailbox)
        if (this.task=='mail')
          {
          var uid;
          if (uid = this.get_single_uid())
            url += '&_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox);
          }
         url += '&_mbox='+urlencode(this.env.mailbox);
     if (this.env.mailbox==this.env.drafts_mailbox)
       {
       var uid;
            if (uid = this.get_single_uid())
              url += '&_draft_uid='+uid;
            }
     }
        // modify url if we're in addressbook
        else if (this.task=='addressbook')
          {
          // switch to mail compose step directly
          if (props && props.indexOf('@') > 0)
          {
            {
            url = this.get_task_url('mail', url);
            this.redirect(url + '&_to='+urlencode(props));
            break;
          }
            }
          
          // use contact_id passed as command parameter
          var a_cids = new Array();
@@ -1924,8 +1929,17 @@
    var input_to = rcube_find_object('_to');
    var input_cc = rcube_find_object('_cc');
    var input_bcc = rcube_find_object('_bcc');
    var input_from = rcube_find_object('_from');
    var input_subject = rcube_find_object('_subject');
    var input_message = rcube_find_object('_message');
    // check sender (if have no identities)
    if (input_from.type == 'text' && !rcube_check_email(input_from.value, true))
      {
      alert(this.get_label('nosenderwarning'));
      input_from.focus();
      return false;
      }
    // check for empty recipient
    var recipients = input_to.value ? input_to.value : (input_cc.value ? input_cc.value : input_bcc.value);
@@ -1971,6 +1985,13 @@
  this.display_spellcheck_controls = function(vis)
  {
    if (this.env.spellcheck) {
      // stop spellchecking process
      if (!vis && !this.spellcheck_ready)
        {
   exec_event(this.env.spellcheck.check_link, 'click');
   this.set_spellcheck_state('ready');
   }
      this.env.spellcheck.check_link.style.visibility = vis ? 'visible' : 'hidden';
      this.env.spellcheck.switch_lan_pic.style.visibility = vis ? 'visible' : 'hidden';
    }
@@ -3385,7 +3406,11 @@
    
    var row = document.createElement('TR');
    row.id = 'rcmrow'+uid;
    row.className = 'message '+(even ? 'even' : 'odd')+(flags.unread ? ' unread' : '')+(flags.deleted ? ' deleted' : '');
    row.className = 'message'
   + (even ? ' even' : ' odd')
        + (flags.unread ? ' unread' : '')
   + (flags.deleted ? ' deleted' : '')
   + (flags.flagged ? ' flagged' : '');
    if (this.message_list.in_selection(uid))
      row.className += ' selected';
@@ -3812,13 +3837,14 @@
      case 'getunread':
      case 'list':
        if (this.task == 'mail') {
          if (this.message_list)
          if (this.message_list && request_obj.__action == 'list')
            this.msglist_select(this.message_list);
          this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0));
          this.enable_command('purge', this.purge_mailbox_test());
        }
        else if (this.task == 'addressbook')
          this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0));
        break;
      }