<commit_before>// dependencies -------------------------------------------------------

import React         from 'react';
import Reflux        from 'reflux';
import fileUtils     from '../../utils/files';
import bowser        from 'bowser';
import notifications from '../../notification/notification.actions';
import UploadStore   from '../../upload/upload.store.js';

let Upload = React.createClass({

	mixins: [Reflux.connect(UploadStore)],

// life cycle events --------------------------------------------------

	componentDidMount () {
		this.refs.fileSelect.getDOMNode().setAttribute('webkitdirectory', true);
		this.refs.fileSelect.getDOMNode().setAttribute('directory', true);
		this._setRefs(this.refs);
	},

	render () {
		let resumeIcon = <span><i className="fa fa-repeat"></i>&nbsp;</span>;
		let icon = this.props.resume ? resumeIcon : null;
		let text = this.props.resume ? "Resume" : "Select folder";

		return (
			<div className="fileupload-btn">
				<span>{icon}{text}</span>
				<input type="file"  className="dirUpload-btn" onClick={this._click} onChange={this._onFileSelect} ref="fileSelect"/>
    		</div>
    	);
	},

// custom methods -----------------------------------------------------

	_click (e) {
		React.findDOMNode(this.refs.fileSelect).value = null;
		e.stopPropagation();
		if (!bowser.chrome) {
			let chromeMessage = (
				<span>This is a Google Chrome only feature. <a href="http://www.google.com/chrome/">Please consider using Chrome as your browser</a>.</span>
			);
			e.preventDefault();
			notifications.createAlert({
				type: 'Error',
				message: chromeMessage
			});
		}
		if (this.state.uploadStatus === 'uploading') {
			e.preventDefault();
			notifications.createAlert({
				type: 'Warning',
				message: "You may only upload one dataset at a time. Please wait for the current upload to finish, then try resuming again."
			});<commit_msg>adjusting the resume styles<commit_after>// dependencies -------------------------------------------------------

import React         from 'react';
import Reflux        from 'reflux';
import fileUtils     from '../../utils/files';
import bowser        from 'bowser';
import notifications from '../../notification/notification.actions';
import UploadStore   from '../../upload/upload.store.js';

let Upload = React.createClass({

	mixins: [Reflux.connect(UploadStore)],

// life cycle events --------------------------------------------------

	componentDidMount () {
		this.refs.fileSelect.getDOMNode().setAttribute('webkitdirectory', true);
		this.refs.fileSelect.getDOMNode().setAttribute('directory', true);
		this._setRefs(this.refs);
	},

	render () {
		let resumeIcon = <span><i className="fa fa-repeat"></i>&nbsp;</span>;
		let icon = this.props.resume ? resumeIcon : null;
		let text = this.props.resume ? "Resume upload" : "Select folder";

		return (
			<div className="fileupload-btn">
				<span>{icon}{text}</span>
				<input type="file"  className="dirUpload-btn" onClick={this._click} onChange={this._onFileSelect} ref="fileSelect"/>
    		</div>
    	);
	},

// custom methods -----------------------------------------------------

	_click (e) {
		React.findDOMNode(this.refs.fileSelect).value = null;
		e.stopPropagation();
		if (!bowser.chrome) {
			let chromeMessage = (
				<span>This is a Google Chrome only feature. <a href="http://www.google.com/chrome/">Please consider using Chrome as your browser</a>.</span>
			);
			e.preventDefault();
			notifications.createAlert({
				type: 'Error',
				message: chromeMessage
			});
		}
		if (this.state.uploadStatus === 'uploading') {
			e.preventDefault();
			notifications.createAlert({
				type: 'Warning',
				message: "You may only upload one dataset at a time. Please wait for the current upload to finish, then try resuming again."
			});
{'fraction_non_alphanumeric': 0.22467771639042358, 'fraction_numerical': 0.0, 'mean_word_length': 2.556594948550047, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '963594', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1057, 'n_words': 262}