<commit_before>TileMill = {};
TileMill.addLayer = function(options) {
  var layerName = '';
  if (options.id) {
    layerName = '#' + options.id + ' ';
  }
  if (options.classes.length) {
    layerName += '.' + options.classes.join(', .');
  }
  var checkbox = $('<input class="checkbox" type="checkbox" />');
  var li = $('<li>')
    .append($('<div class="handle"></div>'))
    .append(checkbox)
    .append($('<a class="layer-delete" href="#">Delete</a>').click(function() {
      // @TODO: Fix Young's lazy code.
      if (confirm('Are you sure you want to delete this layer?')) {
        $(this).parents('li').hide('fast', function() {
          $(this).remove();
        });
      }
      return false;
    }))
    .append($('<a class="layer-inspect" href="#">Inspect</a>').click(function() {
      if (!$(this).parents('li').data('tilemill')['id']) {
        alert('You need to add an id to a field and save to inspect it.');
        return;
      }
      TileMill.save(false);
      $('#layers').hide();
      $('#inspector').show();
      $('#inspector').data('id', $(this).parents('li').data('tilemill').id);
      url = window.server + 'projects/mml?id=' + window.project_id + '&c=' + (new Date().getTime());
      encode = Base64.encode(url);
      $.getScript(window.tilelive + encode + "/fields.json?jsoncallback=TileMill.inspect");
      return false;
    }))
    .append($('<a class="layer-edit" href="#">Edit</a>').click(function() {
      var options = $(this).parents('li').data('tilemill');
      if ($('#popup-layer').is(':hidden')) {
        $('#popup, #popup-layer, #popup-backdrop, #popup-header').show();
        $('#popup-layer input:not(.submit)').val('');
        $('#popup-layer input.submit').val('Save').data('li', $(this).parents('li'));
        $('#popup-layer input#classes').val(options.classes.join(' '));
        $('#popup-layer input#id').val(options.id);
        $('#popup-layer input#srs').val(options.srs);
        $('#popup-layer input#dataSource').val(options.dataSource);
        $('#popup-header h2').text('Edit layer');
        $('#popup-info').hide();
      }
      return false;
    }))
    .append($('<label>' + layerName + '</label>'));
  if (options.status == 'true') {
    checkbox[0].checked = true;
  }
  $('#layers ul.sidebar-content').prepend(li.data('tilemill', options));
};
<commit_msg>Set title of layer inspector to layer id.<commit_after>TileMill = {};
TileMill.addLayer = function(options) {
  var layerName = '';
  if (options.id) {
    layerName = '#' + options.id + ' ';
  }
  if (options.classes.length) {
    layerName += '.' + options.classes.join(', .');
  }
  var checkbox = $('<input class="checkbox" type="checkbox" />');
  var li = $('<li>')
    .append($('<div class="handle"></div>'))
    .append(checkbox)
    .append($('<a class="layer-delete" href="#">Delete</a>').click(function() {
      // @TODO: Fix Young's lazy code.
      if (confirm('Are you sure you want to delete this layer?')) {
        $(this).parents('li').hide('fast', function() {
          $(this).remove();
        });
      }
      return false;
    }))
    .append($('<a class="layer-inspect" href="#">Inspect</a>').click(function() {
      if (!$(this).parents('li').data('tilemill')['id']) {
        alert('You need to add an id to a field and save to inspect it.');
        return;
      }
      TileMill.save(false);
      $('#layers').hide();
      $('#inspector').show();
      $('#inspector').data('id', $(this).parents('li').data('tilemill').id);
      $('#inspector .sidebar-header h2').text('#' + $(this).parents('li').data('tilemill').id);
      url = window.server + 'projects/mml?id=' + window.project_id + '&c=' + (new Date().getTime());
      encode = Base64.encode(url);
      $.getScript(window.tilelive + encode + "/fields.json?jsoncallback=TileMill.inspect");
      return false;
    }))
    .append($('<a class="layer-edit" href="#">Edit</a>').click(function() {
      var options = $(this).parents('li').data('tilemill');
      if ($('#popup-layer').is(':hidden')) {
        $('#popup, #popup-layer, #popup-backdrop, #popup-header').show();
        $('#popup-layer input:not(.submit)').val('');
        $('#popup-layer input.submit').val('Save').data('li', $(this).parents('li'));
        $('#popup-layer input#classes').val(options.classes.join(' '));
        $('#popup-layer input#id').val(options.id);
        $('#popup-layer input#srs').val(options.srs);
        $('#popup-layer input#dataSource').val(options.dataSource);
        $('#popup-header h2').text('Edit layer');
        $('#popup-info').hide();
      }
      return false;
    }))
    .append($('<label>' + layerName + '</label>'));
  if (options.status == 'true') {
    checkbox[0].checked = true;
  }
  $('#layers ul.sidebar-content').prepend(li.data('tilemill', options));
};

{'fraction_non_alphanumeric': 0.2457415870378064, 'fraction_numerical': 0.0018695471541337765, 'mean_word_length': 3.16522491349481, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4796562', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1518, 'n_words': 267}