MDL-14741: make tinymce toggle editor icon work as it should

This commit is contained in:
scyrma 2008-07-15 09:00:23 +00:00
parent b6943d3731
commit a33fa3ad83
3 changed files with 12 additions and 6 deletions

View File

@ -197,10 +197,7 @@ echo <<<EOF
});
function toggleEditor(id) {
var elm = document.getElementById(id);
if (tinyMCE.getInstanceById(id) == null)
tinyMCE.execCommand('mceAddControl', false, id);
else
tinyMCE.execCommand('mceRemoveControl', false, id);
tinyMCE.execCommand('mceToggleEditor',false,elm);
}
function moodlefilemanager(field_name, url, type, win) {
tinyMCE.activeEditor.windowManager.open({

View File

@ -4846,14 +4846,16 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
$str .= '</textarea>'."\n";
if ($usehtmleditor) {
$str_toggle = '<span class="helplink"><a href="javascript:toggleEditor(\''. $id .'\');"><img width="50" height="17" src="'. $CFG->httpswwwroot .'/lib/editor/tinymce/images/toggle.gif" alt="'. get_string('editortoggle') .'" title="'. get_string('editortoggle') .'" class="icontoggle" /></a></span>';
// Show shortcuts button if HTML editor is in use, but only if JavaScript is enabled (MDL-9556)
$str .= '';
$str .= '<a href="javascript:toggleEditor(\''. $id .'\');"><img width="50" height="17" src="'. $CFG->httpswwwroot .'/lib/editor/tinymce/images/toggle.gif" alt="'. get_string('editortoggle') .'" title="'. get_string('editortoggle') .'" /></a>';
$str .= '<div class="textareaicons">';
$str .= '<script type="text/javascript">
//<![CDATA[
document.write(\''.addslashes_js($str_toggle).'\');
document.write(\''.addslashes_js(editorshortcutshelpbutton()).'\');
//]]>
</script>';
$str .= '</div>';
}
if ($return) {

View File

@ -489,6 +489,13 @@ img.iconkbhelp {
border:0px;
}
img.icontoggle {
width:50px;
height:17px;
border:0px;
vertical-align:middle;
}
/*Accessibility: text 'seen' by screen readers but not visual users. Fixed for RTL languages, example Farsi. */
.accesshide {
position:absolute;