Make WordPress Core


Ignore:
Timestamp:
07/31/2008 04:01:30 AM (17 years ago)
Author:
azaozz
Message:

Latest TinyMCE, has new load options and bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r8358 r8512  
    181181// Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0.
    182182
    183 // support for deprecated actions
    184 ob_start();
    185 do_action('mce_options');
    186 $mce_deprecated = ob_get_contents();
    187 ob_end_clean();
    188 
    189 $mce_deprecated = (string) $mce_deprecated;
    190 if ( strlen( $mce_deprecated ) < 10 || ! strpos( $mce_deprecated, ':' ) || ! strpos( $mce_deprecated, ',' ) )   
    191     $mce_deprecated = '';
    192 
    193183// Settings for the gzip compression and cache
    194184$disk_cache = ( ! isset($initArray['disk_cache']) || false == $initArray['disk_cache'] ) ? false : true;
     
    226216if ( $disk_cache ) {
    227217
    228     $cacheKey = apply_filters('tiny_mce_version', '20080712');
     218    $cacheKey = apply_filters('tiny_mce_version', '20080730');
    229219
    230220    foreach ( $initArray as $v )
     
    269259    $mce_options .= $k . ':"' . $v . '",';
    270260
    271 if ( $mce_deprecated ) $mce_options .= $mce_deprecated;
    272 
    273261$mce_options = rtrim( trim($mce_options), '\n\r,' );
    274262
    275 $content = 'var tinyMCEPreInit = { settings : { themes : "' . $theme . '", plugins : "' . $initArray['plugins'] . '", languages : "' . $language . '", debug : false }, base : "' . $baseurl . '", suffix : "", query : "ver=311" };';
     263// Pre-init settings
     264$content = 'var tinyMCEPreInit = { base : "'. $baseurl .'", suffix : "", query : "ver=311b", mceInit : {' . $mce_options . '}};' . "\n";
    276265
    277266// Load patch
     
    280269// Add core
    281270$content .= getFileContents( 'tiny_mce.js' );
    282 
    283 // Patch loading functions
    284 $content .= 'tinyMCEPreInit.start();';
    285271
    286272// Add all languages (WP)
     
    295281    $content .= getFileContents( 'plugins/' . $plugin . '/editor_plugin.js' );
    296282
    297 // Add external plugins and init
    298 $content .= $ext_plugins . 'tinyMCE.init({' . $mce_options . '});';
     283// Add external plugins
     284$content .= $ext_plugins;
     285
     286// Mark translations as done
     287$content .= 'tinyMCEPreInit.start();' . "\n";
     288
     289// Init
     290$content .= 'tinyMCE.init(tinyMCEPreInit.mceInit);';
    299291
    300292// Generate GZIP'd content
     
    308300
    309301// Write file
    310 if ( '' != $cacheKey && is_dir($cache_path) && is_readable($cache_path) ) {
    311 
     302if ( '' != $cacheKey && is_dir($cache_path) && is_readable($cache_path) ) {
    312303    $old_cache = array();
    313304    $handle = opendir($cache_path);
    314305    while ( false !== ( $file = readdir($handle) ) ) {
    315306        if ( $file == '.' || $file == '..' ) continue;
    316         $saved = filectime("$cache_path/$file");
    317         if ( strpos($file, 'tinymce_') !== false && substr($file, -3) == $cache_ext ) $old_cache["$saved"] = $file;
     307        $old_cache[] = filemtime("$cache_path/$file") . strval($file);
    318308    }
    319309    closedir($handle);
    320            
    321     krsort($old_cache);
     310
     311    rsort($old_cache);
    322312    if ( 1 >= $old_cache_max ) $del_cache = $old_cache;
    323313    else $del_cache = array_slice( $old_cache, ($old_cache_max - 1) );
    324314
    325     foreach ( $del_cache as $key )
     315    foreach ( $del_cache as $key ) {
     316        $key = substr($key, 10);
    326317        @unlink("$cache_path/$key");
    327 
     318    }
    328319    putFileContents( $cache_file, $content );
    329320}
Note: See TracChangeset for help on using the changeset viewer.