<commit_before>import React from 'react';
import OnClickOutside from 'react-onclickoutside';
import { trunc } from '../../utils/strings';

const ArticleViewer = React.createClass({
  displayName: 'ArticleViewer',

  propTypes: {
    article: React.PropTypes.object.isRequired,
    showButtonLabel: React.PropTypes.string,
    largeButton: React.PropTypes.bool,
    users: React.PropTypes.array
  },

  getInitialState() {
    return {
      showArticle: false
    };
  },

  showButtonLabel() {
    if (this.props.showButtonLabel) {
      return this.props.showButtonLabel;
    }
    if (this.isEnWiki()) {
      return 'Current Version w/ Authorship Highlighting';
    }
    return I18n.t('articles.show_current_version');
  },

  showArticle() {
    this.setState({ showArticle: true });
    if (!this.state.fetched) {
      this.fetchParsedArticle();
    }

    // WhoColor is only available for English Wikipedia
    if (!this.isEnWiki()) { return; }
    if (!this.state.userIdsFetched) {
      this.fetchUserIds();
    }
    if (!this.state.whocolorFetched) {
      this.fetchWhocolorHtml();
    }
  },

  hideArticle() {
    this.setState({ showArticle: false });
  },

  handleClickOutside() {
    this.hideArticle();
  },

  wikiUrl() {
    return `https://${this.props.article.language}.${this.props.article.project}.org`;
  },

  whocolorUrl() {
    return `http://api.wikicolor.net/whocolor/index.php?title=${this.props.article.title}`;
  },

  parsedArticleUrl() {
    const wikiUrl = this.wikiUrl();
    const queryBase = `${wikiUrl}/w/api.php?action=parse&disableeditsection=true&format=json`;
    const articleUrl = `${queryBase}&page=${this.props.article.title}`;

    return articleUrl;
  },

  isEnWiki() {
    return this.props.article.language === 'en' && this.props.article.project === 'wikipedia';<commit_msg>Revert "Use HTTP instead of HTTPS for whocolor.net requests"<commit_after>import React from 'react';
import OnClickOutside from 'react-onclickoutside';
import { trunc } from '../../utils/strings';

const ArticleViewer = React.createClass({
  displayName: 'ArticleViewer',

  propTypes: {
    article: React.PropTypes.object.isRequired,
    showButtonLabel: React.PropTypes.string,
    largeButton: React.PropTypes.bool,
    users: React.PropTypes.array
  },

  getInitialState() {
    return {
      showArticle: false
    };
  },

  showButtonLabel() {
    if (this.props.showButtonLabel) {
      return this.props.showButtonLabel;
    }
    if (this.isEnWiki()) {
      return 'Current Version w/ Authorship Highlighting';
    }
    return I18n.t('articles.show_current_version');
  },

  showArticle() {
    this.setState({ showArticle: true });
    if (!this.state.fetched) {
      this.fetchParsedArticle();
    }

    // WhoColor is only available for English Wikipedia
    if (!this.isEnWiki()) { return; }
    if (!this.state.userIdsFetched) {
      this.fetchUserIds();
    }
    if (!this.state.whocolorFetched) {
      this.fetchWhocolorHtml();
    }
  },

  hideArticle() {
    this.setState({ showArticle: false });
  },

  handleClickOutside() {
    this.hideArticle();
  },

  wikiUrl() {
    return `https://${this.props.article.language}.${this.props.article.project}.org`;
  },

  whocolorUrl() {
    return `https://api.wikicolor.net/whocolor/index.php?title=${this.props.article.title}`;
  },

  parsedArticleUrl() {
    const wikiUrl = this.wikiUrl();
    const queryBase = `${wikiUrl}/w/api.php?action=parse&disableeditsection=true&format=json`;
    const articleUrl = `${queryBase}&page=${this.props.article.title}`;

    return articleUrl;
  },

  isEnWiki() {
    return this.props.article.language === 'en' && this.props.article.project === 'wikipedia';
{'fraction_non_alphanumeric': 0.1522911051212938, 'fraction_numerical': 0.001078167115902965, 'mean_word_length': 3.3556338028169015, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, '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': '5561149', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1189, 'n_words': 203}