<commit_before>function onDweetChanged() {
  // eslint-disable-next-line newline-per-chained-call
  var charCount = $(this).parent().parent().parent().find('.character-count')[0];
  var submitButton = $(this).parent().parent().find('.remix-button,.dweet-button')[0];

  let CountCharacters=string=>
  {
    // Javascript .length counts 16 bit blocks of UTF16
    // This is different from how the server counts characters,
    // which counts UTF16 characters.
    // The issue is that some UTF16 characters are encoded with two
    // blocks of 16 bit. Google UTF16 surragate pairs for more info.
    // By splitting the string into an array, we get around this issue
    return [... string].length;
  }

  let characterCount = CountCharacters(this.value);
  charCount.textContent = characterCount + '/140';
  if (characterCount > 140) {
    $(charCount).addClass('too-long');
    $(submitButton).prop('disabled', true);
  } else {
    $(charCount).removeClass('too-long');
    $(submitButton).prop('disabled', false);
  }
}

$(document).ajaxComplete(function() {
  $('.code-input').each(onDweetChanged);
});

$(document).ready(function() {
  function requestFullscreen(el) {
    (el.mozRequestFullScreen ||
     el.webkitRequestFullscreen ||
     el.requestFullscreen).call(el);
  }

  $('body').on('input', '.code-input', onDweetChanged);
  $('.code-input').each(onDweetChanged);

  $('body').on('click', '.fullscreen-button', function(e) {
    var dweetCard = $(this).closest('.dweet');
    var iframe = $(dweetCard).find('iframe.dweetiframe');
    e.preventDefault();<commit_msg>Fix linting errors<commit_after>function onDweetChanged() {
  // eslint-disable-next-line newline-per-chained-call
  var charCount = $(this).parent().parent().parent().find('.character-count')[0];
  var submitButton = $(this).parent().parent().find('.remix-button,.dweet-button')[0];

  let CountCharacters = string=>{
    // Javascript .length counts 16 bit blocks of UTF16
    // This is different from how the server counts characters,
    // which counts UTF16 characters.
    // The issue is that some UTF16 characters are encoded with two
    // blocks of 16 bit. Google UTF16 surragate pairs for more info.
    // By splitting the string into an array, we get around this issue
    return [... string].length;
  };

  let characterCount = CountCharacters(this.value);
  charCount.textContent = characterCount + '/140';
  if (characterCount > 140) {
    $(charCount).addClass('too-long');
    $(submitButton).prop('disabled', true);
  } else {
    $(charCount).removeClass('too-long');
    $(submitButton).prop('disabled', false);
  }
}

$(document).ajaxComplete(function() {
  $('.code-input').each(onDweetChanged);
});

$(document).ready(function() {
  function requestFullscreen(el) {
    (el.mozRequestFullScreen ||
     el.webkitRequestFullscreen ||
     el.requestFullscreen).call(el);
  }

  $('body').on('input', '.code-input', onDweetChanged);
  $('.code-input').each(onDweetChanged);

  $('body').on('click', '.fullscreen-button', function(e) {
    var dweetCard = $(this).closest('.dweet');
    var iframe = $(dweetCard).find('iframe.dweetiframe');
    e.preventDefault();
{'fraction_non_alphanumeric': 0.16987078474629688, 'fraction_numerical': 0.012606366214938543, 'mean_word_length': 3.9285714285714284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '483822', 'n_tokens_mistral': 997, 'n_tokens_neox': 948, 'n_words': 216}