alecpl
2010-05-05 1f019c8e5886461eb1ab0c053d88527d45ccacde
- Set focus to editor on reply in HTML mode (#1486632)
- Fix composing in HTML jumps cursor to body instead of recipients (#1486674)


3 files modified
41 ■■■■■ changed files
CHANGELOG 2 ●●●●● patch | view | raw | blame | history
program/js/app.js 26 ●●●● patch | view | raw | blame | history
program/js/editor.js 13 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,8 @@
CHANGELOG RoundCube Webmail
===========================
- Set focus to editor on reply in HTML mode (#1486632)
- Fix composing in HTML jumps cursor to body instead of recipients (#1486674)
- Allow columns order change per user - drag&drop (#1485795)
- Add References header in read receipt (#1486681)
- Fix database constraint violation when opening a message (#1486696)
program/js/app.js
@@ -2621,8 +2621,10 @@
      input_to.focus();
    else if (input_subject.val() == '')
      input_subject.focus();
    else if (input_message && !html_mode)
    else if (input_message)
      input_message.focus();
    this.env.compose_focus_elem = document.activeElement;
    // get summary of all field values
    this.compose_field_hash(true);
@@ -2789,12 +2791,12 @@
    if (!show_sig)
      show_sig = this.env.show_sig;
    var id = obj.options[obj.selectedIndex].value;
    var input_message = $("[name='_message']");
    var message = input_message.val();
    var is_html = ($("input[name='_is_html']").val() == '1');
    var sig_separator = this.env.sig_above && (this.env.compose_mode == 'reply' || this.env.compose_mode == 'forward') ? '---' : '-- ';
    var sig, cursor_pos, p = -1;
    var sig, cursor_pos, p = -1,
      id = obj.options[obj.selectedIndex].value,
      input_message = $("[name='_message']"),
      message = input_message.val(),
      is_html = ($("input[name='_is_html']").val() == '1'),
      sig_separator = this.env.sig_above && (this.env.compose_mode == 'reply' || this.env.compose_mode == 'forward') ? '---' : '-- ';
    if (!this.env.identity)
      this.env.identity = id
@@ -2855,20 +2857,20 @@
      this.set_caret_pos(input_message.get(0), cursor_pos);
    }
    else if (show_sig && this.env.signatures) {  // html
      var editor = tinyMCE.get(this.env.composebody);
      var sigElem = editor.dom.get('_rc_sig');
      var editor = tinyMCE.get(this.env.composebody),
        sigElem = editor.dom.get('_rc_sig');
      // Append the signature as a div within the body
      if (!sigElem) {
        var body = editor.getBody();
        var doc = editor.getDoc();
        var body = editor.getBody(),
          doc = editor.getDoc();
        sigElem = doc.createElement('div');
        sigElem.setAttribute('id', '_rc_sig');
        if (this.env.sig_above) {
          // if no existing sig and top posting then insert at caret pos
          editor.getWin().focus(); // correct focus in IE
          editor.getWin().focus(); // correct focus in IE & Chrome
          var node = editor.selection.getNode();
          if (node.nodeName == 'BODY') {
program/js/editor.js
@@ -63,11 +63,18 @@
// react to real individual tinyMCE editor init
function rcmail_editor_callback(editor)
{
  var input_from = rcube_find_object('_from');
  if (input_from && input_from.type=='select-one')
    rcmail.change_identity(input_from);
  var editor, elem = rcube_find_object('_from');
  if (elem && elem.type=='select-one')
    rcmail.change_identity(elem);
  // set tabIndex
  rcmail_editor_tabindex();
  // set focus to element that was focused before
  if (elem = rcmail.env.compose_focus_elem) {
    if (elem.id == rcmail.env.composebody && (editor = tinyMCE.get(rcmail.env.composebody)))
      editor.getWin().focus();
    else
      elem.focus();
  }
}
// set tabIndex on tinyMCE editor