Changeset 22816 for trunk/wp-includes/js/media-models.js
- Timestamp:
- 11/22/2012 09:32:21 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-models.js
r22809 r22816 192 192 }; 193 193 } 194 }, 195 196 // Truncates a string by injecting an ellipsis into the middle. 197 // Useful for filenames. 198 truncate: function( string, length, replacement ) { 199 length = length || 30; 200 replacement = replacement || '…'; 201 202 if ( string.length <= length ) 203 return string; 204 205 return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); 194 206 } 195 207 });
Note: See TracChangeset
for help on using the changeset viewer.