- removed hardcoded 'compose-body' identifier (#1485996)

release-0.6
alecpl 15 years ago
parent c9e9fe1901
commit a01b3bf9ae

@ -913,7 +913,7 @@ function rcube_webmail()
break; break;
case 'spellcheck': case 'spellcheck':
if (window.tinyMCE && tinyMCE.get('compose-body')) { if (window.tinyMCE && tinyMCE.get(this.env.composebody)) {
tinyMCE.execCommand('mceSpellCheck', true); tinyMCE.execCommand('mceSpellCheck', true);
} }
else if (this.env.spellcheck && this.env.spellcheck.spellCheck && this.spellcheck_ready) { else if (this.env.spellcheck && this.env.spellcheck.spellCheck && this.spellcheck_ready) {
@ -2156,14 +2156,17 @@ function rcube_webmail()
} }
// check for empty body // check for empty body
if ((!window.tinyMCE || !tinyMCE.get('compose-body')) && input_message.val() == '' && !confirm(this.get_label('nobodywarning'))) if ((!window.tinyMCE || !tinyMCE.get(this.env.composebody))
&& input_message.val() == '' && !confirm(this.get_label('nobodywarning')))
{ {
input_message.focus(); input_message.focus();
return false; return false;
} }
else if (window.tinyMCE && tinyMCE.get('compose-body') && !tinyMCE.get('compose-body').getContent() && !confirm(this.get_label('nobodywarning'))) else if (window.tinyMCE && tinyMCE.get(this.env.composebody)
&& !tinyMCE.get(this.env.composebody).getContent()
&& !confirm(this.get_label('nobodywarning')))
{ {
tinyMCE.get('compose-body').focus(); tinyMCE.get(this.env.composebody).focus();
return false; return false;
} }
@ -2171,7 +2174,7 @@ function rcube_webmail()
this.stop_spellchecking(); this.stop_spellchecking();
// move body from html editor to textarea (just to be sure, #1485860) // move body from html editor to textarea (just to be sure, #1485860)
if (window.tinyMCE && tinyMCE.get('compose-body')) if (window.tinyMCE && tinyMCE.get(this.env.composebody))
tinyMCE.triggerSave(); tinyMCE.triggerSave();
return true; return true;
@ -2234,7 +2237,7 @@ function rcube_webmail()
if (value_subject) if (value_subject)
str += value_subject+':'; str += value_subject+':';
var editor = tinyMCE.get('compose-body'); var editor = tinyMCE.get(this.env.composebody);
if (editor) if (editor)
str += editor.getContent(); str += editor.getContent();
else else
@ -2297,7 +2300,7 @@ function rcube_webmail()
} }
else else
{ {
var editor = tinyMCE.get('compose-body'); var editor = tinyMCE.get(this.env.composebody);
if (this.env.signatures) if (this.env.signatures)
{ {

@ -73,10 +73,11 @@ function rcmail_editor_callback(editor)
function rcmail_editor_tabindex() function rcmail_editor_tabindex()
{ {
if (rcmail.env.task == 'mail') { if (rcmail.env.task == 'mail') {
var textarea = tinyMCE.get('compose-body').getElement(); var editor = tinyMCE.get(rcmail.env.composebody);
var editor = tinyMCE.get('compose-body').getContentAreaContainer().childNodes[0]; var textarea = editor.getElement();
if (textarea && editor) var node = editor.getContentAreaContainer().childNodes[0];
editor.tabIndex = textarea.tabIndex; if (textarea && node)
node.tabIndex = textarea.tabIndex;
} }
} }

@ -353,7 +353,7 @@ function rcmail_compose_body($attrib)
unset($attrib['form']); unset($attrib['form']);
if (empty($attrib['id'])) if (empty($attrib['id']))
$attrib['id'] = 'rcmComposeMessage'; $attrib['id'] = 'rcmComposeBody';
$attrib['name'] = '_message'; $attrib['name'] = '_message';
@ -414,6 +414,8 @@ function rcmail_compose_body($attrib)
$out .= $textarea->show($body); $out .= $textarea->show($body);
$out .= $form_end ? "\n$form_end" : ''; $out .= $form_end ? "\n$form_end" : '';
$OUTPUT->set_env('composebody', $attrib['id']);
// include HTML editor // include HTML editor
rcube_html_editor(); rcube_html_editor();
@ -874,7 +876,7 @@ function rcmail_editor_selector($attrib)
$useHtml = ($useHtml && $MESSAGE->has_html_part()); $useHtml = ($useHtml && $MESSAGE->has_html_part());
if (empty($attrib['editorid'])) if (empty($attrib['editorid']))
$attrib['editorid'] = 'rcmComposeMessage'; $attrib['editorid'] = 'rcmComposeBody';
if (empty($attrib['name'])) if (empty($attrib['name']))
$attrib['name'] = 'editorSelect'; $attrib['name'] = 'editorSelect';

Loading…
Cancel
Save