'use strict'; import React from 'react'; import MediaPlayer from './ascribe_media/media_player'; import CollapsibleMixin from 'react-bootstrap/lib/CollapsibleMixin'; import Row from 'react-bootstrap/lib/Row'; import Col from 'react-bootstrap/lib/Col'; import Button from 'react-bootstrap/lib/Button'; import Glyphicon from 'react-bootstrap/lib/Glyphicon'; import TextareaAutosize from 'react-textarea-autosize'; import EditionActions from '../actions/edition_actions'; import AclButtonList from './ascribe_buttons/acl_button_list'; import classNames from 'classnames'; /** * This is the component that implements display-specific functionality */ let Edition = React.createClass({ propTypes: { edition: React.PropTypes.object, currentUser: React.PropTypes.object, deleteEdition: React.PropTypes.func, savePersonalNote: React.PropTypes.func }, render() { let thumbnail = this.props.edition.thumbnail; let mimetype = this.props.edition.digital_work.mime; let extraData = null; if (this.props.edition.digital_work.encoding_urls) { extraData = this.props.edition.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label }; }); } let bitcoinIdValue = ( {this.props.edition.bitcoin_id} ); let hashOfArtwork = ( {this.props.edition.hash_as_address} ); return (

0}> 0}>
); } }); let EditionHeader = React.createClass({ propTypes: { edition: React.PropTypes.object }, render() { var titleHtml =
{this.props.edition.title}
; return (

); } }); let EditionSummary = React.createClass({ propTypes: { edition: React.PropTypes.object, currentUser: React.PropTypes.object }, handleSuccess(){ EditionActions.fetchOne(this.props.edition.id); }, render() { return (


); } }); let CollapsibleEditionDetails = React.createClass({ propTypes: { title: React.PropTypes.string, children: React.PropTypes.oneOfType([ React.PropTypes.object, React.PropTypes.array ]), show: React.PropTypes.bool, iconName: React.PropTypes.string }, getDefaultProps() { return { show: true }; }, render() { if(this.props.show) { return (
{this.props.children}
); } else { return null; } } }); const CollapsibleParagraph = React.createClass({ propTypes: { title: React.PropTypes.string, children: React.PropTypes.oneOfType([ React.PropTypes.object, React.PropTypes.array ]), iconName: React.PropTypes.string }, mixins: [CollapsibleMixin], getCollapsibleDOMNode(){ return React.findDOMNode(this.refs.panel); }, getCollapsibleDimensionValue(){ return React.findDOMNode(this.refs.panel).scrollHeight; }, onHandleToggle(e){ e.preventDefault(); this.setState({expanded: !this.state.expanded}); }, render() { let styles = this.getCollapsibleClassSet(); let text = this.isExpanded() ? '-' : '+'; let icon = this.props.iconName ? () : null; return (
{text} {icon} {this.props.title}
{this.props.children}
); } }); let EditionDetailProperty = React.createClass({ propTypes: { label: React.PropTypes.string, value: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.element ]), separator: React.PropTypes.string, labelClassName: React.PropTypes.string, valueClassName: React.PropTypes.string }, getDefaultProps() { return { separator: ':', labelClassName: 'col-xs-5 col-sm-5 col-md-5 col-lg-5', valueClassName: 'col-xs-7 col-sm-7 col-md-7 col-lg-7' }; }, render() { return (
{ this.props.label }{this.props.separator}
{ this.props.value }
); } }); let EditionDetailHistoryIterator = React.createClass({ propTypes: { history: React.PropTypes.array }, render() { return (
{this.props.history.map((historicalEvent, i) => { return ( ); })}
); } }); let EditionPersonalNote = React.createClass({ propTypes: { savePersonalNote: React.PropTypes.func }, prepareSavePersonalNote() { let personalNote = React.findDOMNode(this.refs.personalNote).value; this.props.savePersonalNote(personalNote); }, render() { return ( ); } }); export default Edition;