<commit_before>'use strict';

var React = require('react');
var ActionCreator = require('../actions/HeisenbergActionCreators');
var FormatDate = require('../utils/FormatDate');
var Player = require('./Player.jsx');
var Helper = require('./Helper.jsx');

var Detail = React.createClass({
  mixin: [Helper],
  getDefaultProps: function() {
    return {
      detail: {}
    };
  },
  handleMark: function(status) {
    ActionCreator.markAs(this.props.currentChannel.channelId, [this.props.detail.id], status);
  },
  like: function() {
    ActionCreator.like(this.props.detail, this.props.likes);
  },
  share: function() {
    var title = 'Inbox.Video';
    var url = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(title) + '&url=http%3A%2F%2Finbox.video%2F';
    ActionCreator.openLink(url);
  },
  clickLink: function(url) {
    ActionCreator.openLink(url);
  },
  toggleFullScreen: function() {
    ActionCreator.toggleFullScreen();
  },
  donate: function() {
    React.findDOMNode(this.refs.donation).submit();
  },
  render() {
    var {detail} = this.props;
    var {likes} = this.props;
    var {isWatched} = this.props;
    var {selectedChannelId} = this.props;
    var {currentChannel} = this.props;
    var {fullScreen} = this.props;
    var isSelectedChannel = selectedChannelId && selectedChannelId.length > 10;

    var detailName = detail.snippet ? detail.snippet.title : '';
    var description = detail.snippet ? detail.snippet.description : '';

    var isSelectedVideo = !!detail.id;
    var url = detail.id ? ActionCreator.generatePlayerUrl(detail.id) : '';
    var playerUrl = detail.id ? ActionCreator.generatePlayerUrl(detail.id, 1) : '';

    var className;
    var tipsClass = 'tips';
    var controlClass = 'control detail-control';
    var likeClass = 'fa fa-heart-o';

    if (detail.id && detail.id in likes.videos) {
      likeClass = 'fa fa-heart';
    }

    if (isSelectedChannel && isSelectedVideo) {
      className = 'detail with-bg';
    } else if (isSelectedChannel && !isSelectedVideo) {
      className = 'detail not-select-video';
    } else {
      className = 'detail hide';
    }

    if (fullScreen) {
      controlClass += ' fullscreen-mode';
      tipsClass += ' hide';
    }

    return (
      <div className={className}>
        <div className="content">
          <h2 className="detail-name">{detailName}</h2>
          <p className={isWatched ? "update-date" : "update-date unwatched"}>{FormatDate.format('yyyy-MM-dd HH:mm', detail.snippet ? new Date(detail.snippet.publishedAt).getTime() : 0)}</p>
          <Player url={playerUrl} fullScreen={fullScreen} />
          <p className="source">Source： <a href="javascript:void(0)" onClick={this.clickLink.bind(this, url + '&feature=' + location.hostname)}>{url}</a></p>
          <div className="description">
            <pre className="description-text">{description}</pre>
          </div>
          <Helper />
        </div>
        <div className={controlClass}>
          <span className="icon icon-fullscreen" onClick={this.toggleFullScreen}></span>
          <div className="mark-as">
            Mark as：
           <button className="mark-button" onClick={this.handleMark.bind(this, 'watched')}>Watched</button>
           <button className="mark-button" onClick={this.handleMark.bind(this, 'unwatched')}>Unwatched</button>
          </div>
          <span className="icon icon-like" onClick={this.like}><i className={likeClass}></i></span>
        </div>
        <div className={tipsClass}>
          <p>Made with <i className="fa fa-heartbeat fa-fw"></i> by <a href="javascript:void(0)" onClick={this.clickLink.bind(this, 'https://twitter.com/leplay_')}>Leplay</a> in Beijing. <a href="javascript:void(0)" onClick={this.donate}>Make a donation</a> for my VPN.</p>
          <form className="hide" ref="donation" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
            <input type="hidden" name="cmd" value="_s-xclick" />
            <input type="hidden" name="encrypted" value="-----<KEY>uGMA0GCSqGSIb3DQEBAQUABIGAYpVCOKfN+89v1YP8G3Jdzrsuk0y8bUVak7TkmPHhEkV00cBMOLZjs8zBS6DD01ebrOSAB/HU/b4oYIOLyAqDNbfkos7blteuIj31m0JRk79qM/JgBM/IlNCkpJa/WOKA2jx7mC8wJxBcO6Jf+ed7GBduxsSWHMlS5lsLRhBqiYo=-----END PKCS7-----" />
            <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
            <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" />
          </form>
        </div>
      </div>
    );

  }
});

module.exports = Detail;<commit_msg>link to timelize<commit_after>'use strict';

var React = require('react');
var ActionCreator = require('../actions/HeisenbergActionCreators');
var FormatDate = require('../utils/FormatDate');
var Player = require('./Player.jsx');
var Helper = require('./Helper.jsx');

var Detail = React.createClass({
  mixin: [Helper],
  getDefaultProps: function() {
    return {
      detail: {}
    };
  },
  handleMark: function(status) {
    ActionCreator.markAs(this.props.currentChannel.channelId, [this.props.detail.id], status);
  },
  like: function() {
    ActionCreator.like(this.props.detail, this.props.likes);
  },
  share: function() {
    var title = 'Inbox.Video';
    var url = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(title) + '&url=http%3A%2F%2Finbox.video%2F';
    ActionCreator.openLink(url);
  },
  clickLink: function(url) {
    ActionCreator.openLink(url);
  },
  toggleFullScreen: function() {
    ActionCreator.toggleFullScreen();
  },
  donate: function() {
    React.findDOMNode(this.refs.donation).submit();
  },
  render() {
    var {detail} = this.props;
    var {likes} = this.props;
    var {isWatched} = this.props;
    var {selectedChannelId} = this.props;
    var {currentChannel} = this.props;
    var {fullScreen} = this.props;
    var isSelectedChannel = selectedChannelId && selectedChannelId.length > 10;

    var detailName = detail.snippet ? detail.snippet.title : '';
    var description = detail.snippet ? detail.snippet.description : '';

    var isSelectedVideo = !!detail.id;
    var url = detail.id ? ActionCreator.generatePlayerUrl(detail.id) : '';
    var playerUrl = detail.id ? ActionCreator.generatePlayerUrl(detail.id, 1) : '';

    var className;
    var tipsClass = 'tips';
    var controlClass = 'control detail-control';
    var likeClass = 'fa fa-heart-o';

    if (detail.id && detail.id in likes.videos) {
      likeClass = 'fa fa-heart';
    }

    if (isSelectedChannel && isSelectedVideo) {
      className = 'detail with-bg';
    } else if (isSelectedChannel && !isSelectedVideo) {
      className = 'detail not-select-video';
    } else {
      className = 'detail hide';
    }

    if (fullScreen) {
      controlClass += ' fullscreen-mode';
      tipsClass += ' hide';
    }

    return (
      <div className={className}>
        <div className="content">
          <h2 className="detail-name">{detailName}</h2>
          <p className={isWatched ? "update-date" : "update-date unwatched"}>{FormatDate.format('yyyy-MM-dd HH:mm', detail.snippet ? new Date(detail.snippet.publishedAt).getTime() : 0)}</p>
          <Player url={playerUrl} fullScreen={fullScreen} />
          <p className="source">Source： <a href="javascript:void(0)" onClick={this.clickLink.bind(this, url + '&feature=' + location.hostname)}>{url}</a></p>
          <div className="description">
            <pre className="description-text">{description}</pre>
          </div>
          <Helper />
        </div>
        <div className={controlClass}>
          <span className="icon icon-fullscreen" onClick={this.toggleFullScreen}></span>
          <div className="mark-as">
            Mark as：
           <button className="mark-button" onClick={this.handleMark.bind(this, 'watched')}>Watched</button>
           <button className="mark-button" onClick={this.handleMark.bind(this, 'unwatched')}>Unwatched</button>
          </div>
          <span className="icon icon-like" onClick={this.like}><i className={likeClass}></i></span>
        </div>
        <div className={tipsClass}>
          <p>Made with <i className="fa fa-heartbeat fa-fw"></i> by <a href="javascript:void(0)" onClick={this.clickLink.bind(this, 'https://twitter.com/leplay_')}>Leplay</a> in Beijing. Checkout my latest project - <a href="javascript:void(0)" onClick={this.clickLink.bind(this, 'https://timelize.co/')}>Timelize</a></p>

        </div>
      </div>
    );

  }
});

module.exports = Detail;
{'fraction_non_alphanumeric': 0.16583207173634565, 'fraction_numerical': 0.00698730639338535, 'mean_word_length': 3.324269889224572, 'pattern_counts': {'":': 0, '<': 94, '<?xml version=': 0, '>': 96, 'https://': 8, 'lorem ipsum': 0, 'www.': 3, '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': '3809601', 'n_tokens_mistral': 2803, 'n_tokens_neox': 2759, 'n_words': 496}