mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Add support for long file names
This commit is contained in:
parent
281822b928
commit
4a4d4ac737
@ -28,12 +28,20 @@ let Other = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
let ext = this.props.url.split('.').pop();
|
||||
let filename = this.props.url.split('/').pop();
|
||||
let tokens = filename.split('.');
|
||||
let preview;
|
||||
|
||||
if (tokens.length > 1) {
|
||||
preview = '.' + tokens.pop();
|
||||
} else {
|
||||
preview = 'file';
|
||||
}
|
||||
|
||||
return (
|
||||
<Panel className="media-other">
|
||||
<p className="text-center">
|
||||
.{ext}
|
||||
{preview}
|
||||
</p>
|
||||
</Panel>
|
||||
);
|
||||
|
@ -12,8 +12,13 @@
|
||||
}
|
||||
|
||||
.media-other {
|
||||
font-size: 500%;
|
||||
color: #cccccc;
|
||||
font-size: 500%;
|
||||
p {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.audiojs {
|
||||
|
Loading…
Reference in New Issue
Block a user