Media: Add global upload progress to the sidebar. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -191,6 +191,18 @@ window.wp = window.wp || {};
|
||||
height: height
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
// Truncates a string by injecting an ellipsis into the middle.
|
||||
// Useful for filenames.
|
||||
truncate: function( string, length, replacement ) {
|
||||
length = length || 30;
|
||||
replacement = replacement || '…';
|
||||
|
||||
if ( string.length <= length )
|
||||
return string;
|
||||
|
||||
return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user