<commit_before># Example initialization
# ArticleList {
#   selected: () ->
#   checkable: true
#   display: 'email'
#   articles: []
# }

_ = require 'underscore'
React = require 'react'
{ input, div, a, h1, h2 } = React.DOM
moment = require 'moment'
icons = -> require('./icons.jade') arguments...

module.exports = React.createClass
  displayName: 'ArticleList'

  getDisplayAttrs: (article) ->
    if @props.display is 'email' and article.email_metadata
      return {headline: article.email_metadata.headline, image: article.email_metadata.image_url}
    else
      return {headline: article.thumbnail_title, image: article.thumbnail_image}

  publishText: (result) ->
    if result.published_at and result.published
      "Published #{moment(result.published_at).fromNow()}"
    else if result.scheduled_publish_at
      "Scheduled to publish " +
      "#{moment(result.scheduled_publish_at).fromNow()}"
    else
      "Last saved " +
      "#{moment(result.updated_at).fromNow()}"<commit_msg>Make window.global available on ArticleList<commit_after># Example initialization
# ArticleList {
#   selected: () ->
#   checkable: true
#   display: 'email'
#   articles: []
# }

window.global = window
_ = require 'underscore'
React = require 'react'
{ input, div, a, h1, h2 } = React.DOM
moment = require 'moment'
icons = -> require('./icons.jade') arguments...

module.exports = React.createClass
  displayName: 'ArticleList'

  getDisplayAttrs: (article) ->
    if @props.display is 'email' and article.email_metadata
      return {headline: article.email_metadata.headline, image: article.email_metadata.image_url}
    else
      return {headline: article.thumbnail_title, image: article.thumbnail_image}

  publishText: (result) ->
    if result.published_at and result.published
      "Published #{moment(result.published_at).fromNow()}"
    else if result.scheduled_publish_at
      "Scheduled to publish " +
      "#{moment(result.scheduled_publish_at).fromNow()}"
    else
      "Last saved " +
      "#{moment(result.updated_at).fromNow()}"
{'fraction_non_alphanumeric': 0.1311555338859093, 'fraction_numerical': 0.0019502681618722574, 'mean_word_length': 3.8857142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '6602900', 'n_tokens_mistral': 636, 'n_tokens_neox': 631, 'n_words': 143}