WordPress.org

Make WordPress Core

Ticket #23263: 23263.diff

File 23263.diff, 2.5 KB (added by wonderboymusic, 14 months ago)
  • new file wp-includes/js/template.js

    diff --git wp-includes/js/template.js wp-includes/js/template.js
    new file mode 100644
    index 0000000..8b4e818
    - +  
     1window.wp = window.wp || {}; 
     2 
     3(function ($) { 
     4        var template; 
     5        /** 
     6         * wp.template( id ) 
     7         * 
     8         * Fetches a template by id. 
     9         * 
     10         * @param  {string} id   A string that corresponds to a DOM element with an id prefixed with "tmpl-". 
     11         *                       For example, "attachment" maps to "tmpl-attachment". 
     12         * @return {function}    A function that lazily-compiles the template requested. 
     13         */ 
     14        template = wp.template = _.memoize(function ( id ) { 
     15                var compiled, 
     16                        options = { 
     17                                evaluate:    /<#([\s\S]+?)#>/g, 
     18                                interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, 
     19                                escape:      /\{\{([^\}]+?)\}\}(?!\})/g, 
     20                                variable:    'data' 
     21                        }; 
     22 
     23                return function ( data ) { 
     24                        compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options ); 
     25                        return compiled( data ); 
     26                }; 
     27        }); 
     28 
     29}(jQuery)); 
     30 No newline at end of file 
  • wp-includes/script-loader.php

    diff --git wp-includes/script-loader.php wp-includes/script-loader.php
    index 139cd95..4eedc21 100644
    function wp_default_scripts( &$scripts ) { 
    270270        $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23'); 
    271271 
    272272        $scripts->add( 'underscore', '/wp-includes/js/underscore.min.js', array(), '1.4.4', 1 ); 
    273         $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery'), '0.9.2', 1 ); 
     273        $scripts->add( 'template', "/wp-includes/js/template$suffix.js", array('underscore'), '1.4.4', 1 ); 
     274        $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery', 'template'), '0.9.2', 1 ); 
     275 
     276        $scripts->add( 'revisions', "/wp-includes/js/revisions.js", array ('backbone'), '', 1 ); 
    274277 
    275278        $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 ); 
    276279 
    function wp_default_styles( &$styles ) { 
    535538        $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie' ) ); 
    536539        $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons' ) ); 
    537540        $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" ); 
     541        $styles->add( 'revisions', "/wp-admin/css/revisions$suffix.css" ); 
     542        $styles->add( 'wp-jquery-ui-slider', "/wp-includes/css/jquery-ui-slider$suffix.css" ); 
    538543 
    539544        foreach ( $rtl_styles as $rtl_style ) { 
    540545                $styles->add_data( $rtl_style, 'rtl', true );