Make WordPress Core


Ignore:
Timestamp:
12/09/2005 07:24:14 PM (20 years ago)
Author:
ryan
Message:

MCE fix-em-ups from skeltoac. fixes #1962

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-page-form.php

    r3149 r3283  
    2020
    2121?>
    22 
    23 <?php $richedit = ( 'true' != get_user_option('rich_editing') ) ? false : true; ?>
    2422
    2523<form name="post" action="post.php" method="post" id="post">
     
    120118
    121119
    122 <fieldset id="<?php echo ( $richedit) ? 'postdivrich' : 'postdiv'; ?>">
     120<fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
    123121    <legend><?php _e('Page Content') ?></legend>
    124122<?php
     
    128126 }
    129127?>
    130 <?php if (! $richedit ) the_quicktags(); ?>
    131 
    132 <div><textarea title="true" rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo $richedit ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div>
    133 </fieldset>
    134 
    135 <?php if ( !$richedit ) : ?>
     128<?php the_quicktags(); ?>
     129
     130<div><textarea title="true" rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div>
     131</fieldset>
     132
    136133<script type="text/javascript">
    137134<!--
    138135edCanvas = document.getElementById('content');
     136<?php if ( user_can_richedit() ) : ?>
     137// This code is meant to allow tabbing from Title to Post (TinyMCE).
     138if ( tinyMCE.isMSIE )
     139    document.getElementById('title').onkeydown = function (e)
     140        {
     141            e = e ? e : window.event;
     142            if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
     143                var i = tinyMCE.selectedInstance;
     144                if(typeof i ==  'undefined')
     145                    return true;
     146                                tinyMCE.execCommand("mceStartTyping");
     147                this.blur();
     148                i.contentWindow.focus();
     149                e.returnValue = false;
     150                return false;
     151            }
     152        }
     153else
     154    document.getElementById('title').onkeypress = function (e)
     155        {
     156            e = e ? e : window.event;
     157            if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
     158                var i = tinyMCE.selectedInstance;
     159                if(typeof i ==  'undefined')
     160                    return true;
     161                                tinyMCE.execCommand("mceStartTyping");
     162                this.blur();
     163                i.contentWindow.focus();
     164                e.returnValue = false;
     165                return false;
     166            }
     167        }
     168<?php endif; ?>
    139169//-->
    140170</script>
    141 <?php endif; ?>
    142171
    143172<p class="submit">
Note: See TracChangeset for help on using the changeset viewer.