2015-09-24 16:06:53 +02:00
|
|
|
/**
|
|
|
|
* Created by cevo on 23.09.15.
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2015-09-29 10:31:13 +02:00
|
|
|
import classnames from 'classnames';
|
|
|
|
|
2015-09-25 14:36:27 +02:00
|
|
|
import DropdownButton from 'react-bootstrap/lib/Button';
|
2015-09-24 16:06:53 +02:00
|
|
|
|
2015-09-29 10:31:13 +02:00
|
|
|
|
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
let AclInformationButton = React.createClass({
|
2015-09-25 14:36:27 +02:00
|
|
|
getDefaultProps: function() {
|
|
|
|
let rows = [];
|
2015-09-24 16:06:53 +02:00
|
|
|
let titleStyle = {
|
|
|
|
color: '#02B6A3',
|
2015-10-06 10:20:57 +02:00
|
|
|
fontSize: '11px',
|
|
|
|
lineHeight: '5px'
|
2015-09-24 16:06:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
let infoStyle = {
|
|
|
|
color: '#333333',
|
2015-10-06 10:20:57 +02:00
|
|
|
fontSize: '11px',
|
|
|
|
lineHeight: '5px'
|
2015-09-28 22:09:25 +02:00
|
|
|
};
|
2015-09-24 16:06:53 +02:00
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
let exampleStyle = {
|
|
|
|
color: '#B2B2B2',
|
2015-10-06 10:20:57 +02:00
|
|
|
fontSize: '11px',
|
|
|
|
lineHeight: '5px'
|
|
|
|
};
|
|
|
|
|
|
|
|
let paragraphStyle = {
|
|
|
|
margin: '0.1em'
|
2015-09-24 16:06:53 +02:00
|
|
|
};
|
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
|
2015-09-24 16:06:53 +02:00
|
|
|
let titleList = ['TRANSFER', 'CONSIGN', 'LOAN', 'SHARE', 'DELETE'];
|
|
|
|
|
|
|
|
let infoSentenceList = [
|
2015-09-28 22:09:25 +02:00
|
|
|
' - Changes ownership of an Edition. As with a physical piece of work, ' +
|
2015-09-24 16:06:53 +02:00
|
|
|
'transferring ownership of an Edition does not transfer copyright in the Work.',
|
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
' - Lets someone represent you in dealing with the work, under the terms you agree to.',
|
2015-09-24 16:06:53 +02:00
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
' - Lets someone use or put the Work on display for a limited amount of time.',
|
2015-09-24 16:06:53 +02:00
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
' - Lets someone view the Work or Edition, but does not give rights to publish or display it.',
|
2015-09-24 16:06:53 +02:00
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
' - Removes the Work from your Wallet. Note that the previous registration and transfer ' +
|
2015-09-25 14:36:27 +02:00
|
|
|
'history will still exist on the blockchain and cannot be deleted.'];
|
2015-09-24 16:06:53 +02:00
|
|
|
|
|
|
|
let exampleSentenceList = [
|
|
|
|
'(e.g. a musician Transfers limited edition 1 of 10 of her new album to a very happy fan)',
|
|
|
|
|
|
|
|
'(e.g. an artist Consigns 10 Editions of her new Work to a gallery ' +
|
|
|
|
'so the gallery can sell them on her behalf, under the terms the artist and the gallery have agreed to)',
|
|
|
|
|
|
|
|
'(e.g. a collector Loans a Work to a gallery for one month for display in the gallery\'s show)',
|
|
|
|
|
|
|
|
'(e.g. a photographer Shares proofs of a graduation photo with the graduate\'s grandparents)',
|
|
|
|
|
2015-09-25 14:36:27 +02:00
|
|
|
'(e.g. an artist uploaded the wrong file and doesn\'t want it cluttering his Wallet, so he Deletes it)'];
|
2015-09-28 22:09:25 +02:00
|
|
|
|
2015-09-25 14:36:27 +02:00
|
|
|
console.log('Now will initialize the rows prop inside default props');
|
2015-09-28 22:09:25 +02:00
|
|
|
|
2015-09-25 14:36:27 +02:00
|
|
|
let createJSXTextSnippet = function(title, info, example){
|
|
|
|
console.log('creating text snippets');
|
2015-10-06 10:20:57 +02:00
|
|
|
return (<p style={paragraphStyle}> <span style={titleStyle}> {title} </span>
|
|
|
|
<span style={infoStyle}> {info} <br/> </span>
|
2015-09-25 14:36:27 +02:00
|
|
|
<span style={exampleStyle}> {example} </span> </p>);
|
|
|
|
};
|
2015-09-24 16:06:53 +02:00
|
|
|
|
|
|
|
for (let i = 0; i < titleList.length; i++){
|
2015-09-25 14:36:27 +02:00
|
|
|
rows.push(createJSXTextSnippet(titleList[i], infoSentenceList[i], exampleSentenceList[i],
|
|
|
|
titleStyle, infoStyle, exampleStyle));
|
2015-09-24 16:06:53 +02:00
|
|
|
}
|
2015-09-25 14:36:27 +02:00
|
|
|
return {
|
2015-09-28 22:09:25 +02:00
|
|
|
rows: rows,
|
|
|
|
dropdownButtonStyle: {
|
|
|
|
background: 'none',
|
|
|
|
color: 'black',
|
|
|
|
padding: 0,
|
|
|
|
border: 'none'
|
|
|
|
},
|
|
|
|
dropdownListStyle: {
|
|
|
|
textAlign: 'left',
|
|
|
|
width: '80.8%'
|
|
|
|
}
|
2015-09-25 14:36:27 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
getInitialState: function(){
|
|
|
|
return {isVisible: false};
|
|
|
|
},
|
|
|
|
show: function(){
|
|
|
|
console.log('now inside the show function');
|
|
|
|
this.setState({isVisible: true});
|
|
|
|
document.addEventListener('click', this.hide);
|
|
|
|
},
|
|
|
|
hide: function(){
|
|
|
|
this.setState({isVisible: false});
|
|
|
|
document.removeEventListener('click', this.hide);
|
|
|
|
},
|
|
|
|
showInformation: function(){
|
|
|
|
if (this.state.isVisible) {
|
|
|
|
return this.props.rows;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
render: function () {
|
2015-09-24 16:06:53 +02:00
|
|
|
return (
|
2015-09-28 22:09:25 +02:00
|
|
|
<span>
|
2015-09-29 10:31:13 +02:00
|
|
|
<DropdownButton
|
|
|
|
style={this.props.dropdownButtonStyle}
|
|
|
|
className="glyphicon glyphicon-question-sign" onClick={this.show} />
|
|
|
|
<div
|
|
|
|
style={this.props.dropdownListStyle}
|
|
|
|
className={classnames({'hidden': !this.state.isVisible})}>
|
2015-09-28 22:09:25 +02:00
|
|
|
{this.showInformation()}
|
2015-09-25 14:36:27 +02:00
|
|
|
</div>
|
2015-09-28 22:09:25 +02:00
|
|
|
</span>
|
2015-09-24 16:06:53 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-09-28 22:09:25 +02:00
|
|
|
export default AclInformationButton;
|