Changeset 4210

Show
Ignore:
Timestamp:
09/22/06 22:24:50 (2 years ago)
Author:
ryan
Message:

Tabbed editor fixes from skeltoac. #2829

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-functions.php

    r4206 r4210  
    19641964} 
    19651965 
    1966 function user_can_richedit() { 
    1967     if ( 'true' != get_user_option('rich_editing') ) 
    1968         return false; 
    1969  
    1970     if ( preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) ) 
    1971         return false; 
    1972  
    1973     return true; // Best guess 
    1974 } 
    1975  
    19761966function the_attachment_links($id = false) { 
    19771967    $id = (int) $id; 
  • trunk/wp-admin/comment.php

    r4144 r4210  
    1313case 'editcomment': 
    1414    $title = __('Edit Comment'); 
    15     if ( user_can_richedit() ) 
    16         wp_enqueue_script( 'wp_tiny_mce' ); 
     15 
    1716    require_once ('admin-header.php'); 
    1817 
  • trunk/wp-includes/general-template.php

    r4206 r4210  
    736736} 
    737737 
     738function user_can_richedit() { 
     739    $can = true; 
     740 
     741    if ( 'true' != get_user_option('rich_editing') || preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) ) 
     742        $can = false; 
     743 
     744    return apply_filters('user_can_richedit', $can); 
     745} 
     746 
    738747function the_editor($content, $id = 'content', $prev_id = 'title') { 
    739748    $rows = get_option('default_post_edit_rows'); 
     
    748757        //  The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it. 
    749758    ?> 
    750     <!--[if IE]><style type="text/css"> 
     759    <style type="text/css"> 
    751760        #postdivrich table, #postdivrich #quicktags {border-top: none;} 
    752761        #quicktags {border-bottom: none; padding-bottom: 2px; margin-bottom: -1px;} 
    753762        #edButtons {border-bottom: 1px solid #ccc;} 
    754     </style><![endif]--> 
     763    </style> 
    755764    <div id='edButtons' style='display:none;'> 
    756765        <div class='zerosize'><input accesskey='e' type='button' onclick='switchEditors("<?php echo $id; ?>")' /></div> 
  • trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js

    r4206 r4210  
    474474    var H = document.getElementById('edButtonHTML'); 
    475475    var P = document.getElementById('edButtonPreview'); 
    476     var pdr = document.getElementById('postdivrich'); 
    477476    var ta = document.getElementById(id); 
     477    var pdr = ta.parentNode; 
    478478 
    479479    if ( inst ) { 
     
    492492        var table = document.getElementById(inst.editorId + '_parent').getElementsByTagName('table')[0]; 
    493493        var y1 = table.offsetTop + table.offsetHeight; 
     494 
     495        if ( TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height") == null ) { 
     496            var expires = new Date(); 
     497            expires.setTime(expires.getTime() + 3600000 * 24 * 30); 
     498            var offset = tinyMCE.isMSIE ? 1 : 2; 
     499            TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + inst.editorId + "_height", "" + (table.offsetHeight - offset), expires); 
     500        } 
    494501 
    495502        // Unload the rich editor