<commit_before>require([
  'js/controllers/controller#controller',
  'js/models/element#element'
], function(Controller, Element) {

  var Settings = new Class({
    Extends: Controller,

    initialize: function(name, config) {
      this.parent(name, config);

      this.selectors = config.selectors;

      this.inputs = {
        branching: {
          value: 'value'
        },
        depth: {
          value: 'value'
        },
        treemode: {
          value: 'checked'
        }
      };

      for (var input in this.inputs) {
        this.inputs[input].selector =
          this.selectors.form + ' input[name=' + input + ']';
      }
    }
  });

  Settings.implement({
    loadController: function(graphcontroller) {
      this.button = new Element(this.selectors.button);
      this.form = new Element(this.selectors.form);

      this.button.addDOMEvent({
        eventName: 'onclick',
        context: this,
        handler: function(event) {
          this.button.jelement.toggleClass('opened');
          this.form.jelement.toggle();
        }
      });

      _.each(this.inputs, function(input) {
        input.element = document.querySelector(input.selector);

        input.element.onchange = function() {
          var inputName = this.name;

          graphcontroller.updateGraph({
            inputName: parseInt(this[input.value]) ||
              this[input.value]
          });
        };
      });

    }
  });

  exports.settings = Settings;
});<commit_msg>bugfix: settings not being applied to graph.<commit_after>require([
  'js/controllers/controller#controller',
  'js/models/element#element'
], function(Controller, Element) {

  var Settings = new Class({
    Extends: Controller,

    initialize: function(name, config) {
      this.parent(name, config);

      this.selectors = config.selectors;

      this.inputs = {
        branching: {
          value: 'value'
        },
        depth: {
          value: 'value'
        },
        treemode: {
          value: 'checked'
        }
      };

      for (var input in this.inputs) {
        this.inputs[input].selector =
          this.selectors.form + ' input[name=' + input + ']';
      }
    }
  });

  Settings.implement({
    loadController: function(graphcontroller) {
      this.button = new Element(this.selectors.button);
      this.form = new Element(this.selectors.form);

      this.button.addDOMEvent({
        eventName: 'onclick',
        context: this,
        handler: function(event) {
          this.button.jelement.toggleClass('opened');
          this.form.jelement.toggle();
        }
      });

      _.each(this.inputs, function(input) {
        input.element = document.querySelector(input.selector);

        input.element.onchange = function() {
          var config = {};

          config[this.name] = parseInt(this[input.value]) ||
            this[input.value];

          graphcontroller.updateGraph(config);
        };
      });

    }
  });

  exports.settings = Settings;
});
{'fraction_non_alphanumeric': 0.13544093178036606, 'fraction_numerical': 0.0, 'mean_word_length': 2.033299697275479, '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': '4120414', 'n_tokens_mistral': 873, 'n_tokens_neox': 849, 'n_words': 145}