mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
Small code style changes
This commit is contained in:
parent
8531b77633
commit
eafa675760
@ -23,9 +23,10 @@ const EMBED_IFRAME_HEIGHT = {
|
|||||||
|
|
||||||
let MediaContainer = React.createClass({
|
let MediaContainer = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
content: React.PropTypes.object,
|
content: React.PropTypes.object.isRequired,
|
||||||
currentUser: React.PropTypes.object,
|
refreshObject: React.PropTypes.func.isRequired,
|
||||||
refreshObject: React.PropTypes.func
|
|
||||||
|
currentUser: React.PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -35,13 +36,14 @@ let MediaContainer = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (!this.props.content.digital_work) {
|
const { content, refreshObject } = this.props;
|
||||||
|
if (!content.digital_work) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isEncoding = this.props.content.digital_work.isEncoding;
|
const isEncoding = content.digital_work.isEncoding;
|
||||||
if (this.props.content.digital_work.mime === 'video' && typeof isEncoding === 'number' && isEncoding !== 100 && !this.state.timerId) {
|
if (content.digital_work.mime === 'video' && typeof isEncoding === 'number' && isEncoding !== 100 && !this.state.timerId) {
|
||||||
let timerId = window.setInterval(this.props.refreshObject, 10000);
|
const timerId = window.setInterval(refreshObject, 10000);
|
||||||
this.setState({timerId: timerId});
|
this.setState({timerId: timerId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -93,7 +95,7 @@ let MediaContainer = React.createClass({
|
|||||||
{'<iframe width="560" height="' + height + '" src="https://embed.ascribe.io/content/'
|
{'<iframe width="560" height="' + height + '" src="https://embed.ascribe.io/content/'
|
||||||
+ content.bitcoin_id + '" frameborder="0" allowfullscreen></iframe>'}
|
+ content.bitcoin_id + '" frameborder="0" allowfullscreen></iframe>'}
|
||||||
</pre>
|
</pre>
|
||||||
}/>
|
} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
@ -120,7 +122,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')} .{mimetype} <Glyphicon glyph="cloud-download" />
|
||||||
</Button>
|
</Button>
|
||||||
</AclProxy>
|
</AclProxy>
|
||||||
{embed}
|
{embed}
|
||||||
|
@ -7,39 +7,35 @@ import Moment from 'moment';
|
|||||||
import ReactError from '../../mixins/react_error';
|
import ReactError from '../../mixins/react_error';
|
||||||
import { ResourceNotFoundError } from '../../models/errors';
|
import { ResourceNotFoundError } from '../../models/errors';
|
||||||
|
|
||||||
|
import EditionListActions from '../../actions/edition_list_actions';
|
||||||
|
|
||||||
|
import GlobalNotificationModel from '../../models/global_notification_model';
|
||||||
|
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
||||||
|
|
||||||
import PieceActions from '../../actions/piece_actions';
|
import PieceActions from '../../actions/piece_actions';
|
||||||
import PieceStore from '../../stores/piece_store';
|
import PieceStore from '../../stores/piece_store';
|
||||||
|
|
||||||
import PieceListActions from '../../actions/piece_list_actions';
|
import PieceListActions from '../../actions/piece_list_actions';
|
||||||
import PieceListStore from '../../stores/piece_list_store';
|
import PieceListStore from '../../stores/piece_list_store';
|
||||||
|
|
||||||
import UserActions from '../../actions/user_actions';
|
|
||||||
import UserStore from '../../stores/user_store';
|
|
||||||
|
|
||||||
import EditionListActions from '../../actions/edition_list_actions';
|
|
||||||
|
|
||||||
import Piece from './piece';
|
|
||||||
import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph';
|
|
||||||
import FurtherDetails from './further_details';
|
import FurtherDetails from './further_details';
|
||||||
|
|
||||||
import DetailProperty from './detail_property';
|
import DetailProperty from './detail_property';
|
||||||
import LicenseDetail from './license_detail';
|
|
||||||
import HistoryIterator from './history_iterator';
|
import HistoryIterator from './history_iterator';
|
||||||
|
import LicenseDetail from './license_detail';
|
||||||
|
import Note from './note';
|
||||||
|
import Piece from './piece';
|
||||||
|
|
||||||
import AclButtonList from './../ascribe_buttons/acl_button_list';
|
import AclButtonList from './../ascribe_buttons/acl_button_list';
|
||||||
import CreateEditionsForm from '../ascribe_forms/create_editions_form';
|
import AclInformation from '../ascribe_buttons/acl_information';
|
||||||
import CreateEditionsButton from '../ascribe_buttons/create_editions_button';
|
import CreateEditionsButton from '../ascribe_buttons/create_editions_button';
|
||||||
import DeleteButton from '../ascribe_buttons/delete_button';
|
import DeleteButton from '../ascribe_buttons/delete_button';
|
||||||
|
|
||||||
import AclInformation from '../ascribe_buttons/acl_information';
|
import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph';
|
||||||
import AclProxy from '../acl_proxy';
|
|
||||||
|
|
||||||
|
import CreateEditionsForm from '../ascribe_forms/create_editions_form';
|
||||||
import ListRequestActions from '../ascribe_forms/list_form_request_actions';
|
import ListRequestActions from '../ascribe_forms/list_form_request_actions';
|
||||||
|
|
||||||
import GlobalNotificationModel from '../../models/global_notification_model';
|
import AclProxy from '../acl_proxy';
|
||||||
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
|
||||||
|
|
||||||
import Note from './note';
|
|
||||||
|
|
||||||
import ApiUrls from '../../constants/api_urls';
|
import ApiUrls from '../../constants/api_urls';
|
||||||
import AscribeSpinner from '../ascribe_spinner';
|
import AscribeSpinner from '../ascribe_spinner';
|
||||||
|
Loading…
Reference in New Issue
Block a user