Make WordPress Core


Ignore:
Timestamp:
02/21/2008 09:40:25 PM (18 years ago)
Author:
ryan
Message:

TinyMCE 3.01. Props azaozz. fixes #5944

File:
1 edited

Legend:

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

    r6900 r6959  
    6363/*
    6464The following filter takes an associative array of external plugins for TinyMCE in the form "name" => "url".
    65 It adds the plugin's name (including the required dash) to TinyMCE's plugins init and the call to PluginManager to load the plugin.
     65It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin.
    6666The url should be absolute and should include the js file name to be loaded.
    6767Example: array( 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js' ).
     
    7272$ext_plugins = "\n";
    7373foreach ( $mce_external_plugins as $name => $url ) {
    74     $plugins[] = '-' . $name;
     74    $plugins[] = $name;
    7575    if ( $https ) str_replace('http://', 'https://', $url);
    7676   
     
    151151
    152152// Settings for the gzip compression and cache
    153 $cache_path = dirname(__FILE__); // Cache path, this is where the .gz files will be stored
     153$cache_path = dirname(__FILE__); // ABSPATH . 'wp-content/uploads/js_cache'; // Cache path, this is where the .gz files will be stored
    154154$cache_ext = '.js';
    155155
     
    160160$initArray['disk_cache'] = $initArray['compress'] = $initArray['old_cache_max'] = null;
    161161unset( $initArray['disk_cache'], $initArray['compress'], $initArray['old_cache_max'] );
     162
     163$isIE5 = ( ( $msie = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) && ( (int) substr( $_SERVER['HTTP_USER_AGENT'], $msie + 5, 3 ) < 6 ) ) ? true : false;
     164if ( $isIE5 ) $compress = false;
    162165
    163166$plugins = explode( ',', $initArray['plugins'] );
     
    166169$enc = $cacheKey = $suffix = $mce_options = '';
    167170
    168 // Custom extra javascripts to pack
    169 $custom_js = array(); //$custom_js = apply_filters('tinymce_custom_js', array());
    170 
    171171// Check if supports gzip
    172172if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
     
    187187    foreach ( $initArray as $v )
    188188        $cacheKey .= $v;
    189    
    190     foreach ( $custom_js as $file )
    191         $cacheKey .= $file;
    192189
    193190    $cacheKey = md5( $cacheKey );
     
    234231    $content .= getFileContents( 'plugins/' . $plugin . '/editor_plugin' . $suffix . '.js' );
    235232
    236 // Add custom files
    237 foreach ( $custom_js as $file )
    238     $content .= getFileContents($file);
    239 
    240233// Add external plugins and init
    241234$content .= $ext_plugins . 'tinyMCE.init({' . $mce_options . '});'; // $mce_deprecated2 .
     
    253246if ( '' != $cacheKey && $cache_path ) {
    254247    if ( $old_cache_max ) {
    255         $old_keys = getFileContents('tinymce_compressed' . $cache_ext . '_key');
     248        $keys_file = $cache_path . '/tinymce_compressed' . $cache_ext . '_key';
     249        $old_keys = getFileContents($keys_file);
    256250           
    257251        if ( '' != $old_keys ) {
     
    270264            $keys_ar = array_slice( $keys_ar, 0, $old_cache_max );
    271265            $cacheKey = trim( implode( "\n", $keys_ar ) );
    272            
    273266        }
    274267       
    275         putFileContents( 'tinymce_compressed' . $cache_ext . '_key', $cacheKey );
     268        putFileContents( $keys_file, $cacheKey );
    276269    }
    277270   
Note: See TracChangeset for help on using the changeset viewer.