Make WordPress Core


Ignore:
Timestamp:
08/24/2008 06:56:22 AM (17 years ago)
Author:
azaozz
Message:

Reply to comments from admin, first run, see #7435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r8691 r8720  
    956956    $rows = "rows='$rows'"; ?>
    957957    <div id="editor-toolbar">
    958     <?php if ( user_can_richedit() ) {
     958    <?php if ( user_can_richedit() && $media_buttons ) {
    959959        $wp_default_editor = wp_default_editor(); ?>
    960960        <div class="zerosize"><input accesskey="e" type="button" onclick="switchEditors.go('<?php echo $id; ?>')" /></div>
     
    968968            <a id="edButtonPreview" onclick="switchEditors.go('<?php echo $id; ?>');"><?php _e('Visual'); ?></a>
    969969        <?php }
    970     }
     970    } else
     971        add_filter('the_editor_content', 'wp_htmledit_pre');
    971972
    972973/*  if ( $media_buttons ) { ?>
     
    982983    </div>
    983984
    984     <?php if ( 'html' != $wp_default_editor ) : ?>
    985     <script type="text/javascript">
    986     // <![CDATA[
    987         if ( typeof tinyMCE != "undefined" )
    988             document.getElementById("quicktags").style.display="none";
    989     // ]]>
    990     </script>
    991     <?php endif; // 'html' != $wp_default_editor
    992 
    993     $the_editor = apply_filters('the_editor', "<div id='editorcontainer'><textarea class='' $rows cols='40' name='$id' tabindex='$tab_index' id='$id'>%s</textarea></div>\n");
     985    <?php $the_editor = apply_filters('the_editor', "<div id='editorcontainer'><textarea $rows cols='40' name='$id' tabindex='$tab_index' id='$id'>%s</textarea></div>\n");
    994986    $the_editor_content = apply_filters('the_editor_content', $content);
    995987
     
    997989
    998990    ?>
    999     <script type="text/javascript">
    1000     // <![CDATA[
    1001     edCanvas = document.getElementById('<?php echo $id; ?>');
    1002     <?php if ( $prev_id && user_can_richedit() ) : ?>
    1003     // If tinyMCE is defined.
    1004     if ( typeof tinyMCE != 'undefined' ) {
    1005     // This code is meant to allow tabbing from Title to Post (TinyMCE).
    1006         document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
    1007             e = e || window.event;
    1008             if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
    1009                 if ( tinyMCE.activeEditor ) {
    1010                     if ( (jQuery("#post_ID").val() < 1) && (jQuery("#title").val().length > 0) ) { autosave(); }
    1011                     e = null;
    1012                     if ( tinyMCE.activeEditor.isHidden() ) return true;
    1013                     tinyMCE.activeEditor.focus();
    1014                     return false;
    1015                 }
    1016                 return true;
    1017             }
    1018         }
    1019     }
    1020     <?php endif; ?>
    1021     // ]]>
    1022     </script>
    1023     <?php
     991    <script type="text/javascript">
     992    // <![CDATA[
     993    edCanvas = document.getElementById('<?php echo $id; ?>');
     994    <?php if ( user_can_richedit() && $prev_id ) { ?>
     995    // If tinyMCE is defined.
     996    if ( typeof tinyMCE != 'undefined' ) {
     997        // This code is meant to allow tabbing from Title to Post (TinyMCE).
     998        document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
     999            e = e || window.event;
     1000            if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
     1001                if ( tinyMCE.activeEditor ) {
     1002                    if ( (jQuery("#post_ID").val() < 1) && (jQuery("#title").val().length > 0) ) { autosave(); }
     1003                    e = null;
     1004                    if ( tinyMCE.activeEditor.isHidden() ) return true;
     1005                    tinyMCE.activeEditor.focus();
     1006                    return false;
     1007                }
     1008                return true;
     1009            }
     1010        }
     1011    }
     1012    <?php } ?>
     1013    // ]]>
     1014    </script>
     1015    <?php
    10241016}
    10251017
Note: See TracChangeset for help on using the changeset viewer.