diff --git a/dist.zip b/dist.zip index 9e9837b22..f54ab886f 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/dist/index.html b/dist/index.html index 1d42421a7..f6f7ba88a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -35,6 +35,7 @@ + diff --git a/js/app.js b/js/app.js index 7ec929def..2271b66bc 100644 --- a/js/app.js +++ b/js/app.js @@ -4,7 +4,7 @@ var App = React.createClass({ var match, param, val; [match, param, val] = window.location.search.match(/\??([^=]*)(?:=(.*))?/); - if (['settings', 'help', 'start', 'watch', 'report', 'files', 'claim'].indexOf(param) != -1) { + if (['settings', 'help', 'start', 'watch', 'report', 'files', 'claim', 'show'].indexOf(param) != -1) { var viewingPage = param; } else { var viewingPage = 'home'; @@ -58,6 +58,8 @@ var App = React.createClass({ return ; } else if (this.state.viewingPage == 'claim') { return ; + } else if (this.state.viewingPage == 'show') { + return ; } } }); diff --git a/js/component/common.js b/js/component/common.js index 343a3634d..ca83c3dd6 100644 --- a/js/component/common.js +++ b/js/component/common.js @@ -87,12 +87,8 @@ var WatchLink = React.createClass({ }, render: function() { - // No support for lbry:// URLs in Windows or on Chrome yet - if (/windows|win32/i.test(navigator.userAgent) || (window.chrome && window.navigator.vendor == "Google Inc.")) { - var uri = "/?watch=" + this.props.streamName; - } else { - var uri = 'lbry://' + this.props.streamName; - } + var uri = "/?watch=" + this.props.streamName; + return ; } diff --git a/js/page/home.js b/js/page/home.js index 2d84643ed..2898c2ba9 100644 --- a/js/page/home.js +++ b/js/page/home.js @@ -102,7 +102,7 @@ var SearchResultRow = React.createClass({ -

{this.props.title}

+

{this.props.title}

lbry://{this.props.name}

{this.props.description}

@@ -191,7 +191,7 @@ var FeaturedContentItem = React.createClass({ {'Photo
-

{this.state.title}

+

{this.state.title}

diff --git a/js/page/my_files.js b/js/page/my_files.js index 69ddfc9d9..b575b318e 100644 --- a/js/page/my_files.js +++ b/js/page/my_files.js @@ -97,7 +97,7 @@ var MyFilesRow = React.createClass({ {'Photo
-

{this.props.title}

+

{this.props.title}

{ ' ' } {this.props.completed ? 'Download complete' : (parseInt(this.props.ratioLoaded * 100) + '%')} diff --git a/js/page/show.js b/js/page/show.js new file mode 100644 index 000000000..9c4b95f48 --- /dev/null +++ b/js/page/show.js @@ -0,0 +1,139 @@ +var formatItemStyle = { + fontSize: '0.95em', + marginTop: '10px', + maxHeight: '220px' +}, formatItemImgStyle = { + maxWidth: '100%', + maxHeight: '100%', + display: 'block', + marginLeft: 'auto', + marginRight: 'auto', + marginTop: '5px', +}, formatHeaderStyle = { + fontWeight: 'bold', + marginBottom: '5px' +}, formatSubheaderStyle = { + marginBottom: '10px', + fontSize: '0.9em' +}, formatItemDescriptionStyle = { + color: '#444', + marginBottom: '5px', + fontSize: '1.2em', +}, formatItemMetadataStyle = { + color: '#444', + marginBottom: '5px', + fontSize: '0.9em', +}, formatItemCostStyle = { + float: 'right' +}; + +var FormatItem = React.createClass({ + propTypes: { + results: React.PropTypes.object, + }, + render: function() { + var results = this.props.results; + var name = results.name; + var thumbnail = results.thumbnail; + var title = results.title; + var amount = results.cost_est ? results.cost_est : 0.0; + var description = results.description; + var author = results.author; + var language = results.language; + var license = results.license; + var fileContentType = results['content-type']; + + return ( +
+
+ {'Photo +
+
+

Address: {name}

+

Content-Type: {fileContentType}

+
+
+ +     + +
+

{description}

+
+ Author: {author}
+ Language: {language}
+ License: {license}
+
+
+
+ ); + } +}); + +var FormatsSection = React.createClass({ + propTypes: { + results: React.PropTypes.object, + name: React.PropTypes.string, + }, + render: function() { + var name = this.props.name; + var format = this.props.results; + var title = format.title; + + if(format == null) + { + return ( +
+

Sorry, no results found for "{name}".

+
); + } + + return ( +
+

{title}

+ {/* In future, anticipate multiple formats, just a guess at what it could look like + // var formats = this.props.results.formats + // return ({formats.map(function(format,i){ */} + + {/* })}); */} +
); + } +}); + +var DetailPage = React.createClass({ + propTypes: { + name: React.PropTypes.string, + }, + getInitialState: function() { + return { + results: null, + searching: true, + }; + }, + componentWillMount: function() { + lbry.search(this.props.name, (results) => { + this.setState({ + results: results[0], + searching: false, + }); + }); + }, + render: function() { + if (this.state.results == null && this.state.searching) { + // Still waiting for metadata + return null; + } + + var name = this.props.name; + var metadata = this.state.metadata; + var results = this.state.results; + + return ( +
+ + +
+ +
+
); + } +}); \ No newline at end of file