mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Extract file extension from amazon S3 link
This commit is contained in:
parent
a23dd99b94
commit
d9755f3563
@ -14,7 +14,9 @@ import CollapsibleButton from './../ascribe_collapsible/collapsible_button';
|
|||||||
|
|
||||||
import AclProxy from '../acl_proxy';
|
import AclProxy from '../acl_proxy';
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
|
import { extractFileExtensionFromString } from '../../utils/file_utils';
|
||||||
|
|
||||||
|
|
||||||
const EMBED_IFRAME_HEIGHT = {
|
const EMBED_IFRAME_HEIGHT = {
|
||||||
video: 315,
|
video: 315,
|
||||||
@ -63,6 +65,7 @@ let MediaContainer = React.createClass({
|
|||||||
// We also force uniqueness of usernames, so this check is safe to dtermine if the
|
// We also force uniqueness of usernames, so this check is safe to dtermine if the
|
||||||
// content was registered by the current user.
|
// content was registered by the current user.
|
||||||
const didUserRegisterContent = currentUser && (currentUser.username === content.user_registered);
|
const didUserRegisterContent = currentUser && (currentUser.username === content.user_registered);
|
||||||
|
const fileExtension = extractFileExtensionFromString(content.digital_work.url);
|
||||||
|
|
||||||
let thumbnail = content.thumbnail.thumbnail_sizes && content.thumbnail.thumbnail_sizes['600x600'] ?
|
let thumbnail = content.thumbnail.thumbnail_sizes && content.thumbnail.thumbnail_sizes['600x600'] ?
|
||||||
content.thumbnail.thumbnail_sizes['600x600'] : content.thumbnail.url_safe;
|
content.thumbnail.thumbnail_sizes['600x600'] : content.thumbnail.url_safe;
|
||||||
@ -120,7 +123,7 @@ let MediaContainer = React.createClass({
|
|||||||
className="ascribe-margin-1px"
|
className="ascribe-margin-1px"
|
||||||
href={content.digital_work.url}
|
href={content.digital_work.url}
|
||||||
target="_blank">
|
target="_blank">
|
||||||
{getLangText('Download')} .{mimetype} <Glyphicon glyph="cloud-download"/>
|
{getLangText('Download')} .{fileExtension} <Glyphicon glyph="cloud-download"/>
|
||||||
</Button>
|
</Button>
|
||||||
</AclProxy>
|
</AclProxy>
|
||||||
{embed}
|
{embed}
|
||||||
|
Loading…
Reference in New Issue
Block a user