alecpl
2010-07-26 1fe60e25c91266b44cee5cc5d858367df7929f90
program/js/app.js
@@ -225,7 +225,7 @@
          }
        }
        else if (this.env.action == 'compose') {
          this.enable_command('send-attachment', 'remove-attachment', 'send', true);
          this.enable_command('send-attachment', 'remove-attachment', 'send', 'toggle-editor', true);
          if (this.env.spellcheck) {
            this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); };
@@ -321,7 +321,7 @@
        }
        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', true);
          this.enable_command('save', 'delete', 'edit', 'toggle-editor', true);
        }
        else if (this.env.action=='folders')
          this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', 'delete-folder', 'enable-threading', 'disable-threading', true);
@@ -977,8 +977,7 @@
      // unified command call (command name == function name)
      default:
        var func = command.replace('-', '_');
        alert(func);
        var func = command.replace(/-/g, '_');
        if (this[func] && typeof this[func] == 'function')
          this[func](props);
        break;
@@ -2808,6 +2807,30 @@
    return true;
  };
  this.toggle_editor = function(props)
  {
    if (props.mode == 'html') {
      this.display_spellcheck_controls(false);
      this.plain2html($('#'+props.id).val(), props.id);
      tinyMCE.execCommand('mceAddControl', false, props.id);
    }
    else {
      var thisMCE = tinyMCE.get(props.id),
        existingHtml = thisMCE.getContent();
      if (existingHtml) {
        if (!confirm(this.get_label('editorwarning'))) {
          return false;
       }
        this.html2plain(existingHtml, props.id);
      }
      tinyMCE.execCommand('mceRemoveControl', false, props.id);
      this.display_spellcheck_controls(true);
    }
    return true;
  };
  this.stop_spellchecking = function()
  {
    if (this.env.spellcheck && !this.spellcheck_ready) {
@@ -3640,7 +3663,7 @@
        this.contact_list.remove_row(cid);
        this.contact_list.init_row(row);
        this.contact_list.selection[0] = newcid;
        ow.style.display = '';
        row.style.display = '';
      }
      return true;
@@ -3687,7 +3710,7 @@
    if (!this.name_input) {
      this.name_input = $('<input>').attr('type', 'text');
      this.name_input.bind('keypress', function(e){ return rcmail.add_input_keypress(e); });
      this.name_input.bind('keydown', function(e){ return rcmail.add_input_keydown(e); });
      this.name_input_li = $('<li>').addClass('contactgroup').append(this.name_input);
      var li = this.get_folder_li(this.env.source)
@@ -3705,7 +3728,7 @@
    if (!this.name_input) {
      this.enable_command('list', 'listgroup', false);
      this.name_input = $('<input>').attr('type', 'text').val(this.env.contactgroups['G'+this.env.source+this.env.group].name);
      this.name_input.bind('keypress', function(e){ return rcmail.add_input_keypress(e); });
      this.name_input.bind('keydown', function(e){ return rcmail.add_input_keydown(e); });
      this.env.group_renaming = true;
      var link, li = this.get_folder_li(this.env.source+this.env.group, 'rcmliG');
@@ -3739,7 +3762,7 @@
  };
  // handler for keyboard events on the input field
  this.add_input_keypress = function(e)
  this.add_input_keydown = function(e)
  {
    var key = rcube_event.get_keycode(e);
@@ -5116,3 +5139,4 @@
rcube_webmail.prototype.addEventListener = rcube_event_engine.prototype.addEventListener;
rcube_webmail.prototype.removeEventListener = rcube_event_engine.prototype.removeEventListener;
rcube_webmail.prototype.triggerEvent = rcube_event_engine.prototype.triggerEvent;