thomascube
2012-01-02 7c2a9310c4104f51fcf56379dcc3511fa5bfae2d
program/js/app.js
@@ -351,11 +351,18 @@
        this.enable_command('preferences', 'identities', 'save', 'folders', true);
        if (this.env.action == 'identities') {
          this.enable_command('add', this.env.identities_level < 2);
          this.enable_command('add', 'delete', this.env.identities_level < 2);
        }
        else if (this.env.action == 'edit-identity' || this.env.action == 'add-identity') {
          this.enable_command('add', this.env.identities_level < 2);
          this.enable_command('save', 'delete', 'edit', 'toggle-editor', true);
          this.enable_command('save', 'edit', 'toggle-editor', true);
          if (this.is_framed() && this.env.identities_level < 2)
            this.set_button('delete', 'act');  // activate button but delegate command to parent
          else
            this.enable_command('delete', this.env.identities_level < 2);
          if (this.env.action == 'add-identity')
            $("input[type='text']").first().select();
        }
        else if (this.env.action == 'folders') {
          this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', true);
@@ -1043,7 +1050,7 @@
        break;
      case 'upload-photo':
        this.upload_contact_photo(props);
        this.upload_contact_photo(props || this.gui_objects.uploadform);
        break;
      case 'delete-photo':
@@ -1364,7 +1371,7 @@
              if (this.folder_auto_timer)
                window.clearTimeout(this.folder_auto_timer);
              this.folder_auto_expand = k;
              this.folder_auto_expand = this.env.mailboxes[k].id;
              this.folder_auto_timer = window.setTimeout(function() {
                rcmail.command('collapse-folder', rcmail.folder_auto_expand);
                rcmail.drag_start(null);
@@ -3092,7 +3099,7 @@
      if (!vis)
        this.stop_spellchecking();
      $(this.env.spellcheck.spell_container).css('visibility', vis ? 'visible' : 'hidden');
      $(this.env.spellcheck.spell_container)[vis ? 'show' : 'hide']();
    }
  };
@@ -4200,7 +4207,6 @@
        yearRange: '-100:+10',
        showOtherMonths: true,
        selectOtherMonths: true,
        monthNamesShort: this.env.month_names,
        onSelect: function(dateText) { $(this).focus().val(dateText) }
      });
      $('input.datepicker').datepicker();
@@ -4771,10 +4777,27 @@
    if (!id)
      id = this.env.iid ? this.env.iid : selection[0];
    // append token to request
    this.goto_url('delete-identity', '_iid='+id+'&_token='+this.env.request_token, true);
    // submit request with appended token
    if (confirm(this.get_label('deleteidentityconfirm')))
      this.goto_url('delete-identity', '_iid='+id+'&_token='+this.env.request_token, true);
    return true;
  };
  this.update_identity_row = function(id, name, add)
  {
    var row, col, list = this.identity_list,
      rid = this.html_identifier(id);
    if (list.rows[rid] && (row = list.rows[rid].obj)) {
      $(row.cells[0]).html(name);
    }
    else if (add) {
      row = $('<tr>').attr('id', 'rcmrow'+rid).get(0);
      col = $('<td>').addClass('mail').html(name).appendTo(row);
      list.insert_row(row);
      list.select(rid);
    }
  };
@@ -5582,8 +5605,9 @@
      if (typeof content === 'object' && content.type == 'image')
        this.percent_indicator(this.gui_objects.quotadisplay, content);
      else
        $(this.gui_objects.quotadisplay).html(content);
        $(this.gui_objects.quotadisplay).html(content.percent+'%').attr('title', content.title);
    }
    this.triggerEvent('setquota', content);
  };
  // update the mailboxlist
@@ -5655,16 +5679,6 @@
      this.set_pagetitle(new_title);
    }
  };
  this.toggle_prefer_html = function(checkbox)
  {
    $('#rcmfd_show_images').prop('disabled', !checkbox.checked).val(0);
  };
  this.toggle_preview_pane = function(checkbox)
  {
    $('#rcmfd_preview_pane_mark_read').prop('disabled', !checkbox.checked);
  };
  // display fetched raw headers