Disable active spell check in tinyMCE before switching to plaintext mode (#1486870) + focus message field after mode switch

release-0.6
thomascube 14 years ago
parent 7b808b585b
commit 5cff852b07

@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
=========================== ===========================
- Fix JS errors on compose mode switch (#1486870)
- Fix message structure parsing when it lacks optional fields (#1486881) - Fix message structure parsing when it lacks optional fields (#1486881)
- Include all recipients in sendmail log - Include all recipients in sendmail log
- Support HTTP_X_FORWARDED_PROTO header for HTTPS detecting (#1486866) - Support HTTP_X_FORWARDED_PROTO header for HTTPS detecting (#1486866)

@ -2815,13 +2815,14 @@ function rcube_webmail()
tinyMCE.execCommand('mceAddControl', false, props.id); tinyMCE.execCommand('mceAddControl', false, props.id);
} }
else { else {
var thisMCE = tinyMCE.get(props.id), var thisMCE = tinyMCE.get(props.id), existingHtml;
existingHtml = thisMCE.getContent(); if (thisMCE.plugins.spellchecker && thisMCE.plugins.spellchecker.active)
thisMCE.execCommand('mceSpellCheck', false);
if (existingHtml) { if (existingHtml = thisMCE.getContent()) {
if (!confirm(this.get_label('editorwarning'))) { if (!confirm(this.get_label('editorwarning'))) {
return false; return false;
} }
this.html2plain(existingHtml, props.id); this.html2plain(existingHtml, props.id);
} }
tinyMCE.execCommand('mceRemoveControl', false, props.id); tinyMCE.execCommand('mceRemoveControl', false, props.id);

@ -67,19 +67,12 @@ function rcmail_editor_callback(editor)
var editor, elem = rcube_find_object('_from'); var editor, elem = rcube_find_object('_from');
if (elem && elem.type=='select-one') if (elem && elem.type=='select-one')
rcmail.change_identity(elem); rcmail.change_identity(elem);
// set tabIndex // set tabIndex and set focus to element that was focused before
rcmail_editor_tabindex(); rcmail_editor_tabindex(rcmail.env.compose_focus_elem && rcmail.env.compose_focus_elem.id == rcmail.env.composebody);
// 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 // set tabIndex on tinyMCE editor
function rcmail_editor_tabindex() function rcmail_editor_tabindex(focus)
{ {
if (rcmail.env.task == 'mail') { if (rcmail.env.task == 'mail') {
var editor = tinyMCE.get(rcmail.env.composebody); var editor = tinyMCE.get(rcmail.env.composebody);
@ -88,6 +81,8 @@ function rcmail_editor_tabindex()
var node = editor.getContentAreaContainer().childNodes[0]; var node = editor.getContentAreaContainer().childNodes[0];
if (textarea && node) if (textarea && node)
node.tabIndex = textarea.tabIndex; node.tabIndex = textarea.tabIndex;
if (focus)
editor.getWin().focus();
} }
} }
} }
@ -106,14 +101,16 @@ function rcmail_toggle_editor(select, textAreaId, flagElement)
if (ishtml) { if (ishtml) {
// #1486593 // #1486593
setTimeout("rcmail_editor_tabindex();", 500); setTimeout("rcmail_editor_tabindex(true);", 500);
if (flagElement && (flag = rcube_find_object(flagElement))) if (flagElement && (flag = rcube_find_object(flagElement)))
flag.value = '1'; flag.value = '1';
} }
else { else {
if (!res && select.tagName == 'SELECT') if (!res && select.tagName == 'SELECT')
select.value = 'html'; select.value = 'html';
if (flagElement && (flag = rcube_find_object(flagElement))) if (flagElement && (flag = rcube_find_object(flagElement)))
flag.value = '0'; flag.value = '0';
rcube_find_object(rcmail.env.composebody).focus();
} }
} }

@ -17,6 +17,7 @@
padding: 0 4px; padding: 0 4px;
font-size: 9pt; font-size: 9pt;
font-family: monospace; font-family: monospace;
border: 1px solid #666;
} }
.googie_edit_layer span { .googie_edit_layer span {

Loading…
Cancel
Save