Check that tinyMCE is defined. Props johnbillion. fixes #4257

git-svn-id: http://svn.automattic.com/wordpress/trunk@5602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-05-31 00:24:31 +00:00
parent e83a798987
commit ebee78ae54

View File

@ -907,10 +907,11 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
//<!--
edCanvas = document.getElementById('<?php echo $id; ?>');
<?php if ( $prev_id && user_can_richedit() ) : ?>
// If tinyMCE is defined.
if ( typeof tinyMCE != 'undefined' ) {
// This code is meant to allow tabbing from Title to Post (TinyMCE).
if ( tinyMCE.isMSIE )
document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e)
{
if ( tinyMCE.isMSIE ) {
document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
e = e ? e : window.event;
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
@ -923,9 +924,8 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
return false;
}
}
else
document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e)
{
} else {
document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e) {
e = e ? e : window.event;
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
@ -938,6 +938,8 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
return false;
}
}
}
}
<?php endif; ?>
//-->
</script>