alecpl
2010-04-15 a4c163f93027f38c7264e9bc1bef8e2593b3e1cf
- removed redundant code + code formatting


1 files modified
39 ■■■■■ changed files
program/js/app.js 39 ●●●●● patch | view | raw | blame | history
program/js/app.js
@@ -2591,16 +2591,14 @@
    this.init_address_input_events($("[name='_cc']"));
    this.init_address_input_events($("[name='_bcc']"));
    
    if (!html_mode)
      this.set_caret_pos(input_message, this.env.top_posting ? 0 : $(input_message).val().length);
    if (!html_mode) {
    // add signature according to selected identity
    if (input_from.attr('type') == 'select-one' && $("input[name='_draft_saveid']").val() == ''
        && !html_mode) {  // if we have HTML editor, signature is added in callback
      // if we have HTML editor, signature is added in callback
      if (input_from.attr('type') == 'select-one' && $("input[name='_draft_saveid']").val() == '') {
      this.change_identity(input_from[0]);
    }
    else if (!html_mode)
      this.set_caret_pos(input_message, this.env.top_posting ? 0 : $(input_message).val().length);
    }
    if (input_to.val() == '')
      input_to.focus();
@@ -2635,8 +2633,7 @@
    var input_message = $("[name='_message']");
    // check sender (if have no identities)
    if (input_from.attr('type') == 'text' && !rcube_check_email(input_from.val(), true))
      {
    if (input_from.attr('type') == 'text' && !rcube_check_email(input_from.val(), true)) {
      alert(this.get_label('nosenderwarning'));
      input_from.focus();
      return false;
@@ -2644,8 +2641,7 @@
    // check for empty recipient
    var recipients = input_to.val() ? input_to.val() : (input_cc.val() ? input_cc.val() : input_bcc.val());
    if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true))
      {
    if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true)) {
      alert(this.get_label('norecipientwarning'));
      input_to.focus();
      return false;
@@ -2903,10 +2899,8 @@
      return false;
    var elm, list;
    if (elm = this.gui_objects.uploadbox)
      {
      if (a && (list = this.gui_objects.attachmentlist))
        {
    if (elm = this.gui_objects.uploadbox) {
      if (a && (list = this.gui_objects.attachmentlist)) {
        var pos = $(list).offset();
        elm.style.top = (pos.top + list.offsetHeight + 10) + 'px';
        elm.style.left = pos.left + 'px';
@@ -2934,27 +2928,23 @@
    // get file input fields
    var send = false;
    for (var n=0; n<form.elements.length; n++)
      if (form.elements[n].type=='file' && form.elements[n].value)
        {
      if (form.elements[n].type=='file' && form.elements[n].value) {
        send = true;
        break;
        }
    
    // create hidden iframe and post upload form
    if (send)
      {
    if (send) {
      var ts = new Date().getTime();
      var frame_name = 'rcmupload'+ts;
      // have to do it this way for IE
      // otherwise the form will be posted to a new window
      if(document.all)
        {
      if (document.all) {
        var html = '<iframe name="'+frame_name+'" src="program/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>';
        document.body.insertAdjacentHTML('BeforeEnd',html);
        }
      else  // for standards-compilant browsers
        {
      else { // for standards-compilant browsers
        var frame = document.createElement('iframe');
        frame.name = frame_name;
        frame.style.border = 'none';
@@ -3077,8 +3067,7 @@
  // send remote request to search mail or contacts
  this.qsearch = function(value)
    {
    if (value != '')
      {
    if (value != '') {
      var addurl = '';
      if (this.message_list) {
        this.message_list.clear();
@@ -3125,7 +3114,7 @@
    {
    this.list_mailbox();
    this.display_message(msg, type, true);
    }
  };
  /*********************************************************/