<commit_before>// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';

ButtonElement genButton;

void main() {
  // Your app starts here.
  querySelector('#inputName').onInput.listen(updateBadge);
  genButton = querySelector('#generateButton');
  genButton.onClick.listen(generateBadge);
}

void updateBadge(Event e) {
  String inputName = (e.target as InputElement).value;
  setBadgeName(inputName);
  if (inputName.trim().isEmpty) {
    // To do: add some code here.
  }
  else {
    // To do: add some code here.
  }
}

void setBadgeName(String newName) {
  querySelector('#badgeName').text = newName;
}
<commit_msg>Added the function where the user can input his/her name!<commit_after>// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';

ButtonElement genButton;

void main() {
  // Your app starts here.
  querySelector('#inputName').onInput.listen(updateBadge);
  genButton = querySelector('#generateButton');
  genButton.onClick.listen(generateBadge);
}

void updateBadge(Event e) {
  String inputName = (e.target as InputElement).value;
  setBadgeName(inputName);
  if (inputName.trim().isEmpty) {
    // To do: add some code here.
    genButton..disabled = false
             ..text = 'Aye! Gimme a name!';
  }
  else {
    // To do: add some code here.
    genButton..disabled = true
             ..text = 'Arrr! Write yer name!';
  }
}

void setBadgeName(String newName) {
  querySelector('#badgeName').text = newName;
}

{'fraction_non_alphanumeric': 0.11790878754171301, 'fraction_numerical': 0.004449388209121246, 'mean_word_length': 3.5544303797468353, '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': '1666606', 'n_tokens_mistral': 562, 'n_tokens_neox': 548, 'n_words': 184}