Changeset 24366
- Timestamp:
- 05/26/2013 05:55:49 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-models.js
r24110 r24366 94 94 * 95 95 * Fetches a template by id. 96 * 97 * @param {string} id A string that corresponds to a DOM element with an id prefixed with "tmpl-". 98 * For example, "attachment" maps to "tmpl-attachment". 99 * @return {function} A function that lazily-compiles the template requested. 96 * See wp.template() in `wp-includes/js/wp-backbone.js`. 100 97 */ 101 template: _.memoize( function( id ) { 102 var compiled, 103 options = { 104 evaluate: /<#([\s\S]+?)#>/g, 105 interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, 106 escape: /\{\{([^\}]+?)\}\}(?!\})/g, 107 variable: 'data' 108 }; 109 110 return function( data ) { 111 compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options ); 112 return compiled( data ); 113 }; 114 }), 98 template: wp.template, 115 99 116 100 /**
Note: See TracChangeset
for help on using the changeset viewer.