WordPress.org

Make WordPress Core

Changeset 3788


Ignore:
Timestamp:
05/22/06 17:16:05 (9 years ago)
Author:
ryan
Message:

Script loader from mdawaffe. #2701

Location:
trunk
Files:
2 added
1 deleted
16 edited

Legend:

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

    r3778 r3788  
    11741174function the_quicktags() { 
    11751175    // Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP 
    1176     if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) 
     1176    if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) { 
    11771177        echo ' 
    11781178        <div id="quicktags"> 
    1179             <script src="../wp-includes/js/quicktags.js" type="text/javascript"></script> 
    1180             <script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script> 
     1179            '; 
     1180        wp_print_scripts( 'quicktags' ); 
     1181        echo '          <script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script> 
    11811182        </div> 
    11821183'; 
    1183     else echo ' 
     1184    } else echo ' 
    11841185<script type="text/javascript"> 
    11851186function edInsertContent(myField, myValue) { 
  • trunk/wp-admin/admin-header.php

    r3735 r3788  
    33if (!isset($_GET["page"])) require_once('admin.php'); 
    44if ( $editing ) { 
    5     $dbx_js = true; 
    6     $pmeta_js = true; 
    7     $list_js = true; 
    8     if ( current_user_can('manage_categories') ) { 
    9         $cat_js = true; 
    10     } 
     5    wp_enqueue_script( array("dbx-admin-key?pagenow=$pagenow",'admin-custom-fields') ); 
     6    if ( current_user_can('manage_categories') ) 
     7        wp_enqueue_script( 'ajaxcat' ); 
     8    if ( user_can_richedit() ) 
     9        wp_enqueue_script( 'wp_tiny_mce' ); 
    1110} 
    12 if ( $list_js ) 
    13     $sack_js = true; 
     11 
     12get_admin_page_title(); 
    1413?> 
    15 <?php get_admin_page_title(); ?> 
    1614<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    1715<html xmlns="http://www.w3.org/1999/xhtml"> 
     
    2523//]]> 
    2624</script> 
    27 <script type="text/javascript" src="../wp-includes/js/fat.js"></script> 
    28 <?php if ( $xfn_js ) { ?> 
    29 <script type="text/javascript" src="xfn.js"></script> 
    30 <?php } ?> 
    31 <?php if ( $sack_js ) { ?> 
    32 <script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script> 
    33 <?php } ?> 
    34 <?php if ( $list_js ) { ?> 
    35 <script type="text/javascript" src="list-manipulation-js.php"></script> 
    36 <?php } ?> 
    37 <?php if ( $pmeta_js ) { ?> 
    38 <script type="text/javascript" src="custom-fields.js"></script> 
    39 <?php } ?> 
    40 <?php if ( 'categories.php' == $pagenow && 'edit' != $action ) { ?> 
    41 <script type="text/javascript" src="categories.js"></script> 
    42 <?php } ?> 
    43 <?php if ( $users_js ) { ?> 
    44 <script type="text/javascript" src="users.js"></script> 
    45 <?php } ?> 
    46 <?php if ( 'edit-comments.php' == $pagenow || ( 'edit.php' == $pagenow && 1 == $_GET['c'] ) ) { ?> 
    47 <script type="text/javascript" src="edit-comments.js"></script> 
    48 <?php } ?> 
    49 <?php if ( $dbx_js ) { ?> 
    50 <script type="text/javascript" src="../wp-includes/js/dbx.js"></script> 
    51 <script type="text/javascript"> 
    52 //<![CDATA[ 
    53 addLoadEvent( function() { 
    54 <?php switch ( $pagenow ) : case 'post.php' : case 'post-new.php' : ?> 
    55 var manager = new dbxManager('postmeta'); 
    56 <?php break; case 'page.php' : case 'page-new.php' : ?> 
    57 var manager = new dbxManager('pagemeta'); 
    58 <?php break; case 'link.php' : case 'link-add.php' : ?> 
    59 var manager = new dbxManager('linkmeta'); 
    60 <?php break; endswitch; ?> 
    61 }); 
    62 //]]> 
    63 </script> 
    64 <script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script> 
    65 <?php } ?> 
    66 <?php if ( $editing && user_can_richedit() ) { tinymce_include(); } ?> 
    67 <?php if ( $cat_js ) { ?> 
    68 <script type="text/javascript" src="cat-js.php"></script> 
    69 <?php } ?> 
    7025<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?> 
    7126<style type="text/css">* html { overflow-x: hidden; }</style> 
    72 <?php endif; ?> 
    73 <?php do_action('admin_head'); ?> 
     27<?php endif; wp_print_scripts(); do_action('admin_head'); ?> 
    7428</head> 
    7529<body> 
  • trunk/wp-admin/admin.php

    r3677 r3788  
    4141} 
    4242 
    43 $xfn_js = $sack_js = $list_js = $cat_js = $users_js = $dbx_js = $pmeta_js = $editing = false; 
     43wp_enqueue_script( 'fat' ); 
     44 
     45$editing = false; 
    4446 
    4547require(ABSPATH . '/wp-admin/menu.php'); 
  • trunk/wp-admin/categories.php

    r3777 r3788  
    8080default: 
    8181 
    82 $list_js = true; 
     82wp_enqueue_script( 'admin-categories' ); 
    8383require_once ('admin-header.php'); 
    8484 
  • trunk/wp-admin/edit-comments.php

    r3770 r3788  
    44$title = __('Edit Comments'); 
    55$parent_file = 'edit.php'; 
    6 $list_js = true; 
     6wp_enqueue_script( 'admin-comments' ); 
    77 
    88require_once('admin-header.php'); 
  • trunk/wp-admin/edit-pages.php

    r3770 r3788  
    33$title = __('Pages'); 
    44$parent_file = 'edit.php'; 
    5 $list_js = true; 
     5wp_enqueue_script( 'listman' ); 
    66require_once('admin-header.php'); 
    77?> 
  • trunk/wp-admin/edit.php

    r3770 r3788  
    44$title = __('Posts'); 
    55$parent_file = 'edit.php'; 
    6 $list_js = true; 
     6wp_enqueue_script( 1 == $_GET['c'] ? 'admin-comments' : 'listman' ); 
    77require_once('admin-header.php'); 
    88 
  • trunk/wp-admin/link-add.php

    r3570 r3788  
    2626} 
    2727 
    28 $xfn_js = true; 
     28wp_enqueue_script( 'xfn' ); 
    2929$editing = true; 
    3030require('admin-header.php'); 
  • trunk/wp-admin/link-manager.php

    r3770 r3788  
    99$title = __('Manage Bookmarks'); 
    1010$this_file = $parent_file = 'link-manager.php'; 
    11 $list_js = true; 
     11wp_enqueue_script( 'listman' ); 
    1212 
    1313$wpvarstoreset = array ('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'); 
  • trunk/wp-admin/link.php

    r3759 r3788  
    103103 
    104104    case 'edit' : 
    105         $xfn_js = true; 
     105        wp_enqueue_script( 'xfn' ); 
    106106        $editing = true; 
    107107        $parent_file = 'link-manager.php'; 
  • trunk/wp-admin/moderation.php

    r3763 r3788  
    44$title = __('Moderate comments'); 
    55$parent_file = 'edit.php'; 
    6 $list_js = true; 
     6wp_enqueue_script( 'listman' ); 
    77 
    88$wpvarstoreset = array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky'); 
  • trunk/wp-admin/users.php

    r3770 r3788  
    144144 
    145145default: 
    146  
    147     $list_js = true; 
    148     $users_js = true; 
     146    wp_enqueue_script( 'admin-users' ); 
    149147 
    150148    include ('admin-header.php'); 
  • trunk/wp-includes/default-filters.php

    r3663 r3788  
    8787add_action('publish_future_post', 'wp_publish_post', 10, 1); 
    8888add_action('wp_head', 'noindex', 1); 
     89add_action('wp_head', 'wp_print_scripts'); 
    8990if(!defined('DOING_CRON')) 
    9091    add_action('init', 'wp_cron'); 
  • trunk/wp-includes/deprecated.php

    r3697 r3788  
    453453} 
    454454 
     455// Deprecated.  Use wp_print_scripts() or WP_Scripts instead. 
     456function tinymce_include() { 
     457    wp_print_script( 'wp_tiny_mce' ); 
     458} 
    455459?> 
  • trunk/wp-includes/functions-post.php

    r3787 r3788  
    10411041 
    10421042/** 
    1043  * Places two script links in <head>: one to get tinyMCE (big), one to configure and start it (small) 
    1044  */ 
    1045 function tinymce_include() { 
    1046     $ver = '04162006'; 
    1047     $src1 = get_settings('siteurl') . "/wp-includes/js/tinymce/tiny_mce_gzip.php?ver=$ver"; 
    1048     $src2 = get_settings('siteurl') . "/wp-includes/js/tinymce/tiny_mce_config.php?ver=$ver"; 
    1049  
    1050     echo "<script type='text/javascript' src='$src1'></script>\n"; 
    1051     echo "<script type='text/javascript' src='$src2'></script>\n"; 
    1052 } 
    1053  
    1054 /** 
    10551043 * Places a textarea according to the current user's preferences, filled with $content. 
    10561044 * Also places a script block that enables tabbing between Title and Content. 
  • trunk/wp-settings.php

    r3714 r3788  
    144144require (ABSPATH . WPINC . '/version.php'); 
    145145require (ABSPATH . WPINC . '/deprecated.php'); 
     146require (ABSPATH . WPINC . '/script-loader.php'); 
    146147 
    147148if (!strstr($_SERVER['PHP_SELF'], 'install.php')) : 
Note: See TracChangeset for help on using the changeset viewer.