<commit_before>/*************************************
* On page load
*************************************/
var mSongListSize = 0;

/*************************************
* Event listeners
**************************************/

// TODO(eugenek): Add validation.
/* On unploadFileBtn click, upload the specified file to the backend */
$("#uploadFileBtn").click(function () {
  var file = $('#chooseFileBtn').prop('files')[0]; // Only one file

  // You got me so high, so high I cannot feel the fire. And you keep telling me that you'll be sweet.
  // As long as I don't break these... promises...
  var data = {}; // 
  var promise = promiseFileContents(file, data);

  

  $.when(promise).then(function (contents) {
      if (contents.split("\n").length > 128+1) {
        alert("Warning: Only adding the first 128 playlists from the file");
      }

      $.ajax({
          type: 'POST',
          url: '/api/addPlaylists',
          data: JSON.stringify(data),
          dataType: "text",
          contentType: 'application/json',
          processData: false,
          success: function (data) {
          },
          error: function (data) {
          }
      });
  });
<commit_msg>Done with add_playlists page<commit_after>/*************************************
* On page load
*************************************/
var mSongListSize = 0;

/*************************************
* Event listeners
**************************************/

/* On unploadFileBtn click, upload the specified file to the backend */
$("#uploadFileBtn").click(function () {
  var file = $('#chooseFileBtn').prop('files')[0]; // Only one file

  // You got me so high, so high I cannot feel the fire. And you keep telling me that you'll be sweet.
  // As long as I don't break these... promises...
  var data = {}; // 
  var promise = promiseFileContents(file, data);

  

  $.when(promise).then(function (contents) {
      if (contents.split("\n").length > 128+1) {
        alert("Warning: Only adding the first 128 playlists from the file");
      }

      $.ajax({
          type: 'POST',
          url: '/api/addPlaylists',
          data: JSON.stringify(data),
          dataType: "text",
          contentType: 'application/json',
          processData: false,
          success: function (data) {
          },
          error: function (data) {
          }
      });
  });

{'fraction_non_alphanumeric': 0.2509505703422053, 'fraction_numerical': 0.0076045627376425855, 'mean_word_length': 2.717425431711146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3611085', 'n_tokens_mistral': 653, 'n_tokens_neox': 611, 'n_words': 198}