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

git-svn-id: https://develop.svn.wordpress.org/trunk@5602 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
rob1n 2007-05-31 00:24:31 +00:00
parent 4fec7327ed
commit 91d0e796ef
1 changed files with 8 additions and 6 deletions

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>