mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-23 06:19:09 +01:00
* felamimail: handle IE (8) problem regarding toggling editor modes in compose window
This commit is contained in:
parent
ae0c6da166
commit
8df1d79e59
@ -555,7 +555,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->t->set_var("toggle_editormode", lang("Editor type").": <span><input name=\"_is_html\" value=\"".$ishtml."\" type=\"hidden\" /><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" ".($ishtml ? "checked=\"checked\"" : "")." id=\"_html\" value=\"html\" type=\"radio\"><label for=\"_html\">HTML</label><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" ".($ishtml ? "" : "checked=\"checked\"")." id=\"_plain\" value=\"plain\" type=\"radio\"><label for=\"_plain\">Plain text</label></span>");
|
$this->t->set_var("toggle_editormode", lang("Editor type").": <span><input name=\"_is_html\" value=\"".$ishtml."\" type=\"hidden\" /><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" onclick=\"fm_toggle_editor(this)\" ".($ishtml ? "checked=\"checked\"" : "")." id=\"_html\" value=\"html\" type=\"radio\"><label for=\"_html\">HTML</label><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" onclick=\"fm_toggle_editor(this)\" ".($ishtml ? "" : "checked=\"checked\"")." id=\"_plain\" value=\"plain\" type=\"radio\"><label for=\"_plain\">Plain text</label></span>");
|
||||||
}
|
}
|
||||||
$this->t->pparse("out","body_input");
|
$this->t->pparse("out","body_input");
|
||||||
|
|
||||||
|
@ -677,6 +677,7 @@ function fm_set_editor_toggle_states()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var scaytStartup;
|
||||||
// Toggle between the HTML and Plain Text editors
|
// Toggle between the HTML and Plain Text editors
|
||||||
function fm_toggle_editor(toggler)
|
function fm_toggle_editor(toggler)
|
||||||
{
|
{
|
||||||
@ -716,10 +717,17 @@ function fm_toggle_editor(toggler)
|
|||||||
plaineditor.style.display = "none";
|
plaineditor.style.display = "none";
|
||||||
if (ckeditor)
|
if (ckeditor)
|
||||||
{
|
{
|
||||||
// nothing to do
|
scaytStartup = ckeditor.config.scayt_autoStartup;
|
||||||
|
if (ckeditor.env.ie) ckeditor.config.scayt_autoStartup = false;
|
||||||
|
ckeditor.config.height = '338px'; // seems to fit the area
|
||||||
|
//ckeditor.config.resize_enabled = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
scaytStartup = ckeditorConfig.scayt_autoStartup;
|
||||||
|
if (CKEDITOR.env.ie) ckeditorConfig.scayt_autoStartup = false;
|
||||||
|
ckeditorConfig.height = "338px"; // seems to fit the area
|
||||||
|
//ckeditorConfig.resize_enabled = true;
|
||||||
ckeditor = CKEDITOR.replace('body',ckeditorConfig);
|
ckeditor = CKEDITOR.replace('body',ckeditorConfig);
|
||||||
}
|
}
|
||||||
//Copy the current ASCII data and recode it via a XAJAX request
|
//Copy the current ASCII data and recode it via a XAJAX request
|
||||||
@ -735,7 +743,8 @@ function fm_toggle_editor(toggler)
|
|||||||
//Copy the current HTML data and recode it via a XAJAX request
|
//Copy the current HTML data and recode it via a XAJAX request
|
||||||
var existingHtml = ckeditor.getData();
|
var existingHtml = ckeditor.getData();
|
||||||
var ckeditor_span = document.getElementById('cke_body');
|
var ckeditor_span = document.getElementById('cke_body');
|
||||||
ckeditor.setData('');
|
//ckeditor.config.scayt_autoStartup = false;
|
||||||
|
ckeditor.setData(' ',function(){this.checkDirty();},true);
|
||||||
//Hide the old editor
|
//Hide the old editor
|
||||||
ckeditor_span.style.display = "none";
|
ckeditor_span.style.display = "none";
|
||||||
// we need to destroy the ckeditor, as the/a submit is using the content of the ckeditor instance for content of body
|
// we need to destroy the ckeditor, as the/a submit is using the content of the ckeditor instance for content of body
|
||||||
@ -797,7 +806,7 @@ function showPlainEditor(_content)
|
|||||||
plaineditor.style.display = "block";
|
plaineditor.style.display = "block";
|
||||||
|
|
||||||
plaineditor.value = _content;
|
plaineditor.value = _content;
|
||||||
|
plaineditor.focus();
|
||||||
hideAjaxLoader(document.getElementById('editorArea'));
|
hideAjaxLoader(document.getElementById('editorArea'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -808,6 +817,9 @@ function showHTMLEditor(_content)
|
|||||||
|
|
||||||
//Set the new content
|
//Set the new content
|
||||||
ckeditor.setData(_content);
|
ckeditor.setData(_content);
|
||||||
|
//alert((typeof scaytStartup)+'->'+ scaytStartup);
|
||||||
|
ckeditor.focus();
|
||||||
|
if ( typeof scaytStartup == boolean ) ckeditor.config.scayt_autoStartup = scaytStartup;
|
||||||
|
|
||||||
//Toggle the plain editor visiblity
|
//Toggle the plain editor visiblity
|
||||||
ckeditor_span.style.display = 'block';
|
ckeditor_span.style.display = 'block';
|
||||||
|
Loading…
Reference in New Issue
Block a user