<commit_before># Collection view of timelets.
#
# The @collection will render as an index of timelets which can be
# loaded into the clock.
#
class Essence.Views.Timelets extends Backbone.Marionette.CompositeView

  template: 'modules/timelet/templates/timelets'
  itemViewContainer: 'ul'

  itemView: Essence.Views.Timelet
  emptyView: Essence.Views.NoTimelet

  ui:
    timelets: 'ul'
    add:      '.add'

  events:
    'click .add': 'createTimelet'

  initialize: ->
    @on 'itemview:timelet:load', (viewItem) =>
      @options.parent.trigger 'timelet:load', viewItem.model.id

  # Creates a new model of a timelet.
  #
  # @param [jQuery.Event] event the click event
  #
  createTimelet: (event) =>
    model = new Essence.Models.Timelet
    model.state.expanded = true
    @collection.add model
    Backbone.history.navigate '/timelet'<commit_msg>Add a placeholder name for new timelets.<commit_after># Collection view of timelets.
#
# The @collection will render as an index of timelets which can be
# loaded into the clock.
#
class Essence.Views.Timelets extends Backbone.Marionette.CompositeView

  template: 'modules/timelet/templates/timelets'
  itemViewContainer: 'ul'

  itemView: Essence.Views.Timelet
  emptyView: Essence.Views.NoTimelet

  ui:
    timelets: 'ul'
    add:      '.add'

  events:
    'click .add': 'createTimelet'

  initialize: ->
    @on 'itemview:timelet:load', (viewItem) =>
      @options.parent.trigger 'timelet:load', viewItem.model.id

  # Creates a new model of a timelet.
  #
  # @param [jQuery.Event] event the click event
  #
  createTimelet: (event) =>
    model = new Essence.Models.Timelet name: 'New Timelet'
    model.state.expanded = true
    @collection.add model
    Backbone.history.navigate '/timelet'
{'fraction_non_alphanumeric': 0.1094017094017094, 'fraction_numerical': 0.0, 'mean_word_length': 3.537467700258398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6204749', 'n_tokens_mistral': 575, 'n_tokens_neox': 562, 'n_words': 154}