<commit_before>library hipster_view;

import 'dart:html';

import 'hipster_collection.dart';
import 'hipster_model.dart';

class HipsterView {
  HipsterCollection collection;
  HipsterModel model;
  Element el;

  HipsterView({el, this.model, this.collection}) {
    if (el != null) {
      this.el = (el is Element) ? el : document.query(el);
    }

    this.post_initialize();

    // TODO define an ensureElement to create a default, anonymous element
    assert(this.el != null);
  }

  void post_initialize() { }
  // abstract _initialize();

  // delegate events
  attachHandler(parent, event_selector, callback) {
    var index = event_selector.indexOf(' ')
      , event_type = event_selector.substring(0,index)
      , selector = event_selector.substring(index+1);

    parent.on[event_type].add((event) {<commit_msg>Fix old event-style listener<commit_after>library hipster_view;

import 'dart:html';

import 'hipster_collection.dart';
import 'hipster_model.dart';

class HipsterView {
  HipsterCollection collection;
  HipsterModel model;
  Element el;

  HipsterView({el, this.model, this.collection}) {
    if (el != null) {
      this.el = (el is Element) ? el : document.query(el);
    }

    this.post_initialize();

    // TODO define an ensureElement to create a default, anonymous element
    assert(this.el != null);
  }

  void post_initialize() { }
  // abstract _initialize();

  // delegate events
  attachHandler(parent, event_selector, callback) {
    var index = event_selector.indexOf(' ')
      , event_type = event_selector.substring(0,index)
      , selector = event_selector.substring(index+1);

    parent.on[event_type].listen((event) {
{'fraction_non_alphanumeric': 0.12275449101796407, 'fraction_numerical': 0.0023952095808383233, 'mean_word_length': 3.7879656160458453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1318518', 'n_tokens_mistral': 528, 'n_tokens_neox': 513, 'n_words': 119}