<commit_before>$(function(){
  var savedData = localStorage.getItem("fusen");
  var fusenList = JSON.parse(savedData);
  
  if(fusenList && (fusenList.constructor != 'Array')){
    jQuery.each(fusenList,function(){
      addFusen(this);
    });
  }
  $('#add').on('click',function(){
    addFusen();
  });

  $( "#workspace" ).sortable({
    revert: true
  });
});

function addFusen(data){
  data = data || '';
  $('#workspace').append(
    $('<li>')
      .attr('contenteditable','true')
      .text(data)
      .on('click',function(){
        $(this).focus();
      })
      .on('blur',function(){
        var fusenList = [];
        $('#workspace li').each(function(){
          fusenList.push($(this).text());
        });
        localStorage.setItem('fusen',JSON.stringify(fusenList));
        console.log('saved!');
      })
  );
}
  <commit_msg>ignore empty fusen for save.<commit_after>$(function(){
  var savedData = localStorage.getItem("fusen");
  var fusenList = JSON.parse(savedData);
  
  if(fusenList && (fusenList.constructor != 'Array')){
    jQuery.each(fusenList,function(){
      addFusen(this);
    });
  }
  $('#add').on('click',function(){
    addFusen();
  });

  $( "#workspace" ).sortable({
    revert: true
  });
});

function addFusen(data){
  data = data || '';
  $('#workspace').append(
    $('<li>')
      .attr('contenteditable','true')
      .text(data)
      .on('click',function(){
        $(this).focus();
      })
      .on('blur',function(){
        var fusenList = [];
        $('#workspace li').each(function(){
          if($(this).text().trim() == '') return;
          fusenList.push($(this).text());
        });
        localStorage.setItem('fusen',JSON.stringify(fusenList));
        console.log('saved!');
      })
  );
}
  
{'fraction_non_alphanumeric': 0.22529644268774704, 'fraction_numerical': 0.0, 'mean_word_length': 2.786324786324786, 'pattern_counts': {'":': 0, '<': 5, '<?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': '587629', 'n_tokens_mistral': 599, 'n_tokens_neox': 604, 'n_words': 78}