<commit_before>define(
  ["lib/extend", "core/controller", "ui/state", "ui/toast", "ui/strings"],
  function (extend, Controller, State, Toast, Strings) {
    function PlayerSettingsController(view) {
      PlayerSettingsController.superconstructor.call(this, view);

      this.reset = this.reset.bind(this);
      this.update = this.update.bind(this);
      this.enterkey = function (e) {
        if (e.which === 13) {
          this.update();
        }
      }.bind(this);

      this.register();
    }
    extend(PlayerSettingsController, Controller);

    PlayerSettingsController.prototype.register = function () {
      this.view.$view.on("click", "button.reset", this.reset);
      this.view.$view.on("click", "button.update", this.update);
      this.view.$view.on("keypress", "input", this.enterkey);
    };

    PlayerSettingsController.prototype.unregister = function () {
      this.view.$view.off("click", "button.reset", this.reset);
      this.view.$view.off("click", "button.update", this.update);
      this.view.$view.off("keypress", "input", this.enterkey);
    };

    PlayerSettingsController.prototype.reset = function () {
      this.view.update();

      new Toast(Strings.team_settings_reset);
    };

    PlayerSettingsController.prototype.update = function () {
      this.model.firstname = this.view.$view.find(".firstname").val();
      this.model.lastname = this.view.$view.find(".lastname").val();
      this.model.setName(this.view.$view.find(".alias").val());
      this.model.club = this.view.$view.find(".club").val();
      this.model.email = this.view.$view.find(".email").val();
      this.model.license = this.view.$view.find(".license").val();
      this.model.rankingpoints = Number(
        this.view.$view.find(".rankingpoints").val()
      );
      this.model.elo = Number(this.view.$view.find(".elo").val());

      new Toast(Strings.team_settings_updated);

      this.model.emit("update");
    };

    PlayerSettingsController.prototype.destroy = function () {
      this.unregister();
<commit_msg>Don't accidentally overwrite player settings on save<commit_after>define(
  ["lib/extend", "core/controller", "ui/state", "ui/toast", "ui/strings"],
  function (extend, Controller, State, Toast, Strings) {
    function PlayerSettingsController(view) {
      PlayerSettingsController.superconstructor.call(this, view);

      this.reset = this.reset.bind(this);
      this.update = this.update.bind(this);
      this.enterkey = function (e) {
        if (e.which === 13) {
          this.update();
        }
      }.bind(this);

      this.register();
    }
    extend(PlayerSettingsController, Controller);

    PlayerSettingsController.prototype.register = function () {
      this.view.$view.on("click", "button.reset", this.reset);
      this.view.$view.on("click", "button.update", this.update);
      this.view.$view.on("keypress", "input", this.enterkey);
    };

    PlayerSettingsController.prototype.unregister = function () {
      this.view.$view.off("click", "button.reset", this.reset);
      this.view.$view.off("click", "button.update", this.update);
      this.view.$view.off("keypress", "input", this.enterkey);
    };

    PlayerSettingsController.prototype.reset = function () {
      this.view.update();

      new Toast(Strings.team_settings_reset);
    };

    PlayerSettingsController.prototype.update = function () {
      this.model.firstname = this.view.$view.find(".firstname").val();
      this.model.lastname = this.view.$view.find(".lastname").val();
      this.model.club = this.view.$view.find(".club").val();
      this.model.email = this.view.$view.find(".email").val();
      this.model.license = this.view.$view.find(".license").val();
      this.model.rankingpoints = Number(
        this.view.$view.find(".rankingpoints").val()
      );
      this.model.elo = Number(this.view.$view.find(".elo").val());

      new Toast(Strings.team_settings_updated);

      this.model.setName(this.view.$view.find(".alias").val());

      this.model.emit("update");
    };

    PlayerSettingsController.prototype.destroy = function () {
      this.unregister();

{'fraction_non_alphanumeric': 0.1793320425943853, 'fraction_numerical': 0.000968054211035818, 'mean_word_length': 3.1831983805668016, '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': '510850', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1201, 'n_words': 170}