<commit_before>// to allow for download button to be introduced via beta feature
$('a.save').click(function (event) {
  event.preventDefault();

  analytics.milestone();
  // if save is disabled, hitting save will trigger a reload
  saveCode('save', jsbin.saveDisabled === true ? false : true);

  return false;
});

function updateSavedState() {
  $('#share form div').each(function () {
    var $div = $(this),
        url = jsbin.getURL() + this.getAttribute('data-path'),
        link = $div.find('a').attr('href', url),
        input = $div.find('input').val(url);
  }).closest('.menu').removeClass('hidden');

  $('#jsbinurl').attr('href', jsbin.getURL()).removeClass('hidden');
  $('#clone').removeClass('hidden');
}

updateSavedState();


//       var textwidth = $('a span').innerWidth(true),
//       outerwidth = $('a:has(span)').width();
  
//   if (textwidth > outerwidth) {
//     $('a').addClass('ellipsis');
//   }

// $('input').on('change', function () {
//   $('a').css('width', this.value + 'px');
//   ellipsis();
// }).trigger('change');
// }

var saveChecksum = sessionStorage.getItem('checksum') || jsbin.state.checksum || false;

// only start live saving it they're allowed to (whereas save is disabled if they're following)
if (!jsbin.saveDisabled) {
  $document.bind('jsbinReady', function () {
    $('.code.panel .label .name').append('<span>Saved</span>');

    var savingLabels = {
      html: $('.panel.html .name span'),
      javascript: $('.panel.javascript .name span'),
      css: $('.panel.css .name span')
    };

    $document.bind('codeChange', function (event, data) {
      // savingLabels[data.panelId].text('Saving');<commit_msg>Oops - obviously don't show the share menu when nothing's saved!<commit_after>// to allow for download button to be introduced via beta feature
$('a.save').click(function (event) {
  event.preventDefault();

  analytics.milestone();
  // if save is disabled, hitting save will trigger a reload
  saveCode('save', jsbin.saveDisabled === true ? false : true);

  return false;
});

function updateSavedState() {
  $('#share form div').each(function () {
    var $div = $(this),
        url = jsbin.getURL() + this.getAttribute('data-path'),
        link = $div.find('a').attr('href', url),
        input = $div.find('input').val(url);
  }).closest('.menu').removeClass('hidden');

  $('#jsbinurl').attr('href', jsbin.getURL()).removeClass('hidden');
  $('#clone').removeClass('hidden');
}

// updateSavedState();

var saveChecksum = sessionStorage.getItem('checksum') || jsbin.state.checksum || false;

// only start live saving it they're allowed to (whereas save is disabled if they're following)
if (!jsbin.saveDisabled) {
  $document.bind('jsbinReady', function () {
    $('.code.panel .label .name').append('<span>Saved</span>');

    var savingLabels = {
      html: $('.panel.html .name span'),
      javascript: $('.panel.javascript .name span'),
      css: $('.panel.css .name span')
    };

    $document.bind('codeChange', function (event, data) {
      // savingLabels[data.panelId].text('Saving');
{'fraction_non_alphanumeric': 0.2018170019467878, 'fraction_numerical': 0.0, 'mean_word_length': 3.6996951219512195, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5490967', 'n_tokens_mistral': 953, 'n_tokens_neox': 934, 'n_words': 225}