<commit_before>CI.outer.Changelog = class Changelog extends CI.outer.Page
  constructor: ->
    super
    @name = "changelog"
    @entries = ko.observableArray([])

  image: (author) =>
    VM.about.team[author]?.img_path

  author: (author) =>
    VM.about.team[author]?.name

  twitter: (author) =>
    url = VM.about.team[author]?.twitter
    "https://twitter.com/#{url}"

  # We want a HTML id, but have a timestamp. All the timestamp characters are
  # valid (':' and '-') but we need to start with a letter
  pubDate2id: (ts) =>
    "t#{ts}"

  type2class: (type) =>
    # map types to bootstrap label styles
    map =
      "bugfix": "warning"
      "feature": "success"
    "label-" + map[type]

  render: (cx) =>
    @fetchContent()
    super cx

  fetchContent: () =>
    $.ajax
      url: "/changelog.rss"
      type: "GET"
      dataType: "xml"
      success: (results) =>
        @entries(@doc2entries(results))
        @reloadHash()


   reloadHash: () =>
    # The hash is created after the page loads, which I think is why we need this.
    window.SammyApp.setLocation("/changelog" + window.location.hash)

  doc2entries: (document) =>
    for i in $(document).find("item")
      elem = $(i)
      title: elem.find('title').text()
      description: elem.find('description').text()
      link: elem.find('link').text()
      author: elem.find('author').text()
      pubDate: elem.find('pubDate').text()<commit_msg>using type for class name instead, simpler<commit_after>CI.outer.Changelog = class Changelog extends CI.outer.Page
  constructor: ->
    super
    @name = "changelog"
    @entries = ko.observableArray([])

  image: (author) =>
    VM.about.team[author]?.img_path

  author: (author) =>
    VM.about.team[author]?.name

  twitter: (author) =>
    url = VM.about.team[author]?.twitter
    "https://twitter.com/#{url}"

  # We want a HTML id, but have a timestamp. All the timestamp characters are
  # valid (':' and '-') but we need to start with a letter
  pubDate2id: (ts) =>
    "t#{ts}"


  render: (cx) =>
    @fetchContent()
    super cx

  fetchContent: () =>
    $.ajax
      url: "/changelog.rss"
      type: "GET"
      dataType: "xml"
      success: (results) =>
        @entries(@doc2entries(results))
        @reloadHash()


   reloadHash: () =>
    # The hash is created after the page loads, which I think is why we need this.
    window.SammyApp.setLocation("/changelog" + window.location.hash)

  doc2entries: (document) =>
    for i in $(document).find("item")
      elem = $(i)
      title: elem.find('title').text()
      description: elem.find('description').text()
      link: elem.find('link').text()
      author: elem.find('author').text()
      pubDate: elem.find('pubDate').text()
{'fraction_non_alphanumeric': 0.16087751371115175, 'fraction_numerical': 0.002559414990859232, 'mean_word_length': 2.8265734265734266, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 24, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7358877', 'n_tokens_mistral': 902, 'n_tokens_neox': 873, 'n_words': 226}