<commit_before>goog.provide 'athena.lib.View'

# top level view for athena.lib
class athena.lib.View extends Backbone.View

  # Defaults for view options.
  defaults: =>

    # additional classes for the element
    extraClasses: []

    # Event aggregator (like NSNotificationCenter)
    eventhub: undefined

  # Events for view options.
  events: => {}

  initialize: ->
    super

    # Extend options with defaults.
    _.defaults @options, @defaults

    # If no eventhub is provided, this object is used as the eventhub.
    @eventhub = @options.eventhub || @

    # Bind all functions within this object (including functions defined in
    # derived classes) to `this`. This exempts you from having to bind
    # functions to their respective objects throughout the codebase.
    _.bindAll @

    # optionally add custom class names
    if @options.extraClasses<commit_msg>view: add className inheritance management<commit_after>goog.provide 'athena.lib.View'

# top level view for athena.lib
class athena.lib.View extends Backbone.View

  className: ''

  # extend className with `className: @classNameExtend 'additional-class'`
  @classNameExtend: (className) ->
    superClass = @::className
    if superClass then superClass + ' ' + className else className

  # Defaults for view options.
  defaults: =>

    # additional classes for the element
    extraClasses: []

    # Event aggregator (like NSNotificationCenter)
    eventhub: undefined

  # Events for view options.
  events: => {}

  initialize: ->
    super

    # Extend options with defaults.
    _.defaults @options, @defaults

    # If no eventhub is provided, this object is used as the eventhub.
    @eventhub = @options.eventhub || @

    # Bind all functions within this object (including functions defined in
    # derived classes) to `this`. This exempts you from having to bind
    # functions to their respective objects throughout the codebase.
    _.bindAll @

    # optionally add custom class names
    if @options.extraClasses
{'fraction_non_alphanumeric': 0.07845084409136048, 'fraction_numerical': 0.0, 'mean_word_length': 3.29637526652452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '788181', 'n_tokens_mistral': 558, 'n_tokens_neox': 533, 'n_words': 207}