<commit_before>/* globals Promise $ toastr window */

'use strict';

(() => {
  const MIN_SKILL_NAME_LENGTH = 3;
  const MAX_SKILL_NAME_LENGTH = 20;

  const $addListItem = $('ul.skills>li.add');
  const $addSkillBtn = $('a.add-skill-btn');

  const $editMode = $('.edit-mode');
  const $editProfileBtn = $('a.edit-profile-btn');
  const $saveChangesBtn = $('a.save-changes-btn');
  const $deleteSkillBtn = $('a.btn-delete');

  const $submitSkillBtn = $('<a class="btn btn-success submit-skill-btn">Add</a>');
  const $skillInput = $('<input class="form-control skill-input" type="text" placeholder="Enter your skill"/>');
  const $addSkillInputContainer = $('<div class="add-skill-input-container hide"/>')
    .append($skillInput)
    .append($submitSkillBtn);

  $addListItem.append($addSkillInputContainer);

  $addSkillBtn.on('click', () => {
    $addSkillBtn.addClass('hide');

    $addSkillInputContainer.removeClass('hide');
  });

  $submitSkillBtn.on('click', () => {
    toastr.options.preventDuplicates = true;

    return Promise.resolve()
      .then(() => {
        let skills = $('ul.skills').children('li.skill');
        if (skills.length >= 10) {
          throw new Error('You cannot have more than 10 skills.');
        }

        let skill = $skillInput.val();
        validateString(skill);

        let skillNames = skills.children('span.skill-name');
        let doesExists = [].slice.call(skillNames)
          .some(s => s.innerHTML.toLowerCase() === skill.toLowerCase());

        if (doesExists) {
          throw new Error('Skill already exists.');
        }

        return skill;
      })
      .then((skill) => {
        return new Promise((resolve, reject) => {<commit_msg>minor tweaks, skills/remove route must be added<commit_after>/* globals Promise $ toastr window */

'use strict';

(() => {
  toastr.options.preventDuplicates = true;

  const MIN_SKILL_NAME_LENGTH = 3;
  const MAX_SKILL_NAME_LENGTH = 20;

  const $addListItem = $('ul.skills>li.add');
  const $addSkillBtn = $('a.add-skill-btn');

  const $editMode = $('.edit-mode');
  const $editProfileBtn = $('a.edit-profile-btn');
  const $saveChangesBtn = $('a.save-changes-btn');
  const $deleteSkillBtn = $('a.btn-delete');

  const $submitSkillBtn = $('<a class="btn btn-success submit-skill-btn">Add</a>');
  const $skillInput = $('<input class="form-control skill-input" type="text" placeholder="Enter your skill"/>');
  const $addSkillInputContainer = $('<div class="add-skill-input-container hide"/>')
    .append($skillInput)
    .append($submitSkillBtn);

  $addListItem.append($addSkillInputContainer);

  $addSkillBtn.on('click', () => {
    $addSkillBtn.addClass('hide');

    $addSkillInputContainer.removeClass('hide');
  });

  $submitSkillBtn.on('click', () => {
    return Promise.resolve()
      .then(() => {
        let skills = $('ul.skills').children('li.skill');
        if (skills.length >= 10) {
          throw new Error('You cannot have more than 10 skills.');
        }

        let skill = $skillInput.val();
        validateString(skill);

        let skillNames = skills.children('span.skill-name');
        let doesExists = [].slice.call(skillNames)
          .some(s => s.innerHTML.toLowerCase() === skill.toLowerCase());

        if (doesExists) {
          throw new Error('Skill already exists.');
        }

        return skill;
      })
      .then((skill) => {
        return new Promise((resolve, reject) => {
{'fraction_non_alphanumeric': 0.17749419953596288, 'fraction_numerical': 0.004060324825986079, 'mean_word_length': 3.2163814180929093, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, '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': '6861619', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1090, 'n_words': 218}