WordPress.org

Make WordPress Core

Changeset 10369


Ignore:
Timestamp:
01/16/09 12:58:38 (7 years ago)
Author:
azaozz
Message:

Concatenated and compressed versions of the default TinyMCE scripts

Location:
trunk
Files:
3 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r10364 r10369  
    3939 
    4040if ( in_array( $pagenow, array('post.php', 'post-new.php', 'page.php', 'page-new.php') ) ) { 
    41     add_action( 'admin_footer', 'wp_tiny_mce' ); 
     41    add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 ); 
    4242    wp_enqueue_script('quicktags'); 
    4343} 
  • trunk/wp-admin/includes/post.php

    r10338 r10369  
    11141114 */ 
    11151115function wp_tiny_mce( $teeny = false ) { 
     1116    global $concatenate_scripts, $compress_scripts; 
     1117     
    11161118    if ( ! user_can_richedit() ) 
    11171119        return; 
     
    11441146        $mce_external_plugins = apply_filters('mce_external_plugins', array()); 
    11451147 
    1146         $ext_plugins = "\n"; 
     1148        $ext_plugins = ''; 
    11471149        if ( ! empty($mce_external_plugins) ) { 
    11481150 
     
    12861288    } 
    12871289 
     1290    if ( ! isset($concatenate_scripts) ) 
     1291        script_concat_settings(); 
     1292 
    12881293    $language = $initArray['language']; 
    1289  
    1290     $ver = apply_filters('tiny_mce_version', '3101'); 
     1294    $zip = $compress_scripts ? 1 : 0; 
     1295    $ver = apply_filters('tiny_mce_version', '3211'); 
    12911296 
    12921297    if ( 'en' != $language ) 
     
    13061311    query : "ver=<?php echo $ver; ?>", 
    13071312    mceInit : {<?php echo $mce_options; ?>}, 
    1308  
    1309     go : function() { 
    1310         var t = this, sl = tinymce.ScriptLoader, ln = t.mceInit.language, th = t.mceInit.theme, pl = t.mceInit.plugins; 
    1311  
    1312         sl.markDone(t.base + '/langs/' + ln + '.js'); 
    1313  
    1314         sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '.js'); 
    1315         sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '_dlg.js'); 
    1316  
    1317         tinymce.each(pl.split(','), function(n) { 
    1318             if (n && n.charAt(0) != '-') { 
    1319                 sl.markDone(t.base + '/plugins/' + n + '/langs/' + ln + '.js'); 
    1320                 sl.markDone(t.base + '/plugins/' + n + '/langs/' + ln + '_dlg.js'); 
    1321             } 
    1322         }); 
    1323     }, 
    1324  
    1325     load_ext : function(url,lang) { 
    1326         var sl = tinymce.ScriptLoader; 
    1327  
    1328         sl.markDone(url + '/langs/' + lang + '.js'); 
    1329         sl.markDone(url + '/langs/' + lang + '_dlg.js'); 
    1330     } 
     1313    load_ext : function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} 
    13311314}; 
    13321315/* ]]> */ 
    13331316</script> 
    1334 <script type="text/javascript" src="<?php echo $baseurl; ?>/tiny_mce.js?ver=<?php echo $ver; ?>"></script> 
    1335 <?php if ( 'en' != $language && isset($lang) ) { ?> 
    1336 <script type="text/javascript"> 
    1337 <?php echo $lang; ?> 
    1338 </script> 
    1339 <?php } else { ?> 
    1340 <script type="text/javascript" src="<?php echo $baseurl; ?>/langs/wp-langs-en.js?ver=<?php echo $ver; ?>"></script> 
    1341 <?php } ?> 
     1317 
     1318<?php 
     1319    if ( $concatenate_scripts ) { 
     1320        echo "<script type='text/javascript' src='$baseurl/wp-tinymce.php?c=$zip&amp;ver=$ver'></script>"; 
     1321    } else { 
     1322        echo "<script type='text/javascript' src='$baseurl/tiny_mce.js?ver=$ver'></script>"; 
     1323 
     1324        if ( 'en' != $language && isset($lang) ) 
     1325            echo "<script type='text/javascript'>\n$lang\n</script>"; 
     1326        else 
     1327            echo "<script type='text/javascript' src='$baseurl/langs/wp-langs-en.js?ver=$ver'></script>"; 
     1328    } 
     1329?> 
     1330 
    13421331<script type="text/javascript"> 
    13431332<?php if ( $ext_plugins ) echo $ext_plugins; ?> 
    1344  
    1345 // Mark translations as done 
     1333<?php if ( $concatenate_scripts ) { ?> 
    13461334tinyMCEPreInit.go(); 
    1347  
    1348 // Init 
     1335<?php } else { ?> 
     1336(function(){var t=tinyMCEPreInit,sl=tinymce.ScriptLoader,ln=t.mceInit.language,th=t.mceInit.theme,pl=t.mceInit.plugins;sl.markDone(t.base+'/langs/'+ln+'.js');sl.markDone(t.base+'/themes/'+th+'/langs/'+ln+'.js');sl.markDone(t.base+'/themes/'+th+'/langs/'+ln+'_dlg.js');tinymce.each(pl.split(','),function(n){if(n&&n.charAt(0)!='-'){sl.markDone(t.base+'/plugins/'+n+'/langs/'+ln+'.js');sl.markDone(t.base+'/plugins/'+n+'/langs/'+ln+'_dlg.js');}});})(); 
     1337<?php } ?> 
    13491338tinyMCE.init(tinyMCEPreInit.mceInit); 
    13501339</script> 
    1351  
    13521340<?php 
    13531341} 
    1354 ?> 
Note: See TracChangeset for help on using the changeset viewer.