1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

Add support for long file names

This commit is contained in:
vrde 2015-09-03 16:11:41 +02:00
parent 281822b928
commit 4a4d4ac737
2 changed files with 16 additions and 3 deletions

View File

@ -28,12 +28,20 @@ let Other = React.createClass({
}, },
render() { 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 ( return (
<Panel className="media-other"> <Panel className="media-other">
<p className="text-center"> <p className="text-center">
.{ext} {preview}
</p> </p>
</Panel> </Panel>
); );

View File

@ -12,8 +12,13 @@
} }
.media-other { .media-other {
font-size: 500%;
color: #cccccc; color: #cccccc;
font-size: 500%;
p {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
.audiojs { .audiojs {