<commit_before>import 'dart:html';

import 'package:angular2/core.dart';

@Component(
    selector: 'editable-label',
    templateUrl: 'editablelabel_component.html'
)
class EditableLabelComponent implements OnInit {

  bool editMode = false;
  String outputText;

  @Input()
  String text;

  @Output()
  EventEmitter<String> textChange = new EventEmitter<String>();

  EditableLabelComponent() {
    editMode = false;
  }

  void update() {
    textChange.emit(text);
    formatText();
  }

  void formatText() {
    outputText = text.length < 18 ? text : text.substring(0, 15) + "...";
  }

  void toggle() {
    editMode = !editMode;
    if (editMode) {
      TextInputElement tb = querySelector("#editbox");
      tb.focus();
    }
    else {
      if (text.length == 0) {
        text = "np8080.txt";
        print(text);
        formatText();
      }
    }
  }

  @override
  ngOnInit() {
    formatText();
  }
}<commit_msg>Fixed bug of default filename not being saved.<commit_after>import 'dart:html';

import 'package:angular2/core.dart';

@Component(
    selector: 'editable-label',
    templateUrl: 'editablelabel_component.html'
)
class EditableLabelComponent implements OnInit {

  bool editMode = false;
  String outputText;

  @Input()
  String text;

  @Output()
  EventEmitter<String> textChange = new EventEmitter<String>();

  EditableLabelComponent() {
    editMode = false;
  }

  void update() {
    textChange.emit(text);
    formatText();
  }

  void formatText() {
    outputText = text.length < 18 ? text : text.substring(0, 15) + "...";
  }

  void toggle() {
    editMode = !editMode;
    if (editMode) {
      TextInputElement tb = querySelector("#editbox");
      tb.focus();
    }
    else {
      if (text.length == 0) {
        text = "np8080.txt";
        update();
      }
    }
  }

  @override
  ngOnInit() {
    formatText();
  }
}
{'fraction_non_alphanumeric': 0.14010695187165775, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 2.8028455284552845, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '5705635', 'n_tokens_mistral': 637, 'n_tokens_neox': 607, 'n_words': 130}