React/Redux - publish component #323

Merged
bones7242 merged 80 commits from react-upload into master 2018-01-25 22:43:20 +01:00
7 changed files with 251 additions and 60 deletions
Showing only changes of commit 70c75976fb - Show all commits

View file

@ -483,26 +483,25 @@ table {
cursor: pointer;
}
#primary-dropzone-instructions, #dropbzone-dragover {
z-index: -1;
}
.position-absolute {
#dropzone-text-holder {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
#asset-preview-holder {
position: relative;
#dropzone-dragover, #dropzone-instructions {
padding: 1em;
}
#asset-preview {
display: block;
padding: 0.5rem;
width: calc(100% - 1rem);
width: 100%;
}
.dim {
opacity: 0.2;
}
/* Assets */

View file

@ -1,10 +1,2 @@
function preview_onmouseenter_handler () {
document.getElementById('asset-preview-dropzone-instructions').setAttribute('class', 'flex-container--column flex-container--center-center position-absolute');
document.getElementById('asset-preview').style.opacity = 0.2;
}
function preview_onmouseleave_handler () {
document.getElementById('asset-preview-dropzone-instructions').setAttribute('class', 'hidden');
document.getElementById('asset-preview').style.opacity = 1;
}

View file

@ -3,12 +3,13 @@ import React from 'react';
import { selectFile } from '../actions';
import { connect } from 'react-redux';
class PublishDropzone extends React.Component {
class Dropzone extends React.Component {
constructor (props) {
super(props);
this.state = {
fileError: null,
dragOver : false,
}
this.handleDrop = this.handleDrop.bind(this);
this.handleDragOver = this.handleDragOver.bind(this);
@ -115,19 +116,21 @@ class PublishDropzone extends React.Component {
<form>
<input className="input-file" type="file" id="file_input" name="file_input" accept="video/*,image/*" onChange={this.handleFileInput} encType="multipart/form-data"/>
</form>
<div id="primary-dropzone" className={'dropzone row row--padded row--tall flex-container--column flex-container--center-center' + (this.state.dragOver ? ' dropzone--drag-over' : '')} onDrop={this.handleDrop} onDragOver={this.handleDragOver} onDragEnd={this.handleDragEnd} onDragEnter={this.handleDragEnter} onDragLeave={this.handleDragLeave} onClick={this.handleClick}>
{ this.state.dragOver ? (
<div id="dropbzone-dragover">
<p className="blue">Drop it.</p>
</div>
) : (
<div id="primary-dropzone-instructions">
<p className="info-message-placeholder info-message--failure" id="input-error-file-selection">{this.state.fileError}</p>
<p>Drag & drop image or video here to publish</p>
<p className="fine-print">OR</p>
<p className="blue--underlined">CHOOSE FILE</p>
</div>
)}
<div id="primary-dropzone" className={'row row--padded row--tall dropzone' + (this.state.dragOver ? ' dropzone--drag-over' : '')} onDrop={this.handleDrop} onDragOver={this.handleDragOver} onDragEnd={this.handleDragEnd} onDragEnter={this.handleDragEnter} onDragLeave={this.handleDragLeave} onClick={this.handleClick}>
<div id="dropzone-text-holder" className={'flex-container--column flex-container--center-center'}>
{ this.state.dragOver ? (
<div id="dropzone-dragover">
<p className="blue">Drop it.</p>
</div>
) : (
<div id="dropzone-instructions">
<p className="info-message-placeholder info-message--failure" id="input-error-file-selection">{this.state.fileError}</p>
<p>Drag & drop image or video here to publish</p>
<p className="fine-print">OR</p>
<p className="blue--underlined">CHOOSE FILE</p>
</div>
)}
</div>
</div>
</div>
);
@ -148,4 +151,4 @@ const mapDispatchToProps = dispatch => {
};
}
export default connect(mapStateToProps, mapDispatchToProps)(PublishDropzone);
export default connect(mapStateToProps, mapDispatchToProps)(Dropzone);

View file

@ -0,0 +1,53 @@
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
import React from 'react';
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
import {connect} from 'react-redux';
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
class Preview extends React.Component {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
constructor (props) {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
super(props);
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
this.state = {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
previewSource: '',
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
this.previewFile = this.previewFile.bind(this);
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
componentWillMount () {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
console.log('Preview will mount');
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
if (this.props.file) {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
this.previewFile(this.props.file);
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
componentWillReceiveProps ({ file }) {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
console.log('Preview will receive props');
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
this.previewFile(file);
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
previewFile (file) {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
console.log('previewFile', file)
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
const that = this;
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
if (file.type !== 'video/mp4') {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
const previewReader = new FileReader();
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
previewReader.readAsDataURL(file);
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
previewReader.onloadend = function () {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
that.setState({previewSource: previewReader.result});
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
};
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
} else {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
that.setState({previewSource: '/assets/img/video_thumb_default.png'});
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
render () {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
return (
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
<img
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
id="asset-preview"
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
src={this.state.previewSource}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
className={this.props.dimPreview ? 'dim' : ''}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
alt="publish preview"
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
/>
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
);
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
};
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
const mapStateToProps = state => {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
return {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
file: state.file,
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
};
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
};
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
export default connect(mapStateToProps, null)(Preview);
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred

View file

@ -1,40 +1,138 @@
import React from 'react';
import {connect} from 'react-redux';
// import PropTypes from 'prop-types';
import { selectFile } from '../actions';
import { connect } from 'react-redux';
import Preview from './Preview.jsx';
import { validateFile } from '../utils/file.js';
class PreviewDropzone extends React.Component {
constructor (props) {
super(props);
this.state = {
previewSource: '',
fileError : null,
dragOver : false,
mouseOver : false,
dimPreview: false,
}
this.previewFile = this.previewFile.bind(this);
this.handleDrop = this.handleDrop.bind(this);
this.handleDragOver = this.handleDragOver.bind(this);
this.handleDragEnd = this.handleDragEnd.bind(this);
this.handleDragEnter = this.handleDragEnter.bind(this);
this.handleDragLeave = this.handleDragLeave.bind(this);
this.handleMouseEnter = this.handleMouseEnter.bind(this);
this.handleMouseLeave = this.handleMouseLeave.bind(this);
this.handleClick = this.handleClick.bind(this);
this.handleFileInput = this.handleFileInput.bind(this);
this.selectFile = this.selectFile.bind(this);
}
componentDidMount () {
console.log('props after mount', this.props);
this.previewFile(this.props.file);
handleDrop (event) {
event.preventDefault();
this.setState({dragOver: false});
// if dropped items aren't files, reject them
const dt = event.dataTransfer;
console.log('dt', dt);
if (dt.items) {
if (dt.items[0].kind == 'file') {
const droppedFile = dt.items[0].getAsFile();
this.selectFile(droppedFile);
}
}
}
previewFile (file) {
console.log('previewFile', file)
const that = this;
if (file.type !== 'video/mp4') {
const previewReader = new FileReader();
previewReader.readAsDataURL(file);
previewReader.onloadend = function () {
that.setState({previewSource: previewReader.result});
};
handleDragOver (event) {
event.preventDefault();
}
handleDragEnd (event) {
var dt = event.dataTransfer;
if (dt.items) {
for (var i = 0; i < dt.items.length; i++) {
dt.items.remove(i);
}
} else {
that.setState({previewSource: '/assets/img/video_thumb_default.png'});
event.dataTransfer.clearData();
}
}
handleDragEnter () {
this.setState({dragOver: true, dimPreview: true});
}
handleDragLeave () {
this.setState({dragOver: false, dimPreview: false});
}
handleMouseEnter () {
this.setState({mouseOver: true, dimPreview: true});
}
handleMouseLeave () {
this.setState({mouseOver: false, dimPreview: false});
}
handleClick (event) {
event.preventDefault();
// trigger file input
document.getElementById('file_input').click();
}
handleFileInput (event) {
event.preventDefault();
const fileList = event.target.files;
this.selectFile(fileList[0]);
}
selectFile (file) {
if (file) {
try {
validateFile(file); // validate the file's name, type, and size
} catch (error) {
return this.setState({fileError: error.message});
}
// stage it so it will be ready when the publish button is clicked
this.setState({fileError: null});
this.props.onFileSelect(file);
}
}
render () {
return (
<div id="asset-preview-holder" className="dropzone">
<div id="asset-preview-dropzone-instructions" className="hidden">
<p>Drag & drop image or video here</p>
<p className="fine-print">OR</p>
<p className="blue--underlined">CHOOSE FILE</p>
<div className="row row--tall flex-container--column">
<form>
<input className="input-file" type="file" id="file_input" name="file_input" accept="video/*,image/*" onChange={this.handleFileInput} encType="multipart/form-data"/>
</form>
<div id="preview-dropzone" className={'row row--padded row--tall dropzone' + (this.state.dragOver ? ' dropzone--drag-over' : '')} onDrop={this.handleDrop} onDragOver={this.handleDragOver} onDragEnd={this.handleDragEnd} onDragEnter={this.handleDragEnter} onDragLeave={this.handleDragLeave} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} onClick={this.handleClick}>
{this.props.file ? (
<div>
<Preview dimPreview={this.state.dimPreview}/>
<div id="dropzone-text-holder" className={'flex-container--column flex-container--center-center'}>
{ this.state.dragOver ? (
<div id="dropzone-dragover">
<p className="blue">Drop it.</p>
</div>
) : (
null
)}
{ this.state.mouseOver ? (
<div id="dropzone-instructions">
<p className="info-message-placeholder info-message--failure" id="input-error-file-selection">{this.state.fileError}</p>
<p>Drag & drop image or video here to publish</p>
<p className="fine-print">OR</p>
<p className="blue--underlined">CHOOSE FILE</p>
</div>
) : (
null
)}
</div>
</div>
) : (
<div id="dropzone-text-holder" className={'flex-container--column flex-container--center-center'}>
{ this.state.dragOver ? (
<div id="dropzone-dragover">
<p className="blue">Drop it.</p>
</div>
) : (
<div id="dropzone-instructions">
<p className="info-message-placeholder info-message--failure" id="input-error-file-selection">{this.state.fileError}</p>
<p>Drag & drop image or video here to publish</p>
<p className="fine-print">OR</p>
<p className="blue--underlined">CHOOSE FILE</p>
</div>
)}
</div>
)}
</div>
<img id="asset-preview" src={this.state.previewSource} alt="publish preview"/>
</div>
);
}
@ -46,4 +144,12 @@ const mapStateToProps = state => {
};
};
export default connect(mapStateToProps, null)(PreviewDropzone);
const mapDispatchToProps = dispatch => {
return {
onFileSelect: (file) => {
dispatch(selectFile(file));
},
};
}
export default connect(mapStateToProps, mapDispatchToProps)(PreviewDropzone);

View file

@ -1,5 +1,5 @@
import React from 'react';
import PublishDropzone from './PublishDropzone.jsx';
import PreviewDropzone from './PreviewDropzone.jsx';
import PublishForm from './PublishForm.jsx';
import PublishStatus from './PublishStatus.jsx';
import {connect} from 'react-redux';
@ -11,7 +11,7 @@ class PublishTool extends React.Component {
render () {
return (
<div className="row row--tall flex-container--column">
{ !this.props.file && <PublishDropzone /> }
{ !this.props.file && <PreviewDropzone /> }
{ this.props.file && <PublishForm /> }
{ this.props.publishStatus && <PublishStatus /> }
</div>

38
react/utils/file.js Normal file
View file

@ -0,0 +1,38 @@
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
module.exports = {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
validateFile (file) {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
if (!file) {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
console.log('no file found');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
throw new Error('no file provided');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
}
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
if (/'/.test(file.name)) {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
console.log('file name had apostrophe in it');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
throw new Error('apostrophes are not allowed in the file name');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
}
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
// validate size and type
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
switch (file.type) {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
case 'image/jpeg':
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
case 'image/jpg':
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
case 'image/png':
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
if (file.size > 10000000) {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
console.log('file was too big');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
throw new Error('Sorry, images are limited to 10 megabytes.');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
}
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
break;
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
case 'image/gif':
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
if (file.size > 50000000) {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
console.log('file was too big');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
throw new Error('Sorry, .gifs are limited to 50 megabytes.');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
}
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
break;
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
case 'video/mp4':
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
if (file.size > 50000000) {
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
console.log('file was too big');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
throw new Error('Sorry, videos are limited to 50 megabytes.');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
}
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
break;
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
default:
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
console.log('file type is not supported');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
throw new Error(file.type + ' is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
}
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
},
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch
}
kauffj commented 2018-01-15 20:26:57 +01:00 (Migrated from github.com)
Review

GIFs

GIFs
etisdew commented 2018-01-15 21:38:07 +01:00 (Migrated from github.com)
Review

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.

I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
bones7242 commented 2018-01-18 18:48:35 +01:00 (Migrated from github.com)
Review

@etisdew yes video/mp4 is supported and supporting video uploads is a key goal for spee.ch

@etisdew yes `video/mp4` is supported and supporting video uploads is a key goal for spee.ch