Make WordPress Core


Ignore:
Timestamp:
01/31/2008 06:10:46 PM (19 years ago)
Author:
ryan
Message:

TinyMCE 3.0 Final from azaozz. see #5674

File:
1 edited

Legend:

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

    r6682 r6694  
    929929                $wp_default_editor = wp_default_editor();
    930930                $active = " class='active'";
    931                 $inactive = " onclick='switchEditors(\"$id\");'";
     931                $inactive = " onclick='switchEditors.go(\"$id\");'";
    932932
    933933                if ( 'tinymce' == $wp_default_editor )
    934934                        add_filter('the_editor_content', 'wp_richedit_pre');
    935935
    936                 //      The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it.
    937         ?>
    938         <style type="text/css">
     936                //      The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it. 
     937        ?>     
     938    <style type="text/css">
    939939                #postdivrich table, #postdivrich #quicktags {border-top: none;}
    940940                #quicktags {border-bottom: none; padding-bottom: 2px; margin-bottom: -1px;}
    941941        </style>
     942       
    942943        <div id='editor-toolbar' style='display:none;'>
    943                 <div class='zerosize'><input accesskey='e' type='button' onclick='switchEditors("<?php echo $id; ?>")' /></div>
     944                <div class='zerosize'><input accesskey='e' type='button' onclick='switchEditors.go("<?php echo $id; ?>")' /></div>
    944945                <a id='edButtonHTML'<?php echo 'html' == $wp_default_editor ? $active : $inactive; ?>><?php _e('HTML'); ?></a>
    945946                <a id='edButtonPreview'<?php echo 'tinymce' == $wp_default_editor ? $active : $inactive; ?>><?php _e('Visual'); ?></a>
    … …  
    974975        <?php endif; // 'html' != $wp_default_editor
    975976
    976         $the_editor = apply_filters('the_editor', "<div><textarea class='' $rows cols='40' name='$id' tabindex='2' id='$id'>%s</textarea></div>\n");
     977        $the_editor = apply_filters('the_editor', "<div id='editorcontainer'><textarea class='' $rows cols='40' name='$id' tabindex='2' id='$id'>%s</textarea></div>\n");
    977978        $the_editor_content = apply_filters('the_editor_content', $content);
    978979
    … …  
    987988        if ( typeof tinyMCE != 'undefined' ) {
    988989        // This code is meant to allow tabbing from Title to Post (TinyMCE).
    989                 if ( tinyMCE.isMSIE ) {
    990                         document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
    991                                 if ( tinyMCE.idCounter == 0 )
    992                                         return true;
    993                                 e = e ? e : window.event;
    994                                 if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
    995                                         var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
    996                                         if(typeof i ==  'undefined')
    997                                                 return true;
    998                                         tinyMCE.execCommand("mceStartTyping");
    999                                         this.blur();
    1000                                         i.contentWindow.focus();
    1001                                         e.returnValue = false;
    1002                                         return false;
    1003                                 }
    1004                         }
    1005                 } else {
    1006                         document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e) {
    1007                                 if ( tinyMCE.idCounter == 0 )
    1008                                         return true;
    1009                                 e = e ? e : window.event;
    1010                                 if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
    1011                                         var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
    1012                                         if(typeof i ==  'undefined')
    1013                                                 return true;
    1014                                         tinyMCE.execCommand("mceStartTyping");
    1015                                         this.blur();
    1016                                         i.contentWindow.focus();
    1017                                         e.returnValue = false;
    1018                                         return false;
    1019                                 }
    1020                         }
    1021                 }
     990        document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
     991            e = e || window.event;
     992            if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
     993                if ( tinyMCE.activeEditor ) {
     994                    e = null;
     995                    if ( tinyMCE.activeEditor.isHidden() ) return true;
     996                    tinyMCE.activeEditor.focus();
     997                    return false;
     998                }
     999                return true;
     1000            }
     1001        }
    10221002        }
    10231003        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.