<commit_before>function tag(t, class, text) {
  return $(document.createElement(t)).addClass(class).text(text);
}

function desc_map(class, field) {
  return tag('div', class).append(tag('span', 'o', field + ':'), tag('span'));
}

function init_description(dom) {
  var fields = [
    desc_map('dlvl', 'Skill Lv.'),
    desc_map('dmp', 'Fee MP'),
    desc_map('dweap', 'Required Weapon'),
    desc_map('dtype', 'Skill Type'),
    desc_map('dele', 'Attribute'),
    desc_map('dcd', 'Cooldown'),
    desc_map('dlimit', 'Level Limit'),
    desc_map('dtsp', 'Total SP'),
    tag('div', 'divider'),
    tag('div', 'dreq o', 'Level Up Requirements:'),
    tag('div', 'dreqlvl').append(tag('span', null, 'Character Level '), tag('span')),
    tag('div', 'dreqskills'),
    tag('div', 'dreqtsp'),
    tag('div', 'dreqsp').append(tag('span', null, 'SP '), tag('span')),
    tag('div', 'divider'),
    tag('div', 'dnow o', 'Skill Descrption'),
    tag('div', 'dnow'),
    tag('div', 'dnext t', 'Next Description'), // t for tangerine
    tag('div', 'dnext')
  ];

  dom.popover({
    animation: false,
    html: true,
    trigger: 'manual',
    placement: 'auto right',
//    content: 'Loading...',
    content: $(document.createElement('div')).text('Hellllloooo'),
    container: $('body')
  })
  .on('mouseenter', _popover.mouseenter)
  .on('mouseleave', _popover.mouseleave)
  .on('mousedown', _popover.mousedown);

  dom.data('bs.popover').options.content.html('Goodbye');
//  update_description(dom);
}

function update_description(dom) {
  var skill = db.Skills[dom.data('skill')];
  var description = [
    '<div><span class="o">Skill Lv.:</span></div>',
    '<div class=""><span class="o">Required Weapons:</span></div>',
  ].join('');

  var p = dom.data('bs.popover').options;
  p.title = db.Lookup[skill.NameID];
  p.content = description;
}

var _popover = {
  persist: null,
  mouseenter: function () {
    var dom = $(this), trigger = dom.data('desc');
    if (trigger == 'hover' && !_popover.persist) {
      dom.popover('show');
    }
  },
  mouseleave: function() {
    var dom = $(this), trigger = dom.data('desc');
    if (trigger == 'hover') {
      dom.popover('hide');
    }
  },<commit_msg>Clone the set.<commit_after>function tag(t, class, text) {
  return $(document.createElement(t)).addClass(class).text(text);
}

function desc_map(class, field) {
  return tag('div', class).append(tag('span', 'o', field + ':'), tag('span'));
}

var desc_fields = [
  desc_map('dlvl', 'Skill Lv.'),
  desc_map('dmp', 'Fee MP'),
  desc_map('dweap', 'Required Weapon'),
  desc_map('dtype', 'Skill Type'),
  desc_map('dele', 'Attribute'),
  desc_map('dcd', 'Cooldown'),
  desc_map('dlimit', 'Level Limit'),
  desc_map('dtsp', 'Total SP'),
  tag('div', 'divider'),
  tag('div', 'dreq o', 'Level Up Requirements:'),
  tag('div', 'dreqlvl').append(tag('span', null, 'Character Level '), tag('span')),
  tag('div', 'dreqskills'),
  tag('div', 'dreqtsp'),
  tag('div', 'dreqsp').append(tag('span', null, 'SP '), tag('span')),
  tag('div', 'divider'),
  tag('div', 'dnow o', 'Skill Descrption'),
  tag('div', 'dnow'),
  tag('div', 'dnext t', 'Next Description'), // t for tangerine
  tag('div', 'dnext')
].reduce(function(p,c) { p.append(c); return p }, tag('div')).children();

function init_description(dom) {

  dom.popover({
    animation: false,
    html: true,
    trigger: 'manual',
    placement: 'auto right',
    content: desc_fields.clone(),
    container: $('body')
  })
  .on('mouseenter', _popover.mouseenter)
  .on('mouseleave', _popover.mouseleave)
  .on('mousedown', _popover.mousedown);

//  dom.data('bs.popover').options.content.html('Goodbye');
//  update_description(dom);
}

function update_description(dom) {
  var skill = db.Skills[dom.data('skill')];
  var description = [
    '<div><span class="o">Skill Lv.:</span></div>',
    '<div class=""><span class="o">Required Weapons:</span></div>',
  ].join('');

  var p = dom.data('bs.popover').options;
  p.title = db.Lookup[skill.NameID];
  p.content = description;
}

var _popover = {
  persist: null,
  mouseenter: function () {
    var dom = $(this), trigger = dom.data('desc');
    if (trigger == 'hover' && !_popover.persist) {
      dom.popover('show');
    }
  },
  mouseleave: function() {
    var dom = $(this), trigger = dom.data('desc');
    if (trigger == 'hover') {
      dom.popover('hide');
    }
  },
{'fraction_non_alphanumeric': 0.22774988589685075, 'fraction_numerical': 0.0, 'mean_word_length': 4.144366197183099, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '6115271', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1583, 'n_words': 317}