mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 18:32:23 +01:00
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:
parent
e83a798987
commit
ebee78ae54
@ -907,10 +907,11 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
|
|||||||
//<!--
|
//<!--
|
||||||
edCanvas = document.getElementById('<?php echo $id; ?>');
|
edCanvas = document.getElementById('<?php echo $id; ?>');
|
||||||
<?php if ( $prev_id && user_can_richedit() ) : ?>
|
<?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).
|
// This code is meant to allow tabbing from Title to Post (TinyMCE).
|
||||||
if ( tinyMCE.isMSIE )
|
if ( tinyMCE.isMSIE ) {
|
||||||
document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e)
|
document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
|
||||||
{
|
|
||||||
e = e ? e : window.event;
|
e = e ? e : window.event;
|
||||||
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
|
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
|
||||||
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
|
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
|
||||||
@ -923,9 +924,8 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e)
|
document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e) {
|
||||||
{
|
|
||||||
e = e ? e : window.event;
|
e = e ? e : window.event;
|
||||||
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
|
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
|
||||||
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
|
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
|
||||||
@ -938,6 +938,8 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user