<commit_before>var UITemplateRegistrator = new Class({
  initialize: function () {
    this.registerNavigation();
    this.registerActiveRule();
    this.registerIMWindow();
    this.registerClickAddAttributeWindow();
    this.registerAddCoefficientWindow();
    this.registerEditConnectiveWindow();
    this.registerFoundRules();
    this.registerMarkedRules();
    this.registerRuleIMs();
    this.registerAttributeWindow();
    this.registerCurrentUser();
  },

  registerNavigation: function () {
    Mooml.register('attributeByListTemplate', function (data) {
      var i18n = data.i18n,
        attribute = data.attribute,
        isUsed = data.isUsed,
        showEditAttribute = data.showEditAttribute,
        showRemoveAttribute = data.showRemoveAttribute;

      var className = '';
      if (attribute.isRecommended()) {
        className = 'rec1';
      } else if (attribute.isPartiallyRecommended()) {
        className = 'rec2';
      } else if (isUsed) {
        className = 'used';
      } else if (attribute.isHidden()) {
        className = 'hidden';
      }

      li({'class': className},
        a({href: '#', id: attribute.getCSSAddID(), class: 'add', title: i18n.translate('Add attribute')}),
        span({id: attribute.getCSSID()}, attribute.getName()),
        showRemoveAttribute ? a({
          href: '#',
          id: attribute.getCSSRemoveID(),
          'class': 'remove-attribute',
          'title': i18n.translate('Hide')
        }) : '',
        showEditAttribute ? a({
          href: '#',
          id: attribute.getCSSEditID(),
          'class': 'edit-attribute',
          'title': i18n.translate('Edit')
        }) : '',
        a({
          href: '#',
          id: attribute.getCSSShowHistogramID(),
          'class': 'show-histogram',
          'title': i18n.translate('Show histogram')
        })
      );
    });

    Mooml.register('dataFieldTemplate', function (data) {
      var i18n = data.i18n,
        field = data.field;

      li({id: field.getCSSID()},
        a({href: '#', id: field.getCSSAddID(), class: 'add', title: i18n.translate('Add to attributes')}),
        span(field.getName()),
        a({
          href: '#',
          id: field.getCSSShowHistogramID(),
          'class': 'show-histogram',
          'title': i18n.translate('Show histogram')
        })
      );
    });

    Mooml.register('changeRulesetWindowTemplate', function (data) {
      var i18n = data.i18n;

      div({id: 'change-ruleset-window'},
          a({id: 'overlay-close', href: '#'}, i18n.translate('Close')),
          h2(i18n.translate('Current ruleset')),
          div({id: 'current-ruleset', class: 'actionsDiv bigButtons'}),
          br(),
          h2(i18n.translate('Change ruleset to')),
          div({id: 'change-ruleset-list', class: 'actionsDiv bigButtons'}),
          br(),
          input({id: 'add-ruleset', type: 'submit', value: i18n.translate('Add new ruleset')}));
    });

    Mooml.register('changeRulesetWindowItemTemplate', function (data) {
      var id = data.rule_set_id,
          name = data.name+' (rules: '+data.rulesCount+')';

      a({href: '#', rel: id}, name,
        span(data.description));
    });

    Mooml.register('changeRulesetWindowAddTemplate', function (data) {<commit_msg>oprava id rulesetu po změně api<commit_after>var UITemplateRegistrator = new Class({
  initialize: function () {
    this.registerNavigation();
    this.registerActiveRule();
    this.registerIMWindow();
    this.registerClickAddAttributeWindow();
    this.registerAddCoefficientWindow();
    this.registerEditConnectiveWindow();
    this.registerFoundRules();
    this.registerMarkedRules();
    this.registerRuleIMs();
    this.registerAttributeWindow();
    this.registerCurrentUser();
  },

  registerNavigation: function () {
    Mooml.register('attributeByListTemplate', function (data) {
      var i18n = data.i18n,
        attribute = data.attribute,
        isUsed = data.isUsed,
        showEditAttribute = data.showEditAttribute,
        showRemoveAttribute = data.showRemoveAttribute;

      var className = '';
      if (attribute.isRecommended()) {
        className = 'rec1';
      } else if (attribute.isPartiallyRecommended()) {
        className = 'rec2';
      } else if (isUsed) {
        className = 'used';
      } else if (attribute.isHidden()) {
        className = 'hidden';
      }

      li({'class': className},
        a({href: '#', id: attribute.getCSSAddID(), class: 'add', title: i18n.translate('Add attribute')}),
        span({id: attribute.getCSSID()}, attribute.getName()),
        showRemoveAttribute ? a({
          href: '#',
          id: attribute.getCSSRemoveID(),
          'class': 'remove-attribute',
          'title': i18n.translate('Hide')
        }) : '',
        showEditAttribute ? a({
          href: '#',
          id: attribute.getCSSEditID(),
          'class': 'edit-attribute',
          'title': i18n.translate('Edit')
        }) : '',
        a({
          href: '#',
          id: attribute.getCSSShowHistogramID(),
          'class': 'show-histogram',
          'title': i18n.translate('Show histogram')
        })
      );
    });

    Mooml.register('dataFieldTemplate', function (data) {
      var i18n = data.i18n,
        field = data.field;

      li({id: field.getCSSID()},
        a({href: '#', id: field.getCSSAddID(), class: 'add', title: i18n.translate('Add to attributes')}),
        span(field.getName()),
        a({
          href: '#',
          id: field.getCSSShowHistogramID(),
          'class': 'show-histogram',
          'title': i18n.translate('Show histogram')
        })
      );
    });

    Mooml.register('changeRulesetWindowTemplate', function (data) {
      var i18n = data.i18n;

      div({id: 'change-ruleset-window'},
          a({id: 'overlay-close', href: '#'}, i18n.translate('Close')),
          h2(i18n.translate('Current ruleset')),
          div({id: 'current-ruleset', class: 'actionsDiv bigButtons'}),
          br(),
          h2(i18n.translate('Change ruleset to')),
          div({id: 'change-ruleset-list', class: 'actionsDiv bigButtons'}),
          br(),
          input({id: 'add-ruleset', type: 'submit', value: i18n.translate('Add new ruleset')}));
    });

    Mooml.register('changeRulesetWindowItemTemplate', function (data) {
      var id = data.id,
          name = data.name+' (rules: '+data.rulesCount+')';

      a({href: '#', rel: id}, name,
        span(data.description));
    });

    Mooml.register('changeRulesetWindowAddTemplate', function (data) {
{'fraction_non_alphanumeric': 0.16103896103896104, 'fraction_numerical': 0.011000763941940413, 'mean_word_length': 2.561479869423286, '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': '348364', 'n_tokens_mistral': 1982, 'n_tokens_neox': 1928, 'n_words': 361}